diff --git a/.dockerignore b/.dockerignore index 89aa2ce572..0370155b5f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -22,4 +22,6 @@ go.work go.work.sum *.md -Dockerfile \ No newline at end of file +Dockerfile +docker/docker-compose.* +cmd/**/Dockerfile \ No newline at end of file diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index e5effeb59e..5b0dad8e36 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -187,122 +187,123 @@ jobs: name: Protocol E2E Logs path: "testutil/e2e/protocolLogs/*" - test-sdk-e2e: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache-dependency-path: go.sum - - # Install Node.js - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: "21.2.0" - - - name: Init the SDK - run: GOPATH=~/go ./scripts/init_sdk.sh -s - working-directory: ./ecosystem/lava-sdk - - - name: Build - run: yarn build - working-directory: ./ecosystem/lava-sdk - - - name: Install ts-node - run: npm install -g ts-node - - - name: Install telescope dependencies - run: yarn; yarn e2e-setup - working-directory: ./ecosystem/lavajs - - - name: Setup test environment - run: npm init --yes; npm install --save-dev @types/node - - ###################################################### - ### Run Lava SDK E2E Tests - ###################################################### - - name: Run Lava SDK E2E Tests -timeout 1200s - run: | - go install github.com/jstemmer/go-junit-report/v2@latest - go test ./testutil/e2e/ -run ^TestLavaSDK -v -timeout 1200s | go-junit-report -iocopy -set-exit-code -out sdk-e2e-report.xml # 20mins - - - name: Upload Test Results - if: always() - uses: actions/upload-artifact@v4 - with: - name: Test Results (SDK E2E) - path: "*-report.xml" - - - name: tail -n 300 Lavad Logs - if: always() - run: tail -n 300 testutil/e2e/sdkLogs/00_StartLava.log - - - name: Stake Lava All Logs - if: always() - run: cat testutil/e2e/sdkLogs/01_stakeLava.log - - - name: Stake Lava Error Only Logs - if: always() - continue-on-error: true - run: cat testutil/e2e/sdkLogs/01_stakeLava_errors.log - - - name: head -n 300 JSON Proxy Logs - if: always() - run: head -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log - - - name: tail -n 300 JSON Proxy Logs - if: always() - run: tail -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log - - - name: JSON Proxy Error Only Logs - if: always() - continue-on-error: true - run: cat testutil/e2e/sdkLogs/02_jsonProxy_errors.log - - - name: JSON Provider All Logs - if: always() - run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --exclude="*errors*" - - - name: JSON Provider Error Only Logs - if: always() - continue-on-error: true - run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --include="*errors*" - - - name: Lava Provider All Logs - if: always() - run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --exclude="*errors*" - - - name: Lava Provider Error Only Logs - if: always() - continue-on-error: true - run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --include="*errors*" - - - name: Badge Server All Logs - if: always() - run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --exclude="*errors*" - - - name: Badge Server Error Only Logs - if: always() - continue-on-error: true - run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --include="*errors*" - - - name: Lava SDK All Logs - if: always() - run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --exclude="*errors*" - - - name: Lava SDK Error Only Logs - if: always() - continue-on-error: true - run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --include="*errors*" + # Temporarly disabled due to a bug in the signature. + # test-sdk-e2e: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-go@v5 + # with: + # go-version-file: go.mod + # cache-dependency-path: go.sum + + # # Install Node.js + # - name: Setup Node.js environment + # uses: actions/setup-node@v4 + # with: + # node-version: "21.2.0" + + # - name: Init the SDK + # run: GOPATH=~/go ./scripts/init_sdk.sh -s + # working-directory: ./ecosystem/lava-sdk + + # - name: Build + # run: yarn build + # working-directory: ./ecosystem/lava-sdk + + # - name: Install ts-node + # run: npm install -g ts-node + + # - name: Install telescope dependencies + # run: yarn; yarn e2e-setup + # working-directory: ./ecosystem/lavajs + + # - name: Setup test environment + # run: npm init --yes; npm install --save-dev @types/node + + # ###################################################### + # ### Run Lava SDK E2E Tests + # ###################################################### + # - name: Run Lava SDK E2E Tests -timeout 1200s + # run: | + # go install github.com/jstemmer/go-junit-report/v2@latest + # go test ./testutil/e2e/ -run ^TestLavaSDK -v -timeout 1200s | go-junit-report -iocopy -set-exit-code -out sdk-e2e-report.xml # 20mins + + # - name: Upload Test Results + # if: always() + # uses: actions/upload-artifact@v4 + # with: + # name: Test Results (SDK E2E) + # path: "*-report.xml" + + # - name: tail -n 300 Lavad Logs + # if: always() + # run: tail -n 300 testutil/e2e/sdkLogs/00_StartLava.log + + # - name: Stake Lava All Logs + # if: always() + # run: cat testutil/e2e/sdkLogs/01_stakeLava.log + + # - name: Stake Lava Error Only Logs + # if: always() + # continue-on-error: true + # run: cat testutil/e2e/sdkLogs/01_stakeLava_errors.log + + # - name: head -n 300 JSON Proxy Logs + # if: always() + # run: head -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log + + # - name: tail -n 300 JSON Proxy Logs + # if: always() + # run: tail -n 300 testutil/e2e/sdkLogs/02_jsonProxy.log + + # - name: JSON Proxy Error Only Logs + # if: always() + # continue-on-error: true + # run: cat testutil/e2e/sdkLogs/02_jsonProxy_errors.log + + # - name: JSON Provider All Logs + # if: always() + # run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --exclude="*errors*" + + # - name: JSON Provider Error Only Logs + # if: always() + # continue-on-error: true + # run: grep "" testutil/e2e/sdkLogs/03_EthProvider* --include="*errors*" + + # - name: Lava Provider All Logs + # if: always() + # run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --exclude="*errors*" + + # - name: Lava Provider Error Only Logs + # if: always() + # continue-on-error: true + # run: grep "" testutil/e2e/sdkLogs/05_LavaProvider* --include="*errors*" + + # - name: Badge Server All Logs + # if: always() + # run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --exclude="*errors*" + + # - name: Badge Server Error Only Logs + # if: always() + # continue-on-error: true + # run: grep "" testutil/e2e/sdkLogs/01_BadgeServer* --include="*errors*" + + # - name: Lava SDK All Logs + # if: always() + # run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --exclude="*errors*" + + # - name: Lava SDK Error Only Logs + # if: always() + # continue-on-error: true + # run: grep "" testutil/e2e/sdkLogs/01_sdkTest* --include="*errors*" - - name: Upload SDK E2E Logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: SDK E2E Logs - path: "testutil/e2e/sdkLogs/*" + # - name: Upload SDK E2E Logs + # if: always() + # uses: actions/upload-artifact@v4 + # with: + # name: SDK E2E Logs + # path: "testutil/e2e/sdkLogs/*" test-payment-e2e: runs-on: ubuntu-latest @@ -328,9 +329,9 @@ jobs: name: Test Results (Payment E2E) path: "*-report.xml" - - name: tail -n 300 Lavad Logs + - name: Lavad Logs if: always() - run: tail -n 300 testutil/e2e/protocolLogs/00_StartLava.log + run: grep 'err\|lava_' testutil/e2e/protocolLogs/00_StartLava.log - name: Stake Lava All Logs if: always() @@ -368,7 +369,14 @@ jobs: report-tests-results: runs-on: ubuntu-latest - needs: [test-consensus, test-protocol, test-protocol-e2e, test-sdk-e2e, test-payment-e2e] + needs: + [ + test-consensus, + test-protocol, + test-protocol-e2e, + # test-sdk-e2e, + test-payment-e2e, + ] if: always() steps: - name: Download Artifacts @@ -418,10 +426,13 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} file: cmd/${{ matrix.binary }}/Dockerfile + platforms: linux/amd64,linux/arm64 build-args: | GIT_VERSION="${{ steps.meta.outputs.version }}" GIT_COMMIT="${{ github.sha }}" push: true + cache-from: type=gha + cache-to: type=gha,mode=max build_and_package: name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aaaa474d2a..4f5810d141 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,14 @@ jobs: contents: write steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + large-packages: false + docker-images: false + swap-storage: false + tool-cache: false + - name: Checkout code uses: actions/checkout@v4 with: @@ -31,19 +39,11 @@ jobs: - name: Fetch all tags run: | git fetch --force --tags - - - name: Configure Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache-dependency-path: go.sum - - + - name: Run GoReleaser id: releaser - uses: goreleaser/goreleaser-action@v5 + uses: docker://goreleaser/goreleaser-cross:v1.22 with: - version: latest args: release --clean --timeout 90m env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -58,7 +58,7 @@ jobs: env: REGISTRY: ghcr.io IMAGE_NAME: "lavanet/lava/${{ matrix.binary }}" - steps: + steps: - name: Checkout code uses: actions/checkout@v4 with: @@ -85,7 +85,28 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} file: cmd/${{ matrix.binary }}/Dockerfile + platforms: linux/amd64,linux/arm64 build-args: | GIT_VERSION="${{ steps.meta.outputs.version }}" GIT_COMMIT="${{ github.sha }}" - push: true \ No newline at end of file + push: true + - name: Extract metadata (cosmovisor) + if: ${{ matrix.binary == 'lavad' }} + id: meta-cosmovisor + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-cosmovisor + tags: | + type=raw,value=latest,enable=true + - name: Build and push + uses: docker/build-push-action@v5 + if: ${{ matrix.binary == 'lavad' }} + with: + tags: ${{ steps.meta-cosmovisor.outputs.tags }} + labels: ${{ steps.meta-cosmovisor.outputs.labels }} + file: cmd/${{ matrix.binary }}/Dockerfile + platforms: linux/amd64,linux/arm64 + build-args: | + GIT_VERSION="${{ steps.meta-cosmovisor.outputs.version }}" + GIT_COMMIT="${{ github.sha }}" + push: true diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 7973f68215..8dbc9f8c5a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,27 +1,21 @@ -# This is an example .goreleaser.yml file with some sensible defaults. -# Make sure to check the documentation at https://goreleaser.com - -# The lines bellow are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/need to use them. -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj +version: 2 project_name: lava + before: hooks: - # You may remove this if you don't use go modules. - go mod tidy - # you may remove this if you don't need go generate - go generate ./... metadata: mod_timestamp: "{{ .CommitTimestamp }}" +env: + - CGO_ENABLED=1 + builds: - id: lavavisor binary: lavavisor dir: cmd/lavavisor - env: - - CGO_ENABLED=0 goos: - linux - windows @@ -44,12 +38,21 @@ builds: - -mod=readonly - -trimpath mod_timestamp: "{{ .CommitTimestamp }}" + env: + - CC_darwin_amd64=o64-clang + - CXX_darwin_amd64=o64-clang++ + - CC_darwin_arm64=oa64-clang + - CXX_darwin_arm64=oa64-clang++ + - CC_linux_arm64=aarch64-linux-gnu-gcc + - CXX_linux_arm64=aarch64-linux-gnu-g++ + - CC_windows_amd64=x86_64-w64-mingw32-gcc + - CXX_windows_amd64=x86_64-w64-mingw32-g++ + - 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' + - 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}' - id: lavad binary: lavad dir: cmd/lavad - env: - - CGO_ENABLED=0 goos: - linux - windows @@ -82,12 +85,21 @@ builds: - netgo - ledger mod_timestamp: "{{ .CommitTimestamp }}" + env: + - CC_darwin_amd64=o64-clang + - CXX_darwin_amd64=o64-clang++ + - CC_darwin_arm64=oa64-clang + - CXX_darwin_arm64=oa64-clang++ + - CC_linux_arm64=aarch64-linux-gnu-gcc + - CXX_linux_arm64=aarch64-linux-gnu-g++ + - CC_windows_amd64=x86_64-w64-mingw32-gcc + - CXX_windows_amd64=x86_64-w64-mingw32-g++ + - 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' + - 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}' - id: lavap binary: lavap dir: cmd/lavap - env: - - CGO_ENABLED=0 goos: - linux - windows @@ -110,6 +122,17 @@ builds: - -mod=readonly - -trimpath mod_timestamp: "{{ .CommitTimestamp }}" + env: + - CC_darwin_amd64=o64-clang + - CXX_darwin_amd64=o64-clang++ + - CC_darwin_arm64=oa64-clang + - CXX_darwin_arm64=oa64-clang++ + - CC_linux_arm64=aarch64-linux-gnu-gcc + - CXX_linux_arm64=aarch64-linux-gnu-g++ + - CC_windows_amd64=x86_64-w64-mingw32-gcc + - CXX_windows_amd64=x86_64-w64-mingw32-g++ + - 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' + - 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}' archives: - id: lavavisor diff --git a/Makefile b/Makefile index 776cbb3226..2aab215424 100644 --- a/Makefile +++ b/Makefile @@ -193,10 +193,10 @@ ifeq (static,$(findstring static,$(LAVA_BUILD_OPTIONS))) endif ifeq (mask_consumer_logs,$(findstring mask_consumer_logs,$(LAVA_BUILD_OPTIONS))) - ldflags += -X github.com/lavanet/lava/protocol/common.ReturnMaskedErrors=true + ldflags += -X github.com/lavanet/lava/v2/protocol/common.ReturnMaskedErrors=true endif ifeq (debug_mutex,$(findstring debug_mutex,$(LAVA_BUILD_OPTIONS))) - ldflags += -X github.com/lavanet/lava/utils.TimeoutMutex=true + ldflags += -X github.com/lavanet/lava/v2/utils.TimeoutMutex=true endif ifeq (cleveldb,$(findstring cleveldb,$(LAVA_BUILD_OPTIONS))) @@ -207,12 +207,12 @@ endif ifeq (release,$(findstring release,$(LAVA_BUILD_OPTIONS))) $(info Building With Production Flag) - ldflags += -X github.com/lavanet/lava/utils.ExtendedLogLevel=production + ldflags += -X github.com/lavanet/lava/v2/utils.ExtendedLogLevel=production endif ifeq (debug_payment_e2e,$(findstring debug_payment_e2e,$(LAVA_BUILD_OPTIONS))) $(info Building With Debug Payment E2E Flag. Making a month 2 minutes) - ldflags += -X github.com/lavanet/lava/utils.DebugPaymentE2E=debug_payment_e2e + ldflags += -X github.com/lavanet/lava/v2/utils.DebugPaymentE2E=debug_payment_e2e endif ifeq (,$(findstring nostrip,$(LAVA_BUILD_OPTIONS))) diff --git a/app/ante.go b/app/ante.go index ed5a7b283f..46fdd13d71 100644 --- a/app/ante.go +++ b/app/ante.go @@ -5,10 +5,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - dualstakingante "github.com/lavanet/lava/x/dualstaking/ante" - dualstakingkeeper "github.com/lavanet/lava/x/dualstaking/keeper" - specante "github.com/lavanet/lava/x/spec/ante" - "github.com/lavanet/lava/x/spec/keeper" + dualstakingante "github.com/lavanet/lava/v2/x/dualstaking/ante" + dualstakingkeeper "github.com/lavanet/lava/v2/x/dualstaking/keeper" + specante "github.com/lavanet/lava/v2/x/spec/ante" + "github.com/lavanet/lava/v2/x/spec/keeper" ) func NewAnteHandler(accountKeeper ante.AccountKeeper, bankKeeper authtypes.BankKeeper, dualstakingKeeper dualstakingkeeper.Keeper, signModeHandler signing.SignModeHandler, feegrantKeeper ante.FeegrantKeeper, specKeeper keeper.Keeper, sigGasConsumer ante.SignatureVerificationGasConsumer) sdk.AnteHandler { diff --git a/app/app.go b/app/app.go index 0ab1202df8..2fc970e1f4 100644 --- a/app/app.go +++ b/app/app.go @@ -15,13 +15,13 @@ import ( v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/fixationstore" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - "github.com/lavanet/lava/x/timerstore" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/fixationstore" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/timerstore" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" @@ -113,48 +113,48 @@ import ( ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - "github.com/lavanet/lava/app/keepers" - appparams "github.com/lavanet/lava/app/params" - "github.com/lavanet/lava/app/upgrades" - "github.com/lavanet/lava/docs" - conflictmodule "github.com/lavanet/lava/x/conflict" - conflictmodulekeeper "github.com/lavanet/lava/x/conflict/keeper" - conflictmoduletypes "github.com/lavanet/lava/x/conflict/types" - downtimemodule "github.com/lavanet/lava/x/downtime" - downtimemodulekeeper "github.com/lavanet/lava/x/downtime/keeper" - downtimemoduletypes "github.com/lavanet/lava/x/downtime/types" - dualstakingmodule "github.com/lavanet/lava/x/dualstaking" - dualstakingmodulekeeper "github.com/lavanet/lava/x/dualstaking/keeper" - dualstakingmoduletypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragemodule "github.com/lavanet/lava/x/epochstorage" - epochstoragemodulekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - epochstoragemoduletypes "github.com/lavanet/lava/x/epochstorage/types" - pairingmodule "github.com/lavanet/lava/x/pairing" - pairingmoduleclient "github.com/lavanet/lava/x/pairing/client" - pairingmodulekeeper "github.com/lavanet/lava/x/pairing/keeper" - pairingmoduletypes "github.com/lavanet/lava/x/pairing/types" - plansmodule "github.com/lavanet/lava/x/plans" - plansmoduleclient "github.com/lavanet/lava/x/plans/client" - plansmodulekeeper "github.com/lavanet/lava/x/plans/keeper" - plansmoduletypes "github.com/lavanet/lava/x/plans/types" - projectsmodule "github.com/lavanet/lava/x/projects" - projectsmodulekeeper "github.com/lavanet/lava/x/projects/keeper" - projectsmoduletypes "github.com/lavanet/lava/x/projects/types" - protocolmodule "github.com/lavanet/lava/x/protocol" - protocolmoduleclient "github.com/lavanet/lava/x/protocol/client/cli" - protocolmodulekeeper "github.com/lavanet/lava/x/protocol/keeper" - protocolmoduletypes "github.com/lavanet/lava/x/protocol/types" - rewardsmodule "github.com/lavanet/lava/x/rewards" - rewardsmoduleclient "github.com/lavanet/lava/x/rewards/client/cli" - rewardsmodulekeeper "github.com/lavanet/lava/x/rewards/keeper" - rewardsmoduletypes "github.com/lavanet/lava/x/rewards/types" - specmodule "github.com/lavanet/lava/x/spec" - specmoduleclient "github.com/lavanet/lava/x/spec/client" - specmodulekeeper "github.com/lavanet/lava/x/spec/keeper" - specmoduletypes "github.com/lavanet/lava/x/spec/types" - subscriptionmodule "github.com/lavanet/lava/x/subscription" - subscriptionmodulekeeper "github.com/lavanet/lava/x/subscription/keeper" - subscriptionmoduletypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/app/keepers" + appparams "github.com/lavanet/lava/v2/app/params" + "github.com/lavanet/lava/v2/app/upgrades" + "github.com/lavanet/lava/v2/docs" + conflictmodule "github.com/lavanet/lava/v2/x/conflict" + conflictmodulekeeper "github.com/lavanet/lava/v2/x/conflict/keeper" + conflictmoduletypes "github.com/lavanet/lava/v2/x/conflict/types" + downtimemodule "github.com/lavanet/lava/v2/x/downtime" + downtimemodulekeeper "github.com/lavanet/lava/v2/x/downtime/keeper" + downtimemoduletypes "github.com/lavanet/lava/v2/x/downtime/types" + dualstakingmodule "github.com/lavanet/lava/v2/x/dualstaking" + dualstakingmodulekeeper "github.com/lavanet/lava/v2/x/dualstaking/keeper" + dualstakingmoduletypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragemodule "github.com/lavanet/lava/v2/x/epochstorage" + epochstoragemodulekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + epochstoragemoduletypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingmodule "github.com/lavanet/lava/v2/x/pairing" + pairingmoduleclient "github.com/lavanet/lava/v2/x/pairing/client" + pairingmodulekeeper "github.com/lavanet/lava/v2/x/pairing/keeper" + pairingmoduletypes "github.com/lavanet/lava/v2/x/pairing/types" + plansmodule "github.com/lavanet/lava/v2/x/plans" + plansmoduleclient "github.com/lavanet/lava/v2/x/plans/client" + plansmodulekeeper "github.com/lavanet/lava/v2/x/plans/keeper" + plansmoduletypes "github.com/lavanet/lava/v2/x/plans/types" + projectsmodule "github.com/lavanet/lava/v2/x/projects" + projectsmodulekeeper "github.com/lavanet/lava/v2/x/projects/keeper" + projectsmoduletypes "github.com/lavanet/lava/v2/x/projects/types" + protocolmodule "github.com/lavanet/lava/v2/x/protocol" + protocolmoduleclient "github.com/lavanet/lava/v2/x/protocol/client/cli" + protocolmodulekeeper "github.com/lavanet/lava/v2/x/protocol/keeper" + protocolmoduletypes "github.com/lavanet/lava/v2/x/protocol/types" + rewardsmodule "github.com/lavanet/lava/v2/x/rewards" + rewardsmoduleclient "github.com/lavanet/lava/v2/x/rewards/client/cli" + rewardsmodulekeeper "github.com/lavanet/lava/v2/x/rewards/keeper" + rewardsmoduletypes "github.com/lavanet/lava/v2/x/rewards/types" + specmodule "github.com/lavanet/lava/v2/x/spec" + specmoduleclient "github.com/lavanet/lava/v2/x/spec/client" + specmodulekeeper "github.com/lavanet/lava/v2/x/spec/keeper" + specmoduletypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptionmodule "github.com/lavanet/lava/v2/x/subscription" + subscriptionmodulekeeper "github.com/lavanet/lava/v2/x/subscription/keeper" + subscriptionmoduletypes "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cast" // this line is used by starport scaffolding # stargate/app/moduleImport ) @@ -197,6 +197,9 @@ var Upgrades = []upgrades.Upgrade{ upgrades.Upgrade_2_1_0, upgrades.Upgrade_2_1_1, upgrades.Upgrade_2_1_3, + upgrades.Upgrade_2_2_0, + upgrades.Upgrade_2_4_0, + upgrades.Upgrade_2_5_0, } // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals @@ -280,6 +283,7 @@ var ( subscriptionmoduletypes.ModuleName: {authtypes.Burner, authtypes.Staking}, string(rewardsmoduletypes.ValidatorsRewardsAllocationPoolName): {authtypes.Minter, authtypes.Staking}, string(rewardsmoduletypes.ValidatorsRewardsDistributionPoolName): {authtypes.Burner, authtypes.Staking}, + string(rewardsmoduletypes.ValidatorsRewardsLeftOverPoolName): {authtypes.Burner, authtypes.Staking}, string(rewardsmoduletypes.ProviderRewardsDistributionPool): {authtypes.Burner, authtypes.Staking}, string(rewardsmoduletypes.ProvidersRewardsAllocationPool): {authtypes.Minter, authtypes.Staking}, dualstakingmoduletypes.ModuleName: {authtypes.Burner, authtypes.Staking}, @@ -576,6 +580,7 @@ func New( app.PlansKeeper, app.DualstakingKeeper, app.RewardsKeeper, + app.SpecKeeper, app.FixationStoreKeeper, app.TimerStoreKeeper, app.StakingKeeper, diff --git a/app/encoding.go b/app/encoding.go index 033ce7958e..a44169894e 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/x/auth/tx" - "github.com/lavanet/lava/app/params" + "github.com/lavanet/lava/v2/app/params" ) // makeEncodingConfig creates an EncodingConfig for an amino based test configuration. diff --git a/app/keepers/lavaKeepers.go b/app/keepers/lavaKeepers.go index 231f63b36a..f6eb0e9851 100644 --- a/app/keepers/lavaKeepers.go +++ b/app/keepers/lavaKeepers.go @@ -20,19 +20,19 @@ import ( icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - conflictmodulekeeper "github.com/lavanet/lava/x/conflict/keeper" - downtimemodulekeeper "github.com/lavanet/lava/x/downtime/keeper" - dualstakingmodulekeeper "github.com/lavanet/lava/x/dualstaking/keeper" - epochstoragemodulekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - pairingmodulekeeper "github.com/lavanet/lava/x/pairing/keeper" - plansmodulekeeper "github.com/lavanet/lava/x/plans/keeper" - projectsmodulekeeper "github.com/lavanet/lava/x/projects/keeper" - protocolmodulekeeper "github.com/lavanet/lava/x/protocol/keeper" - rewardsmodulekeeper "github.com/lavanet/lava/x/rewards/keeper" - specmodulekeeper "github.com/lavanet/lava/x/spec/keeper" - subscriptionmodulekeeper "github.com/lavanet/lava/x/subscription/keeper" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + conflictmodulekeeper "github.com/lavanet/lava/v2/x/conflict/keeper" + downtimemodulekeeper "github.com/lavanet/lava/v2/x/downtime/keeper" + dualstakingmodulekeeper "github.com/lavanet/lava/v2/x/dualstaking/keeper" + epochstoragemodulekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + pairingmodulekeeper "github.com/lavanet/lava/v2/x/pairing/keeper" + plansmodulekeeper "github.com/lavanet/lava/v2/x/plans/keeper" + projectsmodulekeeper "github.com/lavanet/lava/v2/x/projects/keeper" + protocolmodulekeeper "github.com/lavanet/lava/v2/x/protocol/keeper" + rewardsmodulekeeper "github.com/lavanet/lava/v2/x/rewards/keeper" + specmodulekeeper "github.com/lavanet/lava/v2/x/spec/keeper" + subscriptionmodulekeeper "github.com/lavanet/lava/v2/x/subscription/keeper" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" // this line is used by starport scaffolding # stargate/app/moduleImport ) diff --git a/app/simulation_test.go b/app/simulation_test.go index 697af241fd..1d592fef78 100644 --- a/app/simulation_test.go +++ b/app/simulation_test.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" "github.com/cosmos/ibc-go/v7/testing/simapp" - "github.com/lavanet/lava/app" + "github.com/lavanet/lava/v2/app" "github.com/stretchr/testify/require" ) diff --git a/app/upgrades/empty_upgrades.go b/app/upgrades/empty_upgrades.go index 571e1275d1..c3142581c1 100644 --- a/app/upgrades/empty_upgrades.go +++ b/app/upgrades/empty_upgrades.go @@ -11,12 +11,12 @@ import ( packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - "github.com/lavanet/lava/app/keepers" - v1 "github.com/lavanet/lava/x/downtime/v1" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - rewardstypes "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/app/keepers" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" ) func defaultUpgradeHandler( @@ -262,3 +262,23 @@ var Upgrade_2_1_3 = Upgrade{ CreateUpgradeHandler: defaultUpgradeHandler, StoreUpgrades: store.StoreUpgrades{}, } + +var Upgrade_2_2_0 = Upgrade{ + UpgradeName: "v2.2.0", + CreateUpgradeHandler: defaultUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{packetforwardtypes.StoreKey}, + }, +} + +var Upgrade_2_4_0 = Upgrade{ + UpgradeName: "v2.4.0", + CreateUpgradeHandler: defaultUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} + +var Upgrade_2_5_0 = Upgrade{ + UpgradeName: "v2.5.0", + CreateUpgradeHandler: defaultUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{}, +} diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 3c7ca7d623..539f8da374 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/lavanet/lava/app/keepers" + "github.com/lavanet/lava/v2/app/keepers" ) type BaseAppParamManager interface { diff --git a/app/upgrades/upgrade_0_32_0.go b/app/upgrades/upgrade_0_32_0.go index 7f4daecfdb..6264984138 100644 --- a/app/upgrades/upgrade_0_32_0.go +++ b/app/upgrades/upgrade_0_32_0.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/bank/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/lavanet/lava/app/keepers" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - rewardstypes "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/app/keepers" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" ) func v0_32_0_UpgradeHandler( diff --git a/app/upgrades/upgrade_0_35_0.go b/app/upgrades/upgrade_0_35_0.go index f3805afbdc..183adbd2d2 100644 --- a/app/upgrades/upgrade_0_35_0.go +++ b/app/upgrades/upgrade_0_35_0.go @@ -6,9 +6,9 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/cosmos/gogoproto/proto" ibctypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - "github.com/lavanet/lava/app/keepers" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/app/keepers" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) func v_35_0( diff --git a/cmd/common/warning_log_command_wrapper.go b/cmd/common/warning_log_command_wrapper.go index c7ff220dc2..255ff1806b 100644 --- a/cmd/common/warning_log_command_wrapper.go +++ b/cmd/common/warning_log_command_wrapper.go @@ -1,7 +1,7 @@ package common import ( - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/spf13/cobra" ) diff --git a/cmd/lavad/Dockerfile b/cmd/lavad/Dockerfile index 7e4bfb69cc..506990e30f 100644 --- a/cmd/lavad/Dockerfile +++ b/cmd/lavad/Dockerfile @@ -1,15 +1,16 @@ # syntax=docker/dockerfile:1 ARG GO_VERSION="1.20" +ARG RUNNER_IMAGE="gcr.io/distroless/static-debian12:debug" ARG BUILD_TAGS="netgo,ledger,muslc" -FROM golang:${GO_VERSION}-alpine3.18 as builder +FROM golang:${GO_VERSION}-alpine3.18 AS builder RUN apk add --no-cache \ ca-certificates \ build-base \ linux-headers \ - binutils-gold + binutils-gold WORKDIR /lava @@ -40,11 +41,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ -o /lava/build/lavad \ /lava/cmd/lavad/main.go -FROM gcr.io/distroless/static-debian12 +FROM ${RUNNER_IMAGE} COPY --from=builder /lava/build/lavad /bin/lavad -ENV HOME /lava +ENV HOME=/lava WORKDIR $HOME # lava api diff --git a/cmd/lavad/Dockerfile.Cosmovisor b/cmd/lavad/Dockerfile.Cosmovisor new file mode 100644 index 0000000000..f0612bfe0a --- /dev/null +++ b/cmd/lavad/Dockerfile.Cosmovisor @@ -0,0 +1,82 @@ +# syntax=docker/dockerfile:1 + +ARG GO_VERSION="1.20" +ARG RUNNER_IMAGE="debian:12-slim" +ARG BUILD_TAGS="netgo,ledger,muslc" + +FROM golang:${GO_VERSION} as builder + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + build-essential \ + binutils-gold + +WORKDIR /lava + +COPY go.mod go.sum ./ + +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/go/pkg/mod \ + go mod download + +COPY . . + +ARG GIT_VERSION +ARG GIT_COMMIT + +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/go/pkg/mod \ + GOWORK=off go build \ + -mod=readonly \ + -tags "netgo,ledger,muslc" \ + -ldflags \ + "-X github.com/cosmos/cosmos-sdk/version.Name="lava" \ + -X github.com/cosmos/cosmos-sdk/version.AppName="lavad" \ + -X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \ + -X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \ + -X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS} \ + -w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \ + -trimpath \ + -o /lava/build/lavad \ + /lava/cmd/lavad/main.go + +ARG COSMOVISOR_VERSION="v1.5.0" + +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/go/pkg/mod \ + go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@${COSMOVISOR_VERSION} + +FROM ${RUNNER_IMAGE} + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates + +COPY --from=builder /lava/build/lavad /bin/lavad +COPY --from=builder /go/bin/cosmovisor /bin/cosmovisor + +ENV HOME=/lava + +ENV DAEMON_NAME=lavad +ENV DAEMON_HOME=${HOME}/.lava +ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=true +ENV DAEMON_RESTART_AFTER_UPGRADE=true +ENV DAEMON_LOG_BUFFER_SIZE=512 +ENV UNSAFE_SKIP_BACKUP=true + +WORKDIR $HOME + +RUN /bin/cosmovisor init /bin/lavad + +# lava api +EXPOSE 1317 +# rosetta +EXPOSE 8080 +# grpc +EXPOSE 9090 +EXPOSE 9091 +# tendermint p2p +EXPOSE 26656 +# tendermint rpc +EXPOSE 26657 + +ENTRYPOINT ["cosmovisor"] \ No newline at end of file diff --git a/cmd/lavad/cmd/config.go b/cmd/lavad/cmd/config.go index 873167f69a..badaa2588e 100644 --- a/cmd/lavad/cmd/config.go +++ b/cmd/lavad/cmd/config.go @@ -3,7 +3,7 @@ package cmd import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/app" + "github.com/lavanet/lava/v2/app" ) func InitSDKConfig() { diff --git a/cmd/lavad/cmd/root.go b/cmd/lavad/cmd/root.go index 9a832113b4..7ad8854f53 100644 --- a/cmd/lavad/cmd/root.go +++ b/cmd/lavad/cmd/root.go @@ -34,17 +34,17 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - cmdcommon "github.com/lavanet/lava/cmd/common" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + cmdcommon "github.com/lavanet/lava/v2/cmd/common" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/pflag" // this line is used by starport scaffolding # root/moduleImport - "github.com/lavanet/lava/app" - appparams "github.com/lavanet/lava/app/params" + "github.com/lavanet/lava/v2/app" + appparams "github.com/lavanet/lava/v2/app/params" ) // NewRootCmd creates a new root command for a Cosmos SDK application diff --git a/cmd/lavad/main.go b/cmd/lavad/main.go index f25b7be71e..f1e3988527 100644 --- a/cmd/lavad/main.go +++ b/cmd/lavad/main.go @@ -8,13 +8,14 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/lavanet/lava/app" - cmdcommon "github.com/lavanet/lava/cmd/common" - "github.com/lavanet/lava/cmd/lavad/cmd" - "github.com/lavanet/lava/protocol/badgegenerator" - "github.com/lavanet/lava/protocol/rpcconsumer" - "github.com/lavanet/lava/protocol/rpcprovider" - "github.com/lavanet/lava/protocol/statetracker" + "github.com/lavanet/lava/v2/app" + cmdcommon "github.com/lavanet/lava/v2/cmd/common" + "github.com/lavanet/lava/v2/cmd/lavad/cmd" + "github.com/lavanet/lava/v2/protocol/badgegenerator" + "github.com/lavanet/lava/v2/protocol/rpcconsumer" + "github.com/lavanet/lava/v2/protocol/rpcprovider" + "github.com/lavanet/lava/v2/protocol/statetracker" + utilscli "github.com/lavanet/lava/v2/utils/cli" "github.com/spf13/cobra" ) @@ -49,6 +50,8 @@ func main() { testCmd.AddCommand(rpcconsumer.CreateTestRPCConsumerCobraCommand()) testCmd.AddCommand(rpcprovider.CreateTestRPCProviderCobraCommand()) testCmd.AddCommand(statetracker.CreateEventsCobraCommand()) + testCmd.AddCommand(utilscli.NewMultiSendTxCmd()) + testCmd.AddCommand(utilscli.NewQueryTotalGasCmd()) cmd.OverwriteFlagDefaults(rootCmd, map[string]string{ flags.FlagChainID: strings.ReplaceAll(app.Name, "-", ""), diff --git a/cmd/lavap/Dockerfile b/cmd/lavap/Dockerfile index 3e87af4c9b..9da381095e 100644 --- a/cmd/lavap/Dockerfile +++ b/cmd/lavap/Dockerfile @@ -1,9 +1,10 @@ # syntax=docker/dockerfile:1 ARG GO_VERSION="1.20" +ARG RUNNER_IMAGE="gcr.io/distroless/static-debian12:debug" ARG BUILD_TAGS="netgo,ledger,muslc" -FROM golang:${GO_VERSION}-alpine3.18 as builder +FROM golang:${GO_VERSION}-alpine3.18 AS builder RUN apk add --no-cache \ ca-certificates \ @@ -40,11 +41,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ -o /lava/build/lavap \ /lava/cmd/lavap/main.go -FROM gcr.io/distroless/static-debian12 - +FROM ${RUNNER_IMAGE} + COPY --from=builder /lava/build/lavap /bin/lavap -ENV HOME /lava +ENV HOME=/lava WORKDIR $HOME # lava api diff --git a/cmd/lavap/main.go b/cmd/lavap/main.go index 4df2557aca..9ac2f1c5bc 100644 --- a/cmd/lavap/main.go +++ b/cmd/lavap/main.go @@ -9,18 +9,19 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/cmd/lavad/cmd" - "github.com/lavanet/lava/ecosystem/cache" - "github.com/lavanet/lava/protocol/badgegenerator" - "github.com/lavanet/lava/protocol/badgeserver" - "github.com/lavanet/lava/protocol/monitoring" - "github.com/lavanet/lava/protocol/performance/connection" - validators "github.com/lavanet/lava/protocol/performance/validators" - "github.com/lavanet/lava/protocol/rpcconsumer" - "github.com/lavanet/lava/protocol/rpcprovider" - "github.com/lavanet/lava/protocol/statetracker" - "github.com/lavanet/lava/protocol/upgrade" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/cmd/lavad/cmd" + "github.com/lavanet/lava/v2/ecosystem/cache" + "github.com/lavanet/lava/v2/protocol/badgegenerator" + "github.com/lavanet/lava/v2/protocol/badgeserver" + "github.com/lavanet/lava/v2/protocol/loadtest" + "github.com/lavanet/lava/v2/protocol/monitoring" + "github.com/lavanet/lava/v2/protocol/performance/connection" + validators "github.com/lavanet/lava/v2/protocol/performance/validators" + "github.com/lavanet/lava/v2/protocol/rpcconsumer" + "github.com/lavanet/lava/v2/protocol/rpcprovider" + "github.com/lavanet/lava/v2/protocol/statetracker" + "github.com/lavanet/lava/v2/protocol/upgrade" "github.com/spf13/cobra" ) @@ -72,6 +73,8 @@ func main() { testCmd.AddCommand(connection.CreateTestConnectionServerCobraCommand()) testCmd.AddCommand(connection.CreateTestConnectionProbeCobraCommand()) testCmd.AddCommand(monitoring.CreateHealthCobraCommand()) + testCmd.AddCommand(loadtest.CreateTestLoadCobraCommand()) + rootCmd.AddCommand(cache.CreateCacheCobraCommand()) cmd.OverwriteFlagDefaults(rootCmd, map[string]string{ diff --git a/cmd/lavavisor/main.go b/cmd/lavavisor/main.go index 846473badf..34b5c801e0 100644 --- a/cmd/lavavisor/main.go +++ b/cmd/lavavisor/main.go @@ -6,10 +6,10 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/cmd/lavad/cmd" - lvcmd "github.com/lavanet/lava/ecosystem/lavavisor/cmd" - "github.com/lavanet/lava/protocol/upgrade" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/cmd/lavad/cmd" + lvcmd "github.com/lavanet/lava/v2/ecosystem/lavavisor/cmd" + "github.com/lavanet/lava/v2/protocol/upgrade" "github.com/spf13/cobra" ) diff --git a/config.yml b/config.yml index 6078bcd940..149fc947e2 100644 --- a/config.yml +++ b/config.yml @@ -86,4 +86,4 @@ validators: - name: alice bonded: 100000000000ulava app: - minimum-gas-prices: 0.000000001ulava + minimum-gas-prices: 0.00002ulava diff --git a/config/consumer_examples/lava_consumer_static_peers.yml b/config/consumer_examples/lava_consumer_static_peers.yml new file mode 100644 index 0000000000..5e3a6bfe5f --- /dev/null +++ b/config/consumer_examples/lava_consumer_static_peers.yml @@ -0,0 +1,23 @@ +endpoints: + - chain-id: LAV1 + api-interface: rest + network-address: 127.0.0.1:3360 + - chain-id: LAV1 + api-interface: tendermintrpc + network-address: 127.0.0.1:3361 + - chain-id: LAV1 + api-interface: grpc + network-address: 127.0.0.1:3362 +static-providers: + - api-interface: tendermintrpc + chain-id: LAV1 + node-urls: + - url: 127.0.0.1:2220 + - api-interface: grpc + chain-id: LAV1 + node-urls: + - url: 127.0.0.1:2220 + - api-interface: rest + chain-id: LAV1 + node-urls: + - url: 127.0.0.1:2220 \ No newline at end of file diff --git a/config/consumer_examples/lava_example.yml b/config/consumer_examples/lava_example.yml index f318b13fd2..da9b216425 100644 --- a/config/consumer_examples/lava_example.yml +++ b/config/consumer_examples/lava_example.yml @@ -1,11 +1,11 @@ endpoints: - - chain-id: LAV1 - api-interface: tendermintrpc - network-address: 127.0.0.1:3334 - - chain-id: LAV1 - api-interface: rest - network-address: 127.0.0.1:3333 - - chain-id: LAV1 - api-interface: tendermintrpc - network-address: 127.0.0.1:3335 + - chain-id: LAV1 + api-interface: tendermintrpc + network-address: 127.0.0.1:3334 + - chain-id: LAV1 + api-interface: rest + network-address: 127.0.0.1:3333 + - chain-id: LAV1 + api-interface: grpc + network-address: 127.0.0.1:3335 metrics-listen-address: ":7779" \ No newline at end of file diff --git a/config/provider_examples/avalanch_internal_paths_example.yml b/config/provider_examples/avalanch_internal_paths_example.yml index 9d6fc74509..bf69abb6ad 100644 --- a/config/provider_examples/avalanch_internal_paths_example.yml +++ b/config/provider_examples/avalanch_internal_paths_example.yml @@ -1,14 +1,14 @@ -# this example show cases how you can setup Avalanche +# this example show cases how you can setup Avalanche endpoints: - - api-interface: jsonrpc - chain-id: AVAX - network-address: 127.0.0.1:2221 - node-urls: - - url: ws://127.0.0.1:3333/C/rpc/ws - internal-path: "/C/rpc" # c chain like specified in the spec - - url: https://127.0.0.1:3334/C/avax - internal-path: "/C/avax" # c/avax like specified in the spec - - url: https://127.0.0.1:3335/X - internal-path: "/X" # x chain like specified in the spec - - url: https://127.0.0.1:3336/P - internal-path: "/P" # p chain like specified in the spec \ No newline at end of file + - api-interface: jsonrpc + chain-id: AVAX + network-address: 127.0.0.1:2221 + node-urls: + - url: ws://127.0.0.1:3333/C/rpc/ws + internal-path: "/C/rpc" # c chain like specified in the spec + - url: https://127.0.0.1:3334/C/avax + internal-path: "/C/avax" # c/avax like specified in the spec + - url: https://127.0.0.1:3335/X + internal-path: "/X" # x chain like specified in the spec + - url: https://127.0.0.1:3336/P + internal-path: "/P" # p chain like specified in the spec diff --git a/config/provider_examples/lava_example.yml b/config/provider_examples/lava_example.yml index 220d47bf45..f21ddccd6b 100644 --- a/config/provider_examples/lava_example.yml +++ b/config/provider_examples/lava_example.yml @@ -17,4 +17,4 @@ endpoints: network-address: address: "127.0.0.1:2220" node-urls: - - url: http://127.0.0.1:1317 + - url: http://127.0.0.1:1317 \ No newline at end of file diff --git a/config/provider_examples/lava_example_archive.yml b/config/provider_examples/lava_example_archive.yml new file mode 100644 index 0000000000..01dc8458a5 --- /dev/null +++ b/config/provider_examples/lava_example_archive.yml @@ -0,0 +1,29 @@ +endpoints: + - api-interface: tendermintrpc + chain-id: LAV1 + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: ws://127.0.0.1:26657/websocket + - url: http://127.0.0.1:26657 + - url: http://127.0.0.1:26657 + addons: + - archive + - api-interface: grpc + chain-id: LAV1 + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: 127.0.0.1:9090 + - url: 127.0.0.1:9090 + addons: + - archive + - api-interface: rest + chain-id: LAV1 + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: http://127.0.0.1:1317 + - url: http://127.0.0.1:1317 + addons: + - archive diff --git a/config/provider_examples/lava_example_archive_methodroute.yml b/config/provider_examples/lava_example_archive_methodroute.yml new file mode 100644 index 0000000000..e8cbf3bad9 --- /dev/null +++ b/config/provider_examples/lava_example_archive_methodroute.yml @@ -0,0 +1,35 @@ +endpoints: + - api-interface: tendermintrpc + chain-id: LAV1 + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: ws://127.0.0.1:26657/websocket + - url: http://127.0.0.1:26657 + - url: http://127.0.0.1:26657 + addons: + - archive + - url: https://trustless-api.com + methods: + - block + - block_by_hash + addons: + - archive + - api-interface: grpc + chain-id: LAV1 + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: 127.0.0.1:9090 + - url: 127.0.0.1:9090 + addons: + - archive + - api-interface: rest + chain-id: LAV1 + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: http://127.0.0.1:1317 + - url: http://127.0.0.1:1317 + addons: + - archive diff --git a/config/provider_examples/test_spec_template.yml b/config/provider_examples/test_spec_template.yml index 62f5d839e4..cf8354b63f 100644 --- a/config/provider_examples/test_spec_template.yml +++ b/config/provider_examples/test_spec_template.yml @@ -1,26 +1,26 @@ endpoints: - api-interface: tendermintrpc - chain-id: INDEX_RELACE_THIS + chain-id: INDEX_REPLACE_THIS network-address: address: "127.0.0.1:2220" node-urls: - - url: RELACE_THIS_URL - - url: RELACE_THIS_URL + - url: REPLACE_THIS_URL + - url: REPLACE_THIS_URL - api-interface: grpc - chain-id: INDEX_RELACE_THIS + chain-id: INDEX_REPLACE_THIS network-address: address: "127.0.0.1:2220" node-urls: - - url: RELACE_THIS_URL + - url: REPLACE_THIS_URL - api-interface: rest - chain-id: INDEX_RELACE_THIS + chain-id: INDEX_REPLACE_THIS network-address: address: "127.0.0.1:2220" node-urls: - - url: RELACE_THIS_URL + - url: REPLACE_THIS_URL - api-interface: jsonrpc - chain-id: INDEX_RELACE_THIS + chain-id: INDEX_REPLACE_THIS network-address: address: "127.0.0.1:2220" node-urls: - - url: RELACE_THIS_URL + - url: REPLACE_THIS_URL diff --git a/config/provider_examples/test_spec_template_archive.yml b/config/provider_examples/test_spec_template_archive.yml new file mode 100644 index 0000000000..7c0cecdee6 --- /dev/null +++ b/config/provider_examples/test_spec_template_archive.yml @@ -0,0 +1,41 @@ +endpoints: + - api-interface: tendermintrpc + chain-id: INDEX_REPLACE_THIS + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: REPLACE_THIS_URL + - url: REPLACE_THIS_URL + addons: + - archive + - url: REPLACE_THIS_URL + - url: REPLACE_THIS_URL + addons: + - archive + - api-interface: grpc + chain-id: INDEX_REPLACE_THIS + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: REPLACE_THIS_URL + - url: REPLACE_THIS_URL + addons: + - archive + - api-interface: rest + chain-id: INDEX_REPLACE_THIS + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: REPLACE_THIS_URL + - url: REPLACE_THIS_URL + addons: + - archive + - api-interface: jsonrpc + chain-id: INDEX_REPLACE_THIS + network-address: + address: "127.0.0.1:2220" + node-urls: + - url: REPLACE_THIS_URL + - url: REPLACE_THIS_URL + addons: + - archive diff --git a/cookbook/projects/policy_all_chains_with_extension.yml b/cookbook/projects/policy_all_chains_with_extension.yml index 2a45dde89b..25ef52bbd1 100644 --- a/cookbook/projects/policy_all_chains_with_extension.yml +++ b/cookbook/projects/policy_all_chains_with_extension.yml @@ -56,6 +56,26 @@ Policy: extensions: - "archive" mixed: true + - chain_id: LAV1 + requirements: + - collection: + api_interface: "rest" + type: "GET" + extensions: + - "archive" + mixed: true + - collection: + api_interface: "grpc" + type: "" + extensions: + - "archive" + mixed: true + - collection: + api_interface: "tendermintrpc" + type: "" + extensions: + - "archive" + mixed: true - chain_id: COSMOSHUB requirements: - collection: diff --git a/cookbook/specs/aptos.json b/cookbook/specs/aptos.json index b391072c11..a0aef79581 100644 --- a/cookbook/specs/aptos.json +++ b/cookbook/specs/aptos.json @@ -472,7 +472,7 @@ }, "values": [ { - "latest_distance": 21600 + "latest_distance": 432000 }, { "extension": "archive", @@ -486,7 +486,7 @@ "name": "archive", "cu_multiplier": 5, "rule": { - "block": 21300 + "block": 427500 } } ] diff --git a/cookbook/specs/bera.json b/cookbook/specs/bera.json index 533e8ff891..79d539ae49 100644 --- a/cookbook/specs/bera.json +++ b/cookbook/specs/bera.json @@ -5,7 +5,7 @@ "specs": [ { "index": "BERAT", - "name": "berachain testnet", + "name": "berachain artio testnet", "enabled": true, "imports": [ "ETH1" @@ -39,7 +39,7 @@ "name": "chain-id", "values": [ { - "expected_value": "0x138d5" + "expected_value": "0x138d4" } ] }, @@ -63,8 +63,69 @@ ] } ] + },{ + "index": "BERAT2", + "name": "berachain bartio testnet", + "enabled": true, + "imports": [ + "ETH1" + ], + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 1, + "average_block_time": 2000, + "allowed_block_lag_for_qos_sync": 2, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "jsonrpc", + "internal_path": "", + "type": "POST", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "0x138d4" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 43200 + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 42600 + } + } + ] + } + ] } ] }, + "deposit": "10000000ulava" -} \ No newline at end of file +} diff --git a/cookbook/specs/cosmossdk.json b/cookbook/specs/cosmossdk.json index 60b28b7ef0..106790b65f 100644 --- a/cookbook/specs/cosmossdk.json +++ b/cookbook/specs/cosmossdk.json @@ -4738,7 +4738,7 @@ { "name": "minimum-gas-price", "parse_directive": { - "function_template": "cosmos.base.node.v1beta1.Service/Config", + "function_template": "", "function_tag": "VERIFICATION", "result_parsing": { "parser_arg": [ diff --git a/cookbook/specs/elys.json b/cookbook/specs/elys.json new file mode 100644 index 0000000000..ff085a2ec3 --- /dev/null +++ b/cookbook/specs/elys.json @@ -0,0 +1,2972 @@ +{ + "proposal": { + "title": "Add Specs: ELYS", + "description": "Adding new specification support for relaying elys data on Lava", + "specs": [ + { + "index": "ELYS", + "name": "elys testnet", + "enabled": true, + "imports": [ + "COSMOSSDKFULL" + ], + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 1, + "average_block_time": 4500, + "allowed_block_lag_for_qos_sync": 2, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "GET", + "add_on": "" + }, + "apis": [ + { + "name": "/elys-network/elys/accountedpool/accounted_pool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/accountedpool/accounted_pool/{pool_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/balance/{address}/{denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/denom_liquidity", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/denom_liquidity/{denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/exit_pool_estimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/in_route_by_denom/{denom_in}/{denom_out}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/join_pool_estimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/out_route_by_denom/{denom_out}/{denom_in}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/pool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/pool/{pool_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/slippage_track/{pool_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/slippage_tracks", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/swap_estimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/amm/swap_estimation_by_denom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/assetprofile/entry", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/assetprofile/entry/{base_denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/assetprofile/entry/{denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/assetprofile/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/burner/history", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/burner/history/{timestamp}/{denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/burner/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys/clock/v1/contracts", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys/clock/v1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/commitment/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/commitment/show_commitments/{creator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/epochs/v1/current_epoch", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/epochs/v1/epochs", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/incentive/apr/{withdraw_type}/{denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/incentive/aprs", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/incentive/community_pool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/incentive/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/incentive/pool_aprs", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/incentive/pool_rewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/is-whitelisted", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/pool/{index}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/pool/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/position/{address}/{id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/positions-by-pool/{amm_pool_id}/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "​/elys-network​/elys​/leveragelp​/positions-for-address​/{address}​/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/positions/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/status", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/leveragelp/whitelist/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/oracle/asset_info", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/oracle/asset_info/{denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/oracle/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/oracle/price", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/oracle/price_feeder", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/oracle/price_feeder/{feeder}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys/oracle/band_price_result/{request_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys/oracle/last_band_price_request_id", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/parameter/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "​/elys-network​/elys​/perpetual​/is-whitelisted", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/mtp/{address}/{id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "​/elys-network​/elys​/perpetual​/mtps-by-pool​/{amm_pool_id}​/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/mtps-for-address/{address}/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/open-estimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/pool/{index}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/pool/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/positions/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "​/elys-network​/elys​/perpetual​/status", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/perpetual/whitelist/{pagination.key}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/stablestake/borrow-ratio", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/stablestake/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "​/elys-network​/elys​/tokenomics​/airdrop", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/tokenomics/airdrop/{intent}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/tokenomics/genesis_inflation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/tokenomics/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/tokenomics/time_based_inflation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/elys-network/elys/tokenomics/time_based_inflation/{start_block_height}/{end_block_height}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "​/elys-network​/elys​/transferhook​/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "elystestnet-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 19200 + }, + { + "extension": "archive", + "expected_value": "1" + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 19000 + } + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "grpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [ + { + "name": "elys.accountedpool.Query/AccountedPool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.accountedpool.Query/AllAccountedPool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/Pool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/DenomLiquidity", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/DenomLiquidityAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/SwapEstimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/JoinPoolEstimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/ExitPoolEstimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/SlippageTrack", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/SlippageTrackAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/Balance", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/InRouteByDenom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/OutRouteByDenom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.amm.Query/SwapEstimationByDenom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.assetprofile.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.assetprofile.Query/Entry", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.assetprofile.Query/EntryByDenom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.assetprofile.Query/EntryAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.burner.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.burner.Query/History", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.burner.Query/HistoryAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.clock.v1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.clock.v1.Query/ClockContracts", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.commitment.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.commitment.Query/ShowCommitments", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.epochs.v1.Query/EpochInfos", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.epochs.v1.Query/CurrentEpoch", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.estaking.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.estaking.Query/Rewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.incentive.Query/Apr", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.incentive.Query/Aprs", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.incentive.Query/PoolRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.incentive.Query/AllProgramRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/QueryPositions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/QueryPositionsByPool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/GetStatus", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/QueryPositionsForAddress", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/GetWhitelist", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/IsWhitelisted", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/Pool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/Pools", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.leveragelp.Query/Positions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/ExternalIncentive", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/PoolInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/PoolRewardInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/UserRewardInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/UserPendingReward", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/StableStakeApr", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.masterchef.Query/PoolAprs", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/BandPriceResult", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/LastBandRequestId", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/AssetInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/AssetInfoAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/Price", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/PriceAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/PriceFeeder", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.oracle.Query/PriceFeederAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.parameter.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/GetPositions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/GetPositionsByPool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/GetStatus", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/GetPositionsForAddress", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/GetWhitelist", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/IsWhitelisted", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/Pool", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/Pools", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/MTP", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.perpetual.Query/OpenEstimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.stablestake.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.stablestake.Query/BorrowRatio", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.tokenomics.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.tokenomics.Query/Airdrop", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.tokenomics.Query/AirdropAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.tokenomics.Query/GenesisInflation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.tokenomics.Query/TimeBasedInflation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.tokenomics.Query/TimeBasedInflationAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "elys.transferhook.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "elystestnet-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 19200 + }, + { + "extension": "archive", + "expected_value": "1" + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 19000 + } + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "tendermintrpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "elystestnet-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 19200 + }, + { + "extension": "archive", + "expected_value": "1" + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 19000 + } + } + ] + } + ] + } + ] + }, + "deposit": "10000000ulava" +} \ No newline at end of file diff --git a/cookbook/specs/ethereum.json b/cookbook/specs/ethereum.json index 42d573fb05..c16b30a64a 100644 --- a/cookbook/specs/ethereum.json +++ b/cookbook/specs/ethereum.json @@ -384,7 +384,7 @@ "category": { "deterministic": false, "local": true, - "subscription": true, + "subscription": false, "stateful": 0 }, "extra_compute_units": 0 @@ -412,9 +412,9 @@ "name": "eth_getProof", "block_parsing": { "parser_arg": [ - "latest" + "2" ], - "parser_func": "DEFAULT" + "parser_func": "PARSE_BY_ARG" }, "compute_units": 20, "enabled": true, @@ -833,7 +833,7 @@ ], "parser_func": "DEFAULT" }, - "compute_units": 10, + "compute_units": 1000, "enabled": true, "category": { "deterministic": false, @@ -874,7 +874,7 @@ "category": { "deterministic": false, "local": true, - "subscription": true, + "subscription": false, "stateful": 0 }, "extra_compute_units": 0 @@ -883,16 +883,16 @@ "name": "eth_unsubscribe", "block_parsing": { "parser_arg": [ - "" + "latest" ], - "parser_func": "EMPTY" + "parser_func": "DEFAULT" }, "compute_units": 10, "enabled": true, "category": { "deterministic": false, "local": true, - "subscription": false, + "subscription": true, "stateful": 0 }, "extra_compute_units": 0 @@ -1045,6 +1045,15 @@ "encoding": "hex" }, "api_name": "eth_getBlockByNumber" + }, + { + "function_tag": "SUBSCRIBE", + "api_name": "eth_subscribe" + }, + { + "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"eth_unsubscribe\",\"params\":[\"%s\"],\"id\":1}", + "function_tag": "UNSUBSCRIBE", + "api_name": "eth_unsubscribe" } ], "verifications": [ diff --git a/cookbook/specs/fantom.json b/cookbook/specs/fantom.json index 286e9e81d0..7e14dbad37 100644 --- a/cookbook/specs/fantom.json +++ b/cookbook/specs/fantom.json @@ -98,7 +98,7 @@ "category": { "deterministic": false, "local": true, - "subscription": false, + "subscription": true, "stateful": 0 }, "extra_compute_units": 0 @@ -387,7 +387,7 @@ "category": { "deterministic": false, "local": true, - "subscription": true, + "subscription": false, "stateful": 0 }, "extra_compute_units": 0 @@ -477,7 +477,7 @@ "category": { "deterministic": false, "local": true, - "subscription": true, + "subscription": false, "stateful": 0 }, "extra_compute_units": 0 diff --git a/cookbook/specs/fuel.json b/cookbook/specs/fuel.json new file mode 100644 index 0000000000..3a598124fa --- /dev/null +++ b/cookbook/specs/fuel.json @@ -0,0 +1,81 @@ +{ + "proposal": { + "title": "Add Specs: Fuel network", + "description": "Adding new specification support for Fuel network GraphQL", + "specs": [ + { + "index": "FUELNETWORK", + "name": "fuel network graphql", + "enabled": true, + "reliability_threshold": 268435455, + "data_reliability_enabled": false, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 1, + "average_block_time": 1000, + "allowed_block_lag_for_qos_sync": 1, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "POST", + "add_on": "" + }, + "apis": [ + { + "name": "/v1/graphql", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": 200, + "enabled": true, + "category": { + "deterministic": false, + "local": true, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "health", + "parse_directive": { + "function_template": "{\"query\":\"{ health }\"}", + "function_tag": "VERIFICATION", + "result_parsing": { + "parser_arg": [ + "0", + "data", + "health" + ], + "parser_func": "PARSE_CANONICAL" + }, + "api_name": "/v1/graphql" + }, + "values": [ + { + "expected_value": "%!s(bool=true)" + } + ] + } + ] + } + ] + } + ] + }, + "deposit": "10000000ulava" +} \ No newline at end of file diff --git a/cookbook/specs/lava.json b/cookbook/specs/lava.json index c62f5e4105..ca343c40a2 100644 --- a/cookbook/specs/lava.json +++ b/cookbook/specs/lava.json @@ -8,7 +8,7 @@ "name": "lava testnet", "enabled": true, "imports": [ - "COSMOSSDKFULL" + "COSMOSSDK" ], "providers_types": 1, "reliability_threshold": 268435455, @@ -1239,6 +1239,222 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/iprpc_provider_reward/{provider}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/dualstaking/delegator_rewards/{delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/pairing/provider/{address}/{chainID}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/pairing/provider_pairing_chance/{provider}/{chainID}/{geolocation}/{cluster}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/iprpc_spec_reward/{spec}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/provider_reward", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/show_iprpc_data", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/pairing/providers_epoch_cu", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/estimated_validator_rewards/{validator}/{amount_delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/tracked_usage/{subscription}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/estimated_rewards/{provider}/{chain_id}/{amount_delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/SpecTrackedInfo/{chain_id}/{provider}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], @@ -2455,6 +2671,222 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.dualstaking.Query/DelegatorRewardsList", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.pairing.Query/ProviderPairingChance", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/ProviderReward", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.pairing.Query/ProvidersEpochCu", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/IprpcProviderRewardEstimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/IprpcSpecReward", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/ShowIprpcData", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.pairing.Query/Provider", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/EstimatedRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/SpecTrackedInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/EstimatedValidatorRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/TrackedUsage", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], diff --git a/cookbook/specs/lava_mainnet.json b/cookbook/specs/lava_mainnet.json index c2472c7538..1923cbde0f 100644 --- a/cookbook/specs/lava_mainnet.json +++ b/cookbook/specs/lava_mainnet.json @@ -8,7 +8,7 @@ "name": "lava mainnet", "enabled": true, "imports": [ - "COSMOSSDKFULL" + "COSMOSSDK" ], "providers_types": 1, "reliability_threshold": 268435455, @@ -1239,6 +1239,204 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/iprpc_spec_reward/{spec}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/estimated_rewards/{provider}/{chain_id}/{amount_delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/tracked_usage/{subscription}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/iprpc_provider_reward/{provider}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/subscription/estimated_validator_rewards/{validator}/{amount_delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/dualstaking/delegator_rewards/{delegator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/SpecTrackedInfo/{chain_id}/{provider}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/pairing/providers_epoch_cu", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/pairing/provider/{address}/{chainID}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/pairing/provider_pairing_chance/{provider}/{chainID}/{geolocation}/{cluster}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/lavanet/lava/rewards/show_iprpc_data", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], @@ -2455,6 +2653,204 @@ "stateful": 0 }, "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/EstimatedRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/IprpcProviderRewardEstimation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/TrackedUsage", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.subscription.Query/EstimatedValidatorRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.dualstaking.Query/DelegatorRewardsList", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/IprpcSpecReward", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.pairing.Query/ProvidersEpochCu", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/SpecTrackedInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.pairing.Query/Provider", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.pairing.Query/ProviderPairingChance", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "lavanet.lava.rewards.Query/ShowIprpcData", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 } ], "headers": [], @@ -2540,5 +2936,5 @@ } ] }, - "deposit": "10000000ulava" + "deposit": "1750000000ulava" } \ No newline at end of file diff --git a/cookbook/specs/movement.json b/cookbook/specs/movement.json new file mode 100644 index 0000000000..aa7d3d94a9 --- /dev/null +++ b/cookbook/specs/movement.json @@ -0,0 +1,87 @@ +{ + "proposal": { + "title": "Add Specs: Movement", + "description": "Adding new specification support for relaying Movement data on Lava", + "specs": [ + { + "index": "MOVEMENT", + "name": "movement mainnet", + "enabled": true, + "imports": [ + "APT1" + ], + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 5, + "average_block_time": 200, + "allowed_block_lag_for_qos_sync": 50, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "GET", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "4" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 432000 + }, + { + "extension": "archive", + "expected_value": "0" + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 427500 + } + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "POST", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [] + } + ] + } + ] + }, + "deposit": "10000000ulava" +} \ No newline at end of file diff --git a/cookbook/specs/near.json b/cookbook/specs/near.json index 4651085881..037335089c 100644 --- a/cookbook/specs/near.json +++ b/cookbook/specs/near.json @@ -87,7 +87,19 @@ "subscription": false, "stateful": 0 }, - "extra_compute_units": 0 + "extra_compute_units": 0, + "parsers": [ + { + "parse_path": ".params.finality", + "value": "latest", + "rule": "=final || =optimistic", + "parse_type": "DEFAULT_VALUE" + }, + { + "parse_path": ".params.[0]", + "parse_type": "BLOCK_HASH" + } + ] }, { "name": "EXPERIMENTAL_changes_in_block", @@ -127,7 +139,13 @@ "subscription": false, "stateful": 0 }, - "extra_compute_units": 0 + "extra_compute_units": 0, + "parsers": [ + { + "parse_path": ".params.[0]", + "parse_type": "BLOCK_HASH" + } + ] }, { "name": "gas_price", @@ -465,7 +483,6 @@ } ] } - ], "extensions": [ { diff --git a/cookbook/specs/spec_add_injective.json b/cookbook/specs/spec_add_injective.json new file mode 100644 index 0000000000..be1ace1599 --- /dev/null +++ b/cookbook/specs/spec_add_injective.json @@ -0,0 +1,4530 @@ +{ + "proposal": { + "title": "Add Specs: Injective", + "description": "Adding new specification support for relaying injective data on Lava", + "specs": [ + { + "index": "INJECTIVE", + "name": "injective mainnet", + "enabled": true, + "imports": [ + "COSMOSSDKFULL" + ], + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 1, + "average_block_time": 600, + "allowed_block_lag_for_qos_sync": 16, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "GET", + "add_on": "" + }, + "apis": [ + { + "name": "/injective/exchange/v1beta1/atomic_order_fee_multiplier", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/balance_mismatches/{dust_factor}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/balances_with_balance_holds", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/binary_options/markets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/market_address/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/markets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/markets/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/mid_price_and_tob/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/orderbook/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/orders/conditional/{market_id}/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/orders/{market_id}/account/{account_address}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/orders/{market_id}/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/orders_by_hashes/{market_id}/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/derivative/transient_orders/{market_id}/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/effective_positions/{subaccount_id}/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/aggregateMarketVolume/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/aggregateMarketVolumes", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/aggregateVolume/{account}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/aggregateVolumes", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/denom_decimal/{denom}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/denom_decimals", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/exchangeBalances", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/subaccountDeposit", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/subaccountDeposits", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchange/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/exchangeParams", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/expiry_market_info/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/fee_discount_account_info/{account}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/fee_discount_schedule", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/fee_discount_tier_stats", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/historical_trade_records", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/is_opted_out_of_rewards/{account}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/market_volatility/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/mito_vault_infos", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/opted_out_of_rewards_accounts", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/order_metadata/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/orders/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/pending_trade_reward_points", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/perpetual_market_funding/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/perpetual_market_info/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/positions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/positions/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/positions/{subaccount_id}/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/full_market/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/full_markets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/markets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/markets/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/mid_price_and_tob/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/orderbook/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/orders/{market_id}/account/{account_address}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/orders/{market_id}/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/orders_by_hashes/{market_id}/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/spot/transient_orders/{market_id}/{subaccount_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/trade_reward_campaign", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/trade_reward_points", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/exchange/v1beta1/vault_market_id/{vault_address}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/wasmx/v1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/wasmx/v1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/wasmx/v1/registration_info/{contract_address}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/chainlink/ocr/v1beta1/feed_config/{feed_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/chainlink/ocr/v1beta1/feed_config_info/{feed_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/chainlink/ocr/v1beta1/latest_round/{feed_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/chainlink/ocr/v1beta1/latest_transmission_details/{feed_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/chainlink/ocr/v1beta1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/chainlink/ocr/v1beta1/owed_amount/{transmitter}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/chainlink/ocr/v1beta1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/auction/v1beta1/basket", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/auction/v1beta1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/auction/v1beta1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/band_ibc_price_states", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/band_price_states", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/band_relayers", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/coinbase_price_states", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/historical_price_records", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/price", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/pricefeed_price_states", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/provider_price_state/{provider}/{symbol}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/provider_prices", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/providers", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/pyth_price", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/pyth_price_states", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/oracle/v1beta1/volatility", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/insurance/v1beta1/estimated_redemptions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/insurance/v1beta1/insurance_fund/{market_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/insurance/v1beta1/insurance_funds", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/insurance/v1beta1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/insurance/v1beta1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/insurance/v1beta1/pending_redemptions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/batch", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/batch/confirms", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/batch/last", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/batch/outgoingtx", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/batchfees", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/confirms/{nonce}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/cosmos_originated/denom_to_erc20", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/cosmos_originated/erc20_to_denom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/missing_nonces", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/oracle/event/{address}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/pending_send_to_eth", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/query_delegate_keys_by_eth", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/query_delegate_keys_by_orchestrator", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/query_delegate_keys_by_validator", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/valset", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/valset/confirm", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/valset/current", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/valset/last", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/peggy/v1/valset/requests", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/tokenfactory/v1beta1/denoms/{creator}/{sub_denom}/authority_metadata", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/tokenfactory/v1beta1/denoms_from_creator/{creator}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/tokenfactory/v1beta1/module_state", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/injective/tokenfactory/v1beta1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "injective-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 86400 + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 85500 + } + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "grpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [ + { + "name": "injective.auction.v1beta1.Query/AuctionModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.auction.v1beta1.Query/AuctionParams", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.auction.v1beta1.Query/CurrentAuctionBasket", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/AccountAddressDerivativeOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/AccountAddressSpotOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/AggregateMarketVolume", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/AggregateMarketVolumes", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/AggregateVolume", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/AggregateVolumes", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/BalanceMismatches", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/BalanceWithBalanceHolds", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/BinaryOptionsMarkets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DenomDecimal", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DenomDecimals", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DerivativeMarket", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DerivativeMarketAddress", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DerivativeMarkets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DerivativeMidPriceAndTOB", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DerivativeOrderbook", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/DerivativeOrdersByHashes", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/ExchangeBalances", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/ExchangeModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/ExpiryFuturesMarketInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/FeeDiscountAccountInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/FeeDiscountSchedule", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/FeeDiscountTierStatistics", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/FullSpotMarket", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/FullSpotMarkets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/HistoricalTradeRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/IsOptedOutOfRewards", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/MarketAtomicExecutionFeeMultiplier", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/MarketVolatility", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/MitoVaultInfos", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/OptedOutOfRewardsAccounts", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/PendingTradeRewardPoints", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/PerpetualMarketFunding", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/PerpetualMarketInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/Positions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/QueryExchangeParams", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/QueryMarketIDFromVault", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SpotMarket", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SpotMarkets", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SpotMidPriceAndTOB", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SpotOrderbook", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SpotOrdersByHashes", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountDeposit", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountDeposits", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountEffectivePositionInMarket", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountOrderMetadata", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountPositionInMarket", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountPositions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/SubaccountTradeNonce", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/TradeRewardCampaign", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/TradeRewardPoints", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/TraderDerivativeConditionalOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/TraderDerivativeOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/TraderDerivativeTransientOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/TraderSpotOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.exchange.v1beta1.Query/TraderSpotTransientOrders", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.insurance.v1beta1.Query/EstimatedRedemptions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.insurance.v1beta1.Query/InsuranceFund", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.insurance.v1beta1.Query/InsuranceFunds", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.insurance.v1beta1.Query/InsuranceModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.insurance.v1beta1.Query/InsuranceParams", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.insurance.v1beta1.Query/PendingRedemptions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.ocr.v1beta1.Query/FeedConfig", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.ocr.v1beta1.Query/FeedConfigInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.ocr.v1beta1.Query/LatestRound", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.ocr.v1beta1.Query/LatestTransmissionDetails", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.ocr.v1beta1.Query/OcrModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.ocr.v1beta1.Query/OwedAmount", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.ocr.v1beta1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/BandIBCPriceStates", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/BandPriceStates", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/BandRelayers", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/CoinbasePriceStates", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/HistoricalPriceRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/OracleModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/OraclePrice", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/OracleProviderPrices", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/OracleProvidersInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/OracleVolatility", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/PriceFeedPriceStates", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/ProviderPriceState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/PythPrice", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.oracle.v1beta1.Query/PythPriceStates", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/BatchConfirms", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/BatchFees", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/BatchRequestByNonce", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/CurrentValset", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/DenomToERC20", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/ERC20ToDenom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/GetDelegateKeyByEth", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/GetDelegateKeyByOrchestrator", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/GetDelegateKeyByValidator", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/GetPendingSendToEth", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/LastEventByAddr", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/LastPendingBatchRequestByAddr", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/LastPendingValsetRequestByAddr", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/LastValsetRequests", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/MissingPeggoNonces", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/OutgoingTxBatches", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/PeggyModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/ValsetConfirm", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/ValsetConfirmsByNonce", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.peggy.v1.Query/ValsetRequest", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.permissions.v1beta1.Query/AddressRoles", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.permissions.v1beta1.Query/AddressesByRole", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.permissions.v1beta1.Query/AllNamespaces", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.permissions.v1beta1.Query/NamespaceByDenom", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.permissions.v1beta1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.permissions.v1beta1.Query/VouchersForAddress", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.tokenfactory.v1beta1.Query/DenomsFromCreator", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.tokenfactory.v1beta1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.tokenfactory.v1beta1.Query/TokenfactoryModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.wasmx.v1.Query/ContractRegistrationInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.wasmx.v1.Query/WasmxModuleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "injective.wasmx.v1.Query/WasmxParams", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "injective-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 86400 + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 85500 + } + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "tendermintrpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "injective-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 86400 + }, + { + "extension": "archive", + "expected_value": "1" + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 82800 + } + } + ] + } + ] + }, + { + "index": "INJECTIVET", + "name": "injective testnet", + "enabled": true, + "imports": [ + "INJECTIVE" + ], + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 1, + "average_block_time": 600, + "allowed_block_lag_for_qos_sync": 16, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "GET", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "injective-888" + } + ] + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "grpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "injective-888" + } + ] + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "tendermintrpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "injective-888" + } + ] + } + ] + } + ] + } + ] + }, + "deposit": "10000000ulava" +} \ No newline at end of file diff --git a/cookbook/specs/starknet.json b/cookbook/specs/starknet.json index 455d13ae04..567b740a84 100644 --- a/cookbook/specs/starknet.json +++ b/cookbook/specs/starknet.json @@ -9,9 +9,9 @@ "enabled": true, "reliability_threshold": 268435455, "data_reliability_enabled": true, - "block_distance_for_finalized_data": 1, + "block_distance_for_finalized_data": 6, "blocks_in_finalization_proof": 3, - "average_block_time": 180000, + "average_block_time": 12000, "allowed_block_lag_for_qos_sync": 2, "shares": 1, "min_stake_provider": { diff --git a/cookbook/specs/stride.json b/cookbook/specs/stride.json new file mode 100644 index 0000000000..defdc24026 --- /dev/null +++ b/cookbook/specs/stride.json @@ -0,0 +1,1856 @@ +{ + "proposal": { + "title": "Add Specs: Stride", + "description": "Adding new specification support for relaying Stride data on Lava", + "specs": [ + { + "index": "STRIDE", + "name": "stride mainnet", + "enabled": true, + "imports": [ + "COSMOSSDK" + ], + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 1, + "average_block_time": 6000, + "allowed_block_lag_for_qos_sync": 2, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "GET", + "add_on": "" + }, + "apis": [ + { + "name": "/mint/v1beta1/epoch_provisions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/mint/v1beta1/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stridelabs/stride/epochs", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stridelabs/stride/epochs/current_epoch", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stridelabs/stride/epochs/epoch_info", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/icacallbacks/callback_data", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/icacallbacks/callback_data/{callbackKey}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/icacallbacks/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/records/deposit_record", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/records/deposit_record/{id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/records/epoch_unbonding_record", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/records/epoch_unbonding_record/{epochNumber}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/records/user_redemption_record", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/records/user_redemption_record/{id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/records/user_redemption_record_for_user/{chainId}/{day}/{address}/{limit}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/StrideLabs/stride/records/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/stakeibc/epoch_tracker", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/stakeibc/epoch_tracker/{epochIdentifier}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/stakeibc/host_zone", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/stakeibc/host_zone/{chain_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/stakeibc/ica_account", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/stakeibc/module_address/{name}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stride-Labs/stride/stakeibc/validators/{chain_id}", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "/Stridelabs/stride/stakeibc/params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "stride-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 14400 + }, + { + "extension": "archive", + "latest_distance": 1 + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 14250 + } + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "grpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [ + { + "name": "interchain_security.ccv.consumer.v1.Query/QueryNextFeeDistribution", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "interchain_security.ccv.consumer.v1.Query/QueryParams", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "interchain_security.ccv.consumer.v1.Query/QueryProviderInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "interchain_security.ccv.consumer.v1.Query/QueryThrottleState", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "packetforward.v1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "ratelimit.v1.Query/AllBlacklistedDenoms", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "ratelimit.v1.Query/AllRateLimits", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "ratelimit.v1.Query/AllWhitelistedAdresses", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "ratelimit.v1.Query/RateLimit", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "ratelimit.v1.Query/RateLimitsByChainId", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "ratelimit.v1.Query/RateLimitsByChannelId", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.autopilot.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/ClaimMetadata", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/ClaimRecord", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/ClaimStatus", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/ClaimableForAction", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/DistributorAccountBalance", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/TotalClaimable", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.claim.Query/UserVestings", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.epochs.Query/EpochInfo", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.epochs.Query/EpochInfos", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.epochs.Query/CurrentEpoch", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.icacallbacks.Query/CallbackData", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.icacallbacks.Query/CallbackDataAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.icacallbacks.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.icaoracle.Query/ActiveOracles", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.icaoracle.Query/AllOracles", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.icaoracle.Query/Metrics", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.icaoracle.Query/Oracle", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.mint.v1beta1.Query/EpochProvisions", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.mint.v1beta1.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/DepositRecord", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/DepositRecordAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/DepositRecordByHost", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/EpochUnbondingRecord", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/EpochUnbondingRecordAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/LSMDeposits", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/UserRedemptionRecord", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/UserRedemptionRecordAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.records.Query/UserRedemptionRecordForUser", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakedym.Query/DelegationRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakedym.Query/HostZone", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakedym.Query/RedemptionRecord", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakedym.Query/RedemptionRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakedym.Query/SlashRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakedym.Query/UnbondingRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/AddressUnbondings", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/AllTradeRoutes", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/EpochTracker", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/EpochTrackerAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/HostZone", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/HostZoneAll", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/InterchainAccountFromAddress", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/NextPacketSequence", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/Params", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.stakeibc.Query/Validators", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.staketia.Query/DelegationRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.staketia.Query/HostZone", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.staketia.Query/RedemptionRecord", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.staketia.Query/RedemptionRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.staketia.Query/SlashRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "stride.staketia.Query/UnbondingRecords", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "vesting.v1.Query/Balances", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "stride-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 14900 + }, + { + "extension": "archive", + "latest_distance": 1 + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 14250 + } + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "tendermintrpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "stride-1" + } + ] + }, + { + "name": "pruning", + "values": [ + { + "latest_distance": 14400 + }, + { + "extension": "archive", + "latest_distance": 1 + } + ] + } + ], + "extensions": [ + { + "name": "archive", + "cu_multiplier": 5, + "rule": { + "block": 14250 + } + } + ] + } + ] + }, + { + "index": "STRIDET", + "name": "stride testnet", + "enabled": true, + "imports": [ + "STRIDE" + ], + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 0, + "blocks_in_finalization_proof": 1, + "average_block_time": 6500, + "allowed_block_lag_for_qos_sync": 2, + "shares": 1, + "min_stake_provider": { + "denom": "ulava", + "amount": "47500000000" + }, + "api_collections": [ + { + "enabled": true, + "collection_data": { + "api_interface": "rest", + "internal_path": "", + "type": "GET", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "stride-internal-1" + } + ] + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "grpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "stride-internal-1" + } + ] + } + ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "tendermintrpc", + "internal_path": "", + "type": "", + "add_on": "" + }, + "apis": [], + "headers": [], + "inheritance_apis": [], + "parse_directives": [], + "verifications": [ + { + "name": "chain-id", + "values": [ + { + "expected_value": "stride-internal-1" + } + ] + } + ] + } + ] + } + ] + }, + "deposit": "10000000ulava" + } \ No newline at end of file diff --git a/cookbook/specs/tendermint.json b/cookbook/specs/tendermint.json index 3886cb9828..3472a379f8 100644 --- a/cookbook/specs/tendermint.json +++ b/cookbook/specs/tendermint.json @@ -449,11 +449,11 @@ "name": "subscribe", "block_parsing": { "parser_arg": [ - "" + "latest" ], - "parser_func": "EMPTY" + "parser_func": "DEFAULT" }, - "compute_units": 10, + "compute_units": 1000, "enabled": true, "category": { "deterministic": false, @@ -521,16 +521,16 @@ "name": "unsubscribe", "block_parsing": { "parser_arg": [ - "" + "latest" ], - "parser_func": "EMPTY" + "parser_func": "DEFAULT" }, "compute_units": 10, "enabled": true, "category": { "deterministic": false, "local": true, - "subscription": false, + "subscription": true, "stateful": 0 }, "extra_compute_units": 0 @@ -539,16 +539,16 @@ "name": "unsubscribe_all", "block_parsing": { "parser_arg": [ - "" + "latest" ], - "parser_func": "EMPTY" + "parser_func": "DEFAULT" }, "compute_units": 10, "enabled": true, "category": { "deterministic": false, "local": true, - "subscription": false, + "subscription": true, "stateful": 0 }, "extra_compute_units": 0 @@ -618,6 +618,20 @@ "encoding": "base64" }, "api_name": "earliest_block" + }, + { + "function_tag": "SUBSCRIBE", + "api_name": "subscribe" + }, + { + "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"unsubscribe\",\"params\":%s,\"id\":1}", + "function_tag": "UNSUBSCRIBE", + "api_name": "unsubscribe" + }, + { + "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"unsubscribe_all\",\"params\":[],\"id\":1}", + "function_tag": "UNSUBSCRIBE_ALL", + "api_name": "unsubscribe_all" } ], "verifications": [ diff --git a/docker/README.md b/docker/README.md index ad16255dec..07fa6bfe18 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,88 +1,51 @@ -# How to use the lava docker images +# Lava docker support -## Building lava docker images +Lava Network offers Docker support to simplify deployment and management of its nodes and services. Key features include: -1. Download the lava sources: - ``` - git clone https://github.com/lavanet/lava.git - ``` - -2. Build the lava docker image locally - ``` - # to build from the current checked-out code: - LAVA_BINARY=all make docker-build +* **Containerized Environment**: Run Lava components in isolated containers for improved consistency and portability. +* **Easy Setup**: Quickly deploy Lava nodes using pre-configured Docker images. +* **Scalability**: Easily scale your Lava infrastructure by spinning up additional containers as needed. +* **Resource Efficiency**: Optimize resource usage by running multiple Lava services on a single host. +* **Cross-platform Compatibility**: Deploy Lava nodes consistently across different operating systems and environments. - # to build a specific lava version - LAVA_BUILD_OPTIONS="release" LAVA_VERSION=0.4.3 make docker-build - ``` +## Different Lava configuration setups - The result would be a docker image names `lava` tagged with the version. - For example the output of `docker images` after the above: - ``` - lava 0.4.3 bc3a85c7623f 2 hours ago 256MB - lava latest bc3a85c7623f 2 hours ago 256MB - lava 0.4.3-a5e1202-dirty 5ff644084c3d 2 hours ago 257MB - ``` +The compose files are ordered in sub-folders and can be simply run with: -## Running lava containers with docker - -**TODO** +```shell +docker compose -f up -d +``` -## Running lava containers with docker-compose +## Running Lava containers with docker-compose -**Run Lava Node** +The best way to deploy the Lava echo-system is via docker-compose. -1. Review the settings in `docker/env` (sections "common setup" and "common -runtime"). The default settings are usually suitable for all deployments. +*Requirments*: -2. Use the following the commands to create/start/stop/destroy the node: - ``` - # operate in docker/ directory: - cd docker/ +* Docker Compose v2 - # to start the node: - docker-compose --profile node --env-file env -f docker-compose.yml up +To start using the compose files see the examples under the `docker/` directory: - # to stop/restart the node: - docker-compose --profile node --env-file env -f docker-compose.yml stop - docker-compose --profile node --env-file env -f docker-compose.yml start +* `/state-sync` - running a node by [state-syncing](https://docs.tendermint.com/v0.34/tendermint-core/state-sync.html) with another. +* `/from-snapshot` - running a node by downloading an exising snapshot and syncing. +* `/new-node` - running a fresh node from scratch. +* `/load-balancing` - running multiple providers load-balanced by Nginx proxy - # to destroy the node: - docker-compose --profile node --env-file env -f docker-compose.yml down - ``` +## Building Lava docker images -## Running node using state-sync with docker-compose +In order to buid the Lava docker image follow these steps: -From the root path run: -```sh -docker compose -f docker/docker-compose.state-sync.yml up -d -``` +1. Download the lava sources: -To test the setup run: -```sh -curl -X POST -H "Content-Type: application/json" localhost:26657 --data '{"jsonrpc": "2.0", "id": 1, "method": "status", "params": []}' -``` -and expect to see the lastest block. + ```shell + git clone https://github.com/lavanet/lava.git + ``` -You can run change the version of `lavad` using the `LAVAD_VERSION` var: -```sh -LAVAD_VERSION=v2.0.1 docker compose -f docker/docker-compose.state-sync.yml up -d -``` +2. Build the appropriate Lava docker image locally -### Full configuration options: -|Name |Description -|----------------|------------------------------- -|LAVAD_VERSION | The Lavad version to use -|CHAIN_ID | The chain id -|KEYRING_BACKEND | The keyring backend -|MONIKER | The moniker for the `init` command -|STATE_SYNC_RPC_1| The RPC node to sync on -|GENESIS_ADDRESS | The `genesis.json` URL -|ADDRBOOK_ADDRESS| The `addrbook.json` URL -|NUM_BLOCKS | The number of blocks to sync on from behind the latest block - - -To clean the lava node setup including volumes run: -```sh -docker compose -f docker/docker-compose.state-sync.yml down -v -``` \ No newline at end of file + ```shell + docker buildx build -f cmd/lavad/Dockerfile . + docker buildx build -f cmd/lavad/Dockerfile.Cosmovisor . + docker buildx build -f cmd/lavap/Dockerfile . + ``` + \ No newline at end of file diff --git a/docker/common/consumer.yml b/docker/common/consumer.yml new file mode 100644 index 0000000000..b11b267006 --- /dev/null +++ b/docker/common/consumer.yml @@ -0,0 +1,11 @@ +endpoints: + - chain-id: LAV1 + api-interface: tendermintrpc + network-address: 0.0.0.0:3334 + - chain-id: LAV1 + api-interface: rest + network-address: 0.0.0.0:3333 + - chain-id: LAV1 + api-interface: grpc + network-address: 0.0.0.0:3335 +metrics-listen-address: ":7779" diff --git a/docker/common/new_node_init.sh b/docker/common/new_node_init.sh new file mode 100644 index 0000000000..90cf807b8f --- /dev/null +++ b/docker/common/new_node_init.sh @@ -0,0 +1,29 @@ +#!/bin/sh +set -e +set -o pipefail + +echo "### Initializing new Lava node ###" + +# Initialize validator if genesis.json doesn't exist +[ ! -f /lava/.lava/config/genesis.json ] && lavad init validator --chain-id "$CHAIN_ID" + +# Configure default CLI values +lavad config chain-id "$CHAIN_ID" +lavad config keyring-backend "$KEYRING_BACKEND" +lavad config broadcast-mode sync + +# Create users if necessary +[ ! -f /lava/.lava/keyring-test/user1.info ] && lavad keys add user1 || echo "user1 already exists" +[ ! -f /lava/.lava/keyring-test/servicer1.info ] && lavad keys add servicer1 || echo "servicer1 already exists" + +# Add genesis accounts +lavad add-genesis-account user1 50000000000000ulava --keyring-backend test || echo "Failed adding user1 as genesis account" +lavad add-genesis-account servicer1 50000000000000ulava --keyring-backend test || echo "Failed adding servicer1 as genesis account" + +# Generate signed gentx for servicer1 +lavad gentx servicer1 10000000000000ulava --chain-id "$CHAIN_ID" --keyring-backend test || echo "Failed writing signed gen tx for servicer1" + +# Register validator +lavad collect-gentxs + +echo "### Successfully initialized new Lava node ###" \ No newline at end of file diff --git a/docker/common/post_node_init.sh b/docker/common/post_node_init.sh new file mode 100644 index 0000000000..893eed5044 --- /dev/null +++ b/docker/common/post_node_init.sh @@ -0,0 +1,70 @@ +#!/bin/sh +set -e +set -o pipefail + +operator_address() { + lavad q staking validators -o json | jq -r '.validators[0].operator_address' +} + +check_votes_status() { + lavad q gov proposals --output json | jq -r '.proposals[] | select(.status == "PROPOSAL_STATUS_VOTING_PERIOD")' +} + +vote_yes_on_all_pending_proposals() { + echo "Waiting for at least one proposal to be active" + while true; do + sleep 1 + res=$(check_votes_status) + if [ -n $res ]; then + echo "No active proposals yet" + else + echo "Found active proposal!" + lavad q gov proposals --output json | jq -r '.proposals[] | select(.status == "PROPOSAL_STATUS_VOTING_PERIOD") | .id' | while read -r proposal_id; do + echo "$FROM voting yes on proposal id: $proposal_id" + lavad tx gov vote $proposal_id yes -y --from $FROM --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE > /dev/null & + done + lavad q gov proposals --output json | jq -r '.proposals[] | select(.status == "PROPOSAL_STATUS_VOTING_PERIOD") | .id' | while read -r proposal_id; do + echo "Waiting for proposal id: $proposal_id to pass..." + until [ "$(lavad q gov proposal $proposal_id --output json | jq -r .status)" == "PROPOSAL_STATUS_PASSED" ]; do + echo "Proposal id: $proposal_id didn't pass yet..." + sleep 1 + done + echo "Proposal id: $proposal_id finally passed!" + done + break + fi + done +} + +echo "### Starting post node init ###" +wget -O jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64 +chmod +x ./jq +mv jq /usr/bin + +GASPRICE="${GASPRICE:-0.000000001ulava}" +FROM="${FROM:-servicer1}" +NODE="${NODE:-tcp://lava-node:26657}" + +lavad config node $NODE +( +cd /lava/cookbook/specs/ +lavad tx gov submit-legacy-proposal spec-add \ + ./ibc.json,./tendermint.json,./cosmoswasm.json,./cosmossdk.json,./cosmossdk_45.json,./cosmossdk_full.json,./ethermint.json,./ethereum.json,./cosmoshub.json,./lava.json \ + --lava-dev-test -y --from $FROM --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +) +vote_yes_on_all_pending_proposals + +echo "Adding plan: DefaultPlan" +lavad tx gov submit-legacy-proposal plans-add /lava/cookbook/plans/test_plans/default.json -y --from $FROM --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +vote_yes_on_all_pending_proposals + +echo "Buying plan: DefaultPlan for $FROM" +lavad tx subscription buy DefaultPlan $(lavad keys show $FROM -a) --enable-auto-renewal -y --from $FROM --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE 2> /dev/null + +sleep 1 +echo "Staking provider" +PROVIDERSTAKE="500000000000ulava" +PROVIDER_ADDRESS="nginx:80" +lavad tx pairing stake-provider LAV1 $PROVIDERSTAKE "$PROVIDER_ADDRESS,1" 1 $(operator_address) -y --delegate-commission 50 --delegate-limit $PROVIDERSTAKE --from servicer1 --provider-moniker "servicer1" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo "### Post node init finished successfully ###" \ No newline at end of file diff --git a/docker/common/provider.yml b/docker/common/provider.yml new file mode 100644 index 0000000000..4d1ba5eeab --- /dev/null +++ b/docker/common/provider.yml @@ -0,0 +1,26 @@ +endpoints: + - api-interface: tendermintrpc + chain-id: LAV1 + network-address: + address: "0.0.0.0:2220" + node-urls: + - url: ws://lava-node:26657/websocket + - url: http://lava-node:26657 + # addons: + # - archive + - api-interface: grpc + chain-id: LAV1 + network-address: + address: "0.0.0.0:2220" + node-urls: + - url: lava-node:9090 + # addons: + # - archive + - api-interface: rest + chain-id: LAV1 + network-address: + address: "0.0.0.0:2220" + node-urls: + - url: http://lava-node:1317 + # addons: + # - archive diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index 6f9e432ff7..0000000000 --- a/docker/docker-compose.yml +++ /dev/null @@ -1,101 +0,0 @@ -version: '3.9' - -x-vol: - - &vol-lava - ${LAVA_HOME_DIR:-.lava}:/lava/.lava - -services: - - lava-node: - build: .. - image: lava:latest - command: "node" - environment: - # common env - - LAVA_LISTEN_IP=${LAVA_LISTEN_IP:-0.0.0.0} - - LAVA_LOG_LEVEL=${LAVA_LOG_LEVEL:-info} - ports: - - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_NODE_PORT_API:-1317}:1317' - - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_NODE_PORT_GRPC:-9090}:9090' - - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_NODE_PORT_GRPC_WEB:-9091}:9091' - - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_NODE_PORT_P2P:-26656}:26656' - - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_NODE_PORT_RPC:-26657}:26657' - deploy: - resources: - limits: - cpus: '4' - memory: '8gb' - restart: on-failure:5 - profiles: ["node"] - -# --- OUTDATED --- -# lava-portal: -# build: .. -# image: lava:latest -# command: "portal" -# volumes: -# - *vol-lava -# environment: -# # common env -# - LAVA_LISTEN_IP=${LAVA_LISTEN_IP:-0.0.0.0} -# - LAVA_LOG_LEVEL=${LAVA_LOG_LEVEL:-info} -# # portal env -# - LAVA_USER -# - LAVA_KEYRING -# - LAVA_ADDRESS -# - LAVA_STAKE_AMOUNT -# - LAVA_GAS_MODE -# - LAVA_GAS_ADJUST -# - LAVA_GAS_PRICE -# - LAVA_GEOLOCATION -# - LAVA_RPC_NODE -# - LAVA_CHAIN_ID -# - LAVA_RELAY_CHAIN_ID -# - LAVA_RELAY_IFACE -# - LAVA_PORTAL_PORT -# ports: -# - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_PORTAL_PORT:-8080}:${LAVA_PORTAL_PORT:-8080}' -# deploy: -# resources: -# limits: -# cpus: '2' -# memory: '2gb' -# restart: on-failure:5 -# profiles: ["portal"] - -# --- OUTDATED --- -# lava-provider: -# build: .. -# image: lava:latest -# command: "provider" -# volumes: -# - *vol-lava -# environment: -# # common env -# - LAVA_LISTEN_IP=${LAVA_LISTEN_IP:-0.0.0.0} -# - LAVA_LOG_LEVEL=${LAVA_LOG_LEVEL:-info} -# # portal env -# - LAVA_USER -# - LAVA_KEYRING -# - LAVA_ADDRESS -# - LAVA_STAKE_AMOUNT -# - LAVA_GAS_MODE -# - LAVA_GAS_ADJUST -# - LAVA_GAS_PRICE -# - LAVA_GEOLOCATION -# - LAVA_RPC_NODE -# - LAVA_CHAIN_ID -# - LAVA_RELAY_ENDPOINT -# - LAVA_RELAY_NODE_URL -# - LAVA_RELAY_CHAIN_ID -# - LAVA_RELAY_IFACE -# - LAVA_PORTAL_PORT -# ports: -# - '${LAVA_LISTEN_IP:-0.0.0.0}:${LAVA_PORTAL_PORT:-8080}:${LAVA_PORTAL_PORT:-8080}' -# deploy: -# resources: -# limits: -# cpus: '2' -# memory: '4gb' -# restart: on-failure:5 -# profiles: ["provider"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index fbcd886eb9..0000000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# vim:sw=4:ts=4:et - -set -e - -if [ -z "${LAVA_QUIET_LOGS:-}" ]; then - exec 3>&1 -else - exec 3>/dev/null -fi - -if /usr/bin/find "/entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then - echo >&3 "$0: Looking for shell scripts in /entrypoint.d/" - find "/entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do - case "$f" in - *.sh) - if [ -x "$f" ]; then - echo >&3 "$0: Launching $f"; - "$f" - else - # warn on shell scripts without exec bit - echo >&3 "$0: Ignoring $f, not executable"; - fi - ;; - *) echo >&3 "$0: Ignoring $f";; - esac - done - echo >&3 "$0: Configuration complete; ready for start up" -else - echo >&3 "$0: No files found in /entrypoint.d/, skipping configuration" -fi - -if [ $# -lt 1 ]; then - echo >&3 "$0: No command given" - exit 1 -fi - -case _"$1" in - _node) cmd="/lava/start_node.sh" ;; - _portal) cmd="/lava/start_portal.sh" ;; - _provider) cmd="/lava/start_provider.sh" ;; - *) cmd="$1" ;; -esac - -shift - -echo >&3 "$0: Launching $cmd $@" - -exec "$cmd" "$@" diff --git a/docker/env b/docker/env deleted file mode 100644 index aca27142b0..0000000000 --- a/docker/env +++ /dev/null @@ -1,58 +0,0 @@ -# lava environment variables for docker-compose - -# lava home directory, usually ~/.lava [mandatory: portal, provider] -LAVA_HOME_DIR=.lava - -# lava user address -or- user name [mandatory: portal, provider] -# note: at least one must be set (address takes precedence if both are set) -LAVA_USER= -LAVA_ADDRESS= - -# lava keyring backend [mandatory: portal, provider] -LAVA_KEYRING=test - -# stake amount [mandatory: portal, provider] -# (if bigger than existing stake then we would try to increase it) -LAVA_STAKE_AMOUNT=0ulava - -# gas parameters for stakin [mandatory: portal, provider] -LAVA_GAS_MODE=auto -LAVA_GAS_ADJUST=1.5 -LAVA_GAS_PRICE=0.000000001ulava - -# service geo-location [mandatory: portal, provider] -LAVA_GEOLOCATION=1 - -# lava rpc node for queries, and the chain id [mandatory: portal, provider] -LAVA_RPC_NODE=http://public-rpc.lavanet.xyz:80/rpc/ -LAVA_CHAIN_ID=lava-testnet-1 - -# listen address for services [mandatory] -# (normally should be to '0.0.0.0' since services run in container network; -# may set to the host's external address when using 'host' network mode for -# the container). -LAVA_LISTEN_IP=0.0.0.0 - -# listen ports for services [mandatory: node] -LAVA_NODE_PORT_API=1317 -LAVA_NODE_PORT_GRPC=9090 -LAVA_NODE_PORT_GRPC_WEB=9091 -LAVA_NODE_PORT_P2P=26656 -LAVA_NODE_PORT_RPC=26657 - -# listen ports for services [mandatory: portal] -LAVA_PORTAL_PORT=8080 - -# relay chain id, and api interface [mandatory: portal, provider] -LAVA_RELAY_CHAIN_ID= -LAVA_RELAY_IFACE=jsonrpc - -# relay node URL [mandatory: provider] -LAVA_RELAY_NODE_URL= - -# relay endpoint(s) [mandatory: provider] -LAVA_RELAY_ENDPOINT= - -# lavad log level [mandatory] -LAVA_LOG_LEVEL=info - diff --git a/docker/load-balancing/README.md b/docker/load-balancing/README.md new file mode 100644 index 0000000000..54f1d7016d --- /dev/null +++ b/docker/load-balancing/README.md @@ -0,0 +1,70 @@ +# Multiple providers load balance via Nginx + +This example demonstrates how to deploy multiple providers behind a single proxy with only one stake command. + +## Setup Instructions + +1. Run the following command to setup the compose: + + ```shell + docker compose -f docker/load-balancing/docker-compose.yml up -d + ``` + +2. That's it! You should have a running Lava node ready to use. To test the setup run the following command: + + ```shell + curl -X POST -H "Content-Type: application/json" localhost:26657 --data '{"jsonrpc": "2.0", "id": 1, "method": "status", "params": []}' + ``` + + The result will look something like this: + + ```json + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "node_info": { + "protocol_version": { + "p2p": "8", + "block": "11", + "app": "0" + }, + "id": "a803429fe79d72656bd07e0d290ec048c0615037", + "listen_addr": "tcp://0.0.0.0:26656", + "network": "lava", + "version": "0.37.4", + "channels": "40202122233038606100", + "moniker": "validator", + "other": { + "tx_index": "on", + "rpc_address": "tcp://0.0.0.0:26657" + } + }, + "sync_info": { + "latest_block_hash": "B24647F6A2578D361F50796B9FBD936DADC589B6AD56F4F34B1E242184484199", + "latest_app_hash": "1B9147BFB6548B64CCAAAD51C957C3A5C5FF2786F7518DE29AD416E038B52397", + "latest_block_height": "791", + "latest_block_time": "2024-07-28T12:14:01.905074847Z", + "earliest_block_hash": "C8851AF02B28E00491BED38EDA5E719317BCA31433A7C8204FC16318571CA754", + "earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "earliest_block_height": "1", + "earliest_block_time": "2024-07-28T12:00:16.125804428Z", + "catching_up": false + }, + "validator_info": { + "address": "430C6891B7C10939270144206B05ABF4D41CF04B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "y9msPfAEV27Gr3J4uiFJeOhnZnruH49BPCQK6Ib/Lq4=" + }, + "voting_power": "10000000" + } + } + } + ``` + +3. To clean up the setup simply run: + + ```shell + docker compose -f docker/load-balancing/docker-compose.yml down -v + ``` diff --git a/docker/load-balancing/docker-compose.yml b/docker/load-balancing/docker-compose.yml new file mode 100644 index 0000000000..bfab3ca273 --- /dev/null +++ b/docker/load-balancing/docker-compose.yml @@ -0,0 +1,218 @@ +services: + lava-node-init: + # Update with the most recent supported version of lavad + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-latest} + environment: + - CHAIN_ID=${CHAIN_ID:-lava} + - KEYRING_BACKEND=${KEYRING_BACKEND:-test} + - MONIKER=${MONIKER:-DOCKER_COMPOSE_MONIKER} + entrypoint: ["sh"] + command: ["/lava/config/new_node_init.sh"] + volumes: + - lava_data:/lava + - ../common/new_node_init.sh:/lava/config/new_node_init.sh + networks: + - lava_network + + lava-node-config: + image: ghcr.io/tomwright/dasel:v2.7.0 + entrypoint: ["sh", "-c"] + environment: [] + command: > + " + dasel put -f /lava/.lava/config/genesis.json -t string -v ulava 'app_state.gov.params.min_deposit.[0].denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '100' 'app_state.gov.params.min_deposit.[0].amount' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '10s' 'app_state.gov.params.voting_period' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '10s' 'app_state.gov.params.expedited_voting_period' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.gov.params.expedited_min_deposit.[0].denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '200' 'app_state.gov.params.expedited_min_deposit.[0].amount' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '0.67' 'app_state.gov.params.expedited_threshold' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.mint.params.mint_denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.staking.params.bond_denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.crisis.constant_fee.denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '5' 'app_state.epochstorage.params.epochsToSave' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '4' 'app_state.epochstorage.params.epochBlocks' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '0' 'app_state.distribution.params.community_tax' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '0' 'app_state.rewards.params.validators_subscription_participation' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '1s' 'app_state.downtime.params.downtime_duration' && + + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_propose' && + dasel put -f /lava/.lava/config/config.toml -t string -v 500ms 'consensus.timeout_propose_delta' && + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_prevote' && + dasel put -f /lava/.lava/config/config.toml -t string -v 500ms 'consensus.timeout_prevote_delta' && + dasel put -f /lava/.lava/config/config.toml -t string -v 500ms 'consensus.timeout_precommit' && + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_precommit_delta' && + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_commit' && + dasel put -f /lava/.lava/config/config.toml -t string -v false 'consensus.skip_timeout_commit' && + + dasel put -f /lava/.lava/config/config.toml -t string -v true 'rosetta.enable' && + dasel put -f /lava/.lava/config/config.toml -t string -v \"tcp://0.0.0.0:26657\" 'rpc.laddr' && + dasel put -f /lava/.lava/config/app.toml -t string -v \"0.0.0.0:9090\" 'grpc.address' && + dasel put -f /lava/.lava/config/app.toml -t string -v \"tcp://0.0.0.0:1317\" 'api.address' && + dasel put -f /lava/.lava/config/app.toml -t string -v true 'api.enable' + " + volumes: + - lava_data:/lava + networks: + - lava_network + depends_on: + lava-node-init: + condition: service_completed_successfully + + lava-node: + # Update with the most recent supported version of lavad + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-latest} + container_name: lava-node + command: ["start", "--pruning=nothing"] + ports: + - '${LAVA_NODE_PORT_API:-1317}:1317' + - '${LAVA_NODE_PORT_GRPC:-9090}:9090' + - '${LAVA_NODE_PORT_GRPC_WEB:-9091}:9091' + - '${LAVA_NODE_PORT_P2P:-26656}:26656' + - '${LAVA_NODE_PORT_RPC:-26657}:26657' + volumes: + - lava_data:/lava + networks: + - lava_network + healthcheck: + test: ["CMD", "lavad", "status"] + interval: 10s + timeout: 30s + retries: 5 + start_period: 30s + restart: always + depends_on: + lava-node-init: + condition: service_completed_successfully + lava-node-config: + condition: service_completed_successfully + + post-lava-node-init: + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-latest} + entrypoint: ["sh"] + command: ["/lava/config/post_node_init.sh"] + volumes: + - lava_data:/lava + - ../common/post_node_init.sh:/lava/config/post_node_init.sh + - ../../cookbook/specs/:/lava/cookbook/specs/ + - ../../cookbook/plans/:/lava/cookbook/plans/ + networks: + - lava_network + depends_on: + lava-node: + condition: service_healthy + + nginx: + image: nginx:latest + networks: + - lava_network + ports: + - "8080:80" + volumes: + - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro + - ./nginx/nginx.crt:/etc/nginx/ssl/nginx.crt:ro + - ./nginx/nginx.key:/etc/nginx/ssl/nginx.key:ro + + depends_on: + - provider1 + - provider2 + restart: always + + consumer: + image: ghcr.io/lavanet/lava/lavap:${LAVAP_VERSION:-latest} + networks: + - lava_network + ports: + - "3334:3334" + - "3335:3335" + - "3336:3336" + volumes: + - ../common/consumer.yml:/lava/config/consumer.yml:ro + - lava_data:/lava + command: + [ + "rpcconsumer", + "consumer.yml", + "--chain-id", + "lava", + "--from", + "user1", + "--geolocation", + "2", + "--log_level", + "trace", + "--allow-insecure-provider-dialing", + "--keyring-backend", + "test", + "--node", + "tcp://lava-node:26657", + ] + depends_on: + - lava-node + restart: always + + provider1: + image: ghcr.io/lavanet/lava/lavap:${LAVAP_VERSION:-latest} + volumes: + - ../common/provider.yml:/lava/config/provider.yml:ro + - lava_data:/lava + command: + [ + "rpcprovider", + "provider.yml", + "--chain-id", + "lava", + "--from", + "servicer1", + "--log_level", + "debug", + "--geolocation", + "2", + "--keyring-backend", + "test", + "--shard-id", + "1", + "--node", + "tcp://lava-node:26657", + ] + networks: + - lava_network + depends_on: + - lava-node + restart: always + + provider2: + image: ghcr.io/lavanet/lava/lavap:${LAVAP_VERSION:-latest} + volumes: + - ../common/provider.yml:/lava/config/provider.yml:ro + - lava_data:/lava + command: + [ + "rpcprovider", + "provider.yml", + "--chain-id", + "lava", + "--from", + "servicer1", + "--log_level", + "debug", + "--geolocation", + "2", + "--keyring-backend", + "test", + "--shard-id", + "2", + "--node", + "tcp://lava-node:26657", + ] + networks: + - lava_network + depends_on: + - lava-node + restart: always + +volumes: + lava_data: + +networks: + lava_network: \ No newline at end of file diff --git a/docker/load-balancing/nginx/default.conf b/docker/load-balancing/nginx/default.conf new file mode 100644 index 0000000000..d103edbfa9 --- /dev/null +++ b/docker/load-balancing/nginx/default.conf @@ -0,0 +1,32 @@ +upstream backend_servers { + hash $http_lava_lb_unique_id consistent; + + keepalive 32; + keepalive_timeout 1s; + + server provider1:2220 max_fails=1 fail_timeout=1s; + server provider2:2220 max_fails=1 fail_timeout=1s; +} + +log_format grpc_json escape=json '{"uri":"$uri","http-status":$status,"lava_lb_unique_id":"$http_lava_lb_unique_id","upstream":"$upstream_addr"}'; + +map $upstream_trailer_grpc_status $grpc_status { + default $upstream_trailer_grpc_status; # grpc-status is usually a trailer + '' $sent_http_grpc_status; # Else use the header, whatever its source +} + +server { + listen 80 ssl; + http2 on; + server_name nginx; + + access_log /dev/stdout grpc_json; + + ssl_certificate /etc/nginx/ssl/nginx.crt; + ssl_certificate_key /etc/nginx/ssl/nginx.key; + + location / { + grpc_pass grpc://backend_servers; + grpc_set_header X-Real-IP $remote_addr; + } +} \ No newline at end of file diff --git a/docker/load-balancing/nginx/nginx.crt b/docker/load-balancing/nginx/nginx.crt new file mode 100644 index 0000000000..ba16e3d6f2 --- /dev/null +++ b/docker/load-balancing/nginx/nginx.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIUQkWSii7NsgFRxNeyd9cNGjqUQUAwDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA3MTAyMDQ5MzlaFw0yNTA3 +MTAyMDQ5MzlaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCai5FX6I83bL2em1wLlAQwlAyyvBz1TNAznloVa8vp +xTXH7oC9wLdYGADuK9yk56OXtshkRzzYRCUrTwgOCQ/gfEJNWk7k8vnGb7+qwIDj +iMw03G/NXv8Q51tsaKA0MKLBhYfnHlaC1emw0yqkKKdSqVMyWbXYegu21qsXaTwe +4RDQjLeMscSqimooXdc5GUvuSxS+5LsSGsie74x/JF26m8xOyUoDNQJm3puQPfXj +kdwnnv1W5D+pKjrWCmgDggN/H6JXRGRPQooTw9chA7I3Ha9Eoq9KF7+XTN2hbtNa +qz0sNyr2QWGQ9DNDEFuYK2hHQ5sfv5M5I+RpT1in9VchAgMBAAGjUzBRMB0GA1Ud +DgQWBBSi7gwXDODcjdoN9JHfmvFKCBmNwzAfBgNVHSMEGDAWgBSi7gwXDODcjdoN +9JHfmvFKCBmNwzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBp +O4UdAGFWndpC5C4HPLAFEfVdb9foaFxnEP42OXb9ys5XHWoYZCfmrc37QKzUK3wJ +2bqd/2pZttjBV/MB8PjOwcNOASwXGi/YBQIwr94vPFBuaYO35Ahh93WQc8Y/OAIF +17iQn4VIw0ArxbOlIMHSN7cLiukfzWBdIBJdpUNGgLmWiquTkGEgmaaCS1bIFDzo +gVcaBgEi0C7/Qejw6zvRbH54B6CrF58AfylsudagvnF8qOILzW4Ae4Emp/Mro3zW +UrOlFS9rVHw5y5/E0lu+wJH43gv27t7HHSrHIhiLp6+Rgrdzcq9AwbvuKl1KIS6G +bAUKEOVB4ztgqg7FFDLU +-----END CERTIFICATE----- \ No newline at end of file diff --git a/docker/load-balancing/nginx/nginx.key b/docker/load-balancing/nginx/nginx.key new file mode 100644 index 0000000000..5a0ec7e266 --- /dev/null +++ b/docker/load-balancing/nginx/nginx.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCai5FX6I83bL2e +m1wLlAQwlAyyvBz1TNAznloVa8vpxTXH7oC9wLdYGADuK9yk56OXtshkRzzYRCUr +TwgOCQ/gfEJNWk7k8vnGb7+qwIDjiMw03G/NXv8Q51tsaKA0MKLBhYfnHlaC1emw +0yqkKKdSqVMyWbXYegu21qsXaTwe4RDQjLeMscSqimooXdc5GUvuSxS+5LsSGsie +74x/JF26m8xOyUoDNQJm3puQPfXjkdwnnv1W5D+pKjrWCmgDggN/H6JXRGRPQooT +w9chA7I3Ha9Eoq9KF7+XTN2hbtNaqz0sNyr2QWGQ9DNDEFuYK2hHQ5sfv5M5I+Rp +T1in9VchAgMBAAECggEAPfZfW8OeSDaNAB6CFRJPa7qwLKlHYwJdJ5UBwTzrENtE +6NgzPeEaoXNeTB/B40wMRzO9vJbjSkJoNKkHLblsaDDp1GG06A6THoCHdEqiYpfi +Z/9JxCmmUnywJxL7yHEHkFedWYjMXsCtZXwEyLSUAYxqEvHs+tJUCAahqk1DEY3D +0makzxyfixnXdTFQzkNoq7/JWI4MoLI7zcz4nTn1AcS+Z2d20BiQ/+XTK+0nq+Mx +Mjn6etjEFEQ0C+bb4d+19akc99EN1ll1s18sU5Lr+bR5BFL76IFODQXmvwQ+CqQk +U9fiEjx8psEfFMQ8ZUc5InioyweoK0PAvDkgdMqu0QKBgQDE7R5TRzVPgN1kIate +RAEuTLbzlRbouwsacrfaW7NICh8kGTexGQs966zjASKR5VPRhR6pVpdQazuTjpMU +a+J2L0jgz+ZklR2KRq3nEVSO4FN7kFvLNETkZkRbvHF6D9oIiyZ9b+u//cO4ED2n +4NdH/zFPXDVnda2zM0a165TvuwKBgQDI58+Xxh1/pg682SHy5sovLSEJqRbDgR85 +kkZdRv9EkvgJjqNYseUrAltZ17TmpwlXoKODEew4G4SmQ9BCof5UtnVXjsp6VeES +ibxEwd3UYLkbLwkKtd2MXqEynmJZ40AMhzmyEE48zbTY+6+T8KiXcCeyumCOzJTm +vOTaj/9A0wKBgQCA85DPEasMI6NVpWKVOMzZJ60JtlApGAo+SG6yEyhD/TTFK6o3 +UuH0qzYr9BtSFCyd36DjXGt7YqzBhDQ1xCuoHnCHnjwNE0QjvwKzc7q+UJD6Md6a +IuEV+w26UJyyRF0PCSesLjTfJOobxq7JFseCQs5kXEowNHQJC4O7Lsf5bwKBgHqY +up0rUCTs+GFVPtoy634OU/LJNBLpYFyJXlbdVDhMVv++Av/EzsuIDKaucr2tgI3w +gNciwLscT74F87g1kjWvgbuEbxpn/YiKdFCg3PUUcOCduy7F/AQEWunArNOdUSBU +BGkceiGwhYNDUsk8OiTvU8pE4VdCkDqdWinlZSXxAoGAYnhWv9QppikWSS+Cxst1 +15Hdm42UVvym9UvUIzgXmweuT+M+RDlFYrUgpTGb1s//oQ1juvQcr67AecmjINY5 +gOVITuPY3GpTnxg95jiVfAVCjy4/Rdf9wZ+xGGQ/hoa0R/QJN4KDkl1kWlI/5VnW +INlpF0ip0fx9Ed8lIHBnazE= +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/docker/new-node/README.md b/docker/new-node/README.md new file mode 100644 index 0000000000..ad19bc6d6a --- /dev/null +++ b/docker/new-node/README.md @@ -0,0 +1,70 @@ +# Starting a New Lava Node with Docker Compose + +This guide will help you set up and run a Lava node using Docker Compose. The process is simplified and containerized, making it easier to manage and deploy. + +## Setup Instructions + +1. Run the following command to setup the compose: + + ```shell + docker compose -f docker/new-node/docker-compose.yml up -d + ``` + +2. That's it! You should have a running Lava node ready to use. To test the setup run the following command: + + ```shell + curl -X POST -H "Content-Type: application/json" localhost:26657 --data '{"jsonrpc": "2.0", "id": 1, "method": "status", "params": []}' + ``` + + The result will look something like this: + + ```json + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "node_info": { + "protocol_version": { + "p2p": "8", + "block": "11", + "app": "0" + }, + "id": "a803429fe79d72656bd07e0d290ec048c0615037", + "listen_addr": "tcp://0.0.0.0:26656", + "network": "lava", + "version": "0.37.4", + "channels": "40202122233038606100", + "moniker": "validator", + "other": { + "tx_index": "on", + "rpc_address": "tcp://0.0.0.0:26657" + } + }, + "sync_info": { + "latest_block_hash": "B24647F6A2578D361F50796B9FBD936DADC589B6AD56F4F34B1E242184484199", + "latest_app_hash": "1B9147BFB6548B64CCAAAD51C957C3A5C5FF2786F7518DE29AD416E038B52397", + "latest_block_height": "791", + "latest_block_time": "2024-07-28T12:14:01.905074847Z", + "earliest_block_hash": "C8851AF02B28E00491BED38EDA5E719317BCA31433A7C8204FC16318571CA754", + "earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "earliest_block_height": "1", + "earliest_block_time": "2024-07-28T12:00:16.125804428Z", + "catching_up": false + }, + "validator_info": { + "address": "430C6891B7C10939270144206B05ABF4D41CF04B", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "y9msPfAEV27Gr3J4uiFJeOhnZnruH49BPCQK6Ib/Lq4=" + }, + "voting_power": "10000000" + } + } + } + ``` + +3. To clean up the setup simply run: + + ```shell + docker compose -f docker/new-node/docker-compose.yml down -v + ``` diff --git a/docker/new-node/docker-compose.yml b/docker/new-node/docker-compose.yml new file mode 100644 index 0000000000..02e488f9a4 --- /dev/null +++ b/docker/new-node/docker-compose.yml @@ -0,0 +1,109 @@ +services: + lava-node-init: + # Update with the most recent supported version of lavad + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-latest} + environment: + - CHAIN_ID=${CHAIN_ID:-lava} + - KEYRING_BACKEND=${KEYRING_BACKEND:-test} + - MONIKER=${MONIKER:-DOCKER_COMPOSE_MONIKER} + entrypoint: ["sh"] + command: ["/lava/config/new_node_init.sh"] + volumes: + - lava_data:/lava + - ../common/new_node_init.sh:/lava/config/new_node_init.sh + networks: + - lava_network + + lava-node-config: + image: ghcr.io/tomwright/dasel:v2.7.0 + entrypoint: ["sh", "-c"] + environment: [] + command: > + " + dasel put -f /lava/.lava/config/genesis.json -t string -v ulava 'app_state.gov.params.min_deposit.[0].denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '100' 'app_state.gov.params.min_deposit.[0].amount' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '10s' 'app_state.gov.params.voting_period' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '10s' 'app_state.gov.params.expedited_voting_period' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.gov.params.expedited_min_deposit.[0].denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '200' 'app_state.gov.params.expedited_min_deposit.[0].amount' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '0.67' 'app_state.gov.params.expedited_threshold' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.mint.params.mint_denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.staking.params.bond_denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v 'ulava' 'app_state.crisis.constant_fee.denom' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '5' 'app_state.epochstorage.params.epochsToSave' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '4' 'app_state.epochstorage.params.epochBlocks' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '0' 'app_state.distribution.params.community_tax' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '0' 'app_state.rewards.params.validators_subscription_participation' && + dasel put -f /lava/.lava/config/genesis.json -t string -v '1s' 'app_state.downtime.params.downtime_duration' && + + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_propose' && + dasel put -f /lava/.lava/config/config.toml -t string -v 500ms 'consensus.timeout_propose_delta' && + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_prevote' && + dasel put -f /lava/.lava/config/config.toml -t string -v 500ms 'consensus.timeout_prevote_delta' && + dasel put -f /lava/.lava/config/config.toml -t string -v 500ms 'consensus.timeout_precommit' && + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_precommit_delta' && + dasel put -f /lava/.lava/config/config.toml -t string -v 1s 'consensus.timeout_commit' && + dasel put -f /lava/.lava/config/config.toml -t string -v false 'consensus.skip_timeout_commit' && + + dasel put -f /lava/.lava/config/config.toml -t string -v true 'rosetta.enable' && + dasel put -f /lava/.lava/config/config.toml -t string -v \"tcp://0.0.0.0:26657\" 'rpc.laddr' && + dasel put -f /lava/.lava/config/app.toml -t string -v \"0.0.0.0:9090\" 'grpc.address' && + dasel put -f /lava/.lava/config/app.toml -t string -v \"tcp://0.0.0.0:1317\" 'api.address' && + dasel put -f /lava/.lava/config/app.toml -t string -v true 'api.enable' + " + volumes: + - lava_data:/lava + networks: + - lava_network + depends_on: + lava-node-init: + condition: service_completed_successfully + + lava-node: + # Update with the most recent supported version of lavad + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-latest} + container_name: lava-node + command: ["start", "--pruning=nothing"] + ports: + - '${LAVA_NODE_PORT_API:-1317}:1317' + - '${LAVA_NODE_PORT_GRPC:-9090}:9090' + - '${LAVA_NODE_PORT_GRPC_WEB:-9091}:9091' + - '${LAVA_NODE_PORT_P2P:-26656}:26656' + - '${LAVA_NODE_PORT_RPC:-26657}:26657' + volumes: + - lava_data:/lava + networks: + - lava_network + healthcheck: + test: ["CMD", "lavad", "status"] + interval: 10s + timeout: 30s + retries: 5 + start_period: 30s + restart: always + depends_on: + lava-node-init: + condition: service_completed_successfully + lava-node-config: + condition: service_completed_successfully + + post-lava-node-init: + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-main} + entrypoint: ["sh"] + command: ["/lava/config/post_node_init.sh"] + volumes: + - lava_data:/lava + - ../common/post_node_init.sh:/lava/config/post_node_init.sh + - ../../cookbook/specs/:/lava/cookbook/specs/ + - ../../cookbook/plans/:/lava/cookbook/plans/ + networks: + - lava_network + depends_on: + lava-node: + condition: service_healthy + +volumes: + lava_data: + +networks: + lava_network: \ No newline at end of file diff --git a/docker/start_node.sh b/docker/start_node.sh deleted file mode 100755 index b509ba8a55..0000000000 --- a/docker/start_node.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/sh -# vim:sw=2:ts=2:et - -set -e -[ "$LAVA_LOG_LEVEL" = "trace" ] && set -x - -debug() { - case "_${LAVA_LOG_LEVEL}" in - _debug|_trace) echo "debug: $@" ;; - esac -} - -error() { - echo "error: $@" - exit 1 -} - -# defaults - -lava_moniker_default='my-lava-testnet' -lava_chain_id_default='testnet-1' -lava_config_git_url_default='https://github.com/lavanet/lava-config.git' -lava_cosmovisor_url_default='https://lava-binary-upgrades.s3.amazonaws.com/testnet/cosmovisor-upgrades/cosmovisor-upgrades.zip' - -# expect the following env vars: -# LAVA_MONIKER - lava node moniker (deafult: ${lava_moniker_default}) -# LAVA_CHAIN_ID - lava chain identifier (default: ${lava_chain_id_default}) -# LAVA_CONFIG_GIT_URL - url to lavanet config assets (default: ${lava_config_git_url_default}) -# LAVA_COSMOVISOR_URL - url to lavanet cosmovisor zip (default: ${lava_cosmovisor_url_default}) - -LAVA_MONIKER=${LAVA_MONIKER:-${lava_moniker_default}} -LAVA_CHAIN_ID=${LAVA_CHAIN_ID:-${lava_chain_id_default}} -LAVA_COSMOVISOR_URL=${LAVA_COSMOVISOR_URL:-${lava_cosmovisor_url_default}} -LAVA_CONFIG_GIT_URL=${LAVA_CONFIG_GIT_URL:-${lava_config_git_url_default}} - -# shortcuts -lava_home="$HOME/.lava" -lava_config="${lava_home}/config" -lava_binary="${lava_home}/cosmovisor/genesis/bin/lavad" - -setup_env() { - # environment variables for cosmovisor - export CHAIN_ID=lava-${LAVA_CHAIN_ID} - export DAEMON_NAME=lavad - export DAEMON_HOME=${lava_home} - export DAEMON_ALLOW_DOWNLOAD_BINARIES=true - export DAEMON_LOG_BUFFER_SIZE=512 - export DAEMON_RESTART_AFTER_UPGRADE=true - export UNSAFE_SKIP_BACKUP=true -} - -setup_node() { - local setup_config_dir - - debug "LAVA_CHAIN_ID=${LAVA_CHAIN_ID}" - debug "LAVA_CONFIG_GIT_URL=${LAVA_CONFIG_GIT_URL}" - debug "LAVA_COSMOVISOR_URL=${LAVA_COSMOVISOR_URL}" - - setup_config_dir=$(basename ${LAVA_CONFIG_GIT_URL}) - - # remove old data (if any) - rm -rf ${setup_config_dir} - - # download setup configuration - git clone --depth 1 ${LAVA_CONFIG_GIT_URL} ${setup_config_dir} \ - || error "setup: failed to clone setup configuration" - - cd ${setup_config_dir}/${LAVA_CHAIN_ID} \ - || error "setup: invalid LAVA_CHAIN_ID '$LAVA_CHAIN_ID'" - - . setup_config/setup_config.sh \ - || error "setup: internal error (setup_config)" - - # keep a copy handy for when we restart - cp -f setup_config/setup_config.sh ${HOME} \ - || error "setup: internal error (copy setup_config)" - - # remove old home/config (if any) - rm -rf ${lava_home} - rm -rf ${lava_config} - - # copy initial configuration and genesis data - mkdir -p ${lava_home} - mkdir -p ${lava_config} - cp default_lavad_config_files/* ${lava_config} - cp genesis_json/genesis.json ${lava_config}/genesis.json -} - -# note: expected to run in the setup config directory; see setup_node() -setup_cosmovisor() { - local output - - # download latest cosmovisor-upgrades - curl -L --progress-bar -o cosmovisor-upgrades.zip "${LAVA_COSMOVISOR_URL}" \ - || error "setup: failed to download cosmovisor upgrades" - unzip cosmovisor-upgrades.zip \ - || error "setup: failed to unzip cosmovisor upgrades" - - # copy cosmovisor configuration - rm -rf ${lava_home}/cosmovisor/ - mv cosmovisor-upgrades/ ${lava_home}/cosmovisor/ \ - || error "setup: internal error (move cosmovisor)" - - # initialize the chain - output=$( \ - ${lava_binary} init ${LAVA_MONIKER} \ - --chain-id ${LAVA_CHAIN_ID} \ - --home ${lavad_home} \ - --overwrite \ - ) - - # an error message about missing upgrade-info.json is expected; - # anything else is unexpected and should abort. - if [ $? -ne 0 ]; then - case "$output" in - "*upgrade-info.json: no such file or directory*") ;; - "*") error "setup: failed to initialize the chain" ;; - esac - fi - - # copy genesis data again - cp genesis_json/genesis.json ${lava_config}/genesis.json \ - || error "setup: internal error (copy genesis.json)" -} - -setup_env - -if [ ! -e ${lava_home}/cosmovisor/current ]; then - setup_node - setup_cosmovisor -else - . ${HOME}/setup_config.sh -fi - -exec /bin/cosmovisor start --home=${lava_home} --p2p.seeds ${seed_node} - diff --git a/docker/start_portal.sh b/docker/start_portal.sh deleted file mode 100755 index 0520db6922..0000000000 --- a/docker/start_portal.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh -# vim:sw=4:ts=4:et - -set -e - -info() { - echo "INF: $@" -} - -debug() { - echo "DBG: $@" -} - -error() { - echo "ERR: $@" - exit 1 -} - -check_env_vars() { - # no need to check LAVA_USER and LAVA_ADDRESS: see check_lava_addr() - - env_vars="LAVA_KEYRING \ - LAVA_STAKE_AMOUNT \ - LAVA_GEOLOCATION \ - LAVA_RPC_NODE \ - LAVA_CHAIN_ID \ - LAVA_GAS_MODE \ - LAVA_GAS_ADJUST \ - LAVA_GAS_PRICE \ - LAVA_LISTEN_IP \ - LAVA_PORTAL_PORT \ - LAVA_RELAY_CHAIN_ID \ - LAVA_RELAY_IFACE \ - LAVA_LOG_LEVEL \ - " - - for ev in $env_vars; do - eval "v=\$$ev" - test -z "${v}" && errmsg="${errmsg} ${ev}\n" - done - - if [ -n "$errmsg" ]; then - error "some env variables not defined:\n${errmsg%%\\n}" - fi -} - -check_lava_addr() { - lavad keys list --keyring-backend "${LAVA_KEYRING}" - - if [ -z "${LAVA_ADDRESS}" ]; then - LAVA_ADDRESS=$(lavad keys show "${LAVA_USER}" --keyring-backend "${LAVA_KEYRING}" | \ - grep address | awk '{print $2}') - - if [ -z "${LAVA_ADDRESS}" ]; then - error "unable to fetch the user's lava address" - fi - else - lavad keys list --keyring-backend "${LAVA_KEYRING}" | \ - grep -q ${LAVA_ADDRESS} || \ - error "unable to find the requested lava address" - fi -} - -client_staked_amount() { - lavad query pairing clients \ - "${LAVA_RELAY_CHAIN_ID}" \ - --node "${LAVA_RPC_NODE}" \ - --chain-id "${LAVA_CHAIN_ID}" \ - | sed -n '/Staked Clients:/{n;p}' \ - | grep "${LAVA_ADDRESS}" \ - | sed 's/^.*{\([0-9]*ulava\).*$/\1/' -} - -stake_client() { - info "staking client - this may take a while" - lavad tx pairing stake-client -y \ - "${LAVA_RELAY_CHAIN_ID}" \ - "${LAVA_STAKE_AMOUNT}" \ - "${LAVA_GEOLOCATION}" \ - --from "${LAVA_ADDRESS}" \ - --node "${LAVA_RPC_NODE}" \ - --chain-id "${LAVA_CHAIN_ID}" \ - --keyring-backend "${LAVA_KEYRING}" \ - --gas-adjustment "${LAVA_GAS_ADJUST}" \ - --gas-prices "${LAVA_GAS_PRICE}" \ - --gas "${LAVA_GAS_MODE}" \ - --log_level "${LAVA_LOG_LEVEL}" || - error "unable to stake client" -} - -# check sanity of env vars -check_env_vars - -# check (and maybe get) lava address -check_lava_addr - -# check that client is staked with right amount -stake_amount=$(client_staked_amount) - -if [ -z $stake_amount ]; then - info "client not staked: staking client" - stake_client -elif [ $stake_amount -lt ${LAVA_STAKE_AMOUNT} ]; then - info "client staked amount to small: increasing amount" - stake_client -fi - -debug "starting portal server" - -exec lavad portal_server \ - "${LAVA_LISTEN_IP}" \ - "${LAVA_PORTAL_PORT}" \ - "${LAVA_RELAY_CHAIN_ID}" \ - "${LAVA_RELAY_IFACE}" \ - --from "${LAVA_ADDRESS}" \ - --node "${LAVA_RPC_NODE}" \ - --chain-id "${LAVA_CHAIN_ID}" \ - --geolocation "${LAVA_GEOLOCATION}" \ - --log_level "${LAVA_LOG_LEVEL}" || - error "unable to start portal" - diff --git a/docker/start_provider.sh b/docker/start_provider.sh deleted file mode 100755 index 4647bd707d..0000000000 --- a/docker/start_provider.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh -# vim:sw=4:ts=4:et - -set -e - -info() { - echo "INF: $@" -} - -debug() { - echo "DBG: $@" -} - -error() { - echo "ERR: $@" - exit 1 -} - -check_env_vars() { - # no need to check LAVA_USER and LAVA_ADDRESS: see check_lava_addr() - - env_vars="LAVA_KEYRING \ - LAVA_STAKE_AMOUNT \ - LAVA_GEOLOCATION \ - LAVA_RPC_NODE \ - LAVA_CHAIN_ID \ - LAVA_GAS_MODE \ - LAVA_GAS_ADJUST \ - LAVA_GAS_PRICE \ - LAVA_LISTEN_IP \ - LAVA_PORTAL_PORT \ - LAVA_RELAY_ENDPOINT \ - LAVA_RELAY_NODE_URL \ - LAVA_RELAY_CHAIN_ID \ - LAVA_RELAY_IFACE \ - LAVA_LOG_LEVEL \ - " - - for ev in $env_vars; do - eval "v=\$$ev" - test -z "${v}" && errmsg="${errmsg} ${ev}\n" - done - - if [ -n "$errmsg" ]; then - error "some env variables not defined:\n${errmsg%%\\n}" - fi -} - -check_lava_addr() { - lavad keys list --keyring-backend "${LAVA_KEYRING}" - - if [ -z "${LAVA_ADDRESS}" ]; then - LAVA_ADDRESS=$(lavad keys show "${LAVA_USER}" --keyring-backend "${LAVA_KEYRING}" | \ - grep address | awk '{print $2}') - - if [ -z "${LAVA_ADDRESS}" ]; then - error "unable to fetch the user's lava address" - fi - else - lavad keys list --keyring-backend "${LAVA_KEYRING}" | \ - grep -q ${LAVA_ADDRESS} || \ - error "unable to find the requested lava address" - fi -} - -provider_staked_amount() { - lavad query pairing providers \ - "${LAVA_RELAY_CHAIN_ID}" \ - --node "${LAVA_RPC_NODE}" \ - --chain-id "${LAVA_CHAIN_ID}" \ - | sed -n '/Staked Providers:/{n;p}' \ - | grep "${LAVA_ADDRESS}" \ - | sed 's/^.*{\([0-9]*ulava\).*$/\1/' -} - -stake_provider() { - info "staking provider - this may take a while" - lavad tx pairing stake-provider -y \ - "${LAVA_RELAY_CHAIN_ID}" \ - "${LAVA_STAKE_AMOUNT}" \ - "${LAVA_RELAY_ENDPOINT}" \ - "${LAVA_GEOLOCATION}" \ - --from "${LAVA_ADDRESS}" \ - --provider-moniker "dummyMoniker" \ - --node "${LAVA_RPC_NODE}" \ - --chain-id "${LAVA_CHAIN_ID}" \ - --keyring-backend "${LAVA_KEYRING}" \ - --gas-adjustment "${LAVA_GAS_ADJUST}" \ - --gas-prices "${LAVA_GAS_PRICE}" \ - --gas "${LAVA_GAS_MODE}" \ - --log_level "${LAVA_LOG_LEVEL}" || - error "unable to stake provider" -} - -# check sanity of env vars -check_env_vars - -# check (and maybe get) lava address -check_lava_addr - -# check that provider is staked with right amount -stake_amount=$(provider_staked_amount) - -if [ -z $stake_amount ]; then - info "provider not staked: staking provider" - stake_provider -elif [ $stake_amount -lt ${LAVA_STAKE_AMOUNT} ]; then - info "provider staked amount to small: increasing amount" - stake_provider -fi - -debug "starting provider server" - -exec lavad portal_server \ - "${LAVA_LISTEN_IP}" \ - "${LAVA_PORTAL_PORT}" \ - "${LAVA_RELAY_NODE_URL}" \ - "${LAVA_RELAY_CHAIN_ID}" \ - "${LAVA_RELAY_IFACE}" \ - --from "${LAVA_ADDRESS}" \ - --node "${LAVA_RPC_NODE}" \ - --chain-id "${LAVA_CHAIN_ID}" \ - --geolocation "${LAVA_GEOLOCATION}" \ - --log_level "${LAVA_LOG_LEVEL}" || - error "unable to start provider" - diff --git a/docker/state-sync/README.md b/docker/state-sync/README.md new file mode 100644 index 0000000000..ec3c598cfb --- /dev/null +++ b/docker/state-sync/README.md @@ -0,0 +1,40 @@ +# Running node using state-sync with docker-compose + +From the root path run: + +```sh +docker compose -f docker/state-sync/docker-compose.yml up -d +``` + +To test the setup run: + +```sh +curl -X POST -H "Content-Type: application/json" localhost:26657 --data '{"jsonrpc": "2.0", "id": 1, "method": "status", "params": []}' +``` + +and expect to see the lastest block. + +You can run change the version of `lavad` using the `LAVAD_VERSION` var: + +```sh +LAVAD_VERSION=v2.0.1 docker compose -f docker/state-sync/docker-compose.yml up -d +``` + +## Full configuration options + +|Name |Description +|----------------|------------------------------- +|LAVAD_VERSION | The Lavad version to use +|CHAIN_ID | The chain id +|KEYRING_BACKEND | The keyring backend +|MONIKER | The moniker for the `init` command +|STATE_SYNC_RPC_1| The RPC node to sync on +|GENESIS_ADDRESS | The `genesis.json` URL +|ADDRBOOK_ADDRESS| The `addrbook.json` URL +|NUM_BLOCKS | The number of blocks to sync on from behind the latest block + +To clean the lava node setup including volumes run: + +```sh +docker compose -f docker/state-sync/docker-compose.yml down -v +``` diff --git a/docker/docker-compose.state-sync.yml b/docker/state-sync/docker-compose.yml similarity index 92% rename from docker/docker-compose.state-sync.yml rename to docker/state-sync/docker-compose.yml index 491ee546f9..e5f4b0077b 100644 --- a/docker/docker-compose.state-sync.yml +++ b/docker/state-sync/docker-compose.yml @@ -1,9 +1,8 @@ - services: lava-node-init: # Update with the most recent supported version of lavad - image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-v2.0.0} + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-latest} environment: - CHAIN_ID=${CHAIN_ID:-lava-testnet-2} - KEYRING_BACKEND=${KEYRING_BACKEND:-test} @@ -58,7 +57,7 @@ services: lava-node: # Update with the most recent supported version of lavad - image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-v2.0.0} + image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-latest} container_name: lava-node command: ["start"] ports: @@ -71,6 +70,12 @@ services: - lava_data:/lava networks: - lava_network + healthcheck: + test: ["CMD", "lavad", "status"] + interval: 10s + timeout: 30s + retries: 5 + start_period: 30s restart: always depends_on: lava-node-init: diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index c166542f90..2dbd6f408a 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -4,10 +4,410 @@ info: name: '' description: '' paths: + /cosmos/auth/v1beta1/account_info/{address}: + get: + summary: AccountInfo queries account info which is common to all account types. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosAuthV1Beta1AccountInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: address + description: address is the account address string. + in: path + required: true + type: string + tags: + - Query /cosmos/auth/v1beta1/accounts: get: - summary: Accounts returns all the existing accounts - description: 'Since: cosmos-sdk 0.43' + summary: Accounts returns all the existing accounts. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.43 operationId: CosmosAuthV1Beta1Accounts responses: '200': @@ -471,7 +871,6 @@ paths: type: object properties: account: - description: account defines the account of the corresponding address. type: object properties: '@type': @@ -532,6 +931,114 @@ paths: used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } description: >- QueryAccountResponse is the response type for the Query/Account RPC method. @@ -933,6 +1440,8 @@ paths: parameters: - name: id description: |- + Deprecated, use account_id instead + id is the account number of the address to be queried. This field should have been an uint64 (like all account numbers), and will be updated to uint64 in a future version of the auth query. @@ -940,6 +1449,15 @@ paths: required: true type: string format: int64 + - name: account_id + description: |- + account_id is the account number of the address to be queried. + + Since: cosmos-sdk 0.47 + in: query + required: false + type: string + format: uint64 tags: - Query /cosmos/auth/v1beta1/bech32: @@ -2544,36 +3062,215 @@ paths: } tags: - Query - /cosmos/bank/v1beta1/balances/{address}: + /cosmos/authz/v1beta1/grants: get: - summary: AllBalances queries the balance of all coins for a single account. - operationId: CosmosBankV1Beta1AllBalances + summary: Returns list of `Authorization`, granted to the grantee by the granter. + operationId: CosmosAuthzV1Beta1Grants responses: '200': description: A successful response. schema: type: object properties: - balances: + grants: type: array items: type: object properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + protocol buffer message. This string must contain at + least - NOTE: The amount field is an Int which implements the custom - method + one "/" character. The last segment of the URL's + path must represent - signatures required by gogoproto. - description: balances is the balances of all the coins. + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If + null, then the grant + + doesn't have a time expiration (other conditions in + `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + description: >- + authorizations is a list of grants granted for grantee by + granter. pagination: - description: pagination defines the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -2592,10 +3289,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryAllBalancesResponse is the response type for the - Query/AllBalances RPC - - method. + QueryGrantsResponse is the response type for the + Query/Authorizations RPC method. default: description: An unexpected error response. schema: @@ -2613,12 +3308,189 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - - name: address - description: address is the address to query balances for. - in: path - required: true + - name: granter + in: query + required: false + type: string + - name: grantee + in: query + required: false + type: string + - name: msg_type_url + description: >- + Optional, msg_type_url, when set, will query only grants matching + given msg type. + in: query + required: false type: string - name: pagination.key description: |- @@ -2678,321 +3550,212 @@ paths: type: boolean tags: - Query - /cosmos/bank/v1beta1/balances/{address}/by_denom: - get: - summary: Balance queries the balance of a single coin for a single account. - operationId: CosmosBankV1Beta1Balance - responses: - '200': - description: A successful response. - schema: - type: object - properties: - balance: - description: balance is the balance of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QueryBalanceResponse is the response type for the Query/Balance - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: address - description: address is the address to query balances for. - in: path - required: true - type: string - - name: denom - description: denom is the coin denom to query balances for. - in: query - required: false - type: string - tags: - - Query - /cosmos/bank/v1beta1/denom_owners/{denom}: + /cosmos/authz/v1beta1/grants/grantee/{grantee}: get: - summary: >- - DenomOwners queries for all account addresses that own a particular - token - - denomination. + summary: GranteeGrants returns a list of `GrantAuthorization` by grantee. description: 'Since: cosmos-sdk 0.46' - operationId: CosmosBankV1Beta1DenomOwners + operationId: CosmosAuthzV1Beta1GranteeGrants responses: '200': description: A successful response. schema: type: object properties: - denom_owners: + grants: type: array items: type: object properties: - address: + granter: type: string - description: >- - address defines the address that owns a particular - denomination. - balance: - description: >- - balance is the balance of the denominated coin for an - account. + grantee: + type: string + authorization: type: object properties: - denom: - type: string - amount: + '@type': type: string - description: >- - DenomOwner defines structure representing an account that - owns or holds a + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - particular denominated token. It contains the account - address and account + protocol buffer message. This string must contain at + least - balance of the denominated token. + one "/" character. The last segment of the URL's + path must represent + the fully qualified name of the type (as in - Since: cosmos-sdk 0.46 - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + `path/google.protobuf.Duration`). The name should be + in a canonical form - was set, its value is undefined otherwise - description: >- - QueryDenomOwnersResponse defines the RPC response of a DenomOwners - RPC query. + (e.g., leading "." is not accepted). - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: denom - description: >- - denom defines the coin denomination to query all account holders - for. - in: path - required: true - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + In practice, teams usually precompile into the + binary all types that they - It is less efficient than using key. Only one of offset or key - should + expect it to use in the context of Any. However, for + URLs which use the - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + scheme `http`, `https`, or no scheme, one can + optionally set up a type - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + server that maps type URLs to message definitions as + follows: - a count of the total number of items available for pagination in - UIs. - count_total is only respected when offset is used. It is ignored - when key + * If no scheme is provided, `https` is assumed. - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available + in the official - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /cosmos/bank/v1beta1/denoms_metadata: - get: - summary: |- - DenomsMetadata queries the client metadata for all registered coin - denominations. - operationId: CosmosBankV1Beta1DenomsMetadata - responses: - '200': - description: A successful response. - schema: - type: object - properties: - metadatas: - type: array - items: - type: object - properties: - description: - type: string - denom_units: - type: array - items: - type: object - properties: - denom: - type: string - description: >- - denom represents the string name of the given - denom unit (e.g uatom). - exponent: - type: integer - format: int64 - description: >- - exponent represents power of 10 exponent that one - must + protobuf release, and it is not used for type URLs + beginning with - raise the base_denom to in order to equal the - given DenomUnit's denom + type.googleapis.com. - 1 denom = 10^exponent base_denom - (e.g. with a base_denom of uatom, one can create a - DenomUnit of 'atom' with + Schemes other than `http`, `https` (or the empty + scheme) might be - exponent = 6, thus: 1 atom = 10^6 uatom). - aliases: - type: array - items: - type: string - title: >- - aliases is a list of string aliases for the given - denom - description: |- - DenomUnit represents a struct that describes a given - denomination unit of the basic token. - title: >- - denom_units represents the list of DenomUnit's for a - given coin - base: - type: string - description: >- - base represents the base denom (should be the DenomUnit - with exponent = 0). - display: - type: string - description: |- - display indicates the suggested denom that should be - displayed in clients. - name: - type: string - description: 'Since: cosmos-sdk 0.43' - title: 'name defines the name of the token (eg: Cosmos Atom)' - symbol: - type: string + used with implementation specific semantics. + additionalProperties: {} description: >- - symbol is the token symbol usually shown on exchanges - (eg: ATOM). This can + `Any` contains an arbitrary serialized protocol buffer + message along with a - be the same as the display. + URL that describes the type of the serialized message. - Since: cosmos-sdk 0.43 - uri: - type: string - description: >- - URI to a document (on or off-chain) that contains - additional information. Optional. + Protobuf library provides support to pack/unpack Any + values in the form + of utility functions or additional generated methods of + the Any type. - Since: cosmos-sdk 0.46 - uri_hash: - type: string - description: >- - URIHash is a sha256 hash of a document pointed by URI. - It's used to verify that - the document didn't change. Optional. + Example 1: Pack and unpack a message in C++. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Since: cosmos-sdk 0.46 - description: |- - Metadata represents a struct that describes - a basic token. - description: >- - metadata provides the client information for all the - registered tokens. + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses + of the grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted to the grantee. pagination: - description: pagination defines the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -3011,10 +3774,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC - - method. + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. default: description: An unexpected error response. schema: @@ -3032,8 +3793,179 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: + - name: grantee + in: path + required: true + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -3092,222 +4024,212 @@ paths: type: boolean tags: - Query - /cosmos/bank/v1beta1/denoms_metadata/{denom}: + /cosmos/authz/v1beta1/grants/granter/{granter}: get: - summary: DenomsMetadata queries the client metadata of a given coin denomination. - operationId: CosmosBankV1Beta1DenomMetadata + summary: GranterGrants returns list of `GrantAuthorization`, granted by granter. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosAuthzV1Beta1GranterGrants responses: '200': description: A successful response. schema: type: object properties: - metadata: - description: >- - metadata describes and provides all the client information for - the requested token. - type: object - properties: - description: - type: string - denom_units: - type: array - items: + grants: + type: array + items: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: type: object properties: - denom: + '@type': type: string description: >- - denom represents the string name of the given denom - unit (e.g uatom). - exponent: - type: integer - format: int64 - description: >- - exponent represents power of 10 exponent that one - must + A URL/resource name that uniquely identifies the + type of the serialized - raise the base_denom to in order to equal the given - DenomUnit's denom + protocol buffer message. This string must contain at + least - 1 denom = 10^exponent base_denom + one "/" character. The last segment of the URL's + path must represent - (e.g. with a base_denom of uatom, one can create a - DenomUnit of 'atom' with + the fully qualified name of the type (as in - exponent = 6, thus: 1 atom = 10^6 uatom). - aliases: - type: array - items: - type: string - title: >- - aliases is a list of string aliases for the given - denom - description: |- - DenomUnit represents a struct that describes a given - denomination unit of the basic token. - title: >- - denom_units represents the list of DenomUnit's for a given - coin - base: - type: string - description: >- - base represents the base denom (should be the DenomUnit - with exponent = 0). - display: - type: string - description: |- - display indicates the suggested denom that should be - displayed in clients. - name: - type: string - description: 'Since: cosmos-sdk 0.43' - title: 'name defines the name of the token (eg: Cosmos Atom)' - symbol: - type: string - description: >- - symbol is the token symbol usually shown on exchanges (eg: - ATOM). This can + `path/google.protobuf.Duration`). The name should be + in a canonical form - be the same as the display. + (e.g., leading "." is not accepted). - Since: cosmos-sdk 0.43 - uri: - type: string - description: >- - URI to a document (on or off-chain) that contains - additional information. Optional. + In practice, teams usually precompile into the + binary all types that they + expect it to use in the context of Any. However, for + URLs which use the - Since: cosmos-sdk 0.46 - uri_hash: - type: string - description: >- - URIHash is a sha256 hash of a document pointed by URI. - It's used to verify that + scheme `http`, `https`, or no scheme, one can + optionally set up a type - the document didn't change. Optional. + server that maps type URLs to message definitions as + follows: - Since: cosmos-sdk 0.46 - description: >- - QueryDenomMetadataResponse is the response type for the - Query/DenomMetadata RPC + * If no scheme is provided, `https` is assumed. - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: denom - description: denom is the coin denom to query the metadata for. - in: path - required: true - type: string - tags: - - Query - /cosmos/bank/v1beta1/params: - get: - summary: Params queries the parameters of x/bank module. - operationId: CosmosBankV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} description: >- - SendEnabled maps coin denom to a send_enabled status - (whether a denom is + `Any` contains an arbitrary serialized protocol buffer + message along with a - sendable). - default_send_enabled: - type: boolean - description: Params defines the parameters for the bank module. - description: >- - QueryParamsResponse defines the response type for querying x/bank - parameters. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/bank/v1beta1/spendable_balances/{address}: - get: - summary: |- - SpendableBalances queries the spenable balance of all coins for a single - account. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosBankV1Beta1SpendableBalances - responses: - '200': - description: A successful response. - schema: - type: object - properties: - balances: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + URL that describes the type of the serialized message. - NOTE: The amount field is an Int which implements the custom - method + Protobuf library provides support to pack/unpack Any + values in the form - signatures required by gogoproto. - description: balances is the spendable balances of all the coins. + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses + of the grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted by the granter. pagination: - description: pagination defines the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -3326,13 +4248,8 @@ paths: was set, its value is undefined otherwise description: >- - QuerySpendableBalancesResponse defines the gRPC response structure - for querying - - an account's spendable balances. - - - Since: cosmos-sdk 0.46 + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. default: description: An unexpected error response. schema: @@ -3350,10 +4267,176 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - - name: address - description: address is the address to query spendable balances for. + - name: granter in: path required: true type: string @@ -3415,17 +4498,22 @@ paths: type: boolean tags: - Query - /cosmos/bank/v1beta1/supply: + /cosmos/bank/v1beta1/balances/{address}: get: - summary: TotalSupply queries the total supply of all coins. - operationId: CosmosBankV1Beta1TotalSupply + summary: AllBalances queries the balance of all coins for a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1AllBalances responses: '200': description: A successful response. schema: type: object properties: - supply: + balances: type: array items: type: object @@ -3442,12 +4530,9 @@ paths: method signatures required by gogoproto. - title: supply is the supply of the coins + description: balances is the balances of all the coins. pagination: - description: |- - pagination defines the pagination in the response. - - Since: cosmos-sdk 0.43 + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -3465,11 +4550,11 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - title: >- - QueryTotalSupplyResponse is the response type for the - Query/TotalSupply RPC + description: >- + QueryAllBalancesResponse is the response type for the + Query/AllBalances RPC - method + method. default: description: An unexpected error response. schema: @@ -3489,6 +4574,11 @@ paths: type: string additionalProperties: {} parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -3547,18 +4637,18 @@ paths: type: boolean tags: - Query - /cosmos/bank/v1beta1/supply/by_denom: + /cosmos/bank/v1beta1/balances/{address}/by_denom: get: - summary: SupplyOf queries the supply of a single coin. - operationId: CosmosBankV1Beta1SupplyOf + summary: Balance queries the balance of a single coin for a single account. + operationId: CosmosBankV1Beta1Balance responses: '200': description: A successful response. schema: type: object properties: - amount: - description: amount is the supply of the coin. + balance: + description: balance is the balance of the coin. type: object properties: denom: @@ -3566,7 +4656,7 @@ paths: amount: type: string description: >- - QuerySupplyOfResponse is the response type for the Query/SupplyOf + QueryBalanceResponse is the response type for the Query/Balance RPC method. default: description: An unexpected error response. @@ -3587,6 +4677,11 @@ paths: type: string additionalProperties: {} parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string - name: denom description: denom is the coin denom to query balances for. in: query @@ -3594,95 +4689,84 @@ paths: type: string tags: - Query - /cosmos/base/tendermint/v1beta1/abci_query: + /cosmos/bank/v1beta1/denom_owners/{denom}: get: summary: >- - ABCIQuery defines a query handler that supports ABCI queries directly to + DenomOwners queries for all account addresses that own a particular + token + + denomination. + description: >- + When called from another module, this query might consume a high amount + of - the application, bypassing Tendermint completely. The ABCI query must + gas if the pagination field is incorrectly set. - contain a valid and supported path, including app, custom, p2p, and - store. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosBaseTendermintV1Beta1ABCIQuery + + Since: cosmos-sdk 0.46 + operationId: CosmosBankV1Beta1DenomOwners responses: '200': description: A successful response. schema: type: object properties: - code: - type: integer - format: int64 - log: - type: string - title: nondeterministic - info: - type: string - title: nondeterministic - index: - type: string - format: int64 - key: - type: string - format: byte - value: - type: string - format: byte - proof_ops: - type: object - properties: - ops: - type: array - items: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: >- + address defines the address that owns a particular + denomination. + balance: + description: >- + balance is the balance of the denominated coin for an + account. type: object properties: - type: - type: string - key: + denom: type: string - format: byte - data: + amount: type: string - format: byte - description: >- - ProofOp defines an operation used for calculating Merkle - root. The data could - - be arbitrary format, providing nessecary data for - example neighbouring node - - hash. - + description: >- + DenomOwner defines structure representing an account that + owns or holds a - Note: This type is a duplicate of the ProofOp proto type - defined in + particular denominated token. It contains the account + address and account - Tendermint. - description: >- - ProofOps is Merkle proof defined by the list of ProofOps. + balance of the denominated token. - Note: This type is a duplicate of the ProofOps proto type - defined in + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - Tendermint. - height: - type: string - format: int64 - codespace: - type: string + was set, its value is undefined otherwise description: >- - ABCIQueryResponse defines the response structure for the ABCIQuery - gRPC - - query. - + QueryDenomOwnersResponse defines the RPC response of a DenomOwners + RPC query. - Note: This type is a duplicate of the ResponseQuery proto type - defined in - Tendermint. + Since: cosmos-sdk 0.46 default: description: An unexpected error response. schema: @@ -3700,1369 +4784,693 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. + parameters: + - name: denom + description: >- + denom defines the coin denomination to query all account holders + for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + It is less efficient than using key. Only one of offset or key + should - Example 4: Pack and unpack a message in Go + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - The pack methods provided by protobuf library will by - default use + a count of the total number of items available for pagination in + UIs. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + count_total is only respected when offset is used. It is ignored + when key - methods only use the fully qualified type name after the - last '/' + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/denoms_metadata: + get: + summary: |- + DenomsMetadata queries the client metadata for all registered coin + denominations. + operationId: CosmosBankV1Beta1DenomsMetadata + responses: + '200': + description: A successful response. + schema: + type: object + properties: + metadatas: + type: array + items: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given + denom unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one + must + raise the base_denom to in order to equal the + given DenomUnit's denom + 1 denom = 10^exponent base_denom - JSON + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with - ==== + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: >- + aliases is a list of string aliases for the given + denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: >- + denom_units represents the list of DenomUnit's for a + given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges + (eg: ATOM). This can - The JSON representation of an `Any` value uses the regular + be the same as the display. - representation of the deserialized, embedded message, with - an - additional field `@type` which contains the type URL. - Example: + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains + additional information. Optional. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. + It's used to verify that - If the embedded message type is well-known and has a custom - JSON + the document didn't change. Optional. - representation, that representation will be embedded adding - a field - `value` which holds the custom JSON in addition to the - `@type` + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + metadata provides the client information for all the + registered tokens. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - field. Example (for message [google.protobuf.Duration][]): + was set, its value is undefined otherwise + description: >- + QueryDenomsMetadataResponse is the response type for the + Query/DenomsMetadata RPC - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} parameters: - - name: data + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. in: query required: false type: string format: byte - - name: path + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. in: query required: false type: string - - name: height + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. in: query required: false type: string - format: int64 - - name: prove + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 in: query required: false type: boolean tags: - - Service - /cosmos/base/tendermint/v1beta1/blocks/latest: + - Query + /cosmos/bank/v1beta1/denoms_metadata/{denom}: get: - summary: GetLatestBlock returns the latest block. - operationId: CosmosBaseTendermintV1Beta1GetLatestBlock + summary: DenomsMetadata queries the client metadata of a given coin denomination. + operationId: CosmosBankV1Beta1DenomMetadata responses: '200': description: A successful response. schema: type: object properties: - block_id: + metadata: + description: >- + metadata describes and provides all the client information for + the requested token. type: object properties: - hash: + description: type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - title: 'Deprecated: please use `sdk_block` instead' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom + unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one + must - including all blockchain data structures and the rules - of the application's + raise the base_denom to in order to equal the given + DenomUnit's denom - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: + title: >- + aliases is a list of string aliases for the given + denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: >- + denom_units represents the list of DenomUnit's for a given + coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit + with exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: + ATOM). This can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains + additional information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. + It's used to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query the metadata for. + in: path + required: true + type: string + tags: + - Query + /cosmos/bank/v1beta1/params: + get: + summary: Params queries the parameters of x/bank module. + operationId: CosmosBankV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is - NOTE: not all txs here are valid. We're just agreeing - on the order first. + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. - This means that block.AppHash does not include these - txs. - title: >- - Data contains the set of transactions included in the - block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. + For genesis, use the newly added send_enabled field in the + genesis object. - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for + Storage, lookup, and manipulation of this information is + now in the keeper. - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + description: >- + QueryParamsResponse defines the response type for querying x/bank + parameters. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/bank/v1beta1/send_enabled: + get: + summary: SendEnabled queries for SendEnabled entries. + description: >- + This query only returns denominations that have specific SendEnabled + settings. - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a - validator signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, + Any denomination that does not have a specific setting will use the + default - including all blockchain data structures - and the rules of the application's + params.default_send_enabled, and will not be returned by this query. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a - block was committed by a set of - validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a - set of validators attempting to mislead a light - client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - sdk_block: - title: 'Since: cosmos-sdk 0.47' + + Since: cosmos-sdk 0.47 + operationId: CosmosBankV1Beta1SendEnabled + responses: + '200': + description: A successful response. + schema: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status + (whether a denom is + + sendable). + pagination: + description: >- + pagination defines the pagination in the response. This field + is only + + populated if the denoms field in the request is empty. type: object properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - including all blockchain data structures and the rules - of the application's + was set, its value is undefined otherwise + description: >- + QuerySendEnabledResponse defines the RPC response of a SendEnable + query. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer - address, formatted as a Bech32 string. - In Tendermint, this type is `bytes`, but in the SDK, - we convert it to a Bech32 string + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denoms + description: >- + denoms is the specific denoms you want look up. Leave empty to get + all entries. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - for better UX. + It is less efficient than using key. Only one of offset or key + should + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - NOTE: not all txs here are valid. We're just agreeing - on the order first. + a count of the total number of items available for pagination in + UIs. - This means that block.AppHash does not include these - txs. - title: >- - Data contains the set of transactions included in the - block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. + count_total is only respected when offset is used. It is ignored + when key - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed - message in the consensus. - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or - commit vote from validators for + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/spendable_balances/{address}: + get: + summary: >- + SpendableBalances queries the spendable balance of all coins for a + single - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a - validator signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, + account. + description: >- + When called from another module, this query might consume a high amount + of - including all blockchain data structures - and the rules of the application's + gas if the pagination field is incorrectly set. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a - block was committed by a set of - validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a - set of validators attempting to mislead a light - client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - description: >- - Block is tendermint type Block, with the Header proposer - address - field converted to bech32 string. + Since: cosmos-sdk 0.46 + operationId: CosmosBankV1Beta1SpendableBalances + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: balances is the spendable balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - GetLatestBlockResponse is the response type for the - Query/GetLatestBlock RPC + QuerySpendableBalancesResponse defines the gRPC response structure + for querying - method. + an account's spendable balances. + + + Since: cosmos-sdk 0.46 default: description: An unexpected error response. schema: @@ -5080,32 +5488,491 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent + additionalProperties: {} + parameters: + - name: address + description: address is the address to query spendable balances for. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - the fully qualified name of the type (as in + It is less efficient than using key. Only one of offset or key + should - `path/google.protobuf.Duration`). The name should be in - a canonical form + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - (e.g., leading "." is not accepted). + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + a count of the total number of items available for pagination in + UIs. - In practice, teams usually precompile into the binary - all types that they + count_total is only respected when offset is used. It is ignored + when key - expect it to use in the context of Any. However, for - URLs which use the + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - scheme `http`, `https`, or no scheme, one can optionally - set up a type + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/spendable_balances/{address}/by_denom: + get: + summary: >- + SpendableBalanceByDenom queries the spendable balance of a single denom + for + + a single account. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + + + Since: cosmos-sdk 0.47 + operationId: CosmosBankV1Beta1SpendableBalanceByDenom + responses: + '200': + description: A successful response. + schema: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response + structure for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: address + description: address is the address to query balances for. + in: path + required: true + type: string + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/bank/v1beta1/supply: + get: + summary: TotalSupply queries the total supply of all coins. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1TotalSupply + responses: + '200': + description: A successful response. + schema: + type: object + properties: + supply: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: supply is the supply of the coins + pagination: + description: |- + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryTotalSupplyResponse is the response type for the + Query/TotalSupply RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/bank/v1beta1/supply/by_denom: + get: + summary: SupplyOf queries the supply of a single coin. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosBankV1Beta1SupplyOf + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + description: amount is the supply of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySupplyOfResponse is the response type for the Query/SupplyOf + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: denom + description: denom is the coin denom to query balances for. + in: query + required: false + type: string + tags: + - Query + /cosmos/base/node/v1beta1/config: + get: + summary: Config queries for the operator configuration. + operationId: CosmosBaseNodeV1Beta1Config + responses: + '200': + description: A successful response. + schema: + type: object + properties: + minimum_gas_price: + type: string + description: >- + ConfigResponse defines the response structure for the Config gRPC + query. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Service + /cosmos/base/tendermint/v1beta1/abci_query: + get: + summary: >- + ABCIQuery defines a query handler that supports ABCI queries directly to + the + + application, bypassing Tendermint completely. The ABCI query must + contain + + a valid and supported path, including app, custom, p2p, and store. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosBaseTendermintV1Beta1ABCIQuery + responses: + '200': + description: A successful response. + schema: + type: object + properties: + code: + type: integer + format: int64 + log: + type: string + title: nondeterministic + info: + type: string + title: nondeterministic + index: + type: string + format: int64 + key: + type: string + format: byte + value: + type: string + format: byte + proof_ops: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle + root. The data could + + be arbitrary format, providing necessary data for + example neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type + defined in Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type + defined in Tendermint. + height: + type: string + format: int64 + codespace: + type: string + description: >- + ABCIQueryResponse defines the response structure for the ABCIQuery + gRPC query. + + + Note: This type is a duplicate of the ResponseQuery proto type + defined in + + Tendermint. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type server that maps type URLs to message definitions as follows: @@ -5248,12 +6115,31 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + parameters: + - name: data + in: query + required: false + type: string + format: byte + - name: path + in: query + required: false + type: string + - name: height + in: query + required: false + type: string + format: int64 + - name: prove + in: query + required: false + type: boolean tags: - Service - /cosmos/base/tendermint/v1beta1/blocks/{height}: + /cosmos/base/tendermint/v1beta1/blocks/latest: get: - summary: GetBlockByHeight queries block for given height. - operationId: CosmosBaseTendermintV1Beta1GetBlockByHeight + summary: GetLatestBlock returns the latest block. + operationId: CosmosBaseTendermintV1Beta1GetLatestBlock responses: '200': description: A successful response. @@ -6420,10 +7306,8 @@ paths: field converted to bech32 string. description: >- - GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight - - RPC method. + GetLatestBlockResponse is the response type for the + Query/GetLatestBlock RPC method. default: description: An unexpected error response. schema: @@ -6609,362 +7493,1242 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: height - in: path - required: true - type: string - format: int64 tags: - Service - /cosmos/base/tendermint/v1beta1/node_info: + /cosmos/base/tendermint/v1beta1/blocks/{height}: get: - summary: GetNodeInfo queries the current node info. - operationId: CosmosBaseTendermintV1Beta1GetNodeInfo + summary: GetBlockByHeight queries block for given height. + operationId: CosmosBaseTendermintV1Beta1GetBlockByHeight responses: '200': description: A successful response. schema: type: object properties: - default_node_info: + block_id: type: object properties: - protocol_version: - type: object - properties: - p2p: - type: string - format: uint64 - block: - type: string - format: uint64 - app: - type: string - format: uint64 - default_node_id: - type: string - listen_addr: - type: string - network: - type: string - version: - type: string - channels: + hash: type: string format: byte - moniker: - type: string - other: + part_set_header: type: object properties: - tx_index: - type: string - rpc_address: + total: + type: integer + format: int64 + hash: type: string - application_version: + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' type: object properties: - name: - type: string - app_name: - type: string - version: - type: string - git_commit: - type: string - build_tags: - type: string - go_version: - type: string - build_deps: - type: array - items: - type: object - properties: - path: - type: string - title: module path - version: - type: string - title: module version - sum: - type: string - title: checksum - title: Module is the type for VersionInfo - cosmos_sdk_version: - type: string - title: 'Since: cosmos-sdk 0.43' - description: VersionInfo is the type for the GetNodeInfoResponse message. - description: >- - GetNodeInfoResponse is the response type for the Query/GetNodeInfo - RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, - name "y.z". + including all blockchain data structures and the rules + of the application's + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + NOTE: not all txs here are valid. We're just agreeing + on the order first. - JSON + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. - ==== + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for - The JSON representation of an `Any` value uses the regular + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. - representation of the deserialized, embedded message, with - an + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for - additional field `@type` which contains the type URL. - Example: + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + including all blockchain data structures + and the rules of the application's - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Service - /cosmos/base/tendermint/v1beta1/syncing: - get: - summary: GetSyncing queries node syncing. - operationId: CosmosBaseTendermintV1Beta1GetSyncing - responses: - '200': - description: A successful response. - schema: - type: object - properties: - syncing: - type: boolean - description: >- - GetSyncingResponse is the response type for the Query/GetSyncing - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + including all blockchain data structures and the rules + of the application's - In practice, teams usually precompile into the binary - all types that they + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer + address, formatted as a Bech32 string. - expect it to use in the context of Any. However, for - URLs which use the + In Tendermint, this type is `bytes`, but in the SDK, + we convert it to a Bech32 string - scheme `http`, `https`, or no scheme, one can optionally - set up a type + for better UX. - server that maps type URLs to message definitions as - follows: + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. - * If no scheme is provided, `https` is assumed. + NOTE: not all txs here are valid. We're just agreeing + on the order first. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + This means that block.AppHash does not include these + txs. + title: >- + Data contains the set of transactions included in the + block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. - Note: this functionality is not currently available in - the official + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed + message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or + commit vote from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a + validator signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, + + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a + block was committed by a set of + validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a + set of validators attempting to mislead a light + client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + description: >- + Block is tendermint type Block, with the Header proposer + address + + field converted to bech32 string. + description: >- + GetBlockByHeightResponse is the response type for the + Query/GetBlockByHeight RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official protobuf release, and it is not used for type URLs beginning with @@ -7088,232 +8852,298 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + parameters: + - name: height + in: path + required: true + type: string + format: int64 tags: - Service - /cosmos/base/tendermint/v1beta1/validatorsets/latest: + /cosmos/base/tendermint/v1beta1/node_info: get: - summary: GetLatestValidatorSet queries latest validator-set. - operationId: CosmosBaseTendermintV1Beta1GetLatestValidatorSet + summary: GetNodeInfo queries the current node info. + operationId: CosmosBaseTendermintV1Beta1GetNodeInfo responses: '200': description: A successful response. schema: type: object properties: - block_height: - type: string - format: int64 - validators: + default_node_info: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + application_version: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + description: >- + GetNodeInfoResponse is the response type for the Query/GetNodeInfo + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object properties: - address: + '@type': type: string - pub_key: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - one "/" character. The last segment of the URL's - path must represent + protocol buffer message. This string must contain at + least - the fully qualified name of the type (as in + one "/" character. The last segment of the URL's path + must represent - `path/google.protobuf.Duration`). The name should be - in a canonical form + the fully qualified name of the type (as in - (e.g., leading "." is not accepted). + `path/google.protobuf.Duration`). The name should be in + a canonical form + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they - expect it to use in the context of Any. However, for - URLs which use the + In practice, teams usually precompile into the binary + all types that they - scheme `http`, `https`, or no scheme, one can - optionally set up a type + expect it to use in the context of Any. However, for + URLs which use the - server that maps type URLs to message definitions as - follows: + scheme `http`, `https`, or no scheme, one can optionally + set up a type + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * If no scheme is provided, `https` is assumed. - Note: this functionality is not currently available - in the official + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - protobuf release, and it is not used for type URLs - beginning with + Note: this functionality is not currently available in + the official - type.googleapis.com. + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + Schemes other than `http`, `https` (or the empty scheme) + might be - URL that describes the type of the serialized message. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any - values in the form - of utility functions or additional generated methods of - the Any type. + Protobuf library provides support to pack/unpack Any values + in the form + of utility functions or additional generated methods of the + Any type. - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Example 1: Pack and unpack a message in C++. - Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Example 2: Pack and unpack a message in Java. - Example 3: Pack and unpack a message in Python. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Example 3: Pack and unpack a message in Python. - Example 4: Pack and unpack a message in Go + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Example 4: Pack and unpack a message in Go - The pack methods provided by protobuf library will by - default use + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + The pack methods provided by protobuf library will by + default use - methods only use the fully qualified type name after the - last '/' + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + methods only use the fully qualified type name after the + last '/' - name "y.z". + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + name "y.z". - JSON - ==== + JSON - The JSON representation of an `Any` value uses the - regular + ==== - representation of the deserialized, embedded message, - with an + The JSON representation of an `Any` value uses the regular - additional field `@type` which contains the type URL. - Example: + representation of the deserialized, embedded message, with + an - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + additional field `@type` which contains the type URL. + Example: - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - If the embedded message type is well-known and has a - custom JSON + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - representation, that representation will be embedded - adding a field + If the embedded message type is well-known and has a custom + JSON - `value` which holds the custom JSON in addition to the - `@type` + representation, that representation will be embedded adding + a field - field. Example (for message - [google.protobuf.Duration][]): + `value` which holds the custom JSON in addition to the + `@type` - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - pagination: - description: pagination defines an pagination for the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + field. Example (for message [google.protobuf.Duration][]): - was set, its value is undefined otherwise - description: |- - GetLatestValidatorSetResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + tags: + - Service + /cosmos/base/tendermint/v1beta1/syncing: + get: + summary: GetSyncing queries node syncing. + operationId: CosmosBaseTendermintV1Beta1GetSyncing + responses: + '200': + description: A successful response. + schema: + type: object + properties: + syncing: + type: boolean + description: >- + GetSyncingResponse is the response type for the Query/GetSyncing + RPC method. default: description: An unexpected error response. schema: @@ -7499,69 +9329,12 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Service - /cosmos/base/tendermint/v1beta1/validatorsets/{height}: + /cosmos/base/tendermint/v1beta1/validatorsets/latest: get: - summary: GetValidatorSetByHeight queries validator-set at a given height. - operationId: CosmosBaseTendermintV1Beta1GetValidatorSetByHeight + summary: GetLatestValidatorSet queries latest validator-set. + operationId: CosmosBaseTendermintV1Beta1GetLatestValidatorSet responses: '200': description: A successful response. @@ -7779,8 +9552,8 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: |- - GetValidatorSetByHeightResponse is the response type for the + description: >- + GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. default: description: An unexpected error response. @@ -7968,11 +9741,6 @@ paths: "value": "1.212s" } parameters: - - name: height - in: path - required: true - type: string - format: int64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -8031,325 +9799,230 @@ paths: type: boolean tags: - Service - /cosmos/distribution/v1beta1/community_pool: + /cosmos/base/tendermint/v1beta1/validatorsets/{height}: get: - summary: CommunityPool queries the community pool coins. - operationId: CosmosDistributionV1Beta1CommunityPool + summary: GetValidatorSetByHeight queries validator-set at a given height. + operationId: CosmosBaseTendermintV1Beta1GetValidatorSetByHeight responses: '200': description: A successful response. schema: type: object properties: - pool: + block_height: + type: string + format: int64 + validators: type: array items: type: object properties: - denom: - type: string - amount: + address: type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + protocol buffer message. This string must contain at + least - NOTE: The amount field is an Dec which implements the custom - method + one "/" character. The last segment of the URL's + path must represent - signatures required by gogoproto. - description: pool defines community pool's coins. - description: >- - QueryCommunityPoolResponse is the response type for the - Query/CommunityPool + the fully qualified name of the type (as in - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards: - get: - summary: |- - DelegationTotalRewards queries the total rewards accrued by a each - validator. - operationId: CosmosDistributionV1Beta1DelegationTotalRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. + `path/google.protobuf.Duration`). The name should be + in a canonical form + (e.g., leading "." is not accepted). - NOTE: The amount field is an Dec which implements the - custom method - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - description: rewards defines all the rewards accrued by a delegator. - total: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. + In practice, teams usually precompile into the + binary all types that they + expect it to use in the context of Any. However, for + URLs which use the - NOTE: The amount field is an Dec which implements the custom - method + scheme `http`, `https`, or no scheme, one can + optionally set up a type - signatures required by gogoproto. - description: total defines the sum of all the rewards. - description: |- - QueryDelegationTotalRewardsResponse is the response type for the - Query/DelegationTotalRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}: - get: - summary: DelegationRewards queries the total rewards accrued by a delegation. - operationId: CosmosDistributionV1Beta1DelegationRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. + server that maps type URLs to message definitions as + follows: - NOTE: The amount field is an Dec which implements the custom - method + * If no scheme is provided, `https` is assumed. - signatures required by gogoproto. - description: rewards defines the rewards accrued by a delegation. - description: |- - QueryDelegationRewardsResponse is the response type for the - Query/DelegationRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/validators: - get: - summary: DelegatorValidators queries the validators of a delegator. - operationId: CosmosDistributionV1Beta1DelegatorValidators - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validators: - type: array - items: - type: string - description: >- - validators defines the validators a delegator is delegating - for. - description: |- - QueryDelegatorValidatorsResponse is the response type for the - Query/DelegatorValidators RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address: - get: - summary: DelegatorWithdrawAddress queries withdraw address of a delegator. - operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress - responses: - '200': - description: A successful response. - schema: - type: object - properties: - withdraw_address: - type: string - description: withdraw_address defines the delegator address to query for. - description: |- - QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': + format: int64 + proposer_priority: type: string - additionalProperties: {} - parameters: - - name: delegator_address - description: delegator_address defines the delegator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/params: - get: - summary: Params queries params of the distribution module. - operationId: CosmosDistributionV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params defines the parameters of the module. + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. type: object properties: - community_tax: - type: string - base_proposer_reward: + next_key: type: string - bonus_proposer_reward: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string - withdraw_addr_enabled: - type: boolean + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. + GetValidatorSetByHeightResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. default: description: An unexpected error response. schema: @@ -8367,522 +10040,12 @@ paths: properties: '@type': type: string - additionalProperties: {} - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/commission: - get: - summary: ValidatorCommission queries accumulated commission for a validator. - operationId: CosmosDistributionV1Beta1ValidatorCommission - responses: - '200': - description: A successful response. - schema: - type: object - properties: - commission: - description: commission defines the commision the validator received. - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string description: >- - DecCoin defines a token with a denomination and a - decimal amount. + A URL/resource name that uniquely identifies the type of + the serialized - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards: - get: - summary: ValidatorOutstandingRewards queries rewards of a validator address. - operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards - responses: - '200': - description: A successful response. - schema: - type: object - properties: - rewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a - decimal amount. - - - NOTE: The amount field is an Dec which implements the - custom method - - signatures required by gogoproto. - description: >- - ValidatorOutstandingRewards represents outstanding - (un-withdrawn) rewards - - for a validator inexpensive to track, allows simple sanity - checks. - description: >- - QueryValidatorOutstandingRewardsResponse is the response type for - the - - Query/ValidatorOutstandingRewards RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - tags: - - Query - /cosmos/distribution/v1beta1/validators/{validator_address}/slashes: - get: - summary: ValidatorSlashes queries slash events of a validator. - operationId: CosmosDistributionV1Beta1ValidatorSlashes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - slashes: - type: array - items: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: >- - ValidatorSlashEvent represents a validator slash event. - - Height is implicit within the store key. - - This is needed to calculate appropriate amount of staking - tokens - - for delegations which are withdrawn after a slash has - occurred. - description: slashes defines the slashes the validator received. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: validator_address - description: validator_address defines the validator address to query for. - in: path - required: true - type: string - - name: starting_height - description: >- - starting_height defines the optional starting height to query the - slashes. - in: query - required: false - type: string - format: uint64 - - name: ending_height - description: >- - starting_height defines the optional ending height to query the - slashes. - in: query - required: false - type: string - format: uint64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /cosmos/evidence/v1beta1/evidence: - get: - summary: AllEvidence queries all evidence. - operationId: CosmosEvidenceV1Beta1AllEvidence - responses: - '200': - description: A successful response. - schema: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: evidence returns all evidences. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - QueryAllEvidenceResponse is the response type for the - Query/AllEvidence RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least one "/" character. The last segment of the URL's path must represent @@ -9046,6 +10209,11 @@ paths: "value": "1.212s" } parameters: + - name: height + in: path + required: true + type: string + format: int64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -9103,82 +10271,105 @@ paths: required: false type: boolean tags: - - Query - /cosmos/evidence/v1beta1/evidence/{evidence_hash}: + - Service + /cosmos/consensus/v1/params: get: - summary: Evidence queries evidence based on evidence hash. - operationId: CosmosEvidenceV1Beta1Evidence + summary: Params queries the parameters of x/consensus_param module. + operationId: CosmosConsensusV1Params responses: '200': description: A successful response. schema: type: object properties: - evidence: - description: evidence returns the requested evidence. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent + params: + description: >- + params are the tendermint consensus params stored in the + consensus module. - the fully qualified name of the type (as in + Please note that `params.version` is not populated in this + response, it is - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. - server that maps type URLs to message definitions as - follows: + The basic formula for calculating this is: + MaxAgeDuration / {average block - * If no scheme is provided, `https` is assumed. + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available in the - official + It should correspond with an app's "unbonding period" + or other similar - protobuf release, and it is not used for type URLs - beginning with + mechanism for handling [Nothing-At-Stake - type.googleapis.com. + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes + that can be committed in a single block. + and should fall comfortably under the max block bytes. - Schemes other than `http`, `https` (or the empty scheme) - might be + Default is 1048576 or 1MB + description: >- + EvidenceParams determine how we handle evidence of + malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: >- + ValidatorParams restrict the public key types validators + can use. - used with implementation specific semantics. - additionalProperties: {} + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. description: >- - QueryEvidenceResponse is the response type for the Query/Evidence - RPC method. + QueryParamsResponse defines the response type for querying + x/consensus parameters. default: description: An unexpected error response. schema: @@ -9196,278 +10387,184 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/community_pool: + get: + summary: CommunityPool queries the community pool coins. + operationId: CosmosDistributionV1Beta1CommunityPool + responses: + '200': + description: A successful response. + schema: + type: object + properties: + pool: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== + DecCoin defines a token with a denomination and a decimal + amount. - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with - an + NOTE: The amount field is an Dec which implements the custom + method - additional field `@type` which contains the type URL. - Example: + signatures required by gogoproto. + description: pool defines community pool's coins. + description: >- + QueryCommunityPoolResponse is the response type for the + Query/CommunityPool - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards: + get: + summary: |- + DelegationTotalRewards queries the total rewards accrued by a each + validator. + operationId: CosmosDistributionV1Beta1DelegationTotalRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom - JSON + NOTE: The amount field is an Dec which implements the + custom method - representation, that representation will be embedded adding - a field + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + description: rewards defines all the rewards accrued by a delegator. + total: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. - `value` which holds the custom JSON in addition to the - `@type` - field. Example (for message [google.protobuf.Duration][]): + NOTE: The amount field is an Dec which implements the custom + method - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + signatures required by gogoproto. + description: total defines the sum of all the rewards. + description: |- + QueryDelegationTotalRewardsResponse is the response type for the + Query/DelegationTotalRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} parameters: - - name: evidence_hash - description: evidence_hash defines the hash of the requested evidence. + - name: delegator_address + description: delegator_address defines the delegator address to query for. in: path required: true type: string - format: byte tags: - Query - /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}: + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}: get: - summary: Allowance returns fee granted to the grantee by the granter. - operationId: CosmosFeegrantV1Beta1Allowance + summary: DelegationRewards queries the total rewards accrued by a delegation. + operationId: CosmosDistributionV1Beta1DelegationRewards responses: '200': description: A successful response. schema: type: object properties: - allowance: - description: allowance is a allowance granted for grantee by granter. - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance - of their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an - allowance of another user's funds. - allowance: - description: >- - allowance can be any of basic, periodic, allowed fee - allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. - Schemes other than `http`, `https` (or the empty - scheme) might be + NOTE: The amount field is an Dec which implements the custom + method - used with implementation specific semantics. - additionalProperties: {} - title: >- - Grant is stored in the KVStore to record a grant with full - context - description: >- - QueryAllowanceResponse is the response type for the - Query/Allowance RPC method. + signatures required by gogoproto. + description: rewards defines the rewards accrued by a delegation. + description: |- + QueryDelegationRewardsResponse is the response type for the + Query/DelegationRewards RPC method. default: description: An unexpected error response. schema: @@ -9485,307 +10582,143 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } parameters: - - name: granter - description: >- - granter is the address of the user granting an allowance of their - funds. + - name: delegator_address + description: delegator_address defines the delegator address to query for. in: path required: true type: string - - name: grantee - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. + - name: validator_address + description: validator_address defines the validator address to query for. in: path required: true type: string tags: - Query - /cosmos/feegrant/v1beta1/allowances/{grantee}: + /cosmos/distribution/v1beta1/delegators/{delegator_address}/validators: get: - summary: Allowances returns all the grants for address. - operationId: CosmosFeegrantV1Beta1Allowances + summary: DelegatorValidators queries the validators of a delegator. + operationId: CosmosDistributionV1Beta1DelegatorValidators responses: '200': description: A successful response. schema: type: object properties: - allowances: + validators: + type: array + items: + type: string + description: >- + validators defines the validators a delegator is delegating + for. + description: |- + QueryDelegatorValidatorsResponse is the response type for the + Query/DelegatorValidators RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object properties: - granter: + '@type': type: string - description: >- - granter is the address of the user granting an allowance - of their funds. - grantee: + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address: + get: + summary: DelegatorWithdrawAddress queries withdraw address of a delegator. + operationId: CosmosDistributionV1Beta1DelegatorWithdrawAddress + responses: + '200': + description: A successful response. + schema: + type: object + properties: + withdraw_address: + type: string + description: withdraw_address defines the delegator address to query for. + description: |- + QueryDelegatorWithdrawAddressResponse is the response type for the + Query/DelegatorWithdrawAddress RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': type: string - description: >- - grantee is the address of the user being granted an - allowance of another user's funds. - allowance: - description: >- - allowance can be any of basic, periodic, allowed fee - allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - title: >- - Grant is stored in the KVStore to record a grant with full - context - description: allowances are allowance's granted for grantee by granter. - pagination: - description: pagination defines an pagination for the response. + additionalProperties: {} + parameters: + - name: delegator_address + description: delegator_address defines the delegator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/params: + get: + summary: Params queries params of the distribution module. + operationId: CosmosDistributionV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. type: object properties: - next_key: + community_tax: type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + base_proposer_reward: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + Deprecated: The base_proposer_reward field is deprecated + and is no longer used - was set, its value is undefined otherwise + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated + and is no longer used + + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean description: >- - QueryAllowancesResponse is the response type for the - Query/Allowances RPC method. + QueryParamsResponse is the response type for the Query/Params RPC + method. default: description: An unexpected error response. schema: @@ -9803,179 +10736,313 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent + additionalProperties: {} + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}: + get: + summary: >- + ValidatorDistributionInfo queries validator commission and + self-delegation rewards for validator + operationId: CosmosDistributionV1Beta1ValidatorDistributionInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in - a canonical form + NOTE: The amount field is an Dec which implements the custom + method - (e.g., leading "." is not accepted). + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. - In practice, teams usually precompile into the binary - all types that they + NOTE: The amount field is an Dec which implements the custom + method - expect it to use in the context of Any. However, for - URLs which use the + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for + the Query/ValidatorDistributionInfo RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/commission: + get: + summary: ValidatorCommission queries accumulated commission for a validator. + operationId: CosmosDistributionV1Beta1ValidatorCommission + responses: + '200': + description: A successful response. + schema: + type: object + properties: + commission: + description: commission defines the commission the validator received. + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. - scheme `http`, `https`, or no scheme, one can optionally - set up a type - server that maps type URLs to message definitions as - follows: + NOTE: The amount field is an Dec which implements the + custom method + signatures required by gogoproto. + title: |- + QueryValidatorCommissionResponse is the response type for the + Query/ValidatorCommission RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards: + get: + summary: ValidatorOutstandingRewards queries rewards of a validator address. + operationId: CosmosDistributionV1Beta1ValidatorOutstandingRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a + decimal amount. - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + NOTE: The amount field is an Dec which implements the + custom method - Note: this functionality is not currently available in - the official + signatures required by gogoproto. + description: >- + ValidatorOutstandingRewards represents outstanding + (un-withdrawn) rewards - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be + for a validator inexpensive to track, allows simple sanity + checks. + description: >- + QueryValidatorOutstandingRewardsResponse is the response type for + the - used with implementation specific semantics. + Query/ValidatorOutstandingRewards RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string additionalProperties: {} + parameters: + - name: validator_address + description: validator_address defines the validator address to query for. + in: path + required: true + type: string + tags: + - Query + /cosmos/distribution/v1beta1/validators/{validator_address}/slashes: + get: + summary: ValidatorSlashes queries slash events of a validator. + operationId: CosmosDistributionV1Beta1ValidatorSlashes + responses: + '200': + description: A successful response. + schema: + type: object + properties: + slashes: + type: array + items: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON + ValidatorSlashEvent represents a validator slash event. - representation, that representation will be embedded adding - a field + Height is implicit within the store key. - `value` which holds the custom JSON in addition to the - `@type` + This is needed to calculate appropriate amount of staking + tokens - field. Example (for message [google.protobuf.Duration][]): + for delegations which are withdrawn after a slash has + occurred. + description: slashes defines the slashes the validator received. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + was set, its value is undefined otherwise + description: |- + QueryValidatorSlashesResponse is the response type for the + Query/ValidatorSlashes RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} parameters: - - name: grantee + - name: validator_address + description: validator_address defines the validator address to query for. in: path required: true type: string + - name: starting_height + description: >- + starting_height defines the optional starting height to query the + slashes. + in: query + required: false + type: string + format: uint64 + - name: ending_height + description: >- + starting_height defines the optional ending height to query the + slashes. + in: query + required: false + type: string + format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -10034,137 +11101,17 @@ paths: type: boolean tags: - Query - /cosmos/feegrant/v1beta1/issued/{granter}: + /cosmos/evidence/v1beta1/evidence: get: - summary: AllowancesByGranter returns all the grants given by an address - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosFeegrantV1Beta1AllowancesByGranter + summary: AllEvidence queries all evidence. + operationId: CosmosEvidenceV1Beta1AllEvidence responses: '200': description: A successful response. schema: type: object properties: - allowances: - type: array - items: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance - of their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an - allowance of another user's funds. - allowance: - description: >- - allowance can be any of basic, periodic, allowed fee - allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - title: >- - Grant is stored in the KVStore to record a grant with full - context - description: allowances that have been issued by the granter. - pagination: - description: pagination defines an pagination for the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - QueryAllowancesByGranterResponse is the response type for the - Query/AllowancesByGranter RPC method. - - - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: + evidence: type: array items: type: object @@ -10339,137 +11286,30 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: granter - in: path - required: true - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /cosmos/gov/v1/params/{params_type}: - get: - summary: Params queries all parameters of the gov module. - operationId: CosmosGovV1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - voting_params: - description: voting_params defines the parameters related to voting. - type: object - properties: - voting_period: - type: string - description: Length of the voting period. - deposit_params: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - description: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. - Initial value: 2 - months. - tally_params: - description: tally_params defines the parameters related to tally. + description: evidence returns all evidences. + pagination: + description: pagination defines the pagination in the response. type: object properties: - quorum: - type: string - description: >- - Minimum percentage of total stake needed to vote for a - result to be - considered valid. - threshold: + next_key: type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. - Default value: 0.5. - veto_threshold: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string - description: >- - Minimum value of Veto votes to Total votes ratio for - proposal to be - vetoed. Default value: 1/3. + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryParamsResponse is the response type for the Query/Params RPC + QueryAllEvidenceResponse is the response type for the + Query/AllEvidence RPC + method. default: description: An unexpected error response. @@ -10657,318 +11497,139 @@ paths: "value": "1.212s" } parameters: - - name: params_type - description: >- - params_type defines which parameters to query for, can be one of - "voting", - - "tallying" or "deposit". - in: path - required: true - type: string - tags: - - Query - /cosmos/gov/v1/proposals: - get: - summary: Proposals queries all proposals based on given status. - operationId: CosmosGovV1Proposals - responses: - '200': - description: A successful response. - schema: - type: object - properties: - proposals: - type: array - items: - type: object - properties: - id: - type: string - format: uint64 - messages: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain - at least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should - be in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, - for URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions - as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently - available in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods - of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + It is less efficient than using key. Only one of offset or key + should - The pack methods provided by protobuf library will by - default use + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - 'type.googleapis.com/full.type.name' as the type URL - and the unpack + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - methods only use the fully qualified type name after - the last '/' + a count of the total number of items available for pagination in + UIs. - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + count_total is only respected when offset is used. It is ignored + when key - name "y.z". + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/evidence/v1beta1/evidence/{hash}: + get: + summary: Evidence queries evidence based on evidence hash. + operationId: CosmosEvidenceV1Beta1Evidence + responses: + '200': + description: A successful response. + schema: + type: object + properties: + evidence: + description: evidence returns the requested evidence. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - JSON + protocol buffer message. This string must contain at least - ==== + one "/" character. The last segment of the URL's path must + represent - The JSON representation of an `Any` value uses the - regular + the fully qualified name of the type (as in - representation of the deserialized, embedded message, - with an + `path/google.protobuf.Duration`). The name should be in a + canonical form - additional field `@type` which contains the type URL. - Example: + (e.g., leading "." is not accepted). - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + In practice, teams usually precompile into the binary all + types that they - If the embedded message type is well-known and has a - custom JSON + expect it to use in the context of Any. However, for URLs + which use the - representation, that representation will be embedded - adding a field + scheme `http`, `https`, or no scheme, one can optionally + set up a type - `value` which holds the custom JSON in addition to the - `@type` + server that maps type URLs to message definitions as + follows: - field. Example (for message - [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. + * If no scheme is provided, `https` is assumed. - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - querying a proposal via gRPC, this field is not - populated until the + Note: this functionality is not currently available in the + official - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - abstain_count: - type: string - no_count: - type: string - no_with_veto_count: - type: string - submit_time: - type: string - format: date-time - deposit_end_time: - type: string - format: date-time - total_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - NOTE: The amount field is an Int which implements the - custom method - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - metadata: - type: string - description: >- - metadata is any arbitrary metadata attached to the - proposal. - description: >- - Proposal defines the core field members of a governance - proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + Schemes other than `http`, `https` (or the empty scheme) + might be - was set, its value is undefined otherwise + used with implementation specific semantics. + additionalProperties: {} description: >- - QueryProposalsResponse is the response type for the - Query/Proposals RPC - - method. + QueryEvidenceResponse is the response type for the Query/Evidence + RPC method. default: description: An unexpected error response. schema: @@ -11155,377 +11816,119 @@ paths: "value": "1.212s" } parameters: - - name: proposal_status + - name: hash description: |- - proposal_status defines the status of the proposals. + hash defines the evidence hash of the requested evidence. - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - in: query - required: false - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - - name: voter - description: voter defines the voter address for the proposals. - in: query - required: false - type: string - - name: depositor - description: depositor defines the deposit addresses from the proposals. - in: query - required: false + Since: cosmos-sdk 0.47 + in: path + required: true type: string - - name: pagination.key + - name: evidence_hash description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. + evidence_hash defines the hash of the requested evidence. + Deprecated: Use hash, a HEX encoded string, instead. in: query required: false type: string format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /cosmos/gov/v1/proposals/{proposal_id}: + /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}: get: - summary: Proposal queries proposal details based on ProposalID. - operationId: CosmosGovV1Proposal + summary: Allowance returns fee granted to the grantee by the granter. + operationId: CosmosFeegrantV1Beta1Allowance responses: '200': description: A successful response. schema: type: object properties: - proposal: + allowance: + description: allowance is a allowance granted for grantee by granter. type: object properties: - id: + granter: type: string - format: uint64 - messages: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's - path must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be + in a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + In practice, teams usually precompile into the binary + all types that they - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + expect it to use in the context of Any. However, for + URLs which use the - If the embedded message type is well-known and has a - custom JSON + scheme `http`, `https`, or no scheme, one can + optionally set up a type - representation, that representation will be embedded - adding a field + server that maps type URLs to message definitions as + follows: - `value` which holds the custom JSON in addition to the - `@type` - field. Example (for message - [google.protobuf.Duration][]): + * If no scheme is provided, `https` is assumed. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When + Note: this functionality is not currently available in + the official - querying a proposal via gRPC, this field is not populated - until the + protobuf release, and it is not used for type URLs + beginning with - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - abstain_count: - type: string - no_count: - type: string - no_with_veto_count: - type: string - submit_time: - type: string - format: date-time - deposit_end_time: - type: string - format: date-time - total_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + type.googleapis.com. - NOTE: The amount field is an Int which implements the - custom method + Schemes other than `http`, `https` (or the empty + scheme) might be - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - metadata: - type: string - description: >- - metadata is any arbitrary metadata attached to the - proposal. - description: >- - Proposal defines the core field members of a governance - proposal. + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context description: >- - QueryProposalResponse is the response type for the Query/Proposal - RPC method. + QueryAllowanceResponse is the response type for the + Query/Allowance RPC method. default: description: An unexpected error response. schema: @@ -11712,59 +12115,118 @@ paths: "value": "1.212s" } parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. + - name: granter + description: >- + granter is the address of the user granting an allowance of their + funds. + in: path + required: true + type: string + - name: grantee + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. in: path required: true type: string - format: uint64 tags: - Query - /cosmos/gov/v1/proposals/{proposal_id}/deposits: + /cosmos/feegrant/v1beta1/allowances/{grantee}: get: - summary: Deposits queries all deposits of a single proposal. - operationId: CosmosGovV1Deposits + summary: Allowances returns all the grants for address. + operationId: CosmosFeegrantV1Beta1Allowances responses: '200': description: A successful response. schema: type: object properties: - deposits: + allowances: type: array items: type: object properties: - proposal_id: + granter: type: string - format: uint64 - depositor: + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + protocol buffer message. This string must contain at + least - NOTE: The amount field is an Int which implements the - custom method + one "/" character. The last segment of the URL's + path must represent - signatures required by gogoproto. - description: >- - Deposit defines an amount deposited by an account address to - an active + the fully qualified name of the type (as in - proposal. + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: allowances are allowance's granted for grantee by granter. pagination: - description: pagination defines the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -11783,8 +12245,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryDepositsResponse is the response type for the Query/Deposits - RPC method. + QueryAllowancesResponse is the response type for the + Query/Allowances RPC method. default: description: An unexpected error response. schema: @@ -11971,12 +12433,10 @@ paths: "value": "1.212s" } parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. + - name: grantee in: path required: true type: string - format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -12035,47 +12495,126 @@ paths: type: boolean tags: - Query - /cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}: + /cosmos/feegrant/v1beta1/issued/{granter}: get: - summary: >- - Deposit queries single deposit information based proposalID, - depositAddr. - operationId: CosmosGovV1Deposit + summary: AllowancesByGranter returns all the grants given by an address + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosFeegrantV1Beta1AllowancesByGranter responses: '200': description: A successful response. schema: type: object properties: - deposit: - description: deposit defines the requested deposit. - type: object - properties: - proposal_id: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance + of their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an + allowance of another user's funds. + allowance: + description: >- + allowance can be any of basic, periodic, allowed fee + allowance. type: object properties: - denom: - type: string - amount: + '@type': type: string - description: >- - Coin defines a token with a denomination and an amount. + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + protocol buffer message. This string must contain at + least - NOTE: The amount field is an Int which implements the - custom method + one "/" character. The last segment of the URL's + path must represent - signatures required by gogoproto. + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: >- + Grant is stored in the KVStore to record a grant with full + context + description: allowances that have been issued by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryDepositResponse is the response type for the Query/Deposit - RPC method. + QueryAllowancesByGranterResponse is the response type for the + Query/AllowancesByGranter RPC method. + + + Since: cosmos-sdk 0.46 default: description: An unexpected error response. schema: @@ -12262,44 +12801,246 @@ paths: "value": "1.212s" } parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. + - name: granter in: path required: true type: string - format: uint64 - - name: depositor - description: depositor defines the deposit addresses from the proposals. - in: path - required: true + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/gov/v1/proposals/{proposal_id}/tally: + /cosmos/gov/v1/params/{params_type}: get: - summary: TallyResult queries the tally of a proposal vote. - operationId: CosmosGovV1TallyResult + summary: Params queries all parameters of the gov module. + operationId: CosmosGovV1Params responses: '200': description: A successful response. schema: type: object properties: - tally: - description: tally defines the requested tally. + voting_params: + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. type: object properties: - yes_count: + voting_period: type: string - abstain_count: + description: Duration of the voting period. + deposit_params: + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: type: string - no_count: + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + tally_params: + description: |- + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. + type: object + properties: + quorum: type: string - no_with_veto_count: + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 + type: object + properties: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 + + months. + voting_period: + type: string + description: Duration of the voting period. + quorum: + type: string + description: >- + Minimum percentage of total stake needed to vote for a + result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: type: string + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value + that must be paid at proposal submission. + expedited_voting_period: + type: string + description: |- + Duration of the voting period of an expedited proposal. + + Since: cosmos-sdk 0.50 + expedited_threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.67. + + + Since: cosmos-sdk 0.50 + expedited_min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + Minimum expedited deposit for a proposal to enter voting + period. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met description: >- - QueryTallyResultResponse is the response type for the Query/Tally - RPC method. + QueryParamsResponse is the response type for the Query/Params RPC + method. default: description: An unexpected error response. schema: @@ -12486,73 +13227,315 @@ paths: "value": "1.212s" } parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. + - name: params_type + description: >- + params_type defines which parameters to query for, can be one of + "voting", + + "tallying" or "deposit". in: path required: true type: string - format: uint64 tags: - Query - /cosmos/gov/v1/proposals/{proposal_id}/votes: + /cosmos/gov/v1/proposals: get: - summary: Votes queries votes of a given proposal. - operationId: CosmosGovV1Votes + summary: Proposals queries all proposals based on given status. + operationId: CosmosGovV1Proposals responses: '200': description: A successful response. schema: type: object properties: - votes: + proposals: type: array items: type: object properties: - proposal_id: + id: type: string format: uint64 - voter: - type: string - options: + description: id defines the unique id of the proposal. + messages: type: array items: type: object properties: - option: + '@type': type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain + at least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should + be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, + for URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions + as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently + available in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods + of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL + and the unpack + + methods only use the fully qualified type name after + the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if + the proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not + populated until the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto + votes on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: type: string description: >- - WeightedVoteOption defines a unit of vote for vote - split. + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: >- - metadata is any arbitrary metadata to attached to the - vote. + metadata is any arbitrary metadata attached to the + proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + expedited: + type: boolean + title: expedited defines if the proposal is expedited description: >- - Vote defines a vote on a governance proposal. - - A Vote consists of a proposal ID, the voter, and the vote - option. - description: votes defined the queried votes. + Proposal defines the core field members of a governance + proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -12573,7 +13556,9 @@ paths: was set, its value is undefined otherwise description: >- - QueryVotesResponse is the response type for the Query/Votes RPC + QueryProposalsResponse is the response type for the + Query/Proposals RPC + method. default: description: An unexpected error response. @@ -12761,25 +13746,55 @@ paths: "value": "1.212s" } parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - name: pagination.key + - name: proposal_status description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. + proposal_status defines the status of the proposals. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. in: query required: false type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + - name: voter + description: voter defines the voter address for the proposals. + in: query + required: false + type: string + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should @@ -12825,61 +13840,301 @@ paths: type: boolean tags: - Query - /cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}: + /cosmos/gov/v1/proposals/{proposal_id}: get: - summary: Vote queries voted information based on proposalID, voterAddr. - operationId: CosmosGovV1Vote + summary: Proposal queries proposal details based on ProposalID. + operationId: CosmosGovV1Proposal responses: '200': description: A successful response. schema: type: object properties: - vote: - description: vote defined the queried vote. + proposal: + description: proposal is the requested governance proposal. type: object properties: - proposal_id: + id: type: string format: uint64 - voter: - type: string - options: + description: id defines the unique id of the proposal. + messages: type: array items: type: object properties: - option: + '@type': type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the + proposal passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not populated + until the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes + on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: type: string description: >- - WeightedVoteOption defines a unit of vote for vote - split. + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. metadata: type: string description: >- - metadata is any arbitrary metadata to attached to the - vote. + metadata is any arbitrary metadata attached to the + proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + expedited: + type: boolean + title: expedited defines if the proposal is expedited description: >- - QueryVoteResponse is the response type for the Query/Vote RPC - method. + QueryProposalResponse is the response type for the Query/Proposal + RPC method. default: description: An unexpected error response. schema: @@ -13072,85 +14327,79 @@ paths: required: true type: string format: uint64 - - name: voter - description: voter defines the voter address for the proposals. - in: path - required: true - type: string tags: - Query - /cosmos/gov/v1beta1/params/{params_type}: + /cosmos/gov/v1/proposals/{proposal_id}/deposits: get: - summary: Params queries all parameters of the gov module. - operationId: CosmosGovV1Beta1Params + summary: Deposits queries all deposits of a single proposal. + operationId: CosmosGovV1Deposits responses: '200': description: A successful response. schema: type: object properties: - voting_params: - description: voting_params defines the parameters related to voting. - type: object - properties: - voting_period: - type: string - description: Length of the voting period. - deposit_params: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string description: >- - Coin defines a token with a denomination and an amount. + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - NOTE: The amount field is an Int which implements the - custom method + NOTE: The amount field is an Int which implements the + custom method - signatures required by gogoproto. - description: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. - Initial value: 2 - months. - tally_params: - description: tally_params defines the parameters related to tally. + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. type: object properties: - quorum: - type: string - format: byte - description: >- - Minimum percentage of total stake needed to vote for a - result to be - considered valid. - threshold: + next_key: type: string format: byte - description: >- - Minimum proportion of Yes votes for proposal to pass. - Default value: 0.5. - veto_threshold: + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string - format: byte - description: >- - Minimum value of Veto votes to Total votes ratio for - proposal to be - vetoed. Default value: 1/3. + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. + QueryDepositsResponse is the response type for the Query/Deposits + RPC method. default: description: An unexpected error response. schema: @@ -13337,311 +14586,348 @@ paths: "value": "1.212s" } parameters: - - name: params_type - description: >- - params_type defines which parameters to query for, can be one of - "voting", - - "tallying" or "deposit". + - name: proposal_id + description: proposal_id defines the unique id of the proposal. in: path required: true type: string + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/gov/v1beta1/proposals: + /cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}: get: - summary: Proposals queries all proposals based on given status. - operationId: CosmosGovV1Beta1Proposals + summary: >- + Deposit queries single deposit information based proposalID, + depositAddr. + operationId: CosmosGovV1Deposit responses: '200': description: A successful response. schema: type: object properties: - proposals: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - content: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: type: object properties: - '@type': + denom: type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - (e.g., leading "." is not accepted). + NOTE: The amount field is an Int which implements the + custom method + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - In practice, teams usually precompile into the - binary all types that they + protocol buffer message. This string must contain at + least - expect it to use in the context of Any. However, for - URLs which use the + one "/" character. The last segment of the URL's path + must represent - scheme `http`, `https`, or no scheme, one can - optionally set up a type + the fully qualified name of the type (as in - server that maps type URLs to message definitions as - follows: + `path/google.protobuf.Duration`). The name should be in + a canonical form + (e.g., leading "." is not accepted). - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + In practice, teams usually precompile into the binary + all types that they - Note: this functionality is not currently available - in the official + expect it to use in the context of Any. However, for + URLs which use the - protobuf release, and it is not used for type URLs - beginning with + scheme `http`, `https`, or no scheme, one can optionally + set up a type - type.googleapis.com. + server that maps type URLs to message definitions as + follows: - Schemes other than `http`, `https` (or the empty - scheme) might be + * If no scheme is provided, `https` is assumed. - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - URL that describes the type of the serialized message. + Note: this functionality is not currently available in + the official + protobuf release, and it is not used for type URLs + beginning with - Protobuf library provides support to pack/unpack Any - values in the form + type.googleapis.com. - of utility functions or additional generated methods of - the Any type. + Schemes other than `http`, `https` (or the empty scheme) + might be - Example 1: Pack and unpack a message in C++. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + URL that describes the type of the serialized message. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Protobuf library provides support to pack/unpack Any values + in the form - Example 3: Pack and unpack a message in Python. + of utility functions or additional generated methods of the + Any type. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 1: Pack and unpack a message in C++. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - The pack methods provided by protobuf library will by - default use + Example 2: Pack and unpack a message in Java. - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - methods only use the fully qualified type name after the - last '/' + Example 3: Pack and unpack a message in Python. - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - name "y.z". + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + The pack methods provided by protobuf library will by + default use - JSON + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - ==== + methods only use the fully qualified type name after the + last '/' - The JSON representation of an `Any` value uses the - regular + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - representation of the deserialized, embedded message, - with an + name "y.z". - additional field `@type` which contains the type URL. - Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + JSON - If the embedded message type is well-known and has a - custom JSON + ==== - representation, that representation will be embedded - adding a field + The JSON representation of an `Any` value uses the regular - `value` which holds the custom JSON in addition to the - `@type` + representation of the deserialized, embedded message, with + an - field. Example (for message - [google.protobuf.Duration][]): + additional field `@type` which contains the type URL. + Example: - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - querying a proposal via gRPC, this field is not - populated until the + If the embedded message type is well-known and has a custom + JSON - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - no_with_veto: - type: string - submit_time: - type: string - format: date-time - deposit_end_time: - type: string - format: date-time - total_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. + representation, that representation will be embedded adding + a field + `value` which holds the custom JSON in addition to the + `@type` - NOTE: The amount field is an Int which implements the - custom method + field. Example (for message [google.protobuf.Duration][]): - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - description: >- - Proposal defines the core field members of a governance - proposal. - pagination: - description: pagination defines the pagination in the response. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true + type: string + format: uint64 + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: path + required: true + type: string + tags: + - Query + /cosmos/gov/v1/proposals/{proposal_id}/tally: + get: + summary: TallyResult queries the tally of a proposal vote. + operationId: CosmosGovV1TallyResult + responses: + '200': + description: A successful response. + schema: + type: object + properties: + tally: + description: tally defines the requested tally. type: object properties: - next_key: + yes_count: type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + description: yes_count is the number of yes votes on a proposal. + abstain_count: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise + description: >- + abstain_count is the number of abstain votes on a + proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on + a proposal. description: >- - QueryProposalsResponse is the response type for the - Query/Proposals RPC - - method. + QueryTallyResultResponse is the response type for the Query/Tally + RPC method. default: description: An unexpected error response. schema: @@ -13828,368 +15114,95 @@ paths: "value": "1.212s" } parameters: - - name: proposal_status - description: |- - proposal_status defines the status of the proposals. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - in: query - required: false - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - - name: voter - description: voter defines the voter address for the proposals. - in: query - required: false - type: string - - name: depositor - description: depositor defines the deposit addresses from the proposals. - in: query - required: false - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true type: string format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}: + /cosmos/gov/v1/proposals/{proposal_id}/votes: get: - summary: Proposal queries proposal details based on ProposalID. - operationId: CosmosGovV1Beta1Proposal + summary: Votes queries votes of a given proposal. + operationId: CosmosGovV1Votes responses: '200': description: A successful response. schema: type: object properties: - proposal: - type: object - properties: - proposal_id: - type: string - format: uint64 - content: - type: object - properties: - '@type': - type: string + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: >- - ProposalStatus enumerates the valid statuses of a - proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: >- - final_tally_result is the final tally result of the - proposal. When - - querying a proposal via gRPC, this field is not populated - until the - - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - no_with_veto: - type: string - submit_time: - type: string - format: date-time - deposit_end_time: - type: string - format: date-time - total_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string + WeightedVoteOption defines a unit of vote for vote + split. + description: options is the weighted vote options. + metadata: + type: string description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method + metadata is any arbitrary metadata to attached to the + vote. + description: >- + Vote defines a vote on a governance proposal. - signatures required by gogoproto. - voting_start_time: + A Vote consists of a proposal ID, the voter, and the vote + option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: type: string - format: date-time - voting_end_time: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string - format: date-time - description: >- - Proposal defines the core field members of a governance - proposal. + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryProposalResponse is the response type for the Query/Proposal - RPC method. + QueryVotesResponse is the response type for the Query/Votes RPC + method. default: description: An unexpected error response. schema: @@ -14382,73 +15395,119 @@ paths: required: true type: string format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits: + /cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}: get: - summary: Deposits queries all deposits of a single proposal. - operationId: CosmosGovV1Beta1Deposits + summary: Vote queries voted information based on proposalID, voterAddr. + operationId: CosmosGovV1Vote responses: '200': description: A successful response. schema: type: object properties: - deposits: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - description: >- - Deposit defines an amount deposited by an account address to - an active - - proposal. - pagination: - description: pagination defines the pagination in the response. + vote: + description: vote defines the queried vote. type: object properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + proposal_id: type: string format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. + description: options is the weighted vote options. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + vote. description: >- - QueryDepositsResponse is the response type for the Query/Deposits - RPC method. + QueryVoteResponse is the response type for the Query/Vote RPC + method. default: description: An unexpected error response. schema: @@ -14641,86 +15700,35 @@ paths: required: true type: string format: uint64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: voter + description: voter defines the voter address for the proposals. + in: path + required: true type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}: + /cosmos/gov/v1beta1/params/{params_type}: get: - summary: >- - Deposit queries single deposit information based proposalID, - depositAddr. - operationId: CosmosGovV1Beta1Deposit + summary: Params queries all parameters of the gov module. + operationId: CosmosGovV1Beta1Params responses: '200': description: A successful response. schema: type: object properties: - deposit: - description: deposit defines the requested deposit. + voting_params: + description: voting_params defines the parameters related to voting. type: object properties: - proposal_id: - type: string - format: uint64 - depositor: + voting_period: type: string - amount: + description: Duration of the voting period. + deposit_params: + description: deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: type: array items: type: object @@ -14737,233 +15745,43 @@ paths: custom method signatures required by gogoproto. - description: >- - QueryDepositResponse is the response type for the Query/Deposit - RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. + Initial value: 2 - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true - type: string - format: uint64 - - name: depositor - description: depositor defines the deposit addresses from the proposals. - in: path - required: true - type: string - tags: - - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/tally: - get: - summary: TallyResult queries the tally of a proposal vote. - operationId: CosmosGovV1Beta1TallyResult - responses: - '200': - description: A successful response. - schema: - type: object - properties: - tally: - description: tally defines the requested tally. + months. + tally_params: + description: tally_params defines the parameters related to tally. type: object properties: - 'yes': - type: string - abstain: + quorum: type: string - 'no': + format: byte + description: >- + Minimum percentage of total stake needed to vote for a + result to be + + considered valid. + threshold: type: string - no_with_veto: + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. + Default value: 0.5. + veto_threshold: type: string + format: byte + description: >- + Minimum value of Veto votes to Total votes ratio for + proposal to be + + vetoed. Default value: 1/3. description: >- - QueryTallyResultResponse is the response type for the Query/Tally - RPC method. + QueryParamsResponse is the response type for the Query/Params RPC + method. default: description: An unexpected error response. schema: @@ -15150,25 +15968,28 @@ paths: "value": "1.212s" } parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. + - name: params_type + description: >- + params_type defines which parameters to query for, can be one of + "voting", + + "tallying" or "deposit". in: path required: true type: string - format: uint64 tags: - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/votes: + /cosmos/gov/v1beta1/proposals: get: - summary: Votes queries votes of a given proposal. - operationId: CosmosGovV1Beta1Votes + summary: Proposals queries all proposals based on given status. + operationId: CosmosGovV1Beta1Proposals responses: '200': description: A successful response. schema: type: object properties: - votes: + proposals: type: array items: type: object @@ -15176,64 +15997,149 @@ paths: proposal_id: type: string format: uint64 - voter: + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. type: string - option: + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: description: >- - Deprecated: Prefer to use `options` instead. This field - is set in queries + final_tally_result is the final tally result of the + proposal. When - if and only if `len(options) == 1` and that option has - weight 1. In all + querying a proposal via gRPC, this field is not + populated until the - other cases, this field will default to - VOTE_OPTION_UNSPECIFIED. + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: >- + abstain is the number of abstain votes on a + proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on + a proposal. + submit_time: type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: type: array items: type: object properties: - option: + denom: type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: + amount: type: string description: >- - WeightedVoteOption defines a unit of vote for vote - split. + Coin defines a token with a denomination and an + amount. - Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' - description: >- - Vote defines a vote on a governance proposal. + NOTE: The amount field is an Int which implements the + custom method - A Vote consists of a proposal ID, the voter, and the vote - option. - description: votes defined the queried votes. + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: >- + Proposal defines the core field members of a governance + proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -15254,7 +16160,9 @@ paths: was set, its value is undefined otherwise description: >- - QueryVotesResponse is the response type for the Query/Votes RPC + QueryProposalsResponse is the response type for the + Query/Proposals RPC + method. default: description: An unexpected error response. @@ -15442,12 +16350,42 @@ paths: "value": "1.212s" } parameters: - - name: proposal_id - description: proposal_id defines the unique id of the proposal. - in: path - required: true + - name: proposal_status + description: |- + proposal_status defines the status of the proposals. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + in: query + required: false + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + - name: voter + description: voter defines the voter address for the proposals. + in: query + required: false + type: string + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: query + required: false type: string - format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -15506,98 +16444,184 @@ paths: type: boolean tags: - Query - /cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}: + /cosmos/gov/v1beta1/proposals/{proposal_id}: get: - summary: Vote queries voted information based on proposalID, voterAddr. - operationId: CosmosGovV1Beta1Vote + summary: Proposal queries proposal details based on ProposalID. + operationId: CosmosGovV1Beta1Proposal responses: '200': description: A successful response. schema: type: object properties: - vote: - description: vote defined the queried vote. + proposal: type: object properties: proposal_id: type: string format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is - set in queries + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized - if and only if `len(options) == 1` and that option has - weight 1. In all + protocol buffer message. This string must contain at + least - other cases, this field will default to - VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: - type: array - items: - type: object - properties: - option: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a - given governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: - type: string - description: >- - WeightedVoteOption defines a unit of vote for vote - split. + one "/" character. The last segment of the URL's path + must represent + the fully qualified name of the type (as in - Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' - description: >- - QueryVoteResponse is the response type for the Query/Vote RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the + proposal. When + + querying a proposal via gRPC, this field is not populated + until the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: >- + voting_start_time is the starting time to vote on a + proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: >- + Proposal defines the core field members of a governance + proposal. + description: >- + QueryProposalResponse is the response type for the Query/Proposal + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized protocol buffer message. This string must contain at least @@ -15770,165 +16794,79 @@ paths: required: true type: string format: uint64 - - name: voter - description: voter defines the voter address for the proposals. - in: path - required: true - type: string tags: - Query - /cosmos/mint/v1beta1/annual_provisions: + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits: get: - summary: AnnualProvisions current minting annual provisions value. - operationId: CosmosMintV1Beta1AnnualProvisions + summary: Deposits queries all deposits of a single proposal. + operationId: CosmosGovV1Beta1Deposits responses: '200': description: A successful response. schema: type: object properties: - annual_provisions: - type: string - format: byte - description: >- - annual_provisions is the current minting annual provisions - value. - description: |- - QueryAnnualProvisionsResponse is the response type for the - Query/AnnualProvisions RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: + deposits: type: array items: type: object properties: - '@type': + proposal_id: type: string - additionalProperties: {} - tags: - - Query - /cosmos/mint/v1beta1/inflation: - get: - summary: Inflation returns the current minting inflation value. - operationId: CosmosMintV1Beta1Inflation - responses: - '200': - description: A successful response. - schema: - type: object - properties: - inflation: - type: string - format: byte - description: inflation is the current minting inflation value. - description: >- - QueryInflationResponse is the response type for the - Query/Inflation RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: type: string - additionalProperties: {} - tags: - - Query - /cosmos/mint/v1beta1/params: - get: - summary: Params returns the total set of minting parameters. - operationId: CosmosMintV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params defines the parameters of the module. + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. + description: deposits defines the requested deposits. + pagination: + description: pagination defines the pagination in the response. type: object properties: - mint_denom: - type: string - title: type of coin to mint - inflation_rate_change: - type: string - title: maximum annual change in inflation rate - inflation_max: - type: string - title: maximum inflation rate - inflation_min: - type: string - title: minimum inflation rate - goal_bonded: + next_key: type: string - title: goal of percent bonded atoms - blocks_per_year: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string format: uint64 - title: expected blocks per year + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/nft/v1beta1/balance/{owner}/{class_id}: - get: - summary: >- - Balance queries the number of NFTs of a given class owned by the owner, - same as balanceOf in ERC721 - operationId: CosmosNftV1Beta1Balance - responses: - '200': - description: A successful response. - schema: - type: object - properties: - amount: - type: string - format: uint64 - title: >- - QueryBalanceResponse is the response type for the Query/Balance - RPC method + QueryDepositsResponse is the response type for the Query/Deposits + RPC method. default: description: An unexpected error response. schema: @@ -16115,322 +17053,165 @@ paths: "value": "1.212s" } parameters: - - name: owner + - name: proposal_id + description: proposal_id defines the unique id of the proposal. in: path required: true type: string - - name: class_id - in: path - required: true + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/nft/v1beta1/classes: + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}: get: - summary: Classes queries all NFT classes - operationId: CosmosNftV1Beta1Classes + summary: >- + Deposit queries single deposit information based proposalID, + depositAddr. + operationId: CosmosGovV1Beta1Deposit responses: '200': description: A successful response. schema: type: object properties: - classes: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: >- + depositor defines the deposit addresses from the + proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT - classification, similar to the contract address of - ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT - classification. Optional - symbol: - type: string - title: >- - symbol is an abbreviated name for nft classification. - Optional - description: - type: string - title: >- - description is a brief description of nft - classification. Optional - uri: - type: string - title: >- - uri for the class metadata stored off chain. It can - define schema for Class and NFT `Data` attributes. - Optional - uri_hash: + '@type': type: string - title: >- - uri_hash is a hash of the document pointed by uri. - Optional - data: - title: >- - data is the app specific metadata of the NFT class. - Optional - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's - path must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be in + a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QueryClassesResponse is the response type for the Query/Classes - RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] @@ -16568,287 +17349,50 @@ paths: "value": "1.212s" } parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true type: string format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: depositor + description: depositor defines the deposit addresses from the proposals. + in: path + required: true type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /cosmos/nft/v1beta1/classes/{class_id}: + /cosmos/gov/v1beta1/proposals/{proposal_id}/tally: get: - summary: Class queries an NFT class based on its id - operationId: CosmosNftV1Beta1Class + summary: TallyResult queries the tally of a proposal vote. + operationId: CosmosGovV1Beta1TallyResult responses: '200': description: A successful response. schema: type: object properties: - class: + tally: + description: tally defines the requested tally. type: object properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT - classification, similar to the contract address of ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT - classification. Optional - symbol: + 'yes': type: string - title: >- - symbol is an abbreviated name for nft classification. - Optional - description: + description: yes is the number of yes votes on a proposal. + abstain: type: string - title: >- - description is a brief description of nft classification. - Optional - uri: + description: abstain is the number of abstain votes on a proposal. + 'no': type: string - title: >- - uri for the class metadata stored off chain. It can define - schema for Class and NFT `Data` attributes. Optional - uri_hash: + description: no is the number of no votes on a proposal. + no_with_veto: type: string - title: >- - uri_hash is a hash of the document pointed by uri. - Optional - data: - title: >- - data is the app specific metadata of the NFT class. - Optional - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. - title: >- - QueryClassResponse is the response type for the Query/Class RPC - method + no_with_veto is the number of no with veto votes on a + proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally + RPC method. default: description: An unexpected error response. schema: @@ -17035,223 +17579,94 @@ paths: "value": "1.212s" } parameters: - - name: class_id + - name: proposal_id + description: proposal_id defines the unique id of the proposal. in: path required: true type: string + format: uint64 tags: - Query - /cosmos/nft/v1beta1/nfts: + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes: get: - summary: >- - NFTs queries all NFTs of a given class or owner,choose at least one of - the two, similar to tokenByIndex in - - ERC721Enumerable - operationId: CosmosNftV1Beta1NFTs + summary: Votes queries votes of a given proposal. + operationId: CosmosGovV1Beta1Votes responses: '200': description: A successful response. schema: type: object properties: - nfts: + votes: type: array items: type: object properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the - contract address of ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: + proposal_id: type: string - title: uri for the NFT metadata stored off chain - uri_hash: + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} + description: voter is the voter address of the proposal. + option: description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Deprecated: Prefer to use `options` instead. This field + is set in queries - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + if and only if `len(options) == 1` and that option has + weight 1. In all - If the embedded message type is well-known and has a - custom JSON + other cases, this field will default to + VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. - representation, that representation will be embedded - adding a field - `value` which holds the custom JSON in addition to the - `@type` + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. - field. Example (for message - [google.protobuf.Duration][]): + Since: cosmos-sdk 0.43 + description: >- + Vote defines a vote on a governance proposal. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. + A Vote consists of a proposal ID, the voter, and the vote + option. + description: votes defines the queried votes. pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -17269,19 +17684,9 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QueryNFTsResponse is the response type for the Query/NFTs RPC - methods + description: >- + QueryVotesResponse is the response type for the Query/Votes RPC + method. default: description: An unexpected error response. schema: @@ -17468,14 +17873,12 @@ paths: "value": "1.212s" } parameters: - - name: class_id - in: query - required: false - type: string - - name: owner - in: query - required: false + - name: proposal_id + description: proposal_id defines the unique id of the proposal. + in: path + required: true type: string + format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -17534,209 +17937,80 @@ paths: type: boolean tags: - Query - /cosmos/nft/v1beta1/nfts/{class_id}/{id}: + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}: get: - summary: NFT queries an NFT based on its class and id. - operationId: CosmosNftV1Beta1NFT + summary: Vote queries voted information based on proposalID, voterAddr. + operationId: CosmosGovV1Beta1Vote responses: '200': description: A successful response. schema: type: object properties: - nft: + vote: + description: vote defines the queried vote. type: object properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the contract - address of ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: + proposal_id: type: string - title: uri for the NFT metadata stored off chain - uri_hash: + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} + description: voter is the voter address of the proposal. + option: description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Deprecated: Prefer to use `options` instead. This field is + set in queries - If the embedded message type is well-known and has a - custom JSON + if and only if `len(options) == 1` and that option has + weight 1. In all - representation, that representation will be embedded - adding a field + other cases, this field will default to + VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not + contain duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: >- + weight is the vote weight associated with the vote + option. + description: >- + WeightedVoteOption defines a unit of vote for vote + split. - `value` which holds the custom JSON in addition to the - `@type` - field. Example (for message [google.protobuf.Duration][]): + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - title: QueryNFTResponse is the response type for the Query/NFT RPC method + Since: cosmos-sdk 0.43 + description: >- + QueryVoteResponse is the response type for the Query/Vote RPC + method. default: description: An unexpected error response. schema: @@ -17923,34 +18197,71 @@ paths: "value": "1.212s" } parameters: - - name: class_id + - name: proposal_id + description: proposal_id defines the unique id of the proposal. in: path required: true type: string - - name: id + format: uint64 + - name: voter + description: voter defines the voter address for the proposals. in: path required: true type: string tags: - Query - /cosmos/nft/v1beta1/owner/{class_id}/{id}: + /cosmos/group/v1/group_info/{group_id}: get: - summary: >- - Owner queries the owner of the NFT based on its class and id, same as - ownerOf in ERC721 - operationId: CosmosNftV1Beta1Owner + summary: GroupInfo queries group info based on group id. + operationId: CosmosGroupV1GroupInfo responses: '200': description: A successful response. schema: type: object properties: - owner: - type: string - title: >- - QueryOwnerResponse is the response type for the Query/Owner RPC - method - default: + info: + description: info is the GroupInfo of the group. + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership + structure that + + would break existing proposals. Whenever any members + weight is changed, + + or any member is added or removed this version is + incremented and will + + cause proposals based on older versions of this group to + fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group was + created. + description: QueryGroupInfoResponse is the Query/GroupInfo response type. + default: description: An unexpected error response. schema: type: object @@ -18136,34 +18447,82 @@ paths: "value": "1.212s" } parameters: - - name: class_id - in: path - required: true - type: string - - name: id + - name: group_id + description: group_id is the unique ID of the group. in: path required: true type: string + format: uint64 tags: - Query - /cosmos/nft/v1beta1/supply/{class_id}: + /cosmos/group/v1/group_members/{group_id}: get: - summary: >- - Supply queries the number of NFTs from the given class, same as - totalSupply of ERC721. - operationId: CosmosNftV1Beta1Supply + summary: GroupMembers queries members of a group by group id. + operationId: CosmosGroupV1GroupMembers responses: '200': description: A successful response. schema: type: object properties: - amount: - type: string - format: uint64 - title: >- - QuerySupplyResponse is the response type for the Query/Supply RPC - method + members: + type: array + items: + type: object + properties: + group_id: + type: string + format: uint64 + description: group_id is the unique ID of the group. + member: + description: member is the member data. + type: object + properties: + address: + type: string + description: address is the member's account address. + weight: + type: string + description: >- + weight is the member's voting weight that should be + greater than 0. + metadata: + type: string + description: >- + metadata is any arbitrary metadata attached to the + member. + added_at: + type: string + format: date-time + description: >- + added_at is a timestamp specifying when a member was + added. + description: >- + GroupMember represents the relationship between a group and + a member. + description: members are the members of the group with given group_id. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGroupMembersResponse is the Query/GroupMembersResponse + response type. default: description: An unexpected error response. schema: @@ -18350,245 +18709,192 @@ paths: "value": "1.212s" } parameters: - - name: class_id + - name: group_id + description: group_id is the unique ID of the group. in: path required: true type: string - tags: - - Query - /cosmos/params/v1beta1/params: - get: - summary: |- - Params queries a specific parameter of a module, given its subspace and - key. - operationId: CosmosParamsV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - param: - description: param defines the queried parameter. - type: object - properties: - subspace: - type: string - key: - type: string - value: - type: string - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: subspace - description: subspace defines the module to query the parameter for. + format: uint64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. in: query required: false type: string - - name: key - description: key defines the key of the parameter in the subspace. + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. in: query required: false type: string - tags: - - Query - /cosmos/params/v1beta1/subspaces: - get: - summary: >- - Subspaces queries for all registered subspaces and all keys for a - subspace. - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosParamsV1Beta1Subspaces - responses: - '200': - description: A successful response. - schema: - type: object - properties: - subspaces: - type: array - items: - type: object - properties: - subspace: - type: string - keys: - type: array - items: - type: string - description: >- - Subspace defines a parameter subspace name and all the keys - that exist for + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - the subspace. + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + a count of the total number of items available for pagination in + UIs. - Since: cosmos-sdk 0.46 - description: >- - QuerySubspacesResponse defines the response types for querying for - all + count_total is only respected when offset is used. It is ignored + when key - registered subspaces and all keys for a subspace. + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - Since: cosmos-sdk 0.46 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /cosmos/slashing/v1beta1/params: - get: - summary: Params queries the parameters of slashing module - operationId: CosmosSlashingV1Beta1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - signed_blocks_window: - type: string - format: int64 - min_signed_per_window: - type: string - format: byte - downtime_jail_duration: - type: string - slash_fraction_double_sign: - type: string - format: byte - slash_fraction_downtime: - type: string - format: byte - description: >- - Params represents the parameters used for by the slashing - module. - title: >- - QueryParamsResponse is the response type for the Query/Params RPC - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/slashing/v1beta1/signing_infos: + /cosmos/group/v1/group_policies_by_admin/{admin}: get: - summary: SigningInfos queries signing info of all validators - operationId: CosmosSlashingV1Beta1SigningInfos + summary: GroupPoliciesByAdmin queries group policies by admin address. + operationId: CosmosGroupV1GroupPoliciesByAdmin responses: '200': description: A successful response. schema: type: object properties: - info: + group_policies: type: array items: type: object properties: address: type: string - start_height: + description: address is the account address of group policy. + group_id: type: string - format: int64 - title: >- - Height at which validator was first a candidate OR was - unjailed - index_offset: + format: uint64 + description: group_id is the unique ID of the group. + admin: type: string - format: int64 - description: >- - Index which is incremented each time the validator was a - bonded + description: admin is the account address of the group admin. + metadata: + type: string + title: >- + metadata is any arbitrary metadata attached to the group + policy. - in a block and may have signed a precommit or not. This - in conjunction with the + the recommended format of the metadata is to be found + here: - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + version: type: string - format: date-time + format: uint64 description: >- - Timestamp until which the validator is jailed due to - liveness downtime. - tombstoned: - type: boolean + version is used to track changes to a group's + GroupPolicyInfo structure that + + would create a different result on a running proposal. + decision_policy: description: >- - Whether or not a validator has been tombstoned (killed - out of validator set). It is set + decision_policy specifies the group policy's decision + policy. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - once the validator commits an equivocation or for any - other configured misbehiavor. - missed_blocks_counter: + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + created_at: type: string - format: int64 + format: date-time description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. + created_at is a timestamp specifying when a group policy + was created. description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their - - liveness activity. - title: info is the signing info of all validators + GroupPolicyInfo represents the high-level on-chain + information for a group policy. + description: >- + group_policies are the group policies info with provided + admin. pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -18606,21 +18912,9 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySigningInfosResponse is the response type for the - Query/SigningInfos RPC - - method + description: >- + QueryGroupPoliciesByAdminResponse is the + Query/GroupPoliciesByAdmin response type. default: description: An unexpected error response. schema: @@ -18638,290 +18932,32 @@ paths: properties: '@type': type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - It is less efficient than using key. Only one of offset or key - should + protocol buffer message. This string must contain at + least - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + one "/" character. The last segment of the URL's path + must represent - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + the fully qualified name of the type (as in - a count of the total number of items available for pagination in - UIs. + `path/google.protobuf.Duration`). The name should be in + a canonical form - count_total is only respected when offset is used. It is ignored - when key + (e.g., leading "." is not accepted). - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + In practice, teams usually precompile into the binary + all types that they - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /cosmos/slashing/v1beta1/signing_infos/{cons_address}: - get: - summary: SigningInfo queries the signing info of given cons address - operationId: CosmosSlashingV1Beta1SigningInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - val_signing_info: - title: >- - val_signing_info is the signing info of requested val cons - address - type: object - properties: - address: - type: string - start_height: - type: string - format: int64 - title: >- - Height at which validator was first a candidate OR was - unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a - bonded + expect it to use in the context of Any. However, for + URLs which use the - in a block and may have signed a precommit or not. This in - conjunction with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to - liveness downtime. - tombstoned: - type: boolean - description: >- - Whether or not a validator has been tombstoned (killed out - of validator set). It is set - - once the validator commits an equivocation or for any - other configured misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their - - liveness activity. - title: >- - QuerySigningInfoResponse is the response type for the - Query/SigningInfo RPC - - method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: cons_address - description: cons_address is the address to query signing info of - in: path - required: true - type: string - tags: - - Query - /cosmos/staking/v1beta1/delegations/{delegator_addr}: - get: - summary: >- - DelegatorDelegations queries all delegations of a given delegator - address. - operationId: CosmosStakingV1Beta1DelegatorDelegations - responses: - '200': - description: A successful response. - schema: - type: object - properties: - delegation_responses: - type: array - items: - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of - the validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an - account. It is - - owned by one delegator, and is associated with the - voting power of one - - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - description: >- - DelegationResponse is equivalent to Delegation except that - it contains a - - balance in addition to shares which is more suitable for - client responses. - description: >- - delegation_responses defines all the delegations' info of a - delegator. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - QueryDelegatorDelegationsResponse is response type for the - Query/DelegatorDelegations RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type server that maps type URLs to message definitions as follows: @@ -19065,8 +19101,8 @@ paths: "value": "1.212s" } parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. + - name: admin + description: admin is the admin address of the group policy. in: path required: true type: string @@ -19128,132 +19164,126 @@ paths: type: boolean tags: - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: + /cosmos/group/v1/group_policies_by_group/{group_id}: get: - summary: Redelegations queries redelegations of given address. - operationId: CosmosStakingV1Beta1Redelegations + summary: GroupPoliciesByGroup queries group policies by group id. + operationId: CosmosGroupV1GroupPoliciesByGroup responses: '200': description: A successful response. schema: type: object properties: - redelegation_responses: + group_policies: type: array items: type: object properties: - redelegation: + address: + type: string + description: address is the account address of group policy. + group_id: + type: string + format: uint64 + description: group_id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group admin. + metadata: + type: string + title: >- + metadata is any arbitrary metadata attached to the group + policy. + + the recommended format of the metadata is to be found + here: + + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + version: + type: string + format: uint64 + description: >- + version is used to track changes to a group's + GroupPolicyInfo structure that + + would create a different result on a running proposal. + decision_policy: + description: >- + decision_policy specifies the group policy's decision + policy. type: object properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation - source operator address. - validator_dst_address: + '@type': type: string description: >- - validator_dst_address is the validator redelegation - destination operator address. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for - redelegation completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance - when redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of - destination-validator shares created by - redelegation. - description: >- - RedelegationEntry defines a redelegation object - with relevant metadata. - description: |- - entries are the redelegation entries. + A URL/resource name that uniquely identifies the + type of the serialized - redelegation entries - description: >- - Redelegation contains the list of a particular - delegator's redelegating bonds + protocol buffer message. This string must contain at + least - from a particular source validator to a particular - destination validator. - entries: - type: array - items: - type: object - properties: - redelegation_entry: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for - redelegation completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance - when redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of - destination-validator shares created by - redelegation. - description: >- - RedelegationEntry defines a redelegation object - with relevant metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a - RedelegationEntry except that it + one "/" character. The last segment of the URL's + path must represent - contains a balance in addition to shares which is more - suitable for client + the fully qualified name of the type (as in - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except - that its entries + `path/google.protobuf.Duration`). The name should be + in a canonical form - contain a balance in addition to shares which is more - suitable for client + (e.g., leading "." is not accepted). - responses. + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group policy + was created. + description: >- + GroupPolicyInfo represents the high-level on-chain + information for a group policy. + description: >- + group_policies are the group policies info associated with the + provided group. pagination: description: pagination defines the pagination in the response. type: object @@ -19274,10 +19304,8 @@ paths: was set, its value is undefined otherwise description: >- - QueryRedelegationsResponse is response type for the - Query/Redelegations RPC - - method. + QueryGroupPoliciesByGroupResponse is the + Query/GroupPoliciesByGroup response type. default: description: An unexpected error response. schema: @@ -19464,21 +19492,12 @@ paths: "value": "1.212s" } parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. + - name: group_id + description: group_id is the unique ID of the group policy's group. in: path required: true type: string - - name: src_validator_addr - description: src_validator_addr defines the validator address to redelegate from. - in: query - required: false - type: string - - name: dst_validator_addr - description: dst_validator_addr defines the validator address to redelegate to. - in: query - required: false - type: string + format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -19537,134 +19556,160 @@ paths: type: boolean tags: - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations: + /cosmos/group/v1/group_policy_info/{address}: get: summary: >- - DelegatorUnbondingDelegations queries all unbonding delegations of a - given - - delegator address. - operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations + GroupPolicyInfo queries group policy info based on account address of + group policy. + operationId: CosmosGroupV1GroupPolicyInfo responses: '200': description: A successful response. schema: type: object properties: - unbonding_responses: - type: array - items: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time is the unix time for unbonding - completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially - scheduled to receive at completion. - balance: - type: string - description: >- - balance defines the tokens to receive at - completion. - description: >- - UnbondingDelegationEntry defines an unbonding object - with relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's - unbonding bonds - - for a single validator in an time-ordered list. - pagination: - description: pagination defines the pagination in the response. + info: + description: info is the GroupPolicyInfo of the group policy. type: object properties: - next_key: + address: type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + description: address is the account address of group policy. + group_id: type: string format: uint64 + description: group_id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group admin. + metadata: + type: string title: >- - total is total number of results available if - PageRequest.count_total + metadata is any arbitrary metadata attached to the group + policy. - was set, its value is undefined otherwise - description: >- - QueryUnbondingDelegatorDelegationsResponse is response type for - the + the recommended format of the metadata is to be found + here: - Query/UnbondingDelegatorDelegations RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + version: + type: string + format: uint64 + description: >- + version is used to track changes to a group's + GroupPolicyInfo structure that - protocol buffer message. This string must contain at - least + would create a different result on a running proposal. + decision_policy: + description: >- + decision_policy specifies the group policy's decision + policy. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized - one "/" character. The last segment of the URL's path - must represent + protocol buffer message. This string must contain at + least - the fully qualified name of the type (as in + one "/" character. The last segment of the URL's path + must represent - `path/google.protobuf.Duration`). The name should be in - a canonical form + the fully qualified name of the type (as in - (e.g., leading "." is not accepted). + `path/google.protobuf.Duration`). The name should be + in a canonical form + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group policy + was created. + description: >- + QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response + type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for @@ -19815,285 +19860,69 @@ paths: "value": "1.212s" } parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. + - name: address + description: address is the account address of the group policy. in: path required: true type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators: + /cosmos/group/v1/groups: get: - summary: |- - DelegatorValidators queries all validators info for given delegator - address. - operationId: CosmosStakingV1Beta1DelegatorValidators + summary: Groups queries all groups in state. + description: 'Since: cosmos-sdk 0.47.1' + operationId: CosmosGroupV1Groups responses: '200': description: A successful response. schema: type: object properties: - validators: + groups: type: array items: type: object properties: - operator_address: + id: type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed - from bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). + format: uint64 + description: id is the unique ID of the group. + admin: type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: + description: admin is the account address of the group's admin. + metadata: type: string description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: + metadata is any arbitrary metadata to attached to the + group. + version: type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: + format: uint64 + title: >- + version is used to track changes to a group's membership + structure that + + would break existing proposals. Whenever any members + weight is changed, + + or any member is added or removed this version is + incremented and will + + cause proposals based on older versions of this group to + fail + total_weight: type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: + description: total_weight is the sum of the group members' weights. + created_at: type: string format: date-time description: >- - unbonding_time defines, if unbonding, the min time for - the validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission - rates to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to - delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 + created_at is a timestamp specifying when a group was + created. description: >- - Validator defines a validator, together with the total - amount of the - - Validator's bond shares and their exchange rate to coins. - Slashing results in - - a decrease in the exchange rate, allowing correct - calculation of future - - undelegations without iterating over delegators. When coins - are delegated to - - this validator, the validator is credited with a delegation - whose number of - - bond shares is based on the amount of coins delegated - divided by the current - - exchange rate. Voting power can be calculated as total - bonded shares - - multiplied by exchange rate. - description: validators defines the validators' info of a delegator. + GroupInfo represents the high-level on-chain information for + a group. + description: '`groups` is all the groups present in state.' pagination: description: pagination defines the pagination in the response. type: object @@ -20114,8 +19943,9 @@ paths: was set, its value is undefined otherwise description: |- - QueryDelegatorValidatorsResponse is response type for the - Query/DelegatorValidators RPC method. + QueryGroupsResponse is the Query/Groups response type. + + Since: cosmos-sdk 0.47.1 default: description: An unexpected error response. schema: @@ -20302,11 +20132,6 @@ paths: "value": "1.212s" } parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true - type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -20365,199 +20190,409 @@ paths: type: boolean tags: - Query - /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}: + /cosmos/group/v1/groups_by_admin/{admin}: get: - summary: |- - DelegatorValidator queries validator info for given delegator validator - pair. - operationId: CosmosStakingV1Beta1DelegatorValidator + summary: GroupsByAdmin queries groups by admin address. + operationId: CosmosGroupV1GroupsByAdmin responses: '200': description: A successful response. schema: type: object properties: - validator: - description: validator defines the validator info. + groups: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership + structure that + + would break existing proposals. Whenever any members + weight is changed, + + or any member is added or removed this version is + incremented and will + + cause proposals based on older versions of this group to + fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group was + created. + description: >- + GroupInfo represents the high-level on-chain information for + a group. + description: groups are the groups info with the provided admin. + pagination: + description: pagination defines the pagination in the response. type: object properties: - operator_address: + next_key: type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - protocol buffer message. This string must contain at - least + was set, its value is undefined otherwise + description: >- + QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse + response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - one "/" character. The last segment of the URL's path - must represent + protocol buffer message. This string must contain at + least - the fully qualified name of the type (as in + one "/" character. The last segment of the URL's path + must represent - `path/google.protobuf.Duration`). The name should be - in a canonical form + the fully qualified name of the type (as in - (e.g., leading "." is not accepted). + `path/google.protobuf.Duration`). The name should be in + a canonical form + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they - expect it to use in the context of Any. However, for - URLs which use the + In practice, teams usually precompile into the binary + all types that they - scheme `http`, `https`, or no scheme, one can - optionally set up a type + expect it to use in the context of Any. However, for + URLs which use the - server that maps type URLs to message definitions as - follows: + scheme `http`, `https`, or no scheme, one can optionally + set up a type + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * If no scheme is provided, `https` is assumed. - Note: this functionality is not currently available in - the official + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - protobuf release, and it is not used for type URLs - beginning with + Note: this functionality is not currently available in + the official - type.googleapis.com. + protobuf release, and it is not used for type URLs + beginning with + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from - bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: admin + description: admin is the account address of a group's admin. + in: path + required: true + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/group/v1/groups_by_member/{address}: + get: + summary: GroupsByMember queries groups by member address. + operationId: CosmosGroupV1GroupsByMember + responses: + '200': + description: A successful response. + schema: + type: object + properties: + groups: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: >- + metadata is any arbitrary metadata to attached to the + group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership + structure that + + would break existing proposals. Whenever any members + weight is changed, + + or any member is added or removed this version is + incremented and will + + cause proposals based on older versions of this group to + fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group was + created. + description: >- + GroupInfo represents the high-level on-chain information for + a group. + description: groups are the groups info with the provided group member. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates - to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, - as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - Since: cosmos-sdk 0.46 - description: |- - QueryDelegatorValidatorResponse response type for the - Query/DelegatorValidator RPC method. + was set, its value is undefined otherwise + description: >- + QueryGroupsByMemberResponse is the Query/GroupsByMember response + type. default: description: An unexpected error response. schema: @@ -20744,329 +20779,390 @@ paths: "value": "1.212s" } parameters: - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. + - name: address + description: address is the group member address. in: path required: true type: string - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/staking/v1beta1/historical_info/{height}: + /cosmos/group/v1/proposal/{proposal_id}: get: - summary: HistoricalInfo queries the historical info for given height. - operationId: CosmosStakingV1Beta1HistoricalInfo + summary: Proposal queries a proposal based on proposal id. + operationId: CosmosGroupV1Proposal responses: '200': description: A successful response. schema: type: object properties: - hist: - description: hist defines the historical info at the given height. + proposal: + description: proposal is the proposal info. type: object properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, + id: + type: string + format: uint64 + description: id is the unique id of the proposal. + group_policy_address: + type: string + description: >- + group_policy_address is the account address of group + policy. + metadata: + type: string + title: >- + metadata is any arbitrary metadata attached to the + proposal. - including all blockchain data structures and the rules - of the application's + the recommended format of the metadata is to be found + here: - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: + https://docs.cosmos.network/v0.47/modules/group#proposal-4 + proposers: + type: array + items: + type: string + description: proposers are the account addresses of the proposers. + submit_time: + type: string + format: date-time + description: >- + submit_time is a timestamp specifying when a proposal was + submitted. + group_version: + type: string + format: uint64 + description: >- + group_version tracks the version of the group at proposal + submission. + + This field is here for informational purposes only. + group_policy_version: + type: string + format: uint64 + description: >- + group_policy_version tracks the version of the group + policy at proposal submission. + + When a decision policy is changed, existing proposals from + previous policy + + versions will become invalid with the `ABORTED` status. + + This field is here for informational purposes only. + status: + description: >- + status represents the high level position in the life + cycle of the proposal. Initial value is Submitted. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_SUBMITTED + - PROPOSAL_STATUS_ACCEPTED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_ABORTED + - PROPOSAL_STATUS_WITHDRAWN + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result contains the sums of all weighted votes + for this + + proposal for each vote option. It is empty at submission, + and only + + populated after tallying, at voting period end or at + proposal execution, + + whichever happens first. + type: object + properties: + yes_count: type: string - format: byte - title: state after txs from the previous block - last_results_hash: + description: yes_count is the weighted sum of yes votes. + abstain_count: type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: + description: abstain_count is the weighted sum of abstainers. + no_count: type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: + description: no_count is the weighted sum of no votes. + no_with_veto_count: type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - valset: + description: no_with_veto_count is the weighted sum of veto. + voting_period_end: + type: string + format: date-time + description: >- + voting_period_end is the timestamp before which voting + must be done. + + Unless a successful MsgExec is called before (to execute a + proposal whose + + tally is successful before the voting period ends), + tallying will be done + + at this point, and the `final_tally_result`and `status` + fields will be + + accordingly updated. + executor_result: + description: >- + executor_result is the final result of the proposal + execution. Initial value is NotRun. + type: string + enum: + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN + - PROPOSAL_EXECUTOR_RESULT_SUCCESS + - PROPOSAL_EXECUTOR_RESULT_FAILURE + default: PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + messages: type: array items: type: object properties: - operator_address: + '@type': type: string description: >- - operator_address defines the address of the - validator's operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + A URL/resource name that uniquely identifies the + type of the serialized - protocol buffer message. This string must - contain at least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's - path must represent + one "/" character. The last segment of the URL's + path must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name - should be in a canonical form + `path/google.protobuf.Duration`). The name should be + in a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they + In practice, teams usually precompile into the + binary all types that they - expect it to use in the context of Any. However, - for URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can + optionally set up a type - server that maps type URLs to message - definitions as follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently - available in the official + Note: this functionality is not currently available + in the official - protobuf release, and it is not used for type - URLs beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be + Schemes other than `http`, `https` (or the empty + scheme) might be - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed - from bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature - (ex. UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height - at which this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time - for the validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission - rates to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to - delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a - fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate - was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + URL that describes the type of the serialized message. - Since: cosmos-sdk 0.46 - description: >- - Validator defines a validator, together with the total - amount of the - Validator's bond shares and their exchange rate to - coins. Slashing results in + Protobuf library provides support to pack/unpack Any + values in the form - a decrease in the exchange rate, allowing correct - calculation of future + of utility functions or additional generated methods of + the Any type. - undelegations without iterating over delegators. When - coins are delegated to - this validator, the validator is credited with a - delegation whose number of + Example 1: Pack and unpack a message in C++. - bond shares is based on the amount of coins delegated - divided by the current + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - exchange rate. Voting power can be calculated as total - bonded shares + Example 2: Pack and unpack a message in Java. - multiplied by exchange rate. - description: >- - QueryHistoricalInfoResponse is response type for the - Query/HistoricalInfo RPC + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - method. + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of `sdk.Msg`s that will be executed if + the proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + description: QueryProposalResponse is the Query/Proposal response type. default: description: An unexpected error response. schema: @@ -21253,58 +21349,51 @@ paths: "value": "1.212s" } parameters: - - name: height - description: height defines at which height to query the historical info. + - name: proposal_id + description: proposal_id is the unique ID of a proposal. in: path required: true type: string - format: int64 + format: uint64 tags: - Query - /cosmos/staking/v1beta1/params: + /cosmos/group/v1/proposals/{proposal_id}/tally: get: - summary: Parameters queries the staking parameters. - operationId: CosmosStakingV1Beta1Params + summary: >- + TallyResult returns the tally result of a proposal. If the proposal is + + still in voting period, then this query computes the current tally + state, + + which might not be final. On the other hand, if the proposal is final, + + then it simply returns the `final_tally_result` state stored in the + + proposal itself. + operationId: CosmosGroupV1TallyResult responses: '200': description: A successful response. schema: type: object properties: - params: - description: params holds all the parameters of this module. + tally: + description: tally defines the requested tally. type: object properties: - unbonding_time: + yes_count: type: string - description: unbonding_time is the time duration of unbonding. - max_validators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - max_entries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding - delegation or redelegation (per pair/trio). - historical_entries: - type: integer - format: int64 - description: >- - historical_entries is the number of historical entries to - persist. - bond_denom: + description: yes_count is the weighted sum of yes votes. + abstain_count: type: string - description: bond_denom defines the bondable coin denomination. - min_commission_rate: + description: abstain_count is the weighted sum of abstainers. + no_count: type: string - title: >- - min_commission_rate is the chain-wide minimum commission - rate that a validator can charge their delegators - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. + description: no_count is the weighted sum of no votes. + no_with_veto_count: + type: string + description: no_with_veto_count is the weighted sum of veto. + description: QueryTallyResultResponse is the Query/TallyResult response type. default: description: An unexpected error response. schema: @@ -21490,428 +21579,350 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + parameters: + - name: proposal_id + description: proposal_id is the unique id of a proposal. + in: path + required: true + type: string + format: uint64 tags: - Query - /cosmos/staking/v1beta1/pool: + /cosmos/group/v1/proposals_by_group_policy/{address}: get: - summary: Pool queries the pool info. - operationId: CosmosStakingV1Beta1Pool + summary: >- + ProposalsByGroupPolicy queries proposals based on account address of + group policy. + operationId: CosmosGroupV1ProposalsByGroupPolicy responses: '200': description: A successful response. schema: type: object properties: - pool: - description: pool defines the pool info. - type: object - properties: - not_bonded_tokens: - type: string - bonded_tokens: - type: string - description: QueryPoolResponse is response type for the Query/Pool RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: + proposals: type: array items: type: object properties: - '@type': + id: + type: string + format: uint64 + description: id is the unique id of the proposal. + group_policy_address: type: string description: >- - A URL/resource name that uniquely identifies the type of - the serialized + group_policy_address is the account address of group + policy. + metadata: + type: string + title: >- + metadata is any arbitrary metadata attached to the + proposal. - protocol buffer message. This string must contain at - least + the recommended format of the metadata is to be found + here: - one "/" character. The last segment of the URL's path - must represent + https://docs.cosmos.network/v0.47/modules/group#proposal-4 + proposers: + type: array + items: + type: string + description: proposers are the account addresses of the proposers. + submit_time: + type: string + format: date-time + description: >- + submit_time is a timestamp specifying when a proposal + was submitted. + group_version: + type: string + format: uint64 + description: >- + group_version tracks the version of the group at + proposal submission. - the fully qualified name of the type (as in + This field is here for informational purposes only. + group_policy_version: + type: string + format: uint64 + description: >- + group_policy_version tracks the version of the group + policy at proposal submission. - `path/google.protobuf.Duration`). The name should be in - a canonical form + When a decision policy is changed, existing proposals + from previous policy - (e.g., leading "." is not accepted). + versions will become invalid with the `ABORTED` status. + This field is here for informational purposes only. + status: + description: >- + status represents the high level position in the life + cycle of the proposal. Initial value is Submitted. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_SUBMITTED + - PROPOSAL_STATUS_ACCEPTED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_ABORTED + - PROPOSAL_STATUS_WITHDRAWN + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result contains the sums of all weighted + votes for this - In practice, teams usually precompile into the binary - all types that they + proposal for each vote option. It is empty at + submission, and only - expect it to use in the context of Any. However, for - URLs which use the + populated after tallying, at voting period end or at + proposal execution, - scheme `http`, `https`, or no scheme, one can optionally - set up a type + whichever happens first. + type: object + properties: + yes_count: + type: string + description: yes_count is the weighted sum of yes votes. + abstain_count: + type: string + description: abstain_count is the weighted sum of abstainers. + no_count: + type: string + description: no_count is the weighted sum of no votes. + no_with_veto_count: + type: string + description: no_with_veto_count is the weighted sum of veto. + voting_period_end: + type: string + format: date-time + description: >- + voting_period_end is the timestamp before which voting + must be done. - server that maps type URLs to message definitions as - follows: + Unless a successful MsgExec is called before (to execute + a proposal whose + tally is successful before the voting period ends), + tallying will be done - * If no scheme is provided, `https` is assumed. + at this point, and the `final_tally_result`and `status` + fields will be - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + accordingly updated. + executor_result: + description: >- + executor_result is the final result of the proposal + execution. Initial value is NotRun. + type: string + enum: + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN + - PROPOSAL_EXECUTOR_RESULT_SUCCESS + - PROPOSAL_EXECUTOR_RESULT_FAILURE + default: PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - Note: this functionality is not currently available in - the official + protocol buffer message. This string must contain + at least - protobuf release, and it is not used for type URLs - beginning with + one "/" character. The last segment of the URL's + path must represent - type.googleapis.com. + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should + be in a canonical form - Schemes other than `http`, `https` (or the empty scheme) - might be + (e.g., leading "." is not accepted). - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + In practice, teams usually precompile into the + binary all types that they - Example 2: Pack and unpack a message in Java. + expect it to use in the context of Any. However, + for URLs which use the - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + scheme `http`, `https`, or no scheme, one can + optionally set up a type - Example 3: Pack and unpack a message in Python. + server that maps type URLs to message definitions + as follows: - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + * If no scheme is provided, `https` is assumed. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - The pack methods provided by protobuf library will by - default use + Note: this functionality is not currently + available in the official - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + protobuf release, and it is not used for type URLs + beginning with - methods only use the fully qualified type name after the - last '/' + type.googleapis.com. - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - name "y.z". + Schemes other than `http`, `https` (or the empty + scheme) might be + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + URL that describes the type of the serialized message. - JSON - ==== + Protobuf library provides support to pack/unpack Any + values in the form - The JSON representation of an `Any` value uses the regular + of utility functions or additional generated methods + of the Any type. - representation of the deserialized, embedded message, with - an - additional field `@type` which contains the type URL. - Example: + Example 1: Pack and unpack a message in C++. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Example 2: Pack and unpack a message in Java. - If the embedded message type is well-known and has a custom - JSON + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - representation, that representation will be embedded adding - a field + Example 3: Pack and unpack a message in Python. - `value` which holds the custom JSON in addition to the - `@type` + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - field. Example (for message [google.protobuf.Duration][]): + Example 4: Pack and unpack a message in Go - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - tags: - - Query - /cosmos/staking/v1beta1/validators: - get: - summary: Validators queries all validators that match the given status. - operationId: CosmosStakingV1Beta1Validators - responses: - '200': - description: A successful response. - schema: - type: object - properties: - validators: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - protocol buffer message. This string must contain at - least + The pack methods provided by protobuf library will by + default use - one "/" character. The last segment of the URL's - path must represent + 'type.googleapis.com/full.type.name' as the type URL + and the unpack - the fully qualified name of the type (as in + methods only use the fully qualified type name after + the last '/' - `path/google.protobuf.Duration`). The name should be - in a canonical form + in the type URL, for example "foo.bar.com/x/y.z" will + yield type - (e.g., leading "." is not accepted). + name "y.z". - In practice, teams usually precompile into the - binary all types that they - expect it to use in the context of Any. However, for - URLs which use the + JSON - scheme `http`, `https`, or no scheme, one can - optionally set up a type + ==== - server that maps type URLs to message definitions as - follows: + The JSON representation of an `Any` value uses the + regular + representation of the deserialized, embedded message, + with an - * If no scheme is provided, `https` is assumed. + additional field `@type` which contains the type URL. + Example: - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Note: this functionality is not currently available - in the official + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - protobuf release, and it is not used for type URLs - beginning with + If the embedded message type is well-known and has a + custom JSON - type.googleapis.com. + representation, that representation will be embedded + adding a field + `value` which holds the custom JSON in addition to the + `@type` - Schemes other than `http`, `https` (or the empty - scheme) might be + field. Example (for message + [google.protobuf.Duration][]): - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed - from bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: + messages is a list of `sdk.Msg`s that will be executed + if the proposal passes. + title: type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for - the validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission - rates to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to - delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate - which validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily - increase of the validator commission, as a - fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal description: >- - Validator defines a validator, together with the total - amount of the - - Validator's bond shares and their exchange rate to coins. - Slashing results in - - a decrease in the exchange rate, allowing correct - calculation of future - - undelegations without iterating over delegators. When coins - are delegated to - - this validator, the validator is credited with a delegation - whose number of + Proposal defines a group proposal. Any member of a group can + submit a proposal - bond shares is based on the amount of coins delegated - divided by the current + for a group policy to decide upon. - exchange rate. Voting power can be calculated as total - bonded shares + A proposal consists of a set of `sdk.Msg`s that will be + executed if the proposal - multiplied by exchange rate. - description: validators contains all the queried validators. + passes as well as some optional metadata associated with the + proposal. + description: proposals are the proposals with given group policy. pagination: description: pagination defines the pagination in the response. type: object @@ -21931,9 +21942,9 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - title: >- - QueryValidatorsResponse is response type for the Query/Validators - RPC method + description: >- + QueryProposalsByGroupPolicyResponse is the + Query/ProposalByGroupPolicy response type. default: description: An unexpected error response. schema: @@ -22120,10 +22131,12 @@ paths: "value": "1.212s" } parameters: - - name: status - description: status enables to query for validators matching a given status. - in: query - required: false + - name: address + description: >- + address is the account address of the group policy related to + proposals. + in: path + required: true type: string - name: pagination.key description: |- @@ -22183,259 +22196,109 @@ paths: type: boolean tags: - Query - /cosmos/staking/v1beta1/validators/{validator_addr}: + /cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}: get: - summary: Validator queries validator info for given validator address. - operationId: CosmosStakingV1Beta1Validator + summary: VoteByProposalVoter queries a vote by proposal id and voter. + operationId: CosmosGroupV1VoteByProposalVoter responses: '200': description: A successful response. schema: type: object properties: - validator: - description: validator defines the validator info. + vote: + description: vote is the vote with given proposal_id and voter. type: object properties: - operator_address: + proposal_id: type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized + format: uint64 + description: proposal is the unique ID of the proposal. + voter: + type: string + description: voter is the account address of the voter. + option: + description: option is the voter's choice on the proposal. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + metadata: + type: string + description: metadata is any arbitrary metadata attached to the vote. + submit_time: + type: string + format: date-time + description: submit_time is the timestamp when the vote was submitted. + description: >- + QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter + response type. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's path - must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be in + a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary - all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from - bonded status or not. - status: - description: >- - status is the validator status - (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: >- - description defines the description terms for the - validator. - type: object - properties: - moniker: - type: string - description: >- - moniker defines a human-readable name for the - validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for - security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at - which this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates - to be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, - as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared - minimum self delegation. - - - Since: cosmos-sdk 0.46 - title: >- - QueryValidatorResponse is response type for the Query/Validator - RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official + Note: this functionality is not currently available in + the official protobuf release, and it is not used for type URLs beginning with @@ -22560,73 +22423,62 @@ paths: "value": "1.212s" } parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. + - name: proposal_id + description: proposal_id is the unique ID of a proposal. + in: path + required: true + type: string + format: uint64 + - name: voter + description: voter is a proposal voter account address. in: path required: true type: string tags: - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: + /cosmos/group/v1/votes_by_proposal/{proposal_id}: get: - summary: ValidatorDelegations queries delegate info for given validator. - operationId: CosmosStakingV1Beta1ValidatorDelegations + summary: VotesByProposal queries a vote by proposal id. + operationId: CosmosGroupV1VotesByProposal responses: '200': description: A successful response. schema: type: object properties: - delegation_responses: + votes: type: array items: type: object properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of - the delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of - the validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an - account. It is - - owned by one delegator, and is associated with the - voting power of one - - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string + proposal_id: + type: string + format: uint64 + description: proposal is the unique ID of the proposal. + voter: + type: string + description: voter is the account address of the voter. + option: + description: option is the voter's choice on the proposal. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + metadata: + type: string + description: metadata is any arbitrary metadata attached to the vote. + submit_time: + type: string + format: date-time description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - description: >- - DelegationResponse is equivalent to Delegation except that - it contains a - - balance in addition to shares which is more suitable for - client responses. + submit_time is the timestamp when the vote was + submitted. + description: Vote represents a vote for a proposal. + description: votes are the list of votes for given proposal_id. pagination: description: pagination defines the pagination in the response. type: object @@ -22646,9 +22498,9 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - title: |- - QueryValidatorDelegationsResponse is response type for the - Query/ValidatorDelegations RPC method + description: >- + QueryVotesByProposalResponse is the Query/VotesByProposal response + type. default: description: An unexpected error response. schema: @@ -22835,11 +22687,12 @@ paths: "value": "1.212s" } parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. + - name: proposal_id + description: proposal_id is the unique ID of a proposal. in: path required: true type: string + format: uint64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -22898,64 +22751,69 @@ paths: type: boolean tags: - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}: + /cosmos/group/v1/votes_by_voter/{voter}: get: - summary: Delegation queries delegate info for given validator delegator pair. - operationId: CosmosStakingV1Beta1Delegation + summary: VotesByVoter queries a vote by voter. + operationId: CosmosGroupV1VotesByVoter responses: '200': description: A successful response. schema: type: object properties: - delegation_response: - description: >- - delegation_responses defines the delegation info of a - delegation. + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal is the unique ID of the proposal. + voter: + type: string + description: voter is the account address of the voter. + option: + description: option is the voter's choice on the proposal. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + metadata: + type: string + description: metadata is any arbitrary metadata attached to the vote. + submit_time: + type: string + format: date-time + description: >- + submit_time is the timestamp when the vote was + submitted. + description: Vote represents a vote for a proposal. + description: votes are the list of votes by given voter. + pagination: + description: pagination defines the pagination in the response. type: object properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an - account. It is - - owned by one delegator, and is associated with the voting - power of one - - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - signatures required by gogoproto. - description: >- - QueryDelegationResponse is response type for the Query/Delegation - RPC method. + was set, its value is undefined otherwise + description: QueryVotesByVoterResponse is the Query/VotesByVoter response type. default: description: An unexpected error response. schema: @@ -23142,81 +23000,88 @@ paths: "value": "1.212s" } parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. + - name: voter + description: voter is a proposal voter account address. in: path required: true type: string - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. - in: path - required: true + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation: + /cosmos/mint/v1beta1/annual_provisions: get: - summary: |- - UnbondingDelegation queries unbonding info for given validator delegator - pair. - operationId: CosmosStakingV1Beta1UnbondingDelegation + summary: AnnualProvisions current minting annual provisions value. + operationId: CosmosMintV1Beta1AnnualProvisions responses: '200': description: A successful response. schema: type: object properties: - unbond: - description: unbond defines the unbonding information of a delegation. - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time is the unix time for unbonding - completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially - scheduled to receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - description: >- - UnbondingDelegationEntry defines an unbonding object - with relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - QueryDelegationResponse is response type for the - Query/UnbondingDelegation - - RPC method. + annual_provisions: + type: string + format: byte + description: >- + annual_provisions is the current minting annual provisions + value. + description: |- + QueryAnnualProvisionsResponse is the response type for the + Query/AnnualProvisions RPC method. default: description: An unexpected error response. schema: @@ -23234,15 +23099,151 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least + additionalProperties: {} + tags: + - Query + /cosmos/mint/v1beta1/inflation: + get: + summary: Inflation returns the current minting inflation value. + operationId: CosmosMintV1Beta1Inflation + responses: + '200': + description: A successful response. + schema: + type: object + properties: + inflation: + type: string + format: byte + description: inflation is the current minting inflation value. + description: >- + QueryInflationResponse is the response type for the + Query/Inflation RPC - one "/" character. The last segment of the URL's path - must represent + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/mint/v1beta1/params: + get: + summary: Params returns the total set of minting parameters. + operationId: CosmosMintV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/nft/v1beta1/balance/{owner}/{class_id}: + get: + summary: >- + Balance queries the number of NFTs of a given class owned by the owner, + same as balanceOf in ERC721 + operationId: CosmosNftV1Beta1Balance + responses: + '200': + description: A successful response. + schema: + type: object + properties: + amount: + type: string + format: uint64 + title: >- + amount is the number of all NFTs of a given class owned by the + owner + title: >- + QueryBalanceResponse is the response type for the Query/Balance + RPC method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent the fully qualified name of the type (as in @@ -23403,84 +23404,245 @@ paths: "value": "1.212s" } parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. + - name: owner + description: owner is the owner address of the nft in: path required: true type: string - - name: delegator_addr - description: delegator_addr defines the delegator address to query for. + - name: class_id + description: class_id associated with the nft in: path required: true type: string tags: - Query - /cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations: + /cosmos/nft/v1beta1/classes: get: - summary: >- - ValidatorUnbondingDelegations queries unbonding delegations of a - validator. - operationId: CosmosStakingV1Beta1ValidatorUnbondingDelegations + summary: Classes queries all NFT classes + operationId: CosmosNftV1Beta1Classes responses: '200': description: A successful response. schema: type: object properties: - unbonding_responses: + classes: type: array items: type: object properties: - delegator_address: + id: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: + title: >- + id defines the unique identifier of the NFT + classification, similar to the contract address of + ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT + classification. Optional + symbol: + type: string + title: >- + symbol is an abbreviated name for nft classification. + Optional + description: + type: string + title: >- + description is a brief description of nft + classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can + define schema for Class and NFT `Data` attributes. + Optional + uri_hash: type: string + title: >- + uri_hash is a hash of the document pointed by uri. + Optional + data: + title: >- + data is the app specific metadata of the NFT class. + Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time is the unix time for unbonding - completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially - scheduled to receive at completion. - balance: - type: string - description: >- - balance defines the tokens to receive at - completion. - description: >- - UnbondingDelegationEntry defines an unbonding object - with relevant metadata. - description: |- - entries are the unbonding delegation entries. + `Any` contains an arbitrary serialized protocol buffer + message along with a - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's - unbonding bonds + URL that describes the type of the serialized message. - for a single validator in an time-ordered list. + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + description: class defines the class of the nft type. pagination: description: pagination defines the pagination in the response. type: object @@ -23500,11 +23662,9 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: >- - QueryValidatorUnbondingDelegationsResponse is response type for - the - - Query/ValidatorUnbondingDelegations RPC method. + title: >- + QueryClassesResponse is the response type for the Query/Classes + RPC method default: description: An unexpected error response. schema: @@ -23691,11 +23851,6 @@ paths: "value": "1.212s" } parameters: - - name: validator_addr - description: validator_addr defines the validator address to query for. - in: path - required: true - type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -23754,276 +23909,229 @@ paths: type: boolean tags: - Query - /cosmos/tx/v1beta1/simulate: - post: - summary: Simulate simulates executing a transaction for estimating gas usage. - operationId: CosmosTxV1Beta1Simulate + /cosmos/nft/v1beta1/classes/{class_id}: + get: + summary: Class queries an NFT class based on its id + operationId: CosmosNftV1Beta1Class responses: '200': description: A successful response. schema: type: object properties: - gas_info: - description: gas_info is the information about gas used in the simulation. + class: + description: class defines the class of the nft type. type: object properties: - gas_wanted: + id: type: string - format: uint64 - description: >- - GasWanted is the maximum units of work we allow this tx to - perform. - gas_used: + title: >- + id defines the unique identifier of the NFT + classification, similar to the contract address of ERC721 + name: type: string - format: uint64 - description: GasUsed is the amount of gas actually consumed. - result: - description: result is the result of the simulation. - type: object - properties: - data: + title: >- + name defines the human-readable name of the NFT + classification. Optional + symbol: type: string - format: byte - description: >- - Data is any data returned from message or handler - execution. It MUST be - - length prefixed in order to separate data from multiple - message executions. + title: >- + symbol is an abbreviated name for nft classification. + Optional + description: + type: string + title: >- + description is a brief description of nft classification. + Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define + schema for Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: >- + uri_hash is a hash of the document pointed by uri. + Optional + data: + title: >- + data is the app specific metadata of the NFT class. + Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized - Deprecated. This field is still populated, but prefer - msg_response instead + protocol buffer message. This string must contain at + least - because it also contains the Msg response typeURL. - log: - type: string - description: >- - Log contains the log information from message or handler - execution. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, - associated with an event. - description: >- - Event allows application developers to attach additional - information to + one "/" character. The last segment of the URL's path + must represent - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx - and ResponseDeliverTx. + the fully qualified name of the type (as in - Later, transactions may be queried using these events. - description: >- - Events contains a slice of Event objects that were emitted - during message - - or handler execution. - msg_responses: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be + in a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can + optionally set up a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available - in the official + Note: this functionality is not currently available in + the official - protobuf release, and it is not used for type URLs - beginning with + protobuf release, and it is not used for type URLs + beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty - scheme) might be + Schemes other than `http`, `https` (or the empty + scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any - values in the form + Protobuf library provides support to pack/unpack Any + values in the form - of utility functions or additional generated methods of - the Any type. + of utility functions or additional generated methods of + the Any type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { ... - if (any.UnpackTo(&foo)) { - ... - } + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - methods only use the fully qualified type name after the - last '/' + The pack methods provided by protobuf library will by + default use - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + 'type.googleapis.com/full.type.name' as the type URL and + the unpack - name "y.z". + methods only use the fully qualified type name after the + last '/' + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + name "y.z". - JSON - ==== - The JSON representation of an `Any` value uses the - regular + JSON - representation of the deserialized, embedded message, - with an + ==== - additional field `@type` which contains the type URL. - Example: + The JSON representation of an `Any` value uses the regular - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + representation of the deserialized, embedded message, with + an - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + additional field `@type` which contains the type URL. + Example: - If the embedded message type is well-known and has a - custom JSON + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - representation, that representation will be embedded - adding a field + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - `value` which holds the custom JSON in addition to the - `@type` + If the embedded message type is well-known and has a + custom JSON - field. Example (for message - [google.protobuf.Duration][]): + representation, that representation will be embedded + adding a field - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - msg_responses contains the Msg handler responses type - packed in Anys. + `value` which holds the custom JSON in addition to the + `@type` + field. Example (for message [google.protobuf.Duration][]): - Since: cosmos-sdk 0.46 - description: |- - SimulateResponse is the response type for the - Service.SimulateRPC method. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + QueryClassResponse is the response type for the Query/Class RPC + method default: description: An unexpected error response. schema: @@ -24210,25 +24318,246 @@ paths: "value": "1.212s" } parameters: - - name: body - description: |- - SimulateRequest is the request type for the Service.Simulate - RPC method. - in: body + - name: class_id + description: class_id associated with the nft + in: path required: true - schema: - $ref: '#/definitions/cosmos.tx.v1beta1.SimulateRequest' + type: string tags: - - Service - /cosmos/tx/v1beta1/txs: + - Query + /cosmos/nft/v1beta1/nfts: get: - summary: GetTxsEvent fetches txs by event. - operationId: CosmosTxV1Beta1GetTxsEvent + summary: >- + NFTs queries all NFTs of a given class or owner,choose at least one of + the two, similar to tokenByIndex in + + ERC721Enumerable + operationId: CosmosNftV1Beta1NFTs responses: '200': description: A successful response. schema: - $ref: '#/definitions/cosmos.tx.v1beta1.GetTxsEventResponse' + type: object + properties: + nfts: + type: array + items: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the + contract address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: NFT defines the NFT + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryNFTsResponse is the response type for the Query/NFTs RPC + methods default: description: An unexpected error response. schema: @@ -24415,14 +24744,16 @@ paths: "value": "1.212s" } parameters: - - name: events - description: events is the list of transaction event type. + - name: class_id + description: class_id associated with the nft in: query required: false - type: array - items: - type: string - collectionFormat: multi + type: string + - name: owner + description: owner is the owner address of the nft + in: query + required: false + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -24479,137 +24810,38 @@ paths: in: query required: false type: boolean - - name: order_by - description: |2- - - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. - - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order - - ORDER_BY_DESC: ORDER_BY_DESC defines descending order - in: query - required: false - type: string - enum: - - ORDER_BY_UNSPECIFIED - - ORDER_BY_ASC - - ORDER_BY_DESC - default: ORDER_BY_UNSPECIFIED - - name: page - description: >- - page is the page number to query, starts at 1. If not provided, will - default to first page. - in: query - required: false - type: string - format: uint64 - - name: limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 tags: - - Service - post: - summary: BroadcastTx broadcast transaction. - operationId: CosmosTxV1Beta1BroadcastTx + - Query + /cosmos/nft/v1beta1/nfts/{class_id}/{id}: + get: + summary: NFT queries an NFT based on its class and id. + operationId: CosmosNftV1Beta1NFT responses: '200': description: A successful response. schema: type: object properties: - tx_response: - description: tx_response is the queried TxResponses. + nft: + title: owner is the owner address of the nft type: object properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: + class_id: type: string - description: >- - The output of the application's logger (raw string). May - be - - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where - the key and value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where - all the attributes - - contain key/value pairs that are strings instead - of raw bytes. - description: >- - Events contains a slice of Event objects that were - emitted during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed - tx ABCI message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: + title: >- + class_id associated with the NFT, similar to the contract + address of ERC721 + id: type: string - description: Additional information. May be non-deterministic. - gas_wanted: + title: id is a unique identifier of the NFT + uri: type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: + title: uri for the NFT metadata stored off chain + uri_hash: type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional type: object properties: '@type': @@ -24671,66 +24903,119 @@ paths: used with implementation specific semantics. additionalProperties: {} - timestamp: - type: string description: >- - Time of the previous block. For heights > 1, it's the - weighted median of + `Any` contains an arbitrary serialized protocol buffer + message along with a - the timestamps of the valid votes in the block.LastCommit. - For height == 1, + URL that describes the type of the serialized message. - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, - associated with an event. - description: >- - Event allows application developers to attach additional - information to - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx - and ResponseDeliverTx. + Protobuf library provides support to pack/unpack Any + values in the form - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a - transaction. Note, + of utility functions or additional generated methods of + the Any type. - these events include those emitted by processing all the - messages and those - emitted from the ante. Whereas Logs contains the events, - with + Example 1: Pack and unpack a message in C++. - additional metadata, emitted only by processing the - messages. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: |- - BroadcastTxResponse is the response type for the - Service.BroadcastTx method. + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: QueryNFTResponse is the response type for the Query/NFT RPC method default: description: An unexpected error response. schema: @@ -24917,57 +25202,36 @@ paths: "value": "1.212s" } parameters: - - name: body - description: >- - BroadcastTxRequest is the request type for the - Service.BroadcastTxRequest - - RPC method. - in: body + - name: class_id + description: class_id associated with the nft + in: path required: true - schema: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the raw transaction. - mode: - type: string - enum: - - BROADCAST_MODE_UNSPECIFIED - - BROADCAST_MODE_BLOCK - - BROADCAST_MODE_SYNC - - BROADCAST_MODE_ASYNC - default: BROADCAST_MODE_UNSPECIFIED - description: >- - BroadcastMode specifies the broadcast mode for the - TxService.Broadcast RPC method. - - - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. - - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - a CheckTx execution response only. - - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - immediately. - description: >- - BroadcastTxRequest is the request type for the - Service.BroadcastTxRequest - - RPC method. + type: string + - name: id + description: id is a unique identifier of the NFT + in: path + required: true + type: string tags: - - Service - /cosmos/tx/v1beta1/txs/block/{height}: + - Query + /cosmos/nft/v1beta1/owner/{class_id}/{id}: get: - summary: GetBlockWithTxs fetches a block with decoded txs. - description: 'Since: cosmos-sdk 0.45.2' - operationId: CosmosTxV1Beta1GetBlockWithTxs + summary: >- + Owner queries the owner of the NFT based on its class and id, same as + ownerOf in ERC721 + operationId: CosmosNftV1Beta1Owner responses: '200': description: A successful response. schema: - $ref: '#/definitions/cosmos.tx.v1beta1.GetBlockWithTxsResponse' + type: object + properties: + owner: + type: string + title: owner is the owner address of the nft + title: >- + QueryOwnerResponse is the response type for the Query/Owner RPC + method default: description: An unexpected error response. schema: @@ -25154,79 +25418,37 @@ paths: "value": "1.212s" } parameters: - - name: height - description: height is the height of the block to query. + - name: class_id + description: class_id associated with the nft in: path required: true type: string - format: int64 - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: id + description: id is a unique identifier of the NFT + in: path + required: true type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - - Service - /cosmos/tx/v1beta1/txs/{hash}: + - Query + /cosmos/nft/v1beta1/supply/{class_id}: get: - summary: GetTx fetches a tx by hash. - operationId: CosmosTxV1Beta1GetTx + summary: >- + Supply queries the number of NFTs from the given class, same as + totalSupply of ERC721. + operationId: CosmosNftV1Beta1Supply responses: '200': description: A successful response. schema: - $ref: '#/definitions/cosmos.tx.v1beta1.GetTxResponse' + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs from the given class + title: >- + QuerySupplyResponse is the response type for the Query/Supply RPC + method default: description: An unexpected error response. schema: @@ -25413,31 +25635,37 @@ paths: "value": "1.212s" } parameters: - - name: hash - description: hash is the tx hash to query, encoded as a hex string. + - name: class_id + description: class_id associated with the nft in: path required: true type: string tags: - - Service - /cosmos/upgrade/v1beta1/applied_plan/{name}: + - Query + /cosmos/params/v1beta1/params: get: - summary: AppliedPlan queries a previously applied upgrade plan by its name. - operationId: CosmosUpgradeV1Beta1AppliedPlan + summary: |- + Params queries a specific parameter of a module, given its subspace and + key. + operationId: CosmosParamsV1Beta1Params responses: '200': description: A successful response. schema: type: object properties: - height: - type: string - format: int64 - description: height is the block height at which the plan was applied. + param: + description: param defines the queried parameter. + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string description: >- - QueryAppliedPlanResponse is the response type for the - Query/AppliedPlan RPC - + QueryParamsResponse is response type for the Query/Params RPC method. default: description: An unexpected error response. @@ -25456,19 +25684,522 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + additionalProperties: {} + parameters: + - name: subspace + description: subspace defines the module to query the parameter for. + in: query + required: false + type: string + - name: key + description: key defines the key of the parameter in the subspace. + in: query + required: false + type: string + tags: + - Query + /cosmos/params/v1beta1/subspaces: + get: + summary: >- + Subspaces queries for all registered subspaces and all keys for a + subspace. + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosParamsV1Beta1Subspaces + responses: + '200': + description: A successful response. + schema: + type: object + properties: + subspaces: + type: array + items: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: >- + Subspace defines a parameter subspace name and all the keys + that exist for - protocol buffer message. This string must contain at - least + the subspace. - one "/" character. The last segment of the URL's path - must represent - the fully qualified name of the type (as in + Since: cosmos-sdk 0.46 + description: >- + QuerySubspacesResponse defines the response types for querying for + all - `path/google.protobuf.Duration`). The name should be in + registered subspaces and all keys for a subspace. + + + Since: cosmos-sdk 0.46 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/slashing/v1beta1/params: + get: + summary: Params queries the parameters of slashing module + operationId: CosmosSlashingV1Beta1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: >- + Params represents the parameters used for by the slashing + module. + title: >- + QueryParamsResponse is the response type for the Query/Params RPC + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /cosmos/slashing/v1beta1/signing_infos: + get: + summary: SigningInfos queries signing info of all validators + operationId: CosmosSlashingV1Beta1SigningInfos + responses: + '200': + description: A successful response. + schema: + type: object + properties: + info: + type: array + items: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: >- + Height at which validator was first a candidate OR was + unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a + bonded + + in a block and may have signed a precommit or not. This + in conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to + liveness downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed + out of validator set). It is set + + once the validator commits an equivocation or for any + other configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: info is the signing info of all validators + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySigningInfosResponse is the response type for the + Query/SigningInfos RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/slashing/v1beta1/signing_infos/{cons_address}: + get: + summary: SigningInfo queries the signing info of given cons address + operationId: CosmosSlashingV1Beta1SigningInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + val_signing_info: + title: >- + val_signing_info is the signing info of requested val cons + address + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: >- + Height at which validator was first a candidate OR was + unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a + bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to + liveness downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out + of validator set). It is set + + once the validator commits an equivocation or for any + other configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their + + liveness activity. + title: >- + QuerySigningInfoResponse is the response type for the + Query/SigningInfo RPC + + method + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: cons_address + description: cons_address is the address to query signing info of + in: path + required: true + type: string + tags: + - Query + /cosmos/staking/v1beta1/delegations/{delegator_addr}: + get: + summary: >- + DelegatorDelegations queries all delegations of a given delegator + address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of + the validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is + + owned by one delegator, and is associated with the + voting power of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that + it contains a + + balance in addition to shares which is more suitable for + client responses. + description: >- + delegation_responses defines all the delegations' info of a + delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorDelegationsResponse is response type for the + Query/DelegatorDelegations RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading "." is not accepted). @@ -25625,347 +26356,246 @@ paths: "value": "1.212s" } parameters: - - name: name - description: name is the name of the applied plan to query for. + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. in: path required: true type: string - tags: - - Query - /cosmos/upgrade/v1beta1/authority: - get: - summary: Returns the account with authority to conduct upgrades - description: 'Since: cosmos-sdk 0.46' - operationId: CosmosUpgradeV1Beta1Authority - responses: - '200': - description: A successful response. - schema: - type: object - properties: - address: - type: string - description: 'Since: cosmos-sdk 0.46' - title: QueryAuthorityResponse is the response type for Query/Authority - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - additional field `@type` which contains the type URL. - Example: + It is less efficient than using key. Only one of offset or key + should - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - If the embedded message type is well-known and has a custom - JSON + a count of the total number of items available for pagination in + UIs. - representation, that representation will be embedded adding - a field + count_total is only respected when offset is used. It is ignored + when key - `value` which holds the custom JSON in addition to the - `@type` + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /cosmos/upgrade/v1beta1/current_plan: + /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: get: - summary: CurrentPlan queries the current upgrade plan. - operationId: CosmosUpgradeV1Beta1CurrentPlan + summary: Redelegations queries redelegations of given address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1Redelegations responses: '200': description: A successful response. schema: type: object properties: - plan: - description: plan is the current upgrade plan. - type: object - properties: - name: - type: string - description: >- - Sets the name for the upgrade. This name will be used by - the upgraded - - version of the software to apply any special "on-upgrade" - commands during - - the first BeginBlock method after the upgrade is applied. - It is also used + redelegation_responses: + type: array + items: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation + source operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation + destination operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for + redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance + when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of + destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules + description: >- + RedelegationEntry defines a redelegation object + with relevant metadata. + description: |- + entries are the redelegation entries. - to detect whether a software version can handle a given - upgrade. If no + redelegation entries + description: >- + Redelegation contains the list of a particular + delegator's redelegating bonds - upgrade handler with this name has been set in the - software, it will be + from a particular source validator to a particular + destination validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for + redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance + when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of + destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding + has been stopped by external modules + description: >- + RedelegationEntry defines a redelegation object + with relevant metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a + RedelegationEntry except that it - assumed that the software is out-of-date when the upgrade - Time or Height is + contains a balance in addition to shares which is more + suitable for client - reached and the software will exit. - time: - type: string - format: date-time - description: >- - Deprecated: Time based upgrades have been deprecated. Time - based upgrade logic + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except + that its entries - has been removed from the SDK. + contain a balance in addition to shares which is more + suitable for client - If this field is not empty, an error will be thrown. - height: + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: type: string - format: int64 + format: byte description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. - info: + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string + format: uint64 title: >- - Any application specific upgrade info to be included - on-chain - - such as a git commit that validators could automatically - upgrade to - upgraded_client_state: - description: >- - Deprecated: UpgradedClientState field has been deprecated. - IBC upgrade logic has been - - moved to the IBC module in the sub module 02-client. - - If this field is not empty, an error will be thrown. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be + total is total number of results available if + PageRequest.count_total - used with implementation specific semantics. - additionalProperties: {} + was set, its value is undefined otherwise description: >- - QueryCurrentPlanResponse is the response type for the - Query/CurrentPlan RPC + QueryRedelegationsResponse is response type for the + Query/Redelegations RPC method. default: @@ -26153,46 +26783,189 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - tags: - - Query - /cosmos/upgrade/v1beta1/module_versions: - get: - summary: ModuleVersions queries the list of module versions from state. - description: 'Since: cosmos-sdk 0.43' - operationId: CosmosUpgradeV1Beta1ModuleVersions - responses: - '200': - description: A successful response. - schema: - type: object - properties: - module_versions: - type: array - items: - type: object - properties: - name: - type: string - title: name of the app module - version: - type: string - format: uint64 - title: consensus version of the app module - description: |- - ModuleVersion specifies a module and its consensus version. - - Since: cosmos-sdk 0.43 - description: >- - module_versions is a list of module names with their consensus - versions. - description: >- - QueryModuleVersionsResponse is the response type for the - Query/ModuleVersions + parameters: + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: src_validator_addr + description: src_validator_addr defines the validator address to redelegate from. + in: query + required: false + type: string + - name: dst_validator_addr + description: dst_validator_addr defines the validator address to redelegate to. + in: query + required: false + type: string + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - RPC method. + It is less efficient than using key. Only one of offset or key + should + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - Since: cosmos-sdk 0.43 + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations: + get: + summary: >- + DelegatorUnbondingDelegations queries all unbonding delegations of a + given + + delegator address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorUnbondingDelegations + responses: + '200': + description: A successful response. + schema: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: >- + balance defines the tokens to receive at + completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryUnbondingDelegatorDelegationsResponse is response type for + the + + Query/UnbondingDelegatorDelegations RPC method. default: description: An unexpected error response. schema: @@ -26379,46 +27152,326 @@ paths: "value": "1.212s" } parameters: - - name: module_name + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: pagination.key description: |- - module_name is a field to query a specific module - consensus version from state. Leaving this empty will - fetch the full list of module versions from state + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. in: query required: false type: string - tags: - - Query - /cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}: - get: - summary: >- - UpgradedConsensusState queries the consensus state that will serve + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. - as a trusted kernel for the next version of this chain. It will only be + It is less efficient than using key. Only one of offset or key + should - stored at the last height of this chain. + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - UpgradedConsensusState RPC not supported with legacy querier + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - This rpc is deprecated now that IBC has its own replacement + a count of the total number of items available for pagination in + UIs. - (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - operationId: CosmosUpgradeV1Beta1UpgradedConsensusState + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators: + get: + summary: |- + DelegatorValidators queries all validators info for given delegator + address. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1DelegatorValidators responses: '200': description: A successful response. schema: type: object properties: - upgraded_consensus_state: - type: string - format: byte - title: 'Since: cosmos-sdk 0.43' - description: >- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the + validator, as a Protobuf Any. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - RPC method. + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for + the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: validators defines the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorValidatorsResponse is response type for the + Query/DelegatorValidators RPC method. default: description: An unexpected error response. schema: @@ -26605,297 +27658,276 @@ paths: "value": "1.212s" } parameters: - - name: last_height - description: |- - last height of the current chain must be sent in request - as this is the height under which next consensus state is stored + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. in: path required: true type: string - format: int64 - tags: - - Query - /ibc/apps/interchain_accounts/host/v1/params: - get: - summary: Params queries all parameters of the ICA host submodule. - operationId: IbcApplicationsInterchainAccountsHostV1Params - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - host_enabled: - type: boolean - description: host_enabled enables or disables the host submodule. - allow_messages: - type: array - items: - type: string - description: >- - allow_messages defines a list of sdk message typeURLs - allowed to be executed on a host chain. - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address: - get: - summary: >- - EscrowAddress returns the escrow address for a particular port and - channel id. - operationId: IbcApplicationsTransferV1EscrowAddress - responses: - '200': - description: A successful response. - schema: - type: object - properties: - escrow_address: - type: string - title: the escrow account address - description: >- - QueryEscrowAddressResponse is the response type of the - EscrowAddress RPC method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key + should - Example 1: Pack and unpack a message in C++. + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include - Example 2: Pack and unpack a message in Java. + a count of the total number of items available for pagination in + UIs. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + count_total is only respected when offset is used. It is ignored + when key - Example 3: Pack and unpack a message in Python. + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}: + get: + summary: |- + DelegatorValidator queries validator info for given delegator validator + pair. + operationId: CosmosStakingV1Beta1DelegatorValidator + responses: + '200': + description: A successful response. + schema: + type: object + properties: + validator: + description: validator defines the validator info. + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the + validator, as a Protobuf Any. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + protocol buffer message. This string must contain at + least - The pack methods provided by protobuf library will by - default use + one "/" character. The last segment of the URL's path + must represent - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + the fully qualified name of the type (as in - methods only use the fully qualified type name after the - last '/' + `path/google.protobuf.Duration`). The name should be + in a canonical form - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + (e.g., leading "." is not accepted). - name "y.z". + In practice, teams usually precompile into the binary + all types that they + expect it to use in the context of Any. However, for + URLs which use the - JSON + scheme `http`, `https`, or no scheme, one can + optionally set up a type - ==== + server that maps type URLs to message definitions as + follows: - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with - an + * If no scheme is provided, `https` is assumed. - additional field `@type` which contains the type URL. - Example: + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Note: this functionality is not currently available in + the official - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + protobuf release, and it is not used for type URLs + beginning with - If the embedded message type is well-known and has a custom - JSON + type.googleapis.com. - representation, that representation will be embedded adding - a field - `value` which holds the custom JSON in addition to the - `@type` + Schemes other than `http`, `https` (or the empty + scheme) might be - field. Example (for message [google.protobuf.Duration][]): + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates + to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - parameters: - - name: channel_id - description: unique channel identifier - in: path - required: true - type: string - - name: port_id - description: unique port identifier - in: path - required: true - type: string - tags: - - Query - /ibc/apps/transfer/v1/denom_hashes/{trace}: - get: - summary: DenomHash queries a denomination hash information. - operationId: IbcApplicationsTransferV1DenomHash - responses: - '200': - description: A successful response. - schema: - type: object - properties: - hash: - type: string - description: hash (in hex format) of the denomination trace information. - description: >- - QueryDenomHashResponse is the response type for the - Query/DenomHash RPC - method. + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: |- + QueryDelegatorValidatorResponse response type for the + Query/DelegatorValidator RPC method. default: description: An unexpected error response. schema: @@ -27082,107 +28114,382 @@ paths: "value": "1.212s" } parameters: - - name: trace - description: The denomination trace ([port_id]/[channel_id])+/[denom] + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path + required: true + type: string + - name: validator_addr + description: validator_addr defines the validator address to query for. in: path required: true type: string tags: - Query - /ibc/apps/transfer/v1/denom_traces: + /cosmos/staking/v1beta1/historical_info/{height}: get: - summary: DenomTraces queries all denomination traces. - operationId: IbcApplicationsTransferV1DenomTraces + summary: HistoricalInfo queries the historical info for given height. + operationId: CosmosStakingV1Beta1HistoricalInfo responses: '200': description: A successful response. schema: type: object properties: - denom_traces: - type: array - items: - type: object - properties: - path: - type: string - description: >- - path defines the chain of port/channel identifiers used - for tracing the - - source of the fungible token. - base_denom: - type: string - description: base denomination of the relayed fungible token. - description: >- - DenomTrace contains the base denomination for ICS20 fungible - tokens and the - - source tracing information path. - description: denom_traces returns all denominations trace information. - pagination: - description: pagination defines the pagination in the response. + hist: + description: hist defines the historical info at the given height. type: object properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - QueryConnectionsResponse is the response type for the - Query/DenomTraces RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, - In practice, teams usually precompile into the binary - all types that they + including all blockchain data structures and the rules + of the application's - expect it to use in the context of Any. However, for + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the + validator's operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the + validator, as a Protobuf Any. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized + + protocol buffer message. This string must + contain at least + + one "/" character. The last segment of the URL's + path must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name + should be in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, + for URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message + definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently + available in the official + + protobuf release, and it is not used for type + URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature + (ex. UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height + at which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time + for the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a + fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate + was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has + been stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to + coins. Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When + coins are delegated to + + this validator, the validator is credited with a + delegation whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: >- + QueryHistoricalInfoResponse is response type for the + Query/HistoricalInfo RPC + + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for URLs which use the scheme `http`, `https`, or no scheme, one can optionally @@ -27330,94 +28637,57 @@ paths: "value": "1.212s" } parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: height + description: height defines at which height to query the historical info. + in: path + required: true type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean + format: int64 tags: - Query - /ibc/apps/transfer/v1/denom_traces/{hash}: + /cosmos/staking/v1beta1/params: get: - summary: DenomTrace queries a denomination trace information. - operationId: IbcApplicationsTransferV1DenomTrace + summary: Parameters queries the staking parameters. + operationId: CosmosStakingV1Beta1Params responses: '200': description: A successful response. schema: type: object properties: - denom_trace: - description: >- - denom_trace returns the requested denomination trace - information. + params: + description: params holds all the parameters of this module. type: object properties: - path: + unbonding_time: type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 description: >- - path defines the chain of port/channel identifiers used - for tracing the - - source of the fungible token. - base_denom: + max_entries is the max entries for either unbonding + delegation or redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: >- + historical_entries is the number of historical entries to + persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: type: string - description: base denomination of the relayed fungible token. + title: >- + min_commission_rate is the chain-wide minimum commission + rate that a validator can charge their delegators description: >- - QueryDenomTraceResponse is the response type for the - Query/DenomTrace RPC - + QueryParamsResponse is response type for the Query/Params RPC method. default: description: An unexpected error response. @@ -27604,47 +28874,27 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: hash - description: >- - hash (in hex format) or denom (full denom with ibc prefix) of the - denomination trace information. - in: path - required: true - type: string tags: - Query - /ibc/apps/transfer/v1/params: + /cosmos/staking/v1beta1/pool: get: - summary: Params queries all parameters of the ibc-transfer module. - operationId: IbcApplicationsTransferV1Params + summary: Pool queries the pool info. + operationId: CosmosStakingV1Beta1Pool responses: '200': description: A successful response. schema: type: object properties: - params: - description: params defines the parameters of the module. + pool: + description: pool defines the pool info. type: object properties: - send_enabled: - type: boolean - description: >- - send_enabled enables or disables all cross-chain token - transfers from this - - chain. - receive_enabled: - type: boolean - description: >- - receive_enabled enables or disables all cross-chain token - transfers to this - - chain. - description: >- - QueryParamsResponse is the response type for the Query/Params RPC - method. + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: QueryPoolResponse is response type for the Query/Pool RPC method. default: description: An unexpected error response. schema: @@ -27832,157 +29082,261 @@ paths: } tags: - Query - /ibc/core/channel/v1/channels: + /cosmos/staking/v1beta1/validators: get: - summary: Channels queries all the IBC channels of a chain. - operationId: IbcCoreChannelV1Channels + summary: Validators queries all validators that match the given status. + description: >- + When called from another module, this query might consume a high amount + of + + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1Validators responses: '200': description: A successful response. schema: type: object properties: - channels: + validators: type: array items: type: object properties: - state: - title: current state of the channel end + operator_address: type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED description: >- - State defines if a channel is in one of the following - states: - - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered - type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: description: >- - - ORDER_NONE_UNSPECIFIED: zero-value for channel - ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end + consensus_pubkey is the consensus public key of the + validator, as a Protobuf Any. type: object properties: - port_id: + '@type': type: string description: >- - port on the counterparty chain which owns the other - end of the channel. - channel_id: - type: string - title: channel end on the counterparty chain - connection_hops: - type: array - items: - type: string - title: >- - list of connection identifiers, in order, along which - packets sent on + A URL/resource name that uniquely identifies the + type of the serialized - this channel will travel - version: - type: string - title: >- - opaque channel version, which is agreed upon during the - handshake - port_id: - type: string - title: port identifier - channel_id: - type: string - title: channel identifier - description: >- - IdentifiedChannel defines a channel with additional port and - channel + protocol buffer message. This string must contain at + least - identifier fields. - description: list of stored channels of the chain. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + one "/" character. The last segment of the URL's + path must represent - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + the fully qualified name of the type (as in - corresponding request message has used PageRequest. + `path/google.protobuf.Duration`). The name should be + in a canonical form - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they - RevisionNumber the same. However some consensus algorithms may - choose to + expect it to use in the context of Any. However, for + URLs which use the - reset the height in certain conditions e.g. hard forks, - state-machine + scheme `http`, `https`, or no scheme, one can + optionally set up a type - breaking changes In these cases, the RevisionNumber is - incremented so that + server that maps type URLs to message definitions as + follows: - height continues to be monitonically increasing even as the - RevisionHeight - gets reset - description: >- - QueryChannelsResponse is the response type for the Query/Channels - RPC method. + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for + the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission + rates to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to + delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate + which validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct + calculation of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated + divided by the current + + exchange rate. Voting power can be calculated as total + bonded shares + + multiplied by exchange rate. + description: validators contains all the queried validators. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryValidatorsResponse is response type for the Query/Validators + RPC method default: description: An unexpected error response. schema: @@ -28169,6 +29523,11 @@ paths: "value": "1.212s" } parameters: + - name: status + description: status enables to query for validators matching a given status. + in: query + required: false + type: string - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -28227,131 +29586,211 @@ paths: type: boolean tags: - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}: + /cosmos/staking/v1beta1/validators/{validator_addr}: get: - summary: Channel queries an IBC Channel. - operationId: IbcCoreChannelV1Channel + summary: Validator queries validator info for given validator address. + operationId: CosmosStakingV1Beta1Validator responses: '200': description: A successful response. schema: type: object properties: - channel: - title: channel associated with the request identifiers + validator: + description: validator defines the validator info. type: object properties: - state: - title: current state of the channel end + operator_address: type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED description: >- - State defines if a channel is in one of the following - states: - - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered - type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED - description: |- - - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the + validator, as a Protobuf Any. type: object properties: - port_id: + '@type': type: string description: >- - port on the counterparty chain which owns the other - end of the channel. - channel_id: - type: string - title: channel end on the counterparty chain - connection_hops: - type: array - items: - type: string - title: >- - list of connection identifiers, in order, along which - packets sent on + A URL/resource name that uniquely identifies the type + of the serialized - this channel will travel - version: - type: string - title: >- - opaque channel version, which is agreed upon during the - handshake - description: >- - Channel defines pipeline for exactly-once packet delivery - between specific + protocol buffer message. This string must contain at + least - modules on separate blockchains, which has at least one end - capable of + one "/" character. The last segment of the URL's path + must represent - sending packets and one end capable of receiving packets. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping + the fully qualified name of the type (as in - RevisionNumber the same. However some consensus algorithms may - choose to + `path/google.protobuf.Duration`). The name should be + in a canonical form - reset the height in certain conditions e.g. hard forks, - state-machine + (e.g., leading "." is not accepted). - breaking changes In these cases, the RevisionNumber is - incremented so that - height continues to be monitonically increasing even as the - RevisionHeight + In practice, teams usually precompile into the binary + all types that they - gets reset - description: >- - QueryChannelResponse is the response type for the Query/Channel - RPC method. + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at + which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates + to be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. - Besides the Channel end, it includes a proof and the height from - which the - proof was retrieved. + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + title: >- + QueryValidatorResponse is response type for the Query/Validator + RPC method default: description: An unexpected error response. schema: @@ -28538,254 +29977,100 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier + - name: validator_addr + description: validator_addr defines the validator address to query for. in: path required: true type: string tags: - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state: + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: get: - summary: >- - ChannelClientState queries for the client state for the channel - associated + summary: ValidatorDelegations queries delegate info for given validator. + description: >- + When called from another module, this query might consume a high amount + of - with the provided channel identifiers. - operationId: IbcCoreChannelV1ChannelClientState + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1ValidatorDelegations responses: '200': description: A successful response. schema: type: object properties: - identified_client_state: - title: client state associated with the channel - type: object - properties: - client_id: - type: string - title: client identifier - client_state: - title: client state - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of + the delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of + the validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is - In practice, teams usually precompile into the binary - all types that they + owned by one delegator, and is associated with the + voting power of one - expect it to use in the context of Any. However, for - URLs which use the + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - scheme `http`, `https`, or no scheme, one can - optionally set up a type - server that maps type URLs to message definitions as - follows: + NOTE: The amount field is an Int which implements the + custom method + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that + it contains a - * If no scheme is provided, `https` is assumed. + balance in addition to shares which is more suitable for + client responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - IdentifiedClientState defines a client state with an - additional client - - identifier field. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset + was set, its value is undefined otherwise title: |- - QueryChannelClientStateResponse is the Response type for the - Query/QueryChannelClientState RPC method + QueryValidatorDelegationsResponse is response type for the + Query/ValidatorDelegations RPC method default: description: An unexpected error response. schema: @@ -28972,239 +30257,127 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier + - name: validator_addr + description: validator_addr defines the validator address to query for. in: path required: true type: string - - name: port_id - description: port unique identifier - in: path - required: true + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}: + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}: get: - summary: |- - ChannelConsensusState queries for the consensus state for the channel - associated with the provided channel identifiers. - operationId: IbcCoreChannelV1ChannelConsensusState + summary: Delegation queries delegate info for given validator delegator pair. + operationId: CosmosStakingV1Beta1Delegation responses: '200': description: A successful response. schema: type: object properties: - consensus_state: - title: consensus state associated with the channel - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} + delegation_response: description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - client_id: - type: string - title: client ID associated with the consensus state - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved + delegation_responses defines the delegation info of a + delegation. type: object properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an + account. It is - RevisionNumber the same. However some consensus algorithms may - choose to + owned by one delegator, and is associated with the voting + power of one - reset the height in certain conditions e.g. hard forks, - state-machine + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - breaking changes In these cases, the RevisionNumber is - incremented so that - height continues to be monitonically increasing even as the - RevisionHeight + NOTE: The amount field is an Int which implements the + custom method - gets reset - title: |- - QueryChannelClientStateResponse is the Response type for the - Query/QueryChannelClientState RPC method + signatures required by gogoproto. + description: >- + QueryDelegationResponse is response type for the Query/Delegation + RPC method. default: description: An unexpected error response. schema: @@ -29391,82 +30564,91 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier - in: path - required: true - type: string - - name: revision_number - description: revision number of the consensus state + - name: validator_addr + description: validator_addr defines the validator address to query for. in: path required: true type: string - format: uint64 - - name: revision_height - description: revision height of the consensus state + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. in: path required: true type: string - format: uint64 tags: - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence: + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation: get: - summary: >- - NextSequenceReceive returns the next receive sequence for a given - channel. - operationId: IbcCoreChannelV1NextSequenceReceive + summary: |- + UnbondingDelegation queries unbonding info for given validator delegator + pair. + operationId: CosmosStakingV1Beta1UnbondingDelegation responses: '200': description: A successful response. schema: type: object properties: - next_sequence_receive: - type: string - format: uint64 - title: next sequence receive number - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved + unbond: + description: unbond defines the unbonding information of a delegation. type: object properties: - revision_number: + delegator_address: type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: |- + entries are the unbonding delegation entries. - height continues to be monitonically increasing even as the - RevisionHeight + unbonding delegation entries + description: >- + QueryDelegationResponse is response type for the + Query/UnbondingDelegation - gets reset - title: |- - QuerySequenceResponse is the request type for the - Query/QueryNextSequenceReceiveResponse RPC method + RPC method. default: description: An unexpected error response. schema: @@ -29653,63 +30835,103 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier + - name: validator_addr + description: validator_addr defines the validator address to query for. in: path required: true type: string - - name: port_id - description: port unique identifier - in: path + - name: delegator_addr + description: delegator_addr defines the delegator address to query for. + in: path required: true type: string tags: - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements: + /cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations: get: summary: >- - PacketAcknowledgements returns all the packet acknowledgements - associated + ValidatorUnbondingDelegations queries unbonding delegations of a + validator. + description: >- + When called from another module, this query might consume a high amount + of - with a channel. - operationId: IbcCoreChannelV1PacketAcknowledgements + gas if the pagination field is incorrectly set. + operationId: CosmosStakingV1Beta1ValidatorUnbondingDelegations responses: '200': description: A successful response. schema: type: object properties: - acknowledgements: + unbonding_responses: type: array items: type: object properties: - port_id: - type: string - description: channel port identifier. - channel_id: - type: string - description: channel unique identifier. - sequence: + delegator_address: type: string - format: uint64 - description: packet sequence. - data: + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: type: string - format: byte - description: embedded data that represents packet state. - description: >- - PacketState defines the generic type necessary to retrieve - and store - - packet commitments, acknowledgements, and receipts. + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time is the unix time for unbonding + completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially + scheduled to receive at completion. + balance: + type: string + description: >- + balance defines the tokens to receive at + completion. + unbonding_id: + type: string + format: uint64 + title: >- + Incrementing id that uniquely identifies this + entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has + been stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object + with relevant metadata. + description: |- + entries are the unbonding delegation entries. - Caller is responsible for knowing the context necessary to - interpret this + unbonding delegation entries + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds - state as a commitment, acknowledgement, or a receipt. + for a single validator in an time-ordered list. pagination: - title: pagination response + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -29727,48 +30949,11 @@ paths: PageRequest.count_total was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight + description: >- + QueryValidatorUnbondingDelegationsResponse is response type for + the - gets reset - title: |- - QueryPacketAcknowledgemetsResponse is the request type for the - Query/QueryPacketAcknowledgements RPC method + Query/ValidatorUnbondingDelegations RPC method. default: description: An unexpected error response. schema: @@ -29955,13 +31140,8 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier + - name: validator_addr + description: validator_addr defines the validator address to query for. in: path required: true type: string @@ -30021,71 +31201,18 @@ paths: in: query required: false type: boolean - - name: packet_commitment_sequences - description: list of packet sequences - in: query - required: false - type: array - items: - type: string - format: uint64 - collectionFormat: multi tags: - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}: - get: - summary: PacketAcknowledgement queries a stored packet acknowledgement hash. - operationId: IbcCoreChannelV1PacketAcknowledgement + /cosmos/tx/v1beta1/decode: + post: + summary: TxDecode decodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxDecode responses: '200': description: A successful response. schema: - type: object - properties: - acknowledgement: - type: string - format: byte - title: packet associated with the request fields - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - title: >- - QueryPacketAcknowledgementResponse defines the client query - response for a - - packet which also includes a proof and the height from which the - - proof was retrieved + $ref: '#/definitions/cosmos.tx.v1beta1.TxDecodeResponse' default: description: An unexpected error response. schema: @@ -30272,126 +31399,49 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier - in: path - required: true - type: string - - name: sequence - description: packet sequence - in: path + - name: body + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 + in: body required: true - type: string - format: uint64 + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. + + Since: cosmos-sdk 0.47 tags: - - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments: - get: - summary: |- - PacketCommitments returns all the packet commitments hashes associated - with a channel. - operationId: IbcCoreChannelV1PacketCommitments + - Service + /cosmos/tx/v1beta1/decode/amino: + post: + summary: TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxDecodeAmino responses: '200': description: A successful response. schema: type: object properties: - commitments: - type: array - items: - type: object - properties: - port_id: - type: string - description: channel port identifier. - channel_id: - type: string - description: channel unique identifier. - sequence: - type: string - format: uint64 - description: packet sequence. - data: - type: string - format: byte - description: embedded data that represents packet state. - description: >- - PacketState defines the generic type necessary to retrieve - and store - - packet commitments, acknowledgements, and receipts. - - Caller is responsible for knowing the context necessary to - interpret this - - state as a commitment, acknowledgement, or a receipt. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine + amino_json: + type: string + description: >- + TxDecodeAminoResponse is the response type for the + Service.TxDecodeAmino - breaking changes In these cases, the RevisionNumber is - incremented so that + RPC method. - height continues to be monitonically increasing even as the - RevisionHeight - gets reset - title: |- - QueryPacketCommitmentsResponse is the request type for the - Query/QueryPacketCommitments RPC method + Since: cosmos-sdk 0.47 default: description: An unexpected error response. schema: @@ -30578,126 +31628,53 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier - in: path - required: true - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit + - name: body description: >- - limit is the total number of results to be returned in the result - page. + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + RPC method. - a count of the total number of items available for pagination in - UIs. - count_total is only respected when offset is used. It is ignored - when key + Since: cosmos-sdk 0.47 + in: body + required: true + schema: + type: object + properties: + amino_binary: + type: string + format: byte + description: >- + TxDecodeAminoRequest is the request type for the + Service.TxDecodeAmino - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + RPC method. - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean + Since: cosmos-sdk 0.47 tags: - - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks: - get: - summary: >- - UnreceivedAcks returns all the unreceived IBC acknowledgements - associated - - with a channel and sequences. - operationId: IbcCoreChannelV1UnreceivedAcks + - Service + /cosmos/tx/v1beta1/encode: + post: + summary: TxEncode encodes the transaction. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxEncode responses: '200': description: A successful response. schema: type: object properties: - sequences: - type: array - items: - type: string - format: uint64 - title: list of unreceived acknowledgement sequences - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. - gets reset - title: |- - QueryUnreceivedAcksResponse is the response type for the - Query/UnreceivedAcks RPC method + Since: cosmos-sdk 0.47 default: description: An unexpected error response. schema: @@ -30884,80 +31861,40 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier - in: path - required: true - type: string - - name: packet_ack_sequences - description: list of acknowledgement sequences - in: path + - name: body + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + + Since: cosmos-sdk 0.47 + in: body required: true - type: array - items: - type: string - format: uint64 - collectionFormat: csv - minItems: 1 + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.TxEncodeRequest' tags: - - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets: - get: - summary: >- - UnreceivedPackets returns all the unreceived IBC packets associated with - a - - channel and sequences. - operationId: IbcCoreChannelV1UnreceivedPackets + - Service + /cosmos/tx/v1beta1/encode/amino: + post: + summary: TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + description: 'Since: cosmos-sdk 0.47' + operationId: CosmosTxV1Beta1TxEncodeAmino responses: '200': description: A successful response. schema: type: object properties: - sequences: - type: array - items: - type: string - format: uint64 - title: list of unreceived packet sequences - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine + amino_binary: + type: string + format: byte + description: >- + TxEncodeAminoResponse is the response type for the + Service.TxEncodeAmino - breaking changes In these cases, the RevisionNumber is - incremented so that + RPC method. - height continues to be monitonically increasing even as the - RevisionHeight - gets reset - title: |- - QueryUnreceivedPacketsResponse is the response type for the - Query/UnreceivedPacketCommitments RPC method + Since: cosmos-sdk 0.47 default: description: An unexpected error response. schema: @@ -31144,83 +32081,300 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier - in: path - required: true - type: string - - name: packet_commitment_sequences - description: list of packet sequences - in: path + - name: body + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 + in: body required: true - type: array - items: - type: string - format: uint64 - collectionFormat: csv - minItems: 1 + schema: + type: object + properties: + amino_json: + type: string + description: >- + TxEncodeAminoRequest is the request type for the + Service.TxEncodeAmino + + RPC method. + + + Since: cosmos-sdk 0.47 tags: - - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}: - get: - summary: PacketCommitment queries a stored packet commitment hash. - operationId: IbcCoreChannelV1PacketCommitment + - Service + /cosmos/tx/v1beta1/simulate: + post: + summary: Simulate simulates executing a transaction for estimating gas usage. + operationId: CosmosTxV1Beta1Simulate responses: '200': description: A successful response. schema: type: object properties: - commitment: - type: string - format: byte - title: packet associated with the request fields - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved + gas_info: + description: gas_info is the information about gas used in the simulation. type: object properties: - revision_number: + gas_wanted: type: string format: uint64 - title: the revision that the client is currently on - revision_height: + description: >- + GasWanted is the maximum units of work we allow this tx to + perform. + gas_used: type: string format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping + description: GasUsed is the amount of gas actually consumed. + result: + description: result is the result of the simulation. + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler + execution. It MUST be + + length prefixed in order to separate data from multiple + message executions. + + Deprecated. This field is still populated, but prefer + msg_response instead + + because it also contains the Msg response typeURL. + log: + type: string + description: >- + Log contains the log information from message or handler + execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, + associated with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx + and ResponseDeliverTx. - RevisionNumber the same. However some consensus algorithms may - choose to + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted + during message - reset the height in certain conditions e.g. hard forks, - state-machine + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the + type of the serialized - breaking changes In these cases, the RevisionNumber is - incremented so that + protocol buffer message. This string must contain at + least - height continues to be monitonically increasing even as the - RevisionHeight + one "/" character. The last segment of the URL's + path must represent - gets reset - title: >- - QueryPacketCommitmentResponse defines the client query response - for a packet + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be + in a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the + binary all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available + in the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + msg_responses contains the Msg handler responses type + packed in Anys. - which also includes a proof and the height from which the proof - was - retrieved + Since: cosmos-sdk 0.46 + description: |- + SimulateResponse is the response type for the + Service.SimulateRPC method. default: description: An unexpected error response. schema: @@ -31407,82 +32561,25 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true - type: string - - name: port_id - description: port unique identifier - in: path - required: true - type: string - - name: sequence - description: packet sequence - in: path + - name: body + description: |- + SimulateRequest is the request type for the Service.Simulate + RPC method. + in: body required: true - type: string - format: uint64 + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.SimulateRequest' tags: - - Query - /ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}: + - Service + /cosmos/tx/v1beta1/txs: get: - summary: >- - PacketReceipt queries if a given packet sequence has been received on - the - - queried chain - operationId: IbcCoreChannelV1PacketReceipt + summary: GetTxsEvent fetches txs by event. + operationId: CosmosTxV1Beta1GetTxsEvent responses: '200': description: A successful response. schema: - type: object - properties: - received: - type: boolean - title: success flag for if receipt exists - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - title: >- - QueryPacketReceiptResponse defines the client query response for a - packet - - receipt which also includes a proof, and the height from which the - proof was - - retrieved + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxsEventResponse' default: description: An unexpected error response. schema: @@ -31669,177 +32766,558 @@ paths: "value": "1.212s" } parameters: - - name: channel_id - description: channel unique identifier - in: path - required: true + - name: events + description: events is the list of transaction event type. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false type: string - - name: port_id - description: port unique identifier - in: path - required: true + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false type: string - - name: sequence - description: packet sequence - in: path - required: true + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + - name: order_by + description: |2- + - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order + - ORDER_BY_DESC: ORDER_BY_DESC defines descending order + in: query + required: false + type: string + enum: + - ORDER_BY_UNSPECIFIED + - ORDER_BY_ASC + - ORDER_BY_DESC + default: ORDER_BY_UNSPECIFIED + - name: page + description: >- + page is the page number to query, starts at 1. If not provided, will + default to first page. + in: query + required: false + type: string + format: uint64 + - name: limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string format: uint64 tags: - - Query - /ibc/core/channel/v1/connections/{connection}/channels: - get: - summary: |- - ConnectionChannels queries all the channels associated with a connection - end. - operationId: IbcCoreChannelV1ConnectionChannels + - Service + post: + summary: BroadcastTx broadcast transaction. + operationId: CosmosTxV1Beta1BroadcastTx responses: '200': description: A successful response. schema: type: object properties: - channels: - type: array - items: - type: object - properties: - state: - title: current state of the channel end - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED - description: >- - State defines if a channel is in one of the following - states: - - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered - type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED - description: >- - - ORDER_NONE_UNSPECIFIED: zero-value for channel - ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end - type: object - properties: - port_id: - type: string - description: >- - port on the counterparty chain which owns the other - end of the channel. - channel_id: - type: string - title: channel end on the counterparty chain - connection_hops: - type: array - items: - type: string - title: >- - list of connection identifiers, in order, along which - packets sent on - - this channel will travel - version: - type: string - title: >- - opaque channel version, which is agreed upon during the - handshake - port_id: - type: string - title: port identifier - channel_id: - type: string - title: channel identifier - description: >- - IdentifiedChannel defines a channel with additional port and - channel - - identifier fields. - description: list of channels associated with a connection. - pagination: - title: pagination response + tx_response: + description: tx_response is the queried TxResponses. type: object properties: - next_key: + height: type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + format: int64 + title: The block height + txhash: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: >- + The output of the application's logger (raw string). May + be - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where + the key and value are - corresponding request message has used PageRequest. + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where + all the attributes - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: + contain key/value pairs that are strings instead + of raw bytes. + description: >- + Events contains a slice of Event objects that were + emitted during some + + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed + tx ABCI message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + description: Additional information. May be non-deterministic. + gas_wanted: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent - RevisionNumber the same. However some consensus algorithms may - choose to + the fully qualified name of the type (as in - reset the height in certain conditions e.g. hard forks, - state-machine + `path/google.protobuf.Duration`). The name should be + in a canonical form - breaking changes In these cases, the RevisionNumber is - incremented so that + (e.g., leading "." is not accepted). - height continues to be monitonically increasing even as the - RevisionHeight - gets reset - title: |- - QueryConnectionChannelsResponse is the Response type for the - Query/QueryConnectionChannels RPC method + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can + optionally set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty + scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the + weighted median of + + the timestamps of the valid votes in the block.LastCommit. + For height == 1, + + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, + associated with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx + and ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, + + these events include those emitted by processing all the + messages and those + + emitted from the ante. Whereas Logs contains the events, + with + + additional metadata, emitted only by processing the + messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: |- + BroadcastTxResponse is the response type for the + Service.BroadcastTx method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: body + description: >- + BroadcastTxRequest is the request type for the + Service.BroadcastTxRequest + + RPC method. + in: body + required: true + schema: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + mode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the + TxService.Broadcast RPC method. + + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x + onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + description: >- + BroadcastTxRequest is the request type for the + Service.BroadcastTxRequest + + RPC method. + tags: + - Service + /cosmos/tx/v1beta1/txs/block/{height}: + get: + summary: GetBlockWithTxs fetches a block with decoded txs. + description: 'Since: cosmos-sdk 0.45.2' + operationId: CosmosTxV1Beta1GetBlockWithTxs + responses: + '200': + description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetBlockWithTxsResponse' default: description: An unexpected error response. schema: @@ -32026,11 +33504,12 @@ paths: "value": "1.212s" } parameters: - - name: connection - description: connection unique identifier + - name: height + description: height is the height of the block to query. in: path required: true type: string + format: int64 - name: pagination.key description: |- key is a value returned in PageResponse.next_key to begin @@ -32088,287 +33567,62 @@ paths: required: false type: boolean tags: - - Query - /ibc/core/client/v1/client_states: + - Service + /cosmos/tx/v1beta1/txs/{hash}: get: - summary: ClientStates queries all the IBC light clients of a chain. - operationId: IbcCoreClientV1ClientStates + summary: GetTx fetches a tx by hash. + operationId: CosmosTxV1Beta1GetTx responses: '200': description: A successful response. + schema: + $ref: '#/definitions/cosmos.tx.v1beta1.GetTxResponse' + default: + description: An unexpected error response. schema: type: object properties: - client_states: + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object properties: - client_id: + '@type': type: string - title: client identifier - client_state: - title: client state - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - protocol buffer message. This string must contain at - least + protocol buffer message. This string must contain at + least - one "/" character. The last segment of the URL's - path must represent + one "/" character. The last segment of the URL's path + must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be - in a canonical form + `path/google.protobuf.Duration`). The name should be in + a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the - binary all types that they + In practice, teams usually precompile into the binary + all types that they - expect it to use in the context of Any. However, for - URLs which use the + expect it to use in the context of Any. However, for + URLs which use the - scheme `http`, `https`, or no scheme, one can - optionally set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the - regular - - representation of the deserialized, embedded message, - with an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a - custom JSON - - representation, that representation will be embedded - adding a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message - [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - IdentifiedClientState defines a client state with an - additional client - - identifier field. - description: list of stored ClientStates of the chain. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryClientStatesResponse is the response type for the - Query/ClientStates RPC - - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as + follows: * If no scheme is provided, `https` is assumed. @@ -32509,285 +33763,32 @@ paths: "value": "1.212s" } parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: hash + description: hash is the tx hash to query, encoded as a hex string. + in: path + required: true type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - - Query - /ibc/core/client/v1/client_states/{client_id}: + - Service + /cosmos/upgrade/v1beta1/applied_plan/{name}: get: - summary: ClientState queries an IBC light client. - operationId: IbcCoreClientV1ClientState + summary: AppliedPlan queries a previously applied upgrade plan by its name. + operationId: CosmosUpgradeV1Beta1AppliedPlan responses: '200': description: A successful response. schema: type: object properties: - client_state: - title: client state associated with the request identifier - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - proof: + height: type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset + format: int64 + description: height is the block height at which the plan was applied. description: >- - QueryClientStateResponse is the response type for the - Query/ClientState RPC - - method. Besides the client state, it includes a proof and the - height from + QueryAppliedPlanResponse is the response type for the + Query/AppliedPlan RPC - which the proof was retrieved. + method. default: description: An unexpected error response. schema: @@ -32974,30 +33975,28 @@ paths: "value": "1.212s" } parameters: - - name: client_id - description: client state unique identifier + - name: name + description: name is the name of the applied plan to query for. in: path required: true type: string tags: - Query - /ibc/core/client/v1/client_status/{client_id}: + /cosmos/upgrade/v1beta1/authority: get: - summary: Status queries the status of an IBC client. - operationId: IbcCoreClientV1ClientStatus + summary: Returns the account with authority to conduct upgrades + description: 'Since: cosmos-sdk 0.46' + operationId: CosmosUpgradeV1Beta1Authority responses: '200': description: A successful response. schema: type: object properties: - status: + address: type: string - description: >- - QueryClientStatusResponse is the response type for the - Query/ClientStatus RPC - - method. It returns the current status of the IBC client. + description: 'Since: cosmos-sdk 0.46' + title: QueryAuthorityResponse is the response type for Query/Authority default: description: An unexpected error response. schema: @@ -33183,274 +34182,140 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: client_id - description: client unique identifier - in: path - required: true - type: string tags: - Query - /ibc/core/client/v1/consensus_states/{client_id}: + /cosmos/upgrade/v1beta1/current_plan: get: - summary: |- - ConsensusStates queries all the consensus state associated with a given - client. - operationId: IbcCoreClientV1ConsensusStates + summary: CurrentPlan queries the current upgrade plan. + operationId: CosmosUpgradeV1Beta1CurrentPlan responses: '200': description: A successful response. schema: type: object properties: - consensus_states: - type: array - items: - type: object - properties: - height: - title: consensus state height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each - height while keeping - - RevisionNumber the same. However some consensus - algorithms may choose to + plan: + description: plan is the current upgrade plan. + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by + the upgraded - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as - the RevisionHeight - - gets reset - consensus_state: - title: consensus state - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the - type of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's - path must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the - binary all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available - in the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. + version of the software to apply any special "on-upgrade" + commands during - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + the first BeginBlock method after the upgrade is applied. + It is also used - Example 2: Pack and unpack a message in Java. + to detect whether a software version can handle a given + upgrade. If no - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + upgrade handler with this name has been set in the + software, it will be - Example 3: Pack and unpack a message in Python. + assumed that the software is out-of-date when the upgrade + Time or Height is - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + reached and the software will exit. + time: + type: string + format: date-time + description: >- + Deprecated: Time based upgrades have been deprecated. Time + based upgrade logic - Example 4: Pack and unpack a message in Go + has been removed from the SDK. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: >- + Any application specific upgrade info to be included + on-chain - The pack methods provided by protobuf library will by - default use + such as a git commit that validators could automatically + upgrade to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. + IBC upgrade logic has been - 'type.googleapis.com/full.type.name' as the type URL and - the unpack + moved to the IBC module in the sub module 02-client. - methods only use the fully qualified type name after the - last '/' + If this field is not empty, an error will be thrown. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type + of the serialized - in the type URL, for example "foo.bar.com/x/y.z" will - yield type + protocol buffer message. This string must contain at + least - name "y.z". + one "/" character. The last segment of the URL's path + must represent + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be + in a canonical form - JSON + (e.g., leading "." is not accepted). - ==== - The JSON representation of an `Any` value uses the - regular + In practice, teams usually precompile into the binary + all types that they - representation of the deserialized, embedded message, - with an + expect it to use in the context of Any. However, for + URLs which use the - additional field `@type` which contains the type URL. - Example: + scheme `http`, `https`, or no scheme, one can + optionally set up a type - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + server that maps type URLs to message definitions as + follows: - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a - custom JSON + * If no scheme is provided, `https` is assumed. - representation, that representation will be embedded - adding a field + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results + based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - `value` which holds the custom JSON in addition to the - `@type` + Note: this functionality is not currently available in + the official - field. Example (for message - [google.protobuf.Duration][]): + protobuf release, and it is not used for type URLs + beginning with - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - ConsensusStateWithHeight defines a consensus state with an - additional height + type.googleapis.com. - field. - title: consensus states associated with the identifier - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + Schemes other than `http`, `https` (or the empty + scheme) might be - corresponding request message has used PageRequest. + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryCurrentPlanResponse is the response type for the + Query/CurrentPlan RPC - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryConsensusStatesResponse is the response type for the - Query/ConsensusStates RPC method + method. default: description: An unexpected error response. schema: @@ -33636,152 +34501,46 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: client_id - description: client identifier - in: path - required: true - type: string - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /ibc/core/client/v1/consensus_states/{client_id}/heights: + /cosmos/upgrade/v1beta1/module_versions: get: - summary: >- - ConsensusStateHeights queries the height of every consensus states - associated with a given client. - operationId: IbcCoreClientV1ConsensusStateHeights + summary: ModuleVersions queries the list of module versions from state. + description: 'Since: cosmos-sdk 0.43' + operationId: CosmosUpgradeV1Beta1ModuleVersions responses: '200': description: A successful response. schema: type: object properties: - consensus_state_heights: + module_versions: type: array items: type: object properties: - revision_number: + name: type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + title: name of the app module + version: type: string format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms - may choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - title: >- - Height is a monotonically increasing data type - - that can be compared against another Height for the purposes - of updating and - - freezing clients - title: consensus state heights - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. - was set, its value is undefined otherwise + Since: cosmos-sdk 0.43 description: >- - PageResponse is to be embedded in gRPC response messages where - the + module_versions is a list of module names with their consensus + versions. + description: >- + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions - corresponding request message has used PageRequest. + RPC method. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryConsensusStateHeightsResponse is the response type for the - Query/ConsensusStateHeights RPC method + + Since: cosmos-sdk 0.43 default: description: An unexpected error response. schema: @@ -33968,336 +34727,89 @@ paths: "value": "1.212s" } parameters: - - name: client_id - description: client identifier - in: path - required: true - type: string - - name: pagination.key + - name: module_name description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. + module_name is a field to query a specific module + consensus version from state. Leaving this empty will + fetch the full list of module versions from state in: query required: false type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}: + /cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}: get: summary: >- - ConsensusState queries a consensus state associated with a client state - at + UpgradedConsensusState queries the consensus state that will serve + + as a trusted kernel for the next version of this chain. It will only be + + stored at the last height of this chain. - a given height. - operationId: IbcCoreClientV1ConsensusState + UpgradedConsensusState RPC not supported with legacy querier + + This rpc is deprecated now that IBC has its own replacement + + (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + operationId: CosmosUpgradeV1Beta1UpgradedConsensusState responses: '200': description: A successful response. schema: type: object properties: - consensus_state: - title: >- - consensus state associated with the client identifier at the - given height - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least + upgraded_consensus_state: + type: string + format: byte + title: 'Since: cosmos-sdk 0.43' + description: >- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState - one "/" character. The last segment of the URL's path must - represent + RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - the fully qualified name of the type (as in + protocol buffer message. This string must contain at + least - `path/google.protobuf.Duration`). The name should be in a - canonical form + one "/" character. The last segment of the URL's path + must represent - (e.g., leading "." is not accepted). + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in + a canonical form - In practice, teams usually precompile into the binary all - types that they + (e.g., leading "." is not accepted). - expect it to use in the context of Any. However, for URLs - which use the - scheme `http`, `https`, or no scheme, one can optionally - set up a type + In practice, teams usually precompile into the binary + all types that they - server that maps type URLs to message definitions as - follows: + expect it to use in the context of Any. However, for + URLs which use the - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - title: >- - QueryConsensusStateResponse is the response type for the - Query/ConsensusState - - RPC method - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type + scheme `http`, `https`, or no scheme, one can optionally + set up a type server that maps type URLs to message definitions as follows: @@ -34441,60 +34953,253 @@ paths: "value": "1.212s" } parameters: - - name: client_id - description: client identifier + - name: last_height + description: |- + last height of the current chain must be sent in request + as this is the height under which next consensus state is stored in: path required: true type: string - - name: revision_number - description: consensus state revision number - in: path - required: true + format: int64 + tags: + - Query + /lavanet/lava/conflict/conflict_vote: + get: + summary: Queries a list of ConflictVote items. + operationId: LavanetLavaConflictConflictVoteAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + conflictVote: + type: array + items: + type: object + properties: + index: + type: string + clientAddress: + type: string + voteDeadline: + type: string + format: uint64 + voteStartBlock: + type: string + format: uint64 + voteState: + type: string + format: int64 + chainID: + type: string + apiUrl: + type: string + requestData: + type: string + format: byte + requestBlock: + type: string + format: uint64 + firstProvider: + type: object + properties: + account: + type: string + response: + type: string + format: byte + secondProvider: + type: object + properties: + account: + type: string + response: + type: string + format: byte + votes: + type: array + items: + type: object + properties: + address: + type: string + Hash: + type: string + format: byte + Result: + type: string + format: int64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false type: string format: uint64 - - name: revision_height - description: consensus state revision height - in: path - required: true + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string format: uint64 - - name: latest_height + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse description: >- - latest_height overrrides the height field and queries the latest - stored + reverse is set to true if results are to be returned in the + descending order. + - ConsensusState + Since: cosmos-sdk 0.43 in: query required: false type: boolean tags: - Query - /ibc/core/client/v1/params: + /lavanet/lava/conflict/conflict_vote/{index}: get: - summary: ClientParams queries all parameters of the ibc client submodule. - operationId: IbcCoreClientV1ClientParams + summary: Queries a ConflictVote by index. + operationId: LavanetLavaConflictConflictVote responses: '200': description: A successful response. schema: type: object properties: - params: - description: params defines the parameters of the module. + conflictVote: type: object properties: - allowed_clients: + index: + type: string + clientAddress: + type: string + voteDeadline: + type: string + format: uint64 + voteStartBlock: + type: string + format: uint64 + voteState: + type: string + format: int64 + chainID: + type: string + apiUrl: + type: string + requestData: + type: string + format: byte + requestBlock: + type: string + format: uint64 + firstProvider: + type: object + properties: + account: + type: string + response: + type: string + format: byte + secondProvider: + type: object + properties: + account: + type: string + response: + type: string + format: byte + votes: type: array items: - type: string - description: >- - allowed_clients defines the list of allowed client state - types. - description: >- - QueryClientParamsResponse is the response type for the - Query/ClientParams RPC - - method. + type: object + properties: + address: + type: string + Hash: + type: string + format: byte + Result: + type: string + format: int64 default: description: An unexpected error response. schema: @@ -34512,359 +35217,28 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + parameters: + - name: index + in: path + required: true + type: string tags: - Query - /ibc/core/client/v1/upgraded_client_states: + /lavanet/lava/conflict/consumer_conflicts/{consumer}: get: - summary: UpgradedClientState queries an Upgraded IBC light client. - operationId: IbcCoreClientV1UpgradedClientState + summary: Gets a consumer's active conflict list. + operationId: LavanetLavaConflictConsumerConflicts responses: '200': description: A successful response. schema: type: object properties: - upgraded_client_state: - title: client state associated with the request identifier - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - QueryUpgradedClientStateResponse is the response type for the - Query/UpgradedClientState RPC method. + conflicts: + type: array + items: + type: string default: description: An unexpected error response. schema: @@ -34882,359 +35256,493 @@ paths: properties: '@type': type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in - a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values - in the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with - an - - additional field `@type` which contains the type URL. - Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding - a field - - `value` which holds the custom JSON in addition to the - `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + parameters: + - name: consumer + in: path + required: true + type: string tags: - Query - /ibc/core/client/v1/upgraded_consensus_states: + /lavanet/lava/conflict/params: get: - summary: UpgradedConsensusState queries an Upgraded IBC consensus state. - operationId: IbcCoreClientV1UpgradedConsensusState + summary: Parameters queries the parameters of the module. + operationId: LavanetLavaConflictParams responses: '200': description: A successful response. schema: type: object properties: - upgraded_consensus_state: - title: Consensus state associated with the request identifier + params: + description: params holds all the parameters of this module. type: object properties: - '@type': + majorityPercent: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - + voteStartSpan: + type: string + format: uint64 + votePeriod: + type: string + format: uint64 + Rewards: + type: object + properties: + winnerRewardPercent: + type: string + clientRewardPercent: + type: string + votersRewardPercent: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/conflict/provider_conflicts/{provider}: + get: + summary: >- + Queries a provider's conflict list (ones that the provider was reported + in and ones that the provider needs to vote) + operationId: LavanetLavaConflictProviderConflicts + responses: + '200': + description: A successful response. + schema: + type: object + properties: + reported: + type: array + items: + type: string + not_voted: + type: array + items: + type: string + committed: + type: array + items: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: provider + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/downtime/v1/params: + get: + operationId: LavanetLavaDowntimeV1QueryParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + type: object + properties: + downtime_duration: + type: string + description: >- + downtime_duration defines the minimum time elapsed between + blocks + that we consider the chain to be down. + epoch_duration: + type: string + title: >- + epoch_duration defines an estimation of the time elapsed + between epochs + description: Params defines the parameters of the downtime module. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/downtime/v1/query_downtime: + get: + operationId: LavanetLavaDowntimeV1QueryDowntime + responses: + '200': + description: A successful response. + schema: + type: object + properties: + cumulative_downtime_duration: + type: string + description: >- + QueryDowntimeResponse is the response type for the + Query/QueryDowntime RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: epoch_start_block + in: query + required: false + type: string + format: uint64 + tags: + - Query + /lavanet/lava/dualstaking/delegator_providers/{delegator}: + get: + summary: Queries a delegator for all its providers. + operationId: LavanetLavaDualstakingDelegatorProviders + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegations: + type: array + items: + type: object + properties: + provider: + type: string + title: provider receives the delegated funds + chainID: + type: string + title: chainID to which staking delegate funds + delegator: + type: string + title: delegator that owns the delegated funds + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - JSON - ==== + NOTE: The amount field is an Int which implements the + custom method - The JSON representation of an `Any` value uses the regular + signatures required by gogoproto. + timestamp: + type: string + format: int64 + title: Unix timestamp of the delegation (+ month) + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator + in: path + required: true + type: string + - name: with_pending + in: query + required: false + type: boolean + tags: + - Query + /lavanet/lava/dualstaking/delegator_rewards/{delegator}/{provider}/{chain_id}: + get: + summary: Queries a the unclaimed rewards of a delegator. + operationId: LavanetLavaDualstakingDelegatorRewards + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + provider: + type: string + chain_id: + type: string + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + NOTE: The amount field is an Int which implements the + custom method - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + signatures required by gogoproto. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: delegator + in: path + required: true + type: string + - name: provider + in: path + required: true + type: string + - name: chain_id + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/dualstaking/params: + get: + summary: Parameters queries the parameters of the module. + operationId: LavanetLavaDualstakingParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + min_self_delegation: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom - JSON + NOTE: The amount field is an Int which implements the + custom method - representation, that representation will be embedded adding a - field + signatures required by gogoproto. + title: min self delegation for provider + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/dualstaking/provider_delegators/{provider}: + get: + summary: Queries a provider for all its delegators. + operationId: LavanetLavaDualstakingProviderDelegators + responses: + '200': + description: A successful response. + schema: + type: object + properties: + delegations: + type: array + items: + type: object + properties: + provider: + type: string + title: provider receives the delegated funds + chainID: + type: string + title: chainID to which staking delegate funds + delegator: + type: string + title: delegator that owns the delegated funds + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + NOTE: The amount field is an Int which implements the + custom method - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState RPC method. + signatures required by gogoproto. + timestamp: + type: string + format: int64 + title: Unix timestamp of the delegation (+ month) + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: provider + in: path + required: true + type: string + - name: with_pending + in: query + required: false + type: boolean + tags: + - Query + /lavanet/lava/epochstorage/epoch_details: + get: + summary: Queries a EpochDetails by index. + operationId: LavanetLavaEpochstorageEpochDetails + responses: + '200': + description: A successful response. + schema: + type: object + properties: + EpochDetails: + type: object + properties: + startBlock: + type: string + format: uint64 + earliestStart: + type: string + format: uint64 + deletedEpochs: + type: array + items: + type: string + format: uint64 default: description: An unexpected error response. schema: @@ -35422,59 +35930,57 @@ paths: } tags: - Query - /ibc/core/connection/v1/client_connections/{client_id}: + /lavanet/lava/epochstorage/fixated_params: get: - summary: |- - ClientConnections queries the connection paths associated with a client - state. - operationId: IbcCoreConnectionV1ClientConnections + summary: Queries a list of FixatedParams items. + operationId: LavanetLavaEpochstorageFixatedParamsAll responses: '200': description: A successful response. schema: type: object properties: - connection_paths: + fixatedParams: type: array items: - type: string - description: slice of all the connection paths associated with a client. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was generated + type: object + properties: + index: + type: string + parameter: + type: string + format: byte + fixationBlock: + type: string + format: uint64 + pagination: type: object properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + next_key: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - breaking changes In these cases, the RevisionNumber is - incremented so that + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - height continues to be monitonically increasing even as the - RevisionHeight + corresponding request message has used PageRequest. - gets reset - title: |- - QueryClientConnectionsResponse is the response type for the - Query/ClientConnections RPC method + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } default: description: An unexpected error response. schema: @@ -35661,173 +36167,85 @@ paths: "value": "1.212s" } parameters: - - name: client_id - description: client identifier associated with a connection - in: path - required: true + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /ibc/core/connection/v1/connections: + /lavanet/lava/epochstorage/fixated_params/{index}: get: - summary: Connections queries all the IBC connections of a chain. - operationId: IbcCoreConnectionV1Connections + summary: Queries a FixatedParams by index. + operationId: LavanetLavaEpochstorageFixatedParams responses: '200': description: A successful response. schema: type: object properties: - connections: - type: array - items: - type: object - properties: - id: - type: string - description: connection identifier. - client_id: - type: string - description: client associated with this connection. - versions: - type: array - items: - type: object - properties: - identifier: - type: string - title: unique version identifier - features: - type: array - items: - type: string - title: >- - list of features compatible with the specified - identifier - description: >- - Version defines the versioning scheme used to - negotiate the IBC verison in - - the connection handshake. - title: >- - IBC version which can be utilised to determine encodings - or protocols for - - channels or packets utilising this connection - state: - description: current state of the connection end. - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - default: STATE_UNINITIALIZED_UNSPECIFIED - counterparty: - description: counterparty chain associated with this connection. - type: object - properties: - client_id: - type: string - description: >- - identifies the client on the counterparty chain - associated with a given - - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty - chain associated with a - - given connection. - prefix: - description: commitment merkle prefix of the counterparty chain. - type: object - properties: - key_prefix: - type: string - format: byte - title: >- - MerklePrefix is merkle path prefixed to the key. - - The constructed key from the Path and the key will - be append(Path.KeyPath, - - append(Path.KeyPrefix, key...)) - delay_period: - type: string - format: uint64 - description: delay period associated with this connection. - description: >- - IdentifiedConnection defines a connection with additional - connection - - identifier field. - description: list of stored connections of the chain. - pagination: - title: pagination response + fixatedParams: type: object properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + index: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: + parameter: type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + format: byte + fixationBlock: type: string format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - description: >- - QueryConnectionsResponse is the response type for the - Query/Connections RPC - - method. default: description: An unexpected error response. schema: @@ -36014,208 +36432,44 @@ paths: "value": "1.212s" } parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false + - name: index + in: path + required: true type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. - - - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean tags: - Query - /ibc/core/connection/v1/connections/{connection_id}: + /lavanet/lava/epochstorage/params: get: - summary: Connection queries an IBC connection end. - operationId: IbcCoreConnectionV1Connection + summary: Parameters queries the parameters of the module. + operationId: LavanetLavaEpochstorageParams responses: '200': description: A successful response. schema: type: object properties: - connection: - title: connection associated with the request identifier + params: + description: params holds all the parameters of this module. type: object properties: - client_id: + unstakeHoldBlocks: type: string - description: client associated with this connection. - versions: - type: array - items: - type: object - properties: - identifier: - type: string - title: unique version identifier - features: - type: array - items: - type: string - title: >- - list of features compatible with the specified - identifier - description: >- - Version defines the versioning scheme used to negotiate - the IBC verison in - - the connection handshake. - description: >- - IBC version which can be utilised to determine encodings - or protocols for - - channels or packets utilising this connection. - state: - description: current state of the connection end. + format: uint64 + epochBlocks: type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - default: STATE_UNINITIALIZED_UNSPECIFIED - counterparty: - description: counterparty chain associated with this connection. - type: object - properties: - client_id: - type: string - description: >- - identifies the client on the counterparty chain - associated with a given - - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty - chain associated with a - - given connection. - prefix: - description: commitment merkle prefix of the counterparty chain. - type: object - properties: - key_prefix: - type: string - format: byte - title: >- - MerklePrefix is merkle path prefixed to the key. - - The constructed key from the Path and the key will be - append(Path.KeyPath, - - append(Path.KeyPrefix, key...)) - delay_period: + format: uint64 + epochsToSave: type: string format: uint64 - description: >- - delay period that must pass before a consensus state can - be used for - - packet-verification NOTE: delay period logic is only - implemented by some - - clients. - description: >- - ConnectionEnd defines a stateful object on a chain connected - to another - - separate one. - - NOTE: there must only be 2 defined ConnectionEnds to establish - - a connection between two chains. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: + latestParamChange: type: string format: uint64 - title: the revision that the client is currently on - revision_height: + unstakeHoldBlocksStatic: type: string format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset description: >- - QueryConnectionResponse is the response type for the - Query/Connection RPC - - method. Besides the connection end, it includes a proof and the - height from - - which the proof was retrieved. + QueryParamsResponse is response type for the Query/Params RPC + method. default: description: An unexpected error response. schema: @@ -36401,248 +36655,202 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - parameters: - - name: connection_id - description: connection unique identifier - in: path - required: true - type: string tags: - Query - /ibc/core/connection/v1/connections/{connection_id}/client_state: + /lavanet/lava/epochstorage/stake_storage: get: - summary: |- - ConnectionClientState queries the client state associated with the - connection. - operationId: IbcCoreConnectionV1ConnectionClientState + summary: Queries a list of StakeStorage items. + operationId: LavanetLavaEpochstorageStakeStorageAll responses: '200': description: A successful response. schema: type: object properties: - identified_client_state: - title: client state associated with the channel - type: object - properties: - client_id: - type: string - title: client identifier - client_state: - title: client state - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type - of the serialized - - protocol buffer message. This string must contain at - least - - one "/" character. The last segment of the URL's path - must represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be - in a canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary - all types that they - - expect it to use in the context of Any. However, for - URLs which use the - - scheme `http`, `https`, or no scheme, one can - optionally set up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results - based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in - the official - - protobuf release, and it is not used for type URLs - beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty - scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer - message along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any - values in the form - - of utility functions or additional generated methods of - the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by - default use - - 'type.googleapis.com/full.type.name' as the type URL and - the unpack - - methods only use the fully qualified type name after the - last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will - yield type - - name "y.z". - - - - JSON - - ==== + stakeStorage: + type: array + items: + type: object + properties: + index: + type: string + stakeEntries: + type: array + items: + type: object + properties: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with - an + NOTE: The amount field is an Int which implements + the custom method - additional field `@type` which contains the type URL. - Example: + signatures required by gogoproto. + address: + type: string + stake_applied_block: + type: string + format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + NOTE: The amount field is an Int which implements + the custom method - If the embedded message type is well-known and has a - custom JSON + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - representation, that representation will be embedded - adding a field - `value` which holds the custom JSON in addition to the - `@type` + NOTE: The amount field is an Int which implements + the custom method - field. Example (for message [google.protobuf.Duration][]): + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info + regarding blocks of the provider - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - IdentifiedClientState defines a client state with an - additional client + It is set in the relay payment TX logic - identifier field. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved + used by the consumer to calculate the provider's + sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity + signature (ex. UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + epochBlockHash: + type: string + format: byte + pagination: type: object properties: - revision_number: + next_key: type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine + title: >- + total is total number of results available if + PageRequest.count_total - breaking changes In these cases, the RevisionNumber is - incremented so that + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the - height continues to be monitonically increasing even as the - RevisionHeight + corresponding request message has used PageRequest. - gets reset - title: |- - QueryConnectionClientStateResponse is the response type for the - Query/ConnectionClientState RPC method + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } default: description: An unexpected error response. schema: @@ -36829,234 +37037,228 @@ paths: "value": "1.212s" } parameters: - - name: connection_id - description: connection identifier - in: path - required: true + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query - /ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}: + /lavanet/lava/epochstorage/stake_storage/{index}: get: - summary: |- - ConnectionConsensusState queries the consensus state associated with the - connection. - operationId: IbcCoreConnectionV1ConnectionConsensusState + summary: Queries a StakeStorage by index. + operationId: LavanetLavaEpochstorageStakeStorage responses: '200': description: A successful response. schema: type: object properties: - consensus_state: - title: consensus state associated with the channel + stakeStorage: type: object properties: - '@type': + index: type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally - set up a type + stakeEntries: + type: array + items: + type: object + properties: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - server that maps type URLs to message definitions as - follows: + NOTE: The amount field is an Int which implements + the custom method - * If no scheme is provided, `https` is assumed. + signatures required by gogoproto. + address: + type: string + stake_applied_block: + type: string + format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available in the - official + NOTE: The amount field is an Int which implements + the custom method - protobuf release, and it is not used for type URLs - beginning with + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - type.googleapis.com. + NOTE: The amount field is an Int which implements + the custom method - Schemes other than `http`, `https` (or the empty scheme) - might be + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + It is set in the relay payment TX logic - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the - Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield - type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom - JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - client_id: - type: string - title: client ID associated with the consensus state - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + used by the consumer to calculate the provider's + sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature + (ex. UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + epochBlockHash: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height - while keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is - incremented so that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - title: |- - QueryConnectionConsensusStateResponse is the response type for the - Query/ConnectionConsensusState RPC method + format: byte default: description: An unexpected error response. schema: @@ -37243,52 +37445,410 @@ paths: "value": "1.212s" } parameters: - - name: connection_id - description: connection identifier + - name: index + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/fixationstore/Entry/{store_key}/{prefix}/{key}/{block}: + get: + summary: Queries for a specific entry with detailed information. + operationId: LavanetLavaFixationstoreEntry + responses: + '200': + description: A successful response. + schema: + type: object + properties: + entry: + type: object + properties: + index: + type: string + title: unique entry index (i.e. list key) + block: + type: string + format: uint64 + title: block when the entry was created + stale_at: + type: string + format: uint64 + title: block when the entry becomes stale + refcount: + type: string + format: uint64 + title: reference count + data: + type: string + format: byte + title: the data saved in the entry + delete_at: + type: string + format: uint64 + title: block when the entry becomes deleted + is_latest: + type: boolean + title: is this entry the latest entry now? + string_data: + type: string + title: 'optional: entry data as a string' + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: store_key in: path required: true type: string - - name: revision_number + - name: prefix in: path required: true type: string - format: uint64 - - name: revision_height + - name: key + in: path + required: true + type: string + - name: block in: path required: true type: string format: uint64 + - name: hide_data + in: query + required: false + type: boolean + - name: string_data + in: query + required: false + type: boolean tags: - Query - /ibc/core/connection/v1/params: + /lavanet/lava/fixationstore/all_indices/{store_key}/{prefix}: get: - summary: ConnectionParams queries all parameters of the ibc connection submodule. - operationId: IbcCoreConnectionV1ConnectionParams + summary: Queries a fixation store for all its indices. + operationId: LavanetLavaFixationstoreAllIndices responses: '200': description: A successful response. schema: type: object properties: - params: - description: params defines the parameters of the module. + indices: + type: array + items: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: store_key + in: path + required: true + type: string + - name: prefix + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/fixationstore/store_keys: + get: + summary: Queries for all store keys. + operationId: LavanetLavaFixationstoreStoreKeys + responses: + '200': + description: A successful response. + schema: + type: object + properties: + keys: + type: array + items: + type: object + properties: + store_key: + type: string + prefix: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/fixationstore/versions/{store_key}/{prefix}/{key}: + get: + summary: >- + Queries for all versions of a specific entry (versions = different + blocks). + operationId: LavanetLavaFixationstoreVersions + responses: + '200': + description: A successful response. + schema: + type: object + properties: + entries: + type: array + items: + type: object + properties: + index: + type: string + title: unique entry index (i.e. list key) + block: + type: string + format: uint64 + title: block when the entry was created + stale_at: + type: string + format: uint64 + title: block when the entry becomes stale + refcount: + type: string + format: uint64 + title: reference count + data: + type: string + format: byte + title: the data saved in the entry + delete_at: + type: string + format: uint64 + title: block when the entry becomes deleted + is_latest: + type: boolean + title: is this entry the latest entry now? + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: store_key + in: path + required: true + type: string + - name: prefix + in: path + required: true + type: string + - name: key + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/pairing/effective_policy/{consumer}/{specID}: + get: + summary: Queries a list of EffectivePolicy items. + operationId: LavanetLavaPairingEffectivePolicy + responses: + '200': + description: A successful response. + schema: + type: object + properties: + policy: type: object properties: - max_expected_time_per_block: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: type: string format: uint64 - description: >- - maximum expected time per block (in nanoseconds), used to - enforce block delay. This parameter should reflect the - - largest amount of time that the chain might reasonably - take to produce the next block under normal operating - - conditions. A safe choice is 3-5x the expected time per - block. - description: >- - QueryConnectionParamsResponse is the response type for the - Query/ConnectionParams RPC method. + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's + behaviour with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to simplify + parsing + pending_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's + behaviour with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to simplify + parsing default: description: An unexpected error response. schema: @@ -37474,245 +38034,182 @@ paths: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + parameters: + - name: consumer + in: path + required: true + type: string + - name: specID + in: path + required: true + type: string tags: - Query - /lavanet/lava/conflict/conflict_vote: + /lavanet/lava/pairing/get_pairing/{chainID}/{client}: get: - summary: Queries a list of ConflictVote items. - operationId: LavanetLavaConflictConflictVoteAll + summary: Queries a list of GetPairing items. + operationId: LavanetLavaPairingGetPairing responses: '200': description: A successful response. schema: type: object properties: - conflictVote: + providers: type: array items: type: object properties: - index: - type: string - clientAddress: - type: string - voteDeadline: - type: string - format: uint64 - voteStartBlock: - type: string - format: uint64 - voteState: - type: string - format: int64 - chainID: - type: string - apiUrl: - type: string - requestData: - type: string - format: byte - requestBlock: - type: string - format: uint64 - firstProvider: - type: object - properties: - account: - type: string - response: - type: string - format: byte - secondProvider: + stake: type: object properties: - account: + denom: type: string - response: + amount: type: string - format: byte - votes: + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + address: + type: string + stake_applied_block: + type: string + format: uint64 + endpoints: type: array items: type: object properties: - address: - type: string - Hash: - type: string - format: byte - Result: + iPPORT: type: string - format: int64 - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - It is less efficient than using key. Only one of offset or key - should - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + NOTE: The amount field is an Int which implements the + custom method - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - a count of the total number of items available for pagination in - UIs. - count_total is only respected when offset is used. It is ignored - when key + NOTE: The amount field is an Int which implements the + custom method - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider + It is set in the relay payment TX logic - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /lavanet/lava/conflict/conflict_vote/{index}: - get: - summary: Queries a ConflictVote by index. - operationId: LavanetLavaConflictConflictVote - responses: - '200': - description: A successful response. - schema: - type: object - properties: - conflictVote: - type: object - properties: - index: - type: string - clientAddress: - type: string - voteDeadline: - type: string - format: uint64 - voteStartBlock: - type: string - format: uint64 - voteState: - type: string - format: int64 - chainID: - type: string - apiUrl: - type: string - requestData: - type: string - format: byte - requestBlock: - type: string - format: uint64 - firstProvider: - type: object - properties: - account: - type: string - response: - type: string - format: byte - secondProvider: - type: object - properties: - account: - type: string - response: - type: string - format: byte - votes: - type: array - items: + used by the consumer to calculate the provider's sync + score + vault: + type: string + description: type: object properties: - address: + moniker: type: string - Hash: + description: >- + moniker defines a human-readable name for the + validator. + identity: type: string - format: byte - Result: + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: type: string - format: int64 + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + current_epoch: + type: string + format: uint64 + time_left_to_next_pairing: + type: string + format: uint64 + spec_last_updated_block: + type: string + format: uint64 + block_of_next_pairing: + type: string + format: uint64 default: description: An unexpected error response. schema: @@ -37730,18 +38227,189 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - - name: index + - name: chainID + in: path + required: true + type: string + - name: client in: path required: true type: string tags: - Query - /lavanet/lava/conflict/params: + /lavanet/lava/pairing/params: get: summary: Parameters queries the parameters of the module. - operationId: LavanetLavaConflictParams + operationId: LavanetLavaPairingParams responses: '200': description: A successful response. @@ -37752,23 +38420,14 @@ paths: description: params holds all the parameters of this module. type: object properties: - majorityPercent: - type: string - voteStartSpan: + epochBlocksOverlap: type: string format: uint64 - votePeriod: + QoSWeight: + type: string + recommendedEpochNumToCollectPayment: type: string format: uint64 - Rewards: - type: object - properties: - winnerRewardPercent: - type: string - clientRewardPercent: - type: string - votersRewardPercent: - type: string description: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -37789,80 +38448,329 @@ paths: properties: '@type': type: string - additionalProperties: {} - tags: - - Query - /lavanet/lava/downtime/v1/params: - get: - operationId: LavanetLavaDowntimeV1QueryParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - downtime_duration: - type: string - description: >- - downtime_duration defines the minimum time elapsed between - blocks + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - that we consider the chain to be down. - description: Params defines the parameters of the downtime module. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } tags: - Query - /lavanet/lava/downtime/v1/query_downtime: + /lavanet/lava/pairing/provider/{address}/{chainID}: get: - operationId: LavanetLavaDowntimeV1QueryDowntime + summary: Queries a Provider item. + operationId: LavanetLavaPairingProvider responses: '200': description: A successful response. schema: type: object properties: - downtimes: + stakeEntries: type: array items: type: object properties: - block: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + address: + type: string + stake_applied_block: type: string format: uint64 - description: block defines the block that took time to produce. - duration: + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string description: >- - duration defines the time elapsed between the previous - block and this one. + Coin defines a token with a denomination and an amount. - this defines the effective downtime duration. - description: Downtime defines a single downtime record. - cumulative_downtime_duration: - type: string - description: >- - QueryDowntimeResponse is the response type for the - Query/QueryDowntime RPC method. + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync + score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 default: description: An unexpected error response. schema: @@ -37880,42 +38788,208 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - - name: start_block - in: query - required: false + - name: address + in: path + required: true type: string - format: uint64 - - name: end_block - in: query - required: false + - name: chainID + in: path + required: true type: string - format: uint64 tags: - Query - /lavanet/lava/epochstorage/epoch_details: + /lavanet/lava/pairing/provider_monthly_payout/{provider}: get: - summary: Queries a EpochDetails by index. - operationId: LavanetLavaEpochstorageEpochDetails + summary: Queries the expected monthly payout of a specific provider + operationId: LavanetLavaPairingProviderMonthlyPayout responses: '200': description: A successful response. schema: type: object properties: - EpochDetails: - type: object - properties: - startBlock: - type: string - format: uint64 - earliestStart: - type: string - format: uint64 - deletedEpochs: - type: array - items: + total: + type: string + format: uint64 + details: + type: array + items: + type: object + properties: + subscription: + type: string + chain_id: + type: string + amount: type: string format: uint64 default: @@ -37935,158 +39009,193 @@ paths: properties: '@type': type: string - additionalProperties: {} - tags: - - Query - /lavanet/lava/epochstorage/fixated_params: - get: - summary: Queries a list of FixatedParams items. - operationId: LavanetLavaEpochstorageFixatedParamsAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - fixatedParams: - type: array - items: - type: object - properties: - index: - type: string - parameter: - type: string - format: byte - fixationBlock: - type: string - format: uint64 - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + protocol buffer message. This string must contain at + least - corresponding request message has used PageRequest. + one "/" character. The last segment of the URL's path + must represent - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - It is less efficient than using key. Only one of offset or key - should + URL that describes the type of the serialized message. - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + Protobuf library provides support to pack/unpack Any values + in the form - a count of the total number of items available for pagination in - UIs. + of utility functions or additional generated methods of the + Any type. - count_total is only respected when offset is used. It is ignored - when key - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: provider + in: path + required: true + type: string tags: - Query - /lavanet/lava/epochstorage/fixated_params/{index}: + /lavanet/lava/pairing/provider_pairing_chance/{provider}/{chainID}/{geolocation}/{cluster}: get: - summary: Queries a FixatedParams by index. - operationId: LavanetLavaEpochstorageFixatedParams + summary: Queries a list of ProviderPairingChance items. + operationId: LavanetLavaPairingProviderPairingChance responses: '200': description: A successful response. schema: type: object properties: - fixatedParams: - type: object - properties: - index: - type: string - parameter: - type: string - format: byte - fixationBlock: - type: string - format: uint64 + chance: + type: string default: description: An unexpected error response. schema: @@ -38104,169 +39213,347 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - - name: index + - name: provider + in: path + required: true + type: string + - name: chainID + in: path + required: true + type: string + - name: geolocation + in: path + required: true + type: integer + format: int32 + - name: cluster in: path required: true type: string tags: - Query - /lavanet/lava/epochstorage/params: + /lavanet/lava/pairing/providers/{chainID}: get: - summary: Parameters queries the parameters of the module. - operationId: LavanetLavaEpochstorageParams + summary: Queries a list of Providers items. + operationId: LavanetLavaPairingProviders responses: '200': description: A successful response. schema: type: object properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - unstakeHoldBlocks: - type: string - format: uint64 - epochBlocks: - type: string - format: uint64 - epochsToSave: - type: string - format: uint64 - latestParamChange: - type: string - format: uint64 - unstakeHoldBlocksStatic: - type: string - format: uint64 - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: + stakeEntry: type: array items: type: object properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /lavanet/lava/epochstorage/stake_storage: - get: - summary: Queries a list of StakeStorage items. - operationId: LavanetLavaEpochstorageStakeStorageAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - stakeStorage: - type: array - items: - type: object - properties: - index: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + address: type: string - stakeEntries: + stake_applied_block: + type: string + format: uint64 + endpoints: type: array items: type: object properties: - stake: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. - - - NOTE: The amount field is an Int which implements - the custom method - - signatures required by gogoproto. - address: - type: string - stake_applied_block: + iPPORT: type: string - format: uint64 - endpoints: + geolocation: + type: integer + format: int32 + addons: type: array items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - epochBlockHash: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: type: string - format: byte - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - corresponding request message has used PageRequest. + NOTE: The amount field is an Int which implements the + custom method - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync + score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 default: description: An unexpected error response. schema: @@ -38284,139 +39571,207 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - It is less efficient than using key. Only one of offset or key - should + URL that describes the type of the serialized message. - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + Protobuf library provides support to pack/unpack Any values + in the form - a count of the total number of items available for pagination in - UIs. + of utility functions or additional generated methods of the + Any type. - count_total is only respected when offset is used. It is ignored - when key - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - Since: cosmos-sdk 0.43 + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: chainID + in: path + required: true + type: string + - name: showFrozen in: query required: false type: boolean tags: - Query - /lavanet/lava/epochstorage/stake_storage/{index}: + /lavanet/lava/pairing/providers_epoch_cu: get: - summary: Queries a StakeStorage by index. - operationId: LavanetLavaEpochstorageStakeStorage + summary: >- + Queries a for the aggregated CU of all ProviderEpochCu objects all the + providers. + operationId: LavanetLavaPairingProvidersEpochCu responses: '200': description: A successful response. schema: type: object properties: - stakeStorage: - type: object - properties: - index: - type: string - stakeEntries: - type: array - items: - type: object - properties: - stake: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. - - - NOTE: The amount field is an Int which implements - the custom method - - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - epochBlockHash: - type: string - format: byte + info: + type: array + items: + type: object + properties: + provider: + type: string + cu: + type: string + format: uint64 default: description: An unexpected error response. schema: @@ -38434,808 +39789,335 @@ paths: properties: '@type': type: string - additionalProperties: {} - parameters: - - name: index - in: path - required: true - type: string - tags: - - Query - /lavanet/lava/pairing/effective_policy/{consumer}/{specID}: - get: - summary: Queries a list of EffectivePolicy items. - operationId: LavanetLavaPairingEffectivePolicy - responses: - '200': - description: A successful response. - schema: - type: object - properties: - policy: - type: object - properties: - chain_policies: - type: array - items: - type: object - properties: - chain_id: - type: string - apis: - type: array - items: - type: string - requirements: - type: array - items: - type: object - properties: - collection: - type: object - properties: - api_interface: - type: string - internal_path: - type: string - type: - type: string - add_on: - type: string - extensions: - type: array - items: - type: string - geolocation_profile: - type: string - format: uint64 - total_cu_limit: - type: string - format: uint64 - epoch_cu_limit: - type: string - format: uint64 - max_providers_to_pair: - type: string - format: uint64 - selected_providers_mode: - type: string - enum: - - ALLOWED - - MIXED - - EXCLUSIVE - - DISABLED - default: ALLOWED - description: |- - - ALLOWED: no providers restrictions - - MIXED: use the selected providers mixed with randomly chosen providers - - EXCLUSIVE: use only the selected providers - - DISABLED: selected providers feature is disabled - title: >- - the enum below determines the pairing algorithm's - behaviour with the selected providers feature - selected_providers: - type: array - items: - type: string - title: >- - protobuf expected in YAML format: used "moretags" to simplify - parsing - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: consumer - in: path - required: true - type: string - - name: specID - in: path - required: true - type: string - tags: - - Query - /lavanet/lava/pairing/epoch_payments: - get: - summary: Queries a list of EpochPayments items. - operationId: LavanetLavaPairingEpochPaymentsAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - epochPayments: - type: array - items: - type: object - properties: - index: - type: string - providerPaymentStorageKeys: - type: array - items: - type: string - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the + protocol buffer message. This string must contain at + least - corresponding request message has used PageRequest. + one "/" character. The last segment of the URL's path + must represent - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a - It is less efficient than using key. Only one of offset or key - should + URL that describes the type of the serialized message. - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + Protobuf library provides support to pack/unpack Any values + in the form - a count of the total number of items available for pagination in - UIs. + of utility functions or additional generated methods of the + Any type. - count_total is only respected when offset is used. It is ignored - when key - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } tags: - Query - /lavanet/lava/pairing/epoch_payments/{index}: + /lavanet/lava/pairing/sdk_pairing: get: - summary: Queries a EpochPayments by index. - operationId: LavanetLavaPairingEpochPayments + summary: Queries a list of SdkPairing items. + operationId: LavanetLavaPairingSdkPairing responses: '200': description: A successful response. schema: type: object properties: - epochPayments: + pairing: type: object properties: - index: - type: string - providerPaymentStorageKeys: + providers: type: array items: - type: string - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: index - in: path - required: true - type: string - tags: - - Query - /lavanet/lava/pairing/get_pairing/{chainID}/{client}: - get: - summary: Queries a list of GetPairing items. - operationId: LavanetLavaPairingGetPairing - responses: - '200': - description: A successful response. - schema: - type: object - properties: - providers: - type: array - items: - type: object - properties: - stake: type: object properties: - denom: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + address: type: string - amount: + stake_applied_block: type: string - description: >- - Coin defines a token with a denomination and an amount. + format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - NOTE: The amount field is an Int which implements the - custom method + NOTE: The amount field is an Int which implements + the custom method - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: type: string - api_interfaces: - type: array - items: + amount: type: string - extensions: - type: array - items: + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - current_epoch: - type: string - format: uint64 - time_left_to_next_pairing: - type: string - format: uint64 - spec_last_updated_block: - type: string - format: uint64 - block_of_next_pairing: - type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: chainID - in: path - required: true - type: string - - name: client - in: path - required: true - type: string - tags: - - Query - /lavanet/lava/pairing/params: - get: - summary: Parameters queries the parameters of the module. - operationId: LavanetLavaPairingParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - mintCoinsPerCU: - type: string - fraudStakeSlashingFactor: - type: string - fraudSlashingAmount: - type: string - format: uint64 - epochBlocksOverlap: - type: string - format: uint64 - unpayLimit: - type: string - slashLimit: - type: string - dataReliabilityReward: - type: string - QoSWeight: - type: string - recommendedEpochNumToCollectPayment: - type: string - format: uint64 - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /lavanet/lava/pairing/provider_payment_storage: - get: - summary: Queries a list of ProviderPaymentStorage items. - operationId: LavanetLavaPairingProviderPaymentStorageAll - responses: - '200': - description: A successful response. - schema: - type: object - properties: - providerPaymentStorage: - type: array - items: - type: object - properties: - index: - type: string - epoch: - type: string - format: uint64 - uniquePaymentStorageClientProviderKeys: - type: array - items: - type: string - complainersTotalCu: - type: string - format: uint64 - title: >- - total CU that were supposed to be served by the provider - but didn't because he was unavailable (so consumers - complained about him) - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. - - It is less efficient than using key. Only one of offset or key - should - - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. - - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include - - a count of the total number of items available for pagination in - UIs. - - count_total is only respected when offset is used. It is ignored - when key - - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider + It is set in the relay payment TX logic - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /lavanet/lava/pairing/provider_payment_storage/{index}: - get: - summary: Queries a ProviderPaymentStorage by index. - operationId: LavanetLavaPairingProviderPaymentStorage - responses: - '200': - description: A successful response. - schema: - type: object - properties: - providerPaymentStorage: - type: object - properties: - index: - type: string - epoch: - type: string - format: uint64 - uniquePaymentStorageClientProviderKeys: - type: array - items: - type: string - complainersTotalCu: - type: string - format: uint64 - title: >- - total CU that were supposed to be served by the provider - but didn't because he was unavailable (so consumers - complained about him) - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: index - in: path - required: true - type: string - tags: - - Query - /lavanet/lava/pairing/providers/{chainID}: - get: - summary: Queries a list of Providers items. - operationId: LavanetLavaPairingProviders - responses: - '200': - description: A successful response. - schema: - type: object - properties: - stakeEntry: - type: array - items: - type: object - properties: - stake: - type: object - properties: - denom: - type: string - amount: + used by the consumer to calculate the provider's + sync score + vault: type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: + description: + type: object + properties: + moniker: type: string - api_interfaces: - type: array - items: + description: >- + moniker defines a human-readable name for the + validator. + identity: type: string - extensions: - type: array - items: + description: >- + identity defines an optional identity signature + (ex. UPort or Keybase). + website: type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - output: - type: string - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: chainID - in: path - required: true - type: string - - name: showFrozen - in: query - required: false - type: boolean - tags: - - Query - /lavanet/lava/pairing/sdk_pairing: - get: - summary: Queries a list of SdkPairing items. - operationId: LavanetLavaPairingSdkPairing - responses: - '200': - description: A successful response. - schema: - type: object - properties: - pairing: - type: object - properties: - providers: - type: array - items: - type: object - properties: - stake: - type: object - properties: - denom: + description: website defines an optional website link. + security_contact: type: string - amount: + description: >- + security_contact defines an optional email for + security contact. + details: type: string - description: >- - Coin defines a token with a denomination and an - amount. - - - NOTE: The amount field is an Int which implements - the custom method - - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - geolocation: + description: details define other optional details. + description: Description defines a validator description. + jails: type: string format: uint64 - chain: - type: string - moniker: + jail_end_time: type: string + format: int64 current_epoch: type: string format: uint64 @@ -39291,21 +40173,6 @@ paths: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -39407,6 +40274,29 @@ paths: title: >- used to parse byte responses: base64,hex,bech32 + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -39434,6 +40324,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -39463,6 +40354,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -39515,15 +40407,15 @@ paths: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -39543,6 +40435,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -39597,6 +40490,42 @@ paths: type: string expected_value: type: string + latest_distance: + type: string + format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string + downtime_params: + type: object + properties: + downtime_duration: + type: string + description: >- + downtime_duration defines the minimum time elapsed between + blocks + + that we consider the chain to be down. + epoch_duration: + type: string + title: >- + epoch_duration defines an estimation of the time elapsed + between epochs + description: Params defines the parameters of the downtime module. default: description: An unexpected error response. schema: @@ -39614,22 +40543,189 @@ paths: properties: '@type': type: string - additionalProperties: {} - parameters: - - name: chainID - in: query - required: false - type: string - - name: client - in: query - required: false - type: string - tags: - - Query - /lavanet/lava/pairing/static_providers_list/{chainID}: - get: - summary: Queries a list of StaticProvidersList items. - operationId: LavanetLavaPairingStaticProvidersList + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: chainID + in: query + required: false + type: string + - name: client + in: query + required: false + type: string + tags: + - Query + /lavanet/lava/pairing/static_providers_list/{chainID}: + get: + summary: Queries a list of StaticProvidersList items. + operationId: LavanetLavaPairingStaticProvidersList responses: '200': description: A successful response. @@ -39669,8 +40765,8 @@ paths: iPPORT: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 addons: type: array items: @@ -39684,12 +40780,101 @@ paths: items: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 chain: type: string moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync + score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 default: description: An unexpected error response. schema: @@ -39707,7 +40892,174 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - name: chainID in: path @@ -39715,57 +41067,36 @@ paths: type: string tags: - Query - /lavanet/lava/pairing/unique_payment_storage_client_provider: + /lavanet/lava/pairing/subscription_monthly_payout/{consumer}: get: - summary: Queries a list of UniquePaymentStorageClientProvider items. - operationId: LavanetLavaPairingUniquePaymentStorageClientProviderAll + summary: Queries the expected monthly payout of a specific subscription + operationId: LavanetLavaPairingSubscriptionMonthlyPayout responses: '200': description: A successful response. schema: type: object properties: - uniquePaymentStorageClientProvider: + total: + type: string + format: uint64 + details: type: array items: type: object properties: - index: - type: string - block: - type: string - format: uint64 - usedCU: + chain_id: type: string - format: uint64 - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - PageResponse is to be embedded in gRPC response messages where - the - - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } + payouts: + type: array + items: + type: object + properties: + provider: + type: string + amount: + type: string + format: uint64 default: description: An unexpected error response. schema: @@ -39783,107 +41114,176 @@ paths: properties: '@type': type: string - additionalProperties: {} - parameters: - - name: pagination.key - description: |- - key is a value returned in PageResponse.next_key to begin - querying the next page most efficiently. Only one of offset or key - should be set. - in: query - required: false - type: string - format: byte - - name: pagination.offset - description: >- - offset is a numeric offset that can be used when key is unavailable. + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - It is less efficient than using key. Only one of offset or key - should + protocol buffer message. This string must contain at + least - be set. - in: query - required: false - type: string - format: uint64 - - name: pagination.limit - description: >- - limit is the total number of results to be returned in the result - page. + one "/" character. The last segment of the URL's path + must represent - If left empty it will default to a value to be set by each app. - in: query - required: false - type: string - format: uint64 - - name: pagination.count_total - description: >- - count_total is set to true to indicate that the result set should - include + the fully qualified name of the type (as in - a count of the total number of items available for pagination in - UIs. + `path/google.protobuf.Duration`). The name should be in + a canonical form - count_total is only respected when offset is used. It is ignored - when key + (e.g., leading "." is not accepted). - is set. - in: query - required: false - type: boolean - - name: pagination.reverse - description: >- - reverse is set to true if results are to be returned in the - descending order. + In practice, teams usually precompile into the binary + all types that they - Since: cosmos-sdk 0.43 - in: query - required: false - type: boolean - tags: - - Query - /lavanet/lava/pairing/unique_payment_storage_client_provider/{index}: - get: - summary: Queries a UniquePaymentStorageClientProvider by index. - operationId: LavanetLavaPairingUniquePaymentStorageClientProvider - responses: - '200': - description: A successful response. - schema: - type: object - properties: - uniquePaymentStorageClientProvider: - type: object - properties: - index: - type: string - block: - type: string - format: uint64 - usedCU: - type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - - name: index + - name: consumer in: path required: true type: string @@ -39930,8 +41330,8 @@ paths: iPPORT: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 addons: type: array items: @@ -39945,12 +41345,101 @@ paths: items: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 chain: type: string moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync + score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 maxCU: type: string format: uint64 @@ -39971,7 +41460,174 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } parameters: - name: address in: path @@ -40025,60 +41681,227 @@ paths: properties: '@type': type: string - additionalProperties: {} - parameters: - - name: chainID - in: path - required: true - type: string - - name: client - in: path - required: true - type: string - - name: provider - in: path - required: true - type: string - - name: block - in: path - required: true - type: string - format: uint64 - tags: - - Query - /lavanet/lava/plans/info/{plan_index}: - get: - summary: Queries an Info item. - operationId: LavanetLavaPlansInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - plan_info: - type: object - properties: - index: - type: string - block: - type: string - format: uint64 - title: the epoch that this plan was created - price: - title: plan price (in ulava) - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - NOTE: The amount field is an Int which implements the - custom method + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + parameters: + - name: chainID + in: path + required: true + type: string + - name: client + in: path + required: true + type: string + - name: provider + in: path + required: true + type: string + - name: block + in: path + required: true + type: string + format: uint64 + tags: + - Query + /lavanet/lava/plans/info/{plan_index}: + get: + summary: Queries an Info item. + operationId: LavanetLavaPlansInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + plan_info: + type: object + properties: + index: + type: string + block: + type: string + format: uint64 + title: the epoch that this plan was created + price: + title: plan price (in ulava) + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method signatures required by gogoproto. allow_overuse: @@ -40132,9 +41955,11 @@ paths: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -40167,6 +41992,17 @@ paths: title: >- protobuf expected in YAML format: used "moretags" to simplify parsing + projects_limit: + type: string + format: uint64 + title: number of allowed projects + allowed_buyers: + type: array + items: + type: string + title: >- + set of addresses that are the only allowed buyers for the + plan (empty list = everyone is allowed) default: description: An unexpected error response. schema: @@ -40352,9 +42188,11 @@ paths: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -40424,9 +42262,11 @@ paths: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -40463,42 +42303,7 @@ paths: type: string format: uint64 title: snapshot id to uniquely identify snapshots - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: developer - in: path - required: true - type: string - tags: - - Query - /lavanet/lava/projects/info/{project}: - get: - summary: Queries a list of ShowProject items. - operationId: LavanetLavaProjectsInfo - responses: - '200': - description: A successful response. - schema: - type: object - properties: - project: + pending_project: type: object properties: index: @@ -40558,9 +42363,11 @@ paths: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -40630,9 +42437,396 @@ paths: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's + behaviour with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to + simplify parsing + snapshot: + type: string + format: uint64 + title: snapshot id to uniquely identify snapshots + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: developer + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/projects/info/{project}: + get: + summary: Queries a list of ShowProject items. + operationId: LavanetLavaProjectsInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription + address and project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + kinds: + type: integer + format: int64 + title: list of the projects keys + admin_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's + behaviour with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to + simplify parsing + used_cu: + type: string + format: uint64 + subscription_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's + behaviour with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to + simplify parsing + snapshot: + type: string + format: uint64 + title: snapshot id to uniquely identify snapshots + pending_project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription + address and project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + kinds: + type: integer + format: int64 + title: list of the projects keys + admin_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's + behaviour with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to + simplify parsing + used_cu: + type: string + format: uint64 + subscription_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -40779,29 +42973,34 @@ paths: additionalProperties: {} tags: - Query - /lavanet/lava/spec/params: + /lavanet/lava/rewards/block_reward: get: - summary: Parameters queries the parameters of the module. - operationId: LavanetLavaSpecParams + summary: BlockReward queries for the validators reward for proposing a block + operationId: LavanetLavaRewardsBlockReward responses: '200': description: A successful response. schema: type: object properties: - params: - description: params holds all the parameters of this module. + reward: type: object properties: - geolocationCount: + denom: type: string - format: uint64 - maxCU: + amount: type: string - format: uint64 + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. + QueryBlockRewardResponse is response type for the + Query/BlockReward RPC method. default: description: An unexpected error response. schema: @@ -40822,32 +43021,46 @@ paths: additionalProperties: {} tags: - Query - /lavanet/lava/spec/show_all_chains: + /lavanet/lava/rewards/iprpc_provider_reward/{provider}: get: - summary: Queries a list of ShowAllChains items. - operationId: LavanetLavaSpecShowAllChains + summary: >- + IprpcProviderRewardEstimation queries for a provider's current IPRPC + reward (relative to its serviced CU) + operationId: LavanetLavaRewardsIprpcProviderRewardEstimation responses: '200': description: A successful response. schema: type: object properties: - chainInfoList: + spec_funds: type: array items: type: object properties: - chainName: - type: string - chainID: + spec: type: string - enabledApiInterfaces: + fund: type: array items: - type: string - api_count: - type: string - format: uint64 + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + QueryIprpcProviderRewardEstimationResponse is response type for + the Query/IprpcProviderRewardEstimation RPC method. default: description: An unexpected error response. schema: @@ -40866,41 +43079,66 @@ paths: '@type': type: string additionalProperties: {} + parameters: + - name: provider + in: path + required: true + type: string tags: - Query - /lavanet/lava/spec/show_chain_info/{chainName}: + /lavanet/lava/rewards/iprpc_spec_reward/{spec}: get: - summary: Queries a list of ShowChainInfo items. - operationId: LavanetLavaSpecShowChainInfo + summary: IprpcSpecReward queries for a spec's IPRPC reward + operationId: LavanetLavaRewardsIprpcSpecReward responses: '200': description: A successful response. schema: type: object properties: - chainID: - type: string - interfaces: - type: array - items: - type: string - supportedApisInterfaceList: + iprpc_rewards: type: array items: type: object properties: - interface: + id: type: string - supportedApis: + format: uint64 + title: month id + spec_funds: type: array items: - type: string - addon: - type: string - optional_interfaces: - type: array - items: - type: string + type: object + properties: + spec: + type: string + fund: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which + implements the custom method + + signatures required by gogoproto. + title: >- + object that holds the list for iprpc funcs for a specific + month id + current_month_id: + type: string + format: uint64 + description: >- + QueryIprpcSpecRewardResponse is response type for the + Query/IprpcSpecReward RPC method. default: description: An unexpected error response. schema: @@ -40920,36 +43158,427 @@ paths: type: string additionalProperties: {} parameters: - - name: chainName + - name: spec in: path required: true type: string tags: - Query - /lavanet/lava/spec/spec: + /lavanet/lava/rewards/params: get: - summary: Queries a list of Spec items. - operationId: LavanetLavaSpecSpecAll + summary: Parameters queries the parameters of the module. + operationId: LavanetLavaRewardsParams responses: '200': description: A successful response. schema: type: object properties: - Spec: + params: + description: params holds all the parameters of this module. + type: object + properties: + min_bonded_target: + type: string + max_bonded_target: + type: string + low_factor: + type: string + leftover_burn_rate: + type: string + max_reward_boost: + type: string + format: uint64 + validators_subscription_participation: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object properties: - index: - type: string - name: + '@type': type: string - enabled: - type: boolean - reliability_threshold: - type: integer - format: int64 + additionalProperties: {} + tags: + - Query + /lavanet/lava/rewards/pools: + get: + summary: Pools queries all the pools' info + operationId: LavanetLavaRewardsPools + responses: + '200': + description: A successful response. + schema: + type: object + properties: + pools: + type: array + items: + type: object + properties: + name: + type: string + title: pool name + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: pool balance (all types of tokens) + description: details holds all the info of this module's pools. + time_to_refill: + type: string + format: int64 + title: number of seconds until block pools refill + estimated_blocks_to_refill: + type: string + format: int64 + title: estimated number of blocks until block pools are refilled + allocation_pool_months_left: + type: string + format: int64 + title: >- + amount of months until the allocation pools will run out of + funds + description: >- + QueryPoolsResponse is response type for the Query/Pools RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/rewards/provider_reward: + get: + summary: ProviderReward queries for the providers reward for their services + operationId: LavanetLavaRewardsProviderReward + responses: + '200': + description: A successful response. + schema: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + chain_id: + type: string + provider: + type: string + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + description: >- + QueryProviderRewardResponse is response type for the + Query/ProviderReward RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: chain_id + in: query + required: false + type: string + - name: provider + in: query + required: false + type: string + tags: + - Query + /lavanet/lava/rewards/show_iprpc_data: + get: + summary: ShowIprpcData queries for the iprpc data + operationId: LavanetLavaRewardsShowIprpcData + responses: + '200': + description: A successful response. + schema: + type: object + properties: + min_cost: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + iprpc_subscriptions: + type: array + items: + type: string + description: >- + QueryShowIprpcDataResponse is response type for the + Query/ShowIprpcData RPC method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/spec/params: + get: + summary: Parameters queries the parameters of the module. + operationId: LavanetLavaSpecParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + maxCU: + type: string + format: uint64 + allowlisted_expedited_msgs: + type: array + items: + type: string + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/spec/show_all_chains: + get: + summary: Queries a list of ShowAllChains items. + operationId: LavanetLavaSpecShowAllChains + responses: + '200': + description: A successful response. + schema: + type: object + properties: + chainInfoList: + type: array + items: + type: object + properties: + chainName: + type: string + chainID: + type: string + enabledApiInterfaces: + type: array + items: + type: string + api_count: + type: string + format: uint64 + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /lavanet/lava/spec/show_chain_info/{chainName}: + get: + summary: Queries a list of ShowChainInfo items. + operationId: LavanetLavaSpecShowChainInfo + responses: + '200': + description: A successful response. + schema: + type: object + properties: + chainID: + type: string + interfaces: + type: array + items: + type: string + supportedApisInterfaceList: + type: array + items: + type: object + properties: + interface: + type: string + supportedApis: + type: array + items: + type: string + addon: + type: string + optional_interfaces: + type: array + items: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: chainName + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/spec/spec: + get: + summary: Queries a list of Spec items. + operationId: LavanetLavaSpecSpecAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + Spec: + type: array + items: + type: object + properties: + index: + type: string + name: + type: string + enabled: + type: boolean + reliability_threshold: + type: integer + format: int64 data_reliability_enabled: type: boolean block_distance_for_finalized_data: @@ -40978,21 +43607,6 @@ paths: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -41094,6 +43708,29 @@ paths: title: >- used to parse byte responses: base64,hex,bech32 + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -41121,6 +43758,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -41150,6 +43788,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -41202,15 +43841,15 @@ paths: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -41230,6 +43869,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -41287,6 +43927,23 @@ paths: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string pagination: type: object properties: @@ -41442,21 +44099,6 @@ paths: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -41558,6 +44200,29 @@ paths: title: >- used to parse byte responses: base64,hex,bech32 + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -41585,6 +44250,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -41614,6 +44280,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -41666,15 +44333,15 @@ paths: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -41694,6 +44361,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -41751,6 +44419,23 @@ paths: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string default: description: An unexpected error response. schema: @@ -41828,21 +44513,6 @@ paths: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -41944,6 +44614,29 @@ paths: title: >- used to parse byte responses: base64,hex,bech32 + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -41971,6 +44664,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -42000,6 +44694,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -42052,15 +44747,15 @@ paths: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -42080,6 +44775,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -42137,6 +44833,23 @@ paths: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string pagination: type: object properties: @@ -42292,21 +45005,6 @@ paths: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -42408,6 +45106,29 @@ paths: title: >- used to parse byte responses: base64,hex,bech32 + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -42435,6 +45156,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -42464,6 +45186,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -42516,15 +45239,15 @@ paths: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -42544,6 +45267,7 @@ paths: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -42601,6 +45325,23 @@ paths: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string default: description: An unexpected error response. schema: @@ -42656,7 +45397,7 @@ paths: type: string format: uint64 title: when the plan was created - duration_total: + duration_bought: type: string format: uint64 title: total requested duration in months @@ -42676,6 +45417,76 @@ paths: type: string format: uint64 title: CU remaining during current month + cluster: + type: string + title: cluster key + duration_total: + type: string + format: uint64 + title: continous subscription usage + future_subscription: + title: future subscription made with buy --advance-purchase + type: object + properties: + creator: + type: string + title: >- + creator pays for the future subscription. Will replace + the original one once activated + plan_index: + type: string + title: index (name) of plan + plan_block: + type: string + format: uint64 + title: when the plan was created + duration_bought: + type: string + format: uint64 + title: total requested duration in months + credit: + title: >- + credit = funds paid for the subscription which are + used to pay to providers. reduced after paying + providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + auto_renewal_next_plan: + type: string + title: >- + the next plan to subscribe to. If none is set, then auto + renewal is disabled + credit: + title: >- + credit = funds paid for the subscription which are used to + pay to providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. default: description: An unexpected error response. schema: @@ -42722,7 +45533,7 @@ paths: plan: type: string title: plan assosiated with the subscription - duration_total: + duration_bought: type: string format: uint64 title: total duration in months (purchase/renewal) @@ -42742,6 +45553,67 @@ paths: type: string format: uint64 title: remaining CU allowance this month + cluster: + type: string + duration_total: + type: string + format: uint64 + auto_renewal_next_plan: + type: string + future_subscription: + type: object + properties: + creator: + type: string + title: >- + creator pays for the future subscription. Will + replace the original one once activated + plan_index: + type: string + title: index (name) of plan + plan_block: + type: string + format: uint64 + title: when the plan was created + duration_bought: + type: string + format: uint64 + title: total requested duration in months + credit: + title: >- + credit = funds paid for the subscription which are + used to pay to providers. reduced after paying + providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + credit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. default: description: An unexpected error response. schema: @@ -42801,6 +45673,47 @@ paths: type: string tags: - Query + /lavanet/lava/subscription/next_to_month_expiry: + get: + summary: Queries the subscription with the closest month expiry + operationId: LavanetLavaSubscriptionNextToMonthExpiry + responses: + '200': + description: A successful response. + schema: + type: object + properties: + subscriptions: + type: array + items: + type: object + properties: + consumer: + type: string + month_expiry: + type: string + format: uint64 + title: upcoming expiry (of current month) in unix time + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query /lavanet/lava/subscription/params: get: summary: Parameters queries the parameters of the module. @@ -42837,6 +45750,201 @@ paths: additionalProperties: {} tags: - Query + /lavanet/lava/timerstore/all_timers/{store_key}/{prefix}: + get: + summary: Queries a timer store for all its timers. + operationId: LavanetLavaTimerstoreAllTimers + responses: + '200': + description: A successful response. + schema: + type: object + properties: + blockTimeTimers: + type: array + items: + type: object + properties: + blockTime: + type: string + blockHeight: + type: string + format: uint64 + key: + type: string + data: + type: string + format: byte + blockHeightTimers: + type: array + items: + type: object + properties: + blockTime: + type: string + blockHeight: + type: string + format: uint64 + key: + type: string + data: + type: string + format: byte + tick: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: store_key + in: path + required: true + type: string + - name: prefix + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/timerstore/next/{store_key}/{prefix}: + get: + summary: Queries for next timeout of a timer. + operationId: LavanetLavaTimerstoreNext + responses: + '200': + description: A successful response. + schema: + type: object + properties: + nextBlockHeight: + type: string + format: uint64 + nextBlockTime: + type: string + tick: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: store_key + in: path + required: true + type: string + - name: prefix + in: path + required: true + type: string + tags: + - Query + /lavanet/lava/timerstore/store_keys: + get: + summary: Queries for all store keys. + operationId: LavanetLavaTimerstoreStoreKeys + responses: + '200': + description: A successful response. + schema: + type: object + properties: + keys: + type: array + items: + type: object + properties: + store_key: + type: string + prefix: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /ibc/apps/packetforward/v1/params: + get: + summary: Params queries all parameters of the packetforward module. + operationId: PacketforwardV1Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + fee_percentage: + type: string + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query definitions: cosmos.auth.v1beta1.AddressBytesToStringResponse: type: object @@ -42861,6 +45969,182 @@ definitions: Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.BaseAccount: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: >- + BaseAccount defines a base account type. It contains all the necessary + fields + + for basic account functionality. Any custom account type should extend + this + + type for additional functionality (e.g. vesting). cosmos.auth.v1beta1.Bech32PrefixResponse: type: object properties: @@ -42870,6 +46154,13 @@ definitions: Bech32PrefixResponse is the response type for Bech32Prefix rpc method. Since: cosmos-sdk 0.46 + cosmos.auth.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 cosmos.auth.v1beta1.Params: type: object properties: @@ -42898,11 +46189,192 @@ definitions: title: >- QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + cosmos.auth.v1beta1.QueryAccountInfoResponse: + type: object + properties: + info: + description: info is the account info which is represented by BaseAccount. + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + account_number: + type: string + format: uint64 + sequence: + type: string + format: uint64 + description: |- + QueryAccountInfoResponse is the Query/AccountInfo response type. + + Since: cosmos-sdk 0.47 cosmos.auth.v1beta1.QueryAccountResponse: type: object properties: account: - description: account defines the account of the corresponding address. type: object properties: '@type': @@ -42958,6 +46430,107 @@ definitions: used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } description: >- QueryAccountResponse is the response type for the Query/Account RPC method. @@ -43909,569 +47482,556 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - cosmos.bank.v1beta1.DenomOwner: + cosmos.authz.v1beta1.Grant: type: object properties: - address: - type: string - description: address defines the address that owns a particular denomination. - balance: - description: balance is the balance of the denominated coin for an account. + authorization: type: object properties: - denom: - type: string - amount: + '@type': type: string - description: |- - DenomOwner defines structure representing an account that owns or holds a - particular denominated token. It contains the account address and account - balance of the denominated token. + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - Since: cosmos-sdk 0.46 - cosmos.bank.v1beta1.DenomUnit: - type: object - properties: - denom: - type: string - description: denom represents the string name of the given denom unit (e.g uatom). - exponent: - type: integer - format: int64 - description: >- - exponent represents power of 10 exponent that one must + protocol buffer message. This string must contain at least - raise the base_denom to in order to equal the given DenomUnit's denom + one "/" character. The last segment of the URL's path must + represent - 1 denom = 10^exponent base_denom + the fully qualified name of the type (as in - (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' - with + `path/google.protobuf.Duration`). The name should be in a + canonical form - exponent = 6, thus: 1 atom = 10^6 uatom). - aliases: - type: array - items: - type: string - title: aliases is a list of string aliases for the given denom - description: |- - DenomUnit represents a struct that describes a given - denomination unit of the basic token. - cosmos.bank.v1beta1.Input: - type: object - properties: - address: - type: string - coins: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + (e.g., leading "." is not accepted). - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: Input models transaction input. - cosmos.bank.v1beta1.Metadata: - type: object - properties: - description: - type: string - denom_units: - type: array - items: - type: object - properties: - denom: - type: string - description: >- - denom represents the string name of the given denom unit (e.g - uatom). - exponent: - type: integer - format: int64 - description: >- - exponent represents power of 10 exponent that one must - raise the base_denom to in order to equal the given DenomUnit's - denom + In practice, teams usually precompile into the binary all types + that they - 1 denom = 10^exponent base_denom + expect it to use in the context of Any. However, for URLs which + use the - (e.g. with a base_denom of uatom, one can create a DenomUnit of - 'atom' with + scheme `http`, `https`, or no scheme, one can optionally set up a + type - exponent = 6, thus: 1 atom = 10^6 uatom). - aliases: - type: array - items: - type: string - title: aliases is a list of string aliases for the given denom - description: |- - DenomUnit represents a struct that describes a given - denomination unit of the basic token. - title: denom_units represents the list of DenomUnit's for a given coin - base: - type: string - description: >- - base represents the base denom (should be the DenomUnit with exponent - = 0). - display: - type: string - description: |- - display indicates the suggested denom that should be - displayed in clients. - name: - type: string - description: 'Since: cosmos-sdk 0.43' - title: 'name defines the name of the token (eg: Cosmos Atom)' - symbol: - type: string - description: >- - symbol is the token symbol usually shown on exchanges (eg: ATOM). This - can + server that maps type URLs to message definitions as follows: - be the same as the display. + * If no scheme is provided, `https` is assumed. - Since: cosmos-sdk 0.43 - uri: - type: string - description: >- - URI to a document (on or off-chain) that contains additional - information. Optional. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in the + official - Since: cosmos-sdk 0.46 - uri_hash: - type: string - description: >- - URIHash is a sha256 hash of a document pointed by URI. It's used to - verify that + protobuf release, and it is not used for type URLs beginning with - the document didn't change. Optional. + type.googleapis.com. - Since: cosmos-sdk 0.46 - description: |- - Metadata represents a struct that describes - a basic token. - cosmos.bank.v1beta1.MsgMultiSendResponse: - type: object - description: MsgMultiSendResponse defines the Msg/MultiSend response type. - cosmos.bank.v1beta1.MsgSendResponse: - type: object - description: MsgSendResponse defines the Msg/Send response type. - cosmos.bank.v1beta1.Output: - type: object - properties: - address: - type: string - coins: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + Schemes other than `http`, `https` (or the empty scheme) might be - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: Output models transaction outputs. - cosmos.bank.v1beta1.Params: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: >- - SendEnabled maps coin denom to a send_enabled status (whether a - denom is + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - sendable). - default_send_enabled: - type: boolean - description: Params defines the parameters for the bank module. - cosmos.bank.v1beta1.QueryAllBalancesResponse: - type: object - properties: - balances: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + URL that describes the type of the serialized message. - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: balances is the balances of all the coins. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - was set, its value is undefined otherwise - description: >- - QueryAllBalancesResponse is the response type for the Query/AllBalances - RPC + Protobuf library provides support to pack/unpack Any values in the + form - method. - cosmos.bank.v1beta1.QueryBalanceResponse: - type: object - properties: - balance: - description: balance is the balance of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QueryBalanceResponse is the response type for the Query/Balance RPC - method. - cosmos.bank.v1beta1.QueryDenomMetadataResponse: - type: object - properties: - metadata: - description: >- - metadata describes and provides all the client information for the - requested token. - type: object - properties: - description: - type: string - denom_units: - type: array - items: - type: object - properties: - denom: - type: string - description: >- - denom represents the string name of the given denom unit - (e.g uatom). - exponent: - type: integer - format: int64 - description: >- - exponent represents power of 10 exponent that one must + of utility functions or additional generated methods of the Any type. - raise the base_denom to in order to equal the given - DenomUnit's denom - 1 denom = 10^exponent base_denom + Example 1: Pack and unpack a message in C++. - (e.g. with a base_denom of uatom, one can create a DenomUnit - of 'atom' with + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - exponent = 6, thus: 1 atom = 10^6 uatom). - aliases: - type: array - items: - type: string - title: aliases is a list of string aliases for the given denom - description: |- - DenomUnit represents a struct that describes a given - denomination unit of the basic token. - title: denom_units represents the list of DenomUnit's for a given coin - base: - type: string - description: >- - base represents the base denom (should be the DenomUnit with - exponent = 0). - display: - type: string - description: |- - display indicates the suggested denom that should be - displayed in clients. - name: - type: string - description: 'Since: cosmos-sdk 0.43' - title: 'name defines the name of the token (eg: Cosmos Atom)' - symbol: - type: string - description: >- - symbol is the token symbol usually shown on exchanges (eg: ATOM). - This can + Example 2: Pack and unpack a message in Java. - be the same as the display. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - Since: cosmos-sdk 0.43 - uri: - type: string - description: >- - URI to a document (on or off-chain) that contains additional - information. Optional. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - Since: cosmos-sdk 0.46 - uri_hash: - type: string - description: >- - URIHash is a sha256 hash of a document pointed by URI. It's used - to verify that + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - the document didn't change. Optional. + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack - Since: cosmos-sdk 0.46 - description: >- - QueryDenomMetadataResponse is the response type for the - Query/DenomMetadata RPC + methods only use the fully qualified type name after the last '/' - method. - cosmos.bank.v1beta1.QueryDenomOwnersResponse: - type: object - properties: - denom_owners: - type: array - items: - type: object - properties: - address: - type: string - description: address defines the address that owns a particular denomination. - balance: - description: balance is the balance of the denominated coin for an account. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DenomOwner defines structure representing an account that owns or - holds a + in the type URL, for example "foo.bar.com/x/y.z" will yield type - particular denominated token. It contains the account address and - account + name "y.z". - balance of the denominated token. - Since: cosmos-sdk 0.46 - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + JSON - was set, its value is undefined otherwise - description: >- - QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC - query. + ==== + The JSON representation of an `Any` value uses the regular - Since: cosmos-sdk 0.46 - cosmos.bank.v1beta1.QueryDenomsMetadataResponse: - type: object - properties: - metadatas: - type: array - items: - type: object - properties: - description: - type: string - denom_units: - type: array - items: - type: object - properties: - denom: - type: string - description: >- - denom represents the string name of the given denom unit - (e.g uatom). - exponent: - type: integer - format: int64 - description: >- - exponent represents power of 10 exponent that one must + representation of the deserialized, embedded message, with an - raise the base_denom to in order to equal the given - DenomUnit's denom + additional field `@type` which contains the type URL. Example: - 1 denom = 10^exponent base_denom + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - (e.g. with a base_denom of uatom, one can create a - DenomUnit of 'atom' with + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - exponent = 6, thus: 1 atom = 10^6 uatom). - aliases: - type: array - items: - type: string - title: aliases is a list of string aliases for the given denom - description: |- - DenomUnit represents a struct that describes a given - denomination unit of the basic token. - title: denom_units represents the list of DenomUnit's for a given coin - base: - type: string - description: >- - base represents the base denom (should be the DenomUnit with - exponent = 0). - display: - type: string - description: |- - display indicates the suggested denom that should be - displayed in clients. - name: - type: string - description: 'Since: cosmos-sdk 0.43' - title: 'name defines the name of the token (eg: Cosmos Atom)' - symbol: - type: string - description: >- - symbol is the token symbol usually shown on exchanges (eg: - ATOM). This can + If the embedded message type is well-known and has a custom JSON - be the same as the display. + representation, that representation will be embedded adding a field + `value` which holds the custom JSON in addition to the `@type` - Since: cosmos-sdk 0.43 - uri: - type: string - description: >- - URI to a document (on or off-chain) that contains additional - information. Optional. - - - Since: cosmos-sdk 0.46 - uri_hash: - type: string - description: >- - URIHash is a sha256 hash of a document pointed by URI. It's used - to verify that + field. Example (for message [google.protobuf.Duration][]): - the document didn't change. Optional. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If null, then the + grant + doesn't have a time expiration (other conditions in `authorization` - Since: cosmos-sdk 0.46 - description: |- - Metadata represents a struct that describes - a basic token. - description: >- - metadata provides the client information for all the registered - tokens. - pagination: - description: pagination defines the pagination in the response. + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + cosmos.authz.v1beta1.GrantAuthorization: + type: object + properties: + granter: + type: string + grantee: + type: string + authorization: type: object properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + '@type': type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - was set, its value is undefined otherwise - description: >- - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC + protocol buffer message. This string must contain at least - method. - cosmos.bank.v1beta1.QueryParamsResponse: + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the grantee + and granter. + + It is used in genesis.proto and query.proto + cosmos.authz.v1beta1.MsgExecResponse: type: object properties: - params: - type: object - properties: - send_enabled: - type: array - items: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: >- - SendEnabled maps coin denom to a send_enabled status (whether a - denom is - - sendable). - default_send_enabled: - type: boolean - description: Params defines the parameters for the bank module. - description: >- - QueryParamsResponse defines the response type for querying x/bank - parameters. - cosmos.bank.v1beta1.QuerySpendableBalancesResponse: + results: + type: array + items: + type: string + format: byte + description: MsgExecResponse defines the Msg/MsgExecResponse response type. + cosmos.authz.v1beta1.MsgGrantResponse: + type: object + description: MsgGrantResponse defines the Msg/MsgGrant response type. + cosmos.authz.v1beta1.MsgRevokeResponse: + type: object + description: MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. + cosmos.authz.v1beta1.QueryGranteeGrantsResponse: type: object properties: - balances: + grants: type: array items: type: object properties: - denom: + granter: type: string - amount: + grantee: type: string - description: |- - Coin defines a token with a denomination and an amount. + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: balances is the spendable balances of all the coins. + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the + grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted to the grantee. pagination: - description: pagination defines the pagination in the response. + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -44490,2438 +48050,1852 @@ definitions: was set, its value is undefined otherwise description: >- - QuerySpendableBalancesResponse defines the gRPC response structure for - querying - - an account's spendable balances. - - - Since: cosmos-sdk 0.46 - cosmos.bank.v1beta1.QuerySupplyOfResponse: - type: object - properties: - amount: - description: amount is the supply of the coin. - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC - method. - cosmos.bank.v1beta1.QueryTotalSupplyResponse: + QueryGranteeGrantsResponse is the response type for the + Query/GranteeGrants RPC method. + cosmos.authz.v1beta1.QueryGranterGrantsResponse: type: object properties: - supply: + grants: type: array items: type: object properties: - denom: + granter: type: string - amount: + grantee: type: string - description: |- - Coin defines a token with a denomination and an amount. + authorization: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: supply is the supply of the coins - pagination: - description: |- - pagination defines the pagination in the response. + protocol buffer message. This string must contain at least - Since: cosmos-sdk 0.43 - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + one "/" character. The last segment of the URL's path must + represent - was set, its value is undefined otherwise - title: >- - QueryTotalSupplyResponse is the response type for the Query/TotalSupply - RPC + the fully qualified name of the type (as in - method - cosmos.bank.v1beta1.SendEnabled: - type: object - properties: - denom: - type: string - enabled: - type: boolean - description: |- - SendEnabled maps coin denom to a send_enabled status (whether a denom is - sendable). - cosmos.base.v1beta1.Coin: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + `path/google.protobuf.Duration`). The name should be in a + canonical form - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - cosmos.base.tendermint.v1beta1.ABCIQueryResponse: - type: object - properties: - code: - type: integer - format: int64 - log: - type: string - title: nondeterministic - info: - type: string - title: nondeterministic - index: - type: string - format: int64 - key: - type: string - format: byte - value: - type: string - format: byte - proof_ops: - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} description: >- - ProofOp defines an operation used for calculating Merkle root. - The data could + `Any` contains an arbitrary serialized protocol buffer message + along with a - be arbitrary format, providing nessecary data for example - neighbouring node + URL that describes the type of the serialized message. - hash. + Protobuf library provides support to pack/unpack Any values in + the form - Note: This type is a duplicate of the ProofOp proto type defined - in + of utility functions or additional generated methods of the Any + type. - Tendermint. - description: |- - ProofOps is Merkle proof defined by the list of ProofOps. - Note: This type is a duplicate of the ProofOps proto type defined in - Tendermint. - height: - type: string - format: int64 - codespace: - type: string - description: |- - ABCIQueryResponse defines the response structure for the ABCIQuery gRPC - query. + Example 1: Pack and unpack a message in C++. - Note: This type is a duplicate of the ResponseQuery proto type defined in - Tendermint. - cosmos.base.tendermint.v1beta1.Block: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - including all blockchain data structures and the rules of the - application's + Example 2: Pack and unpack a message in Java. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer address, formatted - as a Bech32 string. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - In Tendermint, this type is `bytes`, but in the SDK, we convert it - to a Bech32 string + Example 3: Pack and unpack a message in Python. - for better UX. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - NOTE: not all txs here are valid. We're just agreeing on the - order first. + The pack methods provided by protobuf library will by default + use - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + GrantAuthorization extends a grant with both the addresses of the + grantee and granter. + + It is used in genesis.proto and query.proto + description: grants is a list of grants granted by the granter. + pagination: + description: pagination defines an pagination for the response. type: object properties: - evidence: - type: array - items: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGranterGrantsResponse is the response type for the + Query/GranterGrants RPC method. + cosmos.authz.v1beta1.QueryGrantsResponse: + type: object + properties: + grants: + type: array + items: + type: object + properties: + authorization: type: object properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + protocol buffer message. This string must contain at least - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + one "/" character. The last segment of the URL's path must + represent - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + the fully qualified name of the type (as in - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, + `path/google.protobuf.Duration`). The name should be in a + canonical form - including all blockchain data structures and - the rules of the application's + (e.g., leading "." is not accepted). - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from - the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block was - committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + expiration: + type: string + format: date-time + title: >- + time when the grant will expire and will be pruned. If null, + then the grant + + doesn't have a time expiration (other conditions in + `authorization` + + may apply to invalidate the grant) + description: |- + Grant gives permissions to execute + the provide method with expiration time. + description: authorizations is a list of grants granted for grantee by granter. + pagination: + description: pagination defines an pagination for the response. type: object properties: - height: + next_key: type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - description: |- - Block is tendermint type Block, with the Header proposer address - field converted to bech32 string. - cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGrantsResponse is the response type for the Query/Authorizations RPC + method. + cosmos.bank.v1beta1.DenomOwner: type: object properties: - block_id: + address: + type: string + description: address defines the address that owns a particular denomination. + balance: + description: balance is the balance of the denominated coin for an account. type: object properties: - hash: + denom: type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - title: 'Deprecated: please use `sdk_block` instead' - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, + amount: + type: string + description: |- + DenomOwner defines structure representing an account that owns or holds a + particular denominated token. It contains the account address and account + balance of the denominated token. - including all blockchain data structures and the rules of the - application's + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.DenomUnit: + type: object + properties: + denom: + type: string + description: denom represents the string name of the given denom unit (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: + raise the base_denom to in order to equal the given DenomUnit's denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' + with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + cosmos.bank.v1beta1.Input: + type: object + properties: + address: + type: string + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Input models transaction input. + cosmos.bank.v1beta1.Metadata: + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: + type: string + description: >- + denom represents the string name of the given denom unit (e.g + uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must + + raise the base_denom to in order to equal the given DenomUnit's + denom + + 1 denom = 10^exponent base_denom + + (e.g. with a base_denom of uatom, one can create a DenomUnit of + 'atom' with + + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with exponent + = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: ATOM). This + can + + be the same as the display. + + + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. + + + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used to + verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + cosmos.bank.v1beta1.MsgMultiSendResponse: + type: object + description: MsgMultiSendResponse defines the Msg/MultiSend response type. + cosmos.bank.v1beta1.MsgSendResponse: + type: object + description: MsgSendResponse defines the Msg/Send response type. + cosmos.bank.v1beta1.MsgSetSendEnabledResponse: + type: object + description: |- + MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.Output: + type: object + properties: + address: + type: string + coins: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Output models transaction outputs. + cosmos.bank.v1beta1.Params: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. + + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in the + keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards compatibility of + genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + cosmos.bank.v1beta1.QueryAllBalancesResponse: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: balances is the balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryAllBalancesResponse is the response type for the Query/AllBalances + RPC + + method. + cosmos.bank.v1beta1.QueryBalanceResponse: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QueryBalanceResponse is the response type for the Query/Balance RPC + method. + cosmos.bank.v1beta1.QueryDenomMetadataResponse: + type: object + properties: + metadata: + description: >- + metadata describes and provides all the client information for the + requested token. + type: object + properties: + description: + type: string + denom_units: + type: array + items: + type: object + properties: + denom: type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. + description: >- + denom represents the string name of the given denom unit + (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must - NOTE: not all txs here are valid. We're just agreeing on the - order first. + raise the base_denom to in order to equal the given + DenomUnit's denom - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + 1 denom = 10^exponent base_denom - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + (e.g. with a base_denom of uatom, one can create a DenomUnit + of 'atom' with - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with + exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: ATOM). + This can - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + be the same as the display. - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - including all blockchain data structures - and the rules of the application's + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. + + Since: cosmos-sdk 0.46 + uri_hash: + type: string description: >- - Commit contains the evidence that a block was committed by a set - of validators. - sdk_block: - title: 'Since: cosmos-sdk 0.47' + URIHash is a sha256 hash of a document pointed by URI. It's used + to verify that + + the document didn't change. Optional. + + + Since: cosmos-sdk 0.46 + description: >- + QueryDenomMetadataResponse is the response type for the + Query/DenomMetadata RPC + + method. + cosmos.bank.v1beta1.QueryDenomOwnersResponse: + type: object + properties: + denom_owners: + type: array + items: + type: object + properties: + address: + type: string + description: address defines the address that owns a particular denomination. + balance: + description: balance is the balance of the denominated coin for an account. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DenomOwner defines structure representing an account that owns or + holds a + + particular denominated token. It contains the account address and + account + + balance of the denominated token. + + + Since: cosmos-sdk 0.46 + pagination: + description: pagination defines the pagination in the response. type: object properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - including all blockchain data structures and the rules of the - application's + was set, its value is undefined otherwise + description: >- + QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC + query. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.QueryDenomsMetadataResponse: + type: object + properties: + metadatas: + type: array + items: + type: object + properties: + description: + type: string + denom_units: + type: array + items: type: object properties: - hash: + denom: type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer address, - formatted as a Bech32 string. + description: >- + denom represents the string name of the given denom unit + (e.g uatom). + exponent: + type: integer + format: int64 + description: >- + exponent represents power of 10 exponent that one must - In Tendermint, this type is `bytes`, but in the SDK, we - convert it to a Bech32 string + raise the base_denom to in order to equal the given + DenomUnit's denom - for better UX. + 1 denom = 10^exponent base_denom + (e.g. with a base_denom of uatom, one can create a + DenomUnit of 'atom' with - original proposer of the block - description: Header defines the structure of a Tendermint block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. + exponent = 6, thus: 1 atom = 10^6 uatom). + aliases: + type: array + items: + type: string + title: aliases is a list of string aliases for the given denom + description: |- + DenomUnit represents a struct that describes a given + denomination unit of the basic token. + title: denom_units represents the list of DenomUnit's for a given coin + base: + type: string + description: >- + base represents the base denom (should be the DenomUnit with + exponent = 0). + display: + type: string + description: |- + display indicates the suggested denom that should be + displayed in clients. + name: + type: string + description: 'Since: cosmos-sdk 0.43' + title: 'name defines the name of the token (eg: Cosmos Atom)' + symbol: + type: string + description: >- + symbol is the token symbol usually shown on exchanges (eg: + ATOM). This can - NOTE: not all txs here are valid. We're just agreeing on the - order first. + be the same as the display. - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + Since: cosmos-sdk 0.43 + uri: + type: string + description: >- + URI to a document (on or off-chain) that contains additional + information. Optional. - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, + Since: cosmos-sdk 0.46 + uri_hash: + type: string + description: >- + URIHash is a sha256 hash of a document pointed by URI. It's used + to verify that - including all blockchain data structures - and the rules of the application's + the document didn't change. Optional. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - description: |- - Block is tendermint type Block, with the Header proposer address - field converted to bech32 string. - description: >- - GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight - RPC method. - cosmos.base.tendermint.v1beta1.GetLatestBlockResponse: - type: object - properties: - block_id: + Since: cosmos-sdk 0.46 + description: |- + Metadata represents a struct that describes + a basic token. + description: >- + metadata provides the client information for all the registered + tokens. + pagination: + description: pagination defines the pagination in the response. type: object properties: - hash: + next_key: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - title: 'Deprecated: please use `sdk_block` instead' + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryDenomsMetadataResponse is the response type for the + Query/DenomsMetadata RPC + + method. + cosmos.bank.v1beta1.QueryParamsResponse: + type: object + properties: + params: type: object properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is - including all blockchain data structures and the rules of the - application's + sendable). + description: >- + Deprecated: Use of SendEnabled in params is deprecated. - state transition machine. - chain_id: + For genesis, use the newly added send_enabled field in the genesis + object. + + Storage, lookup, and manipulation of this information is now in + the keeper. + + + As of cosmos-sdk 0.47, this only exists for backwards + compatibility of genesis files. + default_send_enabled: + type: boolean + description: Params defines the parameters for the bank module. + description: >- + QueryParamsResponse defines the response type for querying x/bank + parameters. + cosmos.bank.v1beta1.QuerySendEnabledResponse: + type: object + properties: + send_enabled: + type: array + items: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: >- + SendEnabled maps coin denom to a send_enabled status (whether a + denom is + + sendable). + pagination: + description: |- + pagination defines the pagination in the response. This field is only + populated if the denoms field in the request is empty. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QuerySendEnabledResponse defines the RPC response of a SendEnable query. + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse: + type: object + properties: + balance: + description: balance is the balance of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySpendableBalanceByDenomResponse defines the gRPC response structure + for + + querying an account's spendable balance for a specific denom. + + + Since: cosmos-sdk 0.47 + cosmos.bank.v1beta1.QuerySpendableBalancesResponse: + type: object + properties: + balances: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: balances is the spendable balances of all the coins. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QuerySpendableBalancesResponse defines the gRPC response structure for + querying + + an account's spendable balances. + + + Since: cosmos-sdk 0.46 + cosmos.bank.v1beta1.QuerySupplyOfResponse: + type: object + properties: + amount: + description: amount is the supply of the coin. + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC + method. + cosmos.bank.v1beta1.QueryTotalSupplyResponse: + type: object + properties: + supply: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: supply is the supply of the coins + pagination: + description: |- + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: >- + QueryTotalSupplyResponse is the response type for the Query/TotalSupply + RPC + + method + cosmos.bank.v1beta1.SendEnabled: + type: object + properties: + denom: + type: string + enabled: + type: boolean + description: |- + SendEnabled maps coin denom to a send_enabled status (whether a denom is + sendable). + cosmos.base.v1beta1.Coin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + cosmos.base.node.v1beta1.ConfigResponse: + type: object + properties: + minimum_gas_price: + type: string + description: ConfigResponse defines the response structure for the Config gRPC query. + cosmos.base.tendermint.v1beta1.ABCIQueryResponse: + type: object + properties: + code: + type: integer + format: int64 + log: + type: string + title: nondeterministic + info: + type: string + title: nondeterministic + index: + type: string + format: int64 + key: + type: string + format: byte + value: + type: string + format: byte + proof_ops: + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. + The data could + + be arbitrary format, providing necessary data for example + neighbouring node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined + in Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. + + + Note: This type is a duplicate of the ProofOps proto type defined in + Tendermint. + height: + type: string + format: int64 + codespace: + type: string + description: >- + ABCIQueryResponse defines the response structure for the ABCIQuery gRPC + query. + + + Note: This type is a duplicate of the ResponseQuery proto type defined in + + Tendermint. + cosmos.base.tendermint.v1beta1.Block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: type: string - height: + format: uint64 + app: type: string - format: int64 - time: + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: type: string - format: date-time - last_block_id: + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, formatted + as a Bech32 string. - NOTE: not all txs here are valid. We're just agreeing on the - order first. + In Tendermint, this type is `bytes`, but in the SDK, we convert it + to a Bech32 string - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block + for better UX. + + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: evidence: - type: object - properties: - evidence: - type: array - items: + type: array + items: + type: object + properties: + duplicate_vote_evidence: type: object properties: - duplicate_vote_evidence: + vote_a: type: object properties: - vote_a: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: type: object properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: + hash: type: string - format: int64 - round: - type: integer - format: int32 - block_id: + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the consensus. - vote_b: + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: type: object properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: + hash: type: string - format: int64 - round: - type: integer - format: int32 - block_id: + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 + title: PartsetHeader + title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: type: object properties: - conflicting_block: + signed_header: type: object properties: - signed_header: + header: type: object properties: - header: + version: + title: basic block info type: object properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, - - including all blockchain data structures - and the rules of the application's - - state transition machine. - chain_id: + block: type: string - height: + format: uint64 + app: type: string - format: int64 - time: + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and + the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: type: string - format: date-time - last_block_id: + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from + the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: type: object properties: - height: + hash: type: string - format: int64 - round: - type: integer - format: int32 - block_id: + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: + title: PartsetHeader + title: BlockID + signatures: type: array items: type: object properties: - address: + block_id_flag: type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN title: >- - PublicKey defines the keys available for - use with Validators - voting_power: + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: type: string - format: int64 - proposer_priority: + format: byte + timestamp: type: string - format: int64 - proposer: + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: type: object properties: - address: + ed25519: type: string format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: + secp256k1: type: string - format: int64 - total_voting_power: + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: type: string format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: type: object properties: - address: + ed25519: type: string format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: + secp256k1: type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: type: object properties: - height: + hash: type: string - format: int64 - round: - type: integer - format: int32 - block_id: + format: byte + part_set_header: type: object properties: + total: + type: integer + format: int64 hash: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - sdk_block: - title: 'Since: cosmos-sdk 0.47' + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse: + type: object + properties: + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' type: object properties: header: @@ -47007,18 +49981,9 @@ definitions: title: consensus info proposer_address: type: string - description: >- - proposer_address is the original block proposer address, - formatted as a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, we - convert it to a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. data: type: object properties: @@ -47482,4868 +50447,2033 @@ definitions: description: >- Commit contains the evidence that a block was committed by a set of validators. - description: |- - Block is tendermint type Block, with the Header proposer address - field converted to bech32 string. - description: >- - GetLatestBlockResponse is the response type for the Query/GetLatestBlock - RPC + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, - method. - cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse: - type: object - properties: - block_height: - type: string - format: int64 - validators: - type: array - items: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + including all blockchain data structures and the rules of the + application's - protocol buffer message. This string must contain at least + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, + formatted as a Bech32 string. - one "/" character. The last segment of the URL's path must - represent + In Tendermint, this type is `bytes`, but in the SDK, we + convert it to a Bech32 string - the fully qualified name of the type (as in + for better UX. - `path/google.protobuf.Duration`). The name should be in a - canonical form - (e.g., leading "." is not accepted). + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + NOTE: not all txs here are valid. We're just agreeing on the + order first. - In practice, teams usually precompile into the binary all - types that they + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - expect it to use in the context of Any. However, for URLs - which use the + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for - scheme `http`, `https`, or no scheme, one can optionally set - up a type + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - server that maps type URLs to message definitions as - follows: + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - pagination: - description: pagination defines an pagination for the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + including all blockchain data structures + and the rules of the application's - was set, its value is undefined otherwise - description: |- - GetLatestValidatorSetResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. - cosmos.base.tendermint.v1beta1.GetNodeInfoResponse: + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + description: >- + GetBlockByHeightResponse is the response type for the + Query/GetBlockByHeight RPC method. + cosmos.base.tendermint.v1beta1.GetLatestBlockResponse: type: object properties: - default_node_info: + block_id: type: object properties: - protocol_version: - type: object - properties: - p2p: - type: string - format: uint64 - block: - type: string - format: uint64 - app: - type: string - format: uint64 - default_node_id: - type: string - listen_addr: - type: string - network: - type: string - version: - type: string - channels: + hash: type: string format: byte - moniker: - type: string - other: + part_set_header: type: object properties: - tx_index: - type: string - rpc_address: + total: + type: integer + format: int64 + hash: type: string - application_version: + format: byte + title: PartsetHeader + title: BlockID + block: + title: 'Deprecated: please use `sdk_block` instead' type: object properties: - name: - type: string - app_name: - type: string - version: - type: string - git_commit: - type: string - build_tags: - type: string - go_version: - type: string - build_deps: - type: array - items: - type: object - properties: - path: - type: string - title: module path - version: - type: string - title: module version - sum: - type: string - title: checksum - title: Module is the type for VersionInfo - cosmos_sdk_version: - type: string - title: 'Since: cosmos-sdk 0.43' - description: VersionInfo is the type for the GetNodeInfoResponse message. - description: |- - GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC - method. - cosmos.base.tendermint.v1beta1.GetSyncingResponse: - type: object - properties: - syncing: - type: boolean - description: >- - GetSyncingResponse is the response type for the Query/GetSyncing RPC - method. - cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse: - type: object - properties: - block_height: - type: string - format: int64 - validators: - type: array - items: - type: object - properties: - address: - type: string - pub_key: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + including all blockchain data structures and the rules of the + application's - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. - If the embedded message type is well-known and has a custom JSON + NOTE: not all txs here are valid. We're just agreeing on the + order first. - representation, that representation will be embedded adding a - field + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - `value` which holds the custom JSON in addition to the `@type` + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for - field. Example (for message [google.protobuf.Duration][]): + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - pagination: - description: pagination defines an pagination for the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for - was set, its value is undefined otherwise - description: |- - GetValidatorSetByHeightResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. - cosmos.base.tendermint.v1beta1.Header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in the - blockchain, + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, - including all blockchain data structures and the rules of the - application's + including all blockchain data structures + and the rules of the application's - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: type: object properties: - total: + height: + type: string + format: int64 + round: type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + sdk_block: + title: 'Since: cosmos-sdk 0.47' + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string format: int64 - hash: + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: type: string format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - description: >- - proposer_address is the original block proposer address, formatted as - a Bech32 string. - - In Tendermint, this type is `bytes`, but in the SDK, we convert it to - a Bech32 string - - for better UX. - - - original proposer of the block - description: Header defines the structure of a Tendermint block header. - cosmos.base.tendermint.v1beta1.Module: - type: object - properties: - path: - type: string - title: module path - version: - type: string - title: module version - sum: - type: string - title: checksum - title: Module is the type for VersionInfo - cosmos.base.tendermint.v1beta1.ProofOp: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - description: >- - ProofOp defines an operation used for calculating Merkle root. The data - could + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, + formatted as a Bech32 string. - be arbitrary format, providing nessecary data for example neighbouring - node + In Tendermint, this type is `bytes`, but in the SDK, we + convert it to a Bech32 string - hash. + for better UX. - Note: This type is a duplicate of the ProofOp proto type defined in + original proposer of the block + description: Header defines the structure of a Tendermint block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. - Tendermint. - cosmos.base.tendermint.v1beta1.ProofOps: - type: object - properties: - ops: - type: array - items: - type: object - properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte - description: >- - ProofOp defines an operation used for calculating Merkle root. The - data could + NOTE: not all txs here are valid. We're just agreeing on the + order first. - be arbitrary format, providing nessecary data for example - neighbouring node + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - hash. + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - Note: This type is a duplicate of the ProofOp proto type defined in + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for - Tendermint. - description: |- - ProofOps is Merkle proof defined by the list of ProofOps. + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, - Note: This type is a duplicate of the ProofOps proto type defined in - Tendermint. - cosmos.base.tendermint.v1beta1.Validator: + including all blockchain data structures + and the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + description: |- + Block is tendermint type Block, with the Header proposer address + field converted to bech32 string. + description: >- + GetLatestBlockResponse is the response type for the Query/GetLatestBlock + RPC method. + cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse: type: object properties: - address: + block_height: type: string - pub_key: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + format: int64 + validators: + type: array + items: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all types - that they + In practice, teams usually precompile into the binary all + types that they - expect it to use in the context of Any. However, for URLs which - use the + expect it to use in the context of Any. However, for URLs + which use the - scheme `http`, `https`, or no scheme, one can optionally set up a - type + scheme `http`, `https`, or no scheme, one can optionally set + up a type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as + follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might be + Schemes other than `http`, `https` (or the empty scheme) + might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in the - form + Protobuf library provides support to pack/unpack Any values in + the form - of utility functions or additional generated methods of the Any type. + of utility functions or additional generated methods of the Any + type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default + use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last + '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field + representation, that representation will be embedded adding a + field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - description: Validator is the type for the validator-set. - cosmos.base.tendermint.v1beta1.VersionInfo: - type: object - properties: - name: - type: string - app_name: - type: string - version: - type: string - git_commit: - type: string - build_tags: - type: string - go_version: - type: string - build_deps: - type: array - items: - type: object - properties: - path: - type: string - title: module path - version: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: type: string - title: module version - sum: + format: int64 + proposer_priority: type: string - title: checksum - title: Module is the type for VersionInfo - cosmos_sdk_version: - type: string - title: 'Since: cosmos-sdk 0.43' - description: VersionInfo is the type for the GetNodeInfoResponse message. - tendermint.crypto.PublicKey: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - tendermint.p2p.DefaultNodeInfo: - type: object - properties: - protocol_version: + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. type: object properties: - p2p: - type: string - format: uint64 - block: + next_key: type: string - format: uint64 - app: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string format: uint64 - default_node_id: - type: string - listen_addr: - type: string - network: - type: string - version: - type: string - channels: - type: string - format: byte - moniker: - type: string - other: - type: object - properties: - tx_index: - type: string - rpc_address: - type: string - tendermint.p2p.DefaultNodeInfoOther: - type: object - properties: - tx_index: - type: string - rpc_address: - type: string - tendermint.p2p.ProtocolVersion: - type: object - properties: - p2p: - type: string - format: uint64 - block: - type: string - format: uint64 - app: - type: string - format: uint64 - tendermint.types.Block: + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + GetLatestValidatorSetResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + cosmos.base.tendermint.v1beta1.GetNodeInfoResponse: type: object properties: - header: + default_node_info: type: object properties: - version: - title: basic block info + protocol_version: type: object properties: + p2p: + type: string + format: uint64 block: type: string format: uint64 app: type: string format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: + default_node_id: type: string - height: + listen_addr: type: string - format: int64 - time: + network: type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: + version: type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: + channels: type: string format: byte - title: transactions - validators_hash: + moniker: type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + application_version: + type: object + properties: + name: type: string - format: byte - title: validators for the next block - consensus_hash: + app_name: type: string - format: byte - title: consensus params for current block - app_hash: + version: type: string - format: byte - title: state after txs from the previous block - last_results_hash: + git_commit: type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: + build_tags: type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: + go_version: type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: + build_deps: type: array items: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + description: >- + GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC + method. + cosmos.base.tendermint.v1beta1.GetSyncingResponse: + type: object + properties: + syncing: + type: boolean + description: >- + GetSyncingResponse is the response type for the Query/GetSyncing RPC + method. + cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse: + type: object + properties: + block_height: + type: string + format: int64 + validators: + type: array + items: + type: object + properties: + address: type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the - order first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: + pub_key: type: object properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + protocol buffer message. This string must contain at least - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and - the rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from - the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block was - committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - tendermint.types.BlockID: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - tendermint.types.BlockIDFlag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - tendermint.types.Commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - tendermint.types.CommitSig: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - tendermint.types.Data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. - - NOTE: not all txs here are valid. We're just agreeing on the order - first. - - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - tendermint.types.DuplicateVoteEvidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from validators - for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from validators - for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator signed two - conflicting votes. - tendermint.types.Evidence: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator signed two - conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, - - including all blockchain data structures and the rules - of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was committed by - a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of validators - attempting to mislead a light client. - tendermint.types.EvidenceList: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote from - validators for - - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator signed - two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and the - rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the - previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included in a - Commit. - description: >- - Commit contains the evidence that a block was - committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - tendermint.types.Header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in the - blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - tendermint.types.LightBlock: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - tendermint.types.LightClientAttackEvidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a - block in the blockchain, - - including all blockchain data structures and the rules of - the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs from the previous - block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the signature is - for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a - set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use with - Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of validators - attempting to mislead a light client. - tendermint.types.PartSetHeader: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - tendermint.types.SignedHeader: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set of - validators. - tendermint.types.SignedMsgType: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - tendermint.types.Validator: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - tendermint.types.ValidatorSet: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: PublicKey defines the keys available for use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - tendermint.types.Vote: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: |- - SignedMsgType is a type of signed message in the consensus. - - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: |- - Vote represents a prevote, precommit, or commit vote from validators for - consensus. - tendermint.version.Consensus: - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in the - blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - cosmos.crisis.v1beta1.MsgVerifyInvariantResponse: - type: object - description: MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. - cosmos.base.v1beta1.DecCoin: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - cosmos.distribution.v1beta1.DelegationDelegatorReward: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse: - type: object - description: >- - MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response - type. - cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse: - type: object - description: >- - MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response - type. - cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse: - type: object - properties: - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: 'Since: cosmos-sdk 0.46' - description: >- - MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward - response type. - cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: - type: object - properties: - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: 'Since: cosmos-sdk 0.46' - description: >- - MsgWithdrawValidatorCommissionResponse defines the - Msg/WithdrawValidatorCommission response type. - cosmos.distribution.v1beta1.Params: - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - bonus_proposer_reward: - type: string - withdraw_addr_enabled: - type: boolean - description: Params defines the set of params for the distribution module. - cosmos.distribution.v1beta1.QueryCommunityPoolResponse: - type: object - properties: - pool: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: pool defines community pool's coins. - description: >- - QueryCommunityPoolResponse is the response type for the - Query/CommunityPool - - RPC method. - cosmos.distribution.v1beta1.QueryDelegationRewardsResponse: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: rewards defines the rewards accrued by a delegation. - description: |- - QueryDelegationRewardsResponse is the response type for the - Query/DelegationRewards RPC method. - cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - validator_address: - type: string - reward: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: |- - DelegationDelegatorReward represents the properties - of a delegator's delegation reward. - description: rewards defines all the rewards accrued by a delegator. - total: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: total defines the sum of all the rewards. - description: |- - QueryDelegationTotalRewardsResponse is the response type for the - Query/DelegationTotalRewards RPC method. - cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse: - type: object - properties: - validators: - type: array - items: - type: string - description: validators defines the validators a delegator is delegating for. - description: |- - QueryDelegatorValidatorsResponse is the response type for the - Query/DelegatorValidators RPC method. - cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse: - type: object - properties: - withdraw_address: - type: string - description: withdraw_address defines the delegator address to query for. - description: |- - QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. - cosmos.distribution.v1beta1.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - community_tax: - type: string - base_proposer_reward: - type: string - bonus_proposer_reward: - type: string - withdraw_addr_enabled: - type: boolean - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.distribution.v1beta1.QueryValidatorCommissionResponse: - type: object - properties: - commission: - description: commission defines the commision the validator received. - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - title: |- - QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method - cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: - type: object - properties: - rewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - DecCoin defines a token with a denomination and a decimal - amount. - - - NOTE: The amount field is an Dec which implements the custom - method - - signatures required by gogoproto. - description: >- - ValidatorOutstandingRewards represents outstanding (un-withdrawn) - rewards - - for a validator inexpensive to track, allows simple sanity checks. - description: |- - QueryValidatorOutstandingRewardsResponse is the response type for the - Query/ValidatorOutstandingRewards RPC method. - cosmos.distribution.v1beta1.QueryValidatorSlashesResponse: - type: object - properties: - slashes: - type: array - items: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: |- - ValidatorSlashEvent represents a validator slash event. - Height is implicit within the store key. - This is needed to calculate appropriate amount of staking tokens - for delegations which are withdrawn after a slash has occurred. - description: slashes defines the slashes the validator received. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. - cosmos.distribution.v1beta1.ValidatorAccumulatedCommission: - type: object - properties: - commission: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - ValidatorAccumulatedCommission represents accumulated commission - for a validator kept as a running counter, can be withdrawn at any time. - cosmos.distribution.v1beta1.ValidatorOutstandingRewards: - type: object - properties: - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - DecCoin defines a token with a denomination and a decimal amount. - - NOTE: The amount field is an Dec which implements the custom method - signatures required by gogoproto. - description: |- - ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards - for a validator inexpensive to track, allows simple sanity checks. - cosmos.distribution.v1beta1.ValidatorSlashEvent: - type: object - properties: - validator_period: - type: string - format: uint64 - fraction: - type: string - description: |- - ValidatorSlashEvent represents a validator slash event. - Height is implicit within the store key. - This is needed to calculate appropriate amount of staking tokens - for delegations which are withdrawn after a slash has occurred. - cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse: - type: object - properties: - hash: - type: string - format: byte - description: hash defines the hash of the evidence. - description: MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. - cosmos.evidence.v1beta1.QueryAllEvidenceResponse: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up - a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might - be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: evidence returns all evidences. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - QueryAllEvidenceResponse is the response type for the Query/AllEvidence - RPC - - method. - cosmos.evidence.v1beta1.QueryEvidenceResponse: - type: object - properties: - evidence: - description: evidence returns the requested evidence. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up a - type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - QueryEvidenceResponse is the response type for the Query/Evidence RPC - method. - cosmos.feegrant.v1beta1.Grant: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of their - funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up a - type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse: - type: object - description: >- - MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response - type. - cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse: - type: object - description: >- - MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse - response type. - cosmos.feegrant.v1beta1.QueryAllowanceResponse: - type: object - properties: - allowance: - description: allowance is a allowance granted for grantee by granter. - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of their - funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might - be - - used with implementation specific semantics. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - description: >- - QueryAllowanceResponse is the response type for the Query/Allowance RPC - method. - cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse: - type: object - properties: - allowances: - type: array - items: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of - their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - description: allowances that have been issued by the granter. - pagination: - description: pagination defines an pagination for the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - QueryAllowancesByGranterResponse is the response type for the - Query/AllowancesByGranter RPC method. - - - Since: cosmos-sdk 0.46 - cosmos.feegrant.v1beta1.QueryAllowancesResponse: - type: object - properties: - allowances: - type: array - items: - type: object - properties: - granter: - type: string - description: >- - granter is the address of the user granting an allowance of - their funds. - grantee: - type: string - description: >- - grantee is the address of the user being granted an allowance of - another user's funds. - allowance: - description: allowance can be any of basic, periodic, allowed fee allowance. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - title: Grant is stored in the KVStore to record a grant with full context - description: allowances are allowance's granted for grantee by granter. - pagination: - description: pagination defines an pagination for the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - QueryAllowancesResponse is the response type for the Query/Allowances RPC - method. - cosmos.gov.v1.Deposit: - type: object - properties: - proposal_id: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: |- - Deposit defines an amount deposited by an account address to an active - proposal. - cosmos.gov.v1.DepositParams: - type: object - properties: - min_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - months. - description: DepositParams defines the params for deposits on governance proposals. - cosmos.gov.v1.MsgDepositResponse: - type: object - description: MsgDepositResponse defines the Msg/Deposit response type. - cosmos.gov.v1.MsgExecLegacyContentResponse: - type: object - description: >- - MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response - type. - cosmos.gov.v1.MsgSubmitProposalResponse: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - cosmos.gov.v1.MsgVoteResponse: - type: object - description: MsgVoteResponse defines the Msg/Vote response type. - cosmos.gov.v1.MsgVoteWeightedResponse: - type: object - description: MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - cosmos.gov.v1.Proposal: - type: object - properties: - id: - type: string - format: uint64 - messages: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up - a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might - be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: |- - final_tally_result is the final tally result of the proposal. When - querying a proposal via gRPC, this field is not populated until the - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - abstain_count: - type: string - no_count: - type: string - no_with_veto_count: - type: string - submit_time: - type: string - format: date-time - deposit_end_time: - type: string - format: date-time - total_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - metadata: - type: string - description: metadata is any arbitrary metadata attached to the proposal. - description: Proposal defines the core field members of a governance proposal. - cosmos.gov.v1.ProposalStatus: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - cosmos.gov.v1.QueryDepositResponse: - type: object - properties: - deposit: - description: deposit defines the requested deposit. - type: object - properties: - proposal_id: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - description: >- - QueryDepositResponse is the response type for the Query/Deposit RPC - method. - cosmos.gov.v1.QueryDepositsResponse: - type: object - properties: - deposits: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - description: >- - Deposit defines an amount deposited by an account address to an - active - - proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: >- - QueryDepositsResponse is the response type for the Query/Deposits RPC - method. - cosmos.gov.v1.QueryParamsResponse: - type: object - properties: - voting_params: - description: voting_params defines the parameters related to voting. - type: object - properties: - voting_period: - type: string - description: Length of the voting period. - deposit_params: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - description: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - months. - tally_params: - description: tally_params defines the parameters related to tally. - type: object - properties: - quorum: - type: string - description: >- - Minimum percentage of total stake needed to vote for a result to - be - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. Default - value: 0.5. - veto_threshold: - type: string - description: >- - Minimum value of Veto votes to Total votes ratio for proposal to - be - vetoed. Default value: 1/3. - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.gov.v1.QueryProposalResponse: - type: object - properties: - proposal: - type: object - properties: - id: - type: string - format: uint64 - messages: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent the fully qualified name of the type (as in @@ -52498,2752 +52628,3741 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - status: + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED + format: byte description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: >- - final_tally_result is the final tally result of the proposal. When + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - querying a proposal via gRPC, this field is not populated until - the + was set, its value is undefined otherwise + description: >- + GetValidatorSetByHeightResponse is the response type for the + Query/GetValidatorSetByHeight RPC method. + cosmos.base.tendermint.v1beta1.Header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, - proposal's voting period has ended. + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: type: object properties: - yes_count: - type: string - abstain_count: - type: string - no_count: - type: string - no_with_veto_count: + total: + type: integer + format: int64 + hash: type: string - submit_time: - type: string - format: date-time - deposit_end_time: - type: string - format: date-time - total_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + description: >- + proposer_address is the original block proposer address, formatted as + a Bech32 string. + In Tendermint, this type is `bytes`, but in the SDK, we convert it to + a Bech32 string - NOTE: The amount field is an Int which implements the custom - method + for better UX. - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - metadata: - type: string - description: metadata is any arbitrary metadata attached to the proposal. - description: Proposal defines the core field members of a governance proposal. + + original proposer of the block + description: Header defines the structure of a Tendermint block header. + cosmos.base.tendermint.v1beta1.Module: + type: object + properties: + path: + type: string + title: module path + version: + type: string + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos.base.tendermint.v1beta1.ProofOp: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte description: >- - QueryProposalResponse is the response type for the Query/Proposal RPC - method. - cosmos.gov.v1.QueryProposalsResponse: + ProofOp defines an operation used for calculating Merkle root. The data + could + + be arbitrary format, providing necessary data for example neighbouring + node + + hash. + + + Note: This type is a duplicate of the ProofOp proto type defined in + Tendermint. + cosmos.base.tendermint.v1beta1.ProofOps: type: object properties: - proposals: + ops: type: array items: type: object properties: - id: + type: type: string - format: uint64 - messages: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + key: + type: string + format: byte + data: + type: string + format: byte + description: >- + ProofOp defines an operation used for calculating Merkle root. The + data could - protocol buffer message. This string must contain at least + be arbitrary format, providing necessary data for example + neighbouring node - one "/" character. The last segment of the URL's path must - represent + hash. - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + Note: This type is a duplicate of the ProofOp proto type defined in + Tendermint. + description: >- + ProofOps is Merkle proof defined by the list of ProofOps. - (e.g., leading "." is not accepted). + Note: This type is a duplicate of the ProofOps proto type defined in + Tendermint. + cosmos.base.tendermint.v1beta1.Validator: + type: object + properties: + address: + type: string + pub_key: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - In practice, teams usually precompile into the binary all - types that they + protocol buffer message. This string must contain at least - expect it to use in the context of Any. However, for URLs - which use the + one "/" character. The last segment of the URL's path must + represent - scheme `http`, `https`, or no scheme, one can optionally - set up a type + the fully qualified name of the type (as in - server that maps type URLs to message definitions as - follows: + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + In practice, teams usually precompile into the binary all types + that they - Note: this functionality is not currently available in the - official + expect it to use in the context of Any. However, for URLs which + use the - protobuf release, and it is not used for type URLs - beginning with + scheme `http`, `https`, or no scheme, one can optionally set up a + type - type.googleapis.com. + server that maps type URLs to message definitions as follows: - Schemes other than `http`, `https` (or the empty scheme) - might be + * If no scheme is provided, `https` is assumed. - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - URL that describes the type of the serialized message. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning with - Protobuf library provides support to pack/unpack Any values in - the form + type.googleapis.com. - of utility functions or additional generated methods of the - Any type. + Schemes other than `http`, `https` (or the empty scheme) might be - Example 1: Pack and unpack a message in C++. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + URL that describes the type of the serialized message. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Protobuf library provides support to pack/unpack Any values in the + form - Example 3: Pack and unpack a message in Python. + of utility functions or additional generated methods of the Any type. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Example 1: Pack and unpack a message in C++. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - The pack methods provided by protobuf library will by default - use + Example 2: Pack and unpack a message in Java. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - methods only use the fully qualified type name after the last - '/' + Example 3: Pack and unpack a message in Python. - in the type URL, for example "foo.bar.com/x/y.z" will yield - type + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - name "y.z". + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + The pack methods provided by protobuf library will by default use - JSON + 'type.googleapis.com/full.type.name' as the type URL and the unpack - ==== + methods only use the fully qualified type name after the last '/' - The JSON representation of an `Any` value uses the regular + in the type URL, for example "foo.bar.com/x/y.z" will yield type - representation of the deserialized, embedded message, with an + name "y.z". - additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + JSON - If the embedded message type is well-known and has a custom - JSON + ==== - representation, that representation will be embedded adding a - field + The JSON representation of an `Any` value uses the regular - `value` which holds the custom JSON in addition to the `@type` + representation of the deserialized, embedded message, with an - field. Example (for message [google.protobuf.Duration][]): + additional field `@type` which contains the type URL. Example: - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: >- - final_tally_result is the final tally result of the proposal. - When + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - querying a proposal via gRPC, this field is not populated until - the + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - proposal's voting period has ended. - type: object - properties: - yes_count: - type: string - abstain_count: - type: string - no_count: - type: string - no_with_veto_count: - type: string - submit_time: + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + description: Validator is the type for the validator-set. + cosmos.base.tendermint.v1beta1.VersionInfo: + type: object + properties: + name: + type: string + app_name: + type: string + version: + type: string + git_commit: + type: string + build_tags: + type: string + go_version: + type: string + build_deps: + type: array + items: + type: object + properties: + path: type: string - format: date-time - deposit_end_time: + title: module path + version: type: string - format: date-time - total_deposit: - type: array - items: + title: module version + sum: + type: string + title: checksum + title: Module is the type for VersionInfo + cosmos_sdk_version: + type: string + title: 'Since: cosmos-sdk 0.43' + description: VersionInfo is the type for the GetNodeInfoResponse message. + tendermint.crypto.PublicKey: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + tendermint.p2p.DefaultNodeInfo: + type: object + properties: + protocol_version: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + default_node_id: + type: string + listen_addr: + type: string + network: + type: string + version: + type: string + channels: + type: string + format: byte + moniker: + type: string + other: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + tendermint.p2p.DefaultNodeInfoOther: + type: object + properties: + tx_index: + type: string + rpc_address: + type: string + tendermint.p2p.ProtocolVersion: + type: object + properties: + p2p: + type: string + format: uint64 + block: + type: string + format: uint64 + app: + type: string + format: uint64 + tendermint.types.Block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: type: object properties: - denom: - type: string - amount: + total: + type: integer + format: int64 + hash: type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - metadata: - type: string - description: metadata is any arbitrary metadata attached to the proposal. - description: Proposal defines the core field members of a governance proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: type: string format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + description: commit from validators from the last block + title: hashes of block data + data_hash: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - QueryProposalsResponse is the response type for the Query/Proposals RPC - method. - cosmos.gov.v1.QueryTallyResultResponse: - type: object - properties: - tally: - description: tally defines the requested tally. - type: object - properties: - yes_count: + format: byte + title: transactions + validators_hash: type: string - abstain_count: + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: type: string - no_count: + format: byte + title: validators for the next block + consensus_hash: type: string - no_with_veto_count: + format: byte + title: consensus params for current block + app_hash: type: string - description: >- - QueryTallyResultResponse is the response type for the Query/Tally RPC - method. - cosmos.gov.v1.QueryVoteResponse: - type: object - properties: - vote: - description: vote defined the queried vote. + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: type: object properties: - proposal_id: - type: string - format: uint64 - voter: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. + + NOTE: not all txs here are valid. We're just agreeing on the + order first. + + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and + the rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from + the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: + type: object + properties: + height: type: string - options: + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: type: array items: type: object properties: - option: + block_id_flag: type: string enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: type: string - description: WeightedVoteOption defines a unit of vote for vote split. - metadata: - type: string - description: metadata is any arbitrary metadata to attached to the vote. - description: QueryVoteResponse is the response type for the Query/Vote RPC method. - cosmos.gov.v1.QueryVotesResponse: + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.BlockID: type: object properties: - votes: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - voter: - type: string - options: - type: array - items: - type: object - properties: - option: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: - type: string - description: WeightedVoteOption defines a unit of vote for vote split. - metadata: - type: string - description: metadata is any arbitrary metadata to attached to the vote. - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. - pagination: - description: pagination defines the pagination in the response. + hash: + type: string + format: byte + part_set_header: type: object properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. total: + type: integer + format: int64 + hash: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: QueryVotesResponse is the response type for the Query/Votes RPC method. - cosmos.gov.v1.TallyParams: - type: object - properties: - quorum: - type: string - description: |- - Minimum percentage of total stake needed to vote for a result to be - considered valid. - threshold: - type: string - description: >- - Minimum proportion of Yes votes for proposal to pass. Default value: - 0.5. - veto_threshold: - type: string - description: |- - Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. - description: TallyParams defines the params for tallying votes on governance proposals. - cosmos.gov.v1.TallyResult: - type: object - properties: - yes_count: - type: string - abstain_count: - type: string - no_count: - type: string - no_with_veto_count: - type: string - description: TallyResult defines a standard tally for a governance proposal. - cosmos.gov.v1.Vote: - type: object - properties: - proposal_id: - type: string - format: uint64 - voter: - type: string - options: - type: array - items: - type: object - properties: - option: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: - type: string - description: WeightedVoteOption defines a unit of vote for vote split. - metadata: - type: string - description: metadata is any arbitrary metadata to attached to the vote. - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - cosmos.gov.v1.VoteOption: + format: byte + title: PartsetHeader + title: BlockID + tendermint.types.BlockIDFlag: type: string enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - cosmos.gov.v1.VotingParams: - type: object - properties: - voting_period: - type: string - description: Length of the voting period. - description: VotingParams defines the params for voting on governance proposals. - cosmos.gov.v1.WeightedVoteOption: - type: object - properties: - option: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: - type: string - description: WeightedVoteOption defines a unit of vote for vote split. - cosmos.gov.v1beta1.Deposit: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + tendermint.types.Commit: type: object properties: - proposal_id: - type: string - format: uint64 - depositor: + height: type: string - amount: + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: type: array items: type: object properties: - denom: + block_id_flag: type: string - amount: + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: |- - Deposit defines an amount deposited by an account address to an active - proposal. - cosmos.gov.v1beta1.DepositParams: - type: object - properties: - min_deposit: - type: array - items: - type: object - properties: - denom: + format: byte + timestamp: type: string - amount: + format: date-time + signature: type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: Minimum deposit for a proposal to enter voting period. - max_deposit_period: - type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - months. - description: DepositParams defines the params for deposits on governance proposals. - cosmos.gov.v1beta1.MsgDepositResponse: - type: object - description: MsgDepositResponse defines the Msg/Deposit response type. - cosmos.gov.v1beta1.MsgSubmitProposalResponse: - type: object - properties: - proposal_id: - type: string - format: uint64 - description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - cosmos.gov.v1beta1.MsgVoteResponse: - type: object - description: MsgVoteResponse defines the Msg/Vote response type. - cosmos.gov.v1beta1.MsgVoteWeightedResponse: - type: object - description: |- - MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. - - Since: cosmos-sdk 0.43 - cosmos.gov.v1beta1.Proposal: + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.CommitSig: type: object properties: - proposal_id: - type: string - format: uint64 - content: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up a - type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: + block_id_flag: type: string enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: - description: |- - final_tally_result is the final tally result of the proposal. When - querying a proposal via gRPC, this field is not populated until the - proposal's voting period has ended. - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - no_with_veto: - type: string - submit_time: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: type: string - format: date-time - deposit_end_time: + format: byte + timestamp: type: string format: date-time - total_deposit: + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + tendermint.types.Data: + type: object + properties: + txs: type: array items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - description: Proposal defines the core field members of a governance proposal. - cosmos.gov.v1beta1.ProposalStatus: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. + NOTE: not all txs here are valid. We're just agreeing on the order + first. - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - cosmos.gov.v1beta1.QueryDepositResponse: + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + tendermint.types.DuplicateVoteEvidence: type: object properties: - deposit: - description: deposit defines the requested deposit. + vote_a: type: object properties: - proposal_id: - type: string - format: uint64 - depositor: + type: type: string - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. - signatures required by gogoproto. - description: >- - QueryDepositResponse is the response type for the Query/Deposit RPC - method. - cosmos.gov.v1beta1.QueryDepositsResponse: - type: object - properties: - deposits: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - depositor: - type: string - amount: - type: array - items: + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: type: object properties: - denom: - type: string - amount: + total: + type: integer + format: int64 + hash: type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - description: >- - Deposit defines an amount deposited by an account address to an - active - - proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: type: string format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + validator_index: + type: integer + format: int32 + signature: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from validators + for - was set, its value is undefined otherwise - description: >- - QueryDepositsResponse is the response type for the Query/Deposits RPC - method. - cosmos.gov.v1beta1.QueryParamsResponse: - type: object - properties: - voting_params: - description: voting_params defines the parameters related to voting. + consensus. + vote_b: type: object properties: - voting_period: + type: type: string - description: Length of the voting period. - deposit_params: - description: deposit_params defines the parameters related to deposit. - type: object - properties: - min_deposit: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. - signatures required by gogoproto. - description: Minimum deposit for a proposal to enter voting period. - max_deposit_period: + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: type: string - description: >- - Maximum period for Atom holders to deposit on a proposal. Initial - value: 2 - months. - tally_params: - description: tally_params defines the parameters related to tally. - type: object - properties: - quorum: + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: type: string - format: byte - description: >- - Minimum percentage of total stake needed to vote for a result to - be - considered valid. - threshold: + format: date-time + validator_address: type: string format: byte - description: >- - Minimum proportion of Yes votes for proposal to pass. Default - value: 0.5. - veto_threshold: + validator_index: + type: integer + format: int32 + signature: type: string format: byte - description: >- - Minimum value of Veto votes to Total votes ratio for proposal to - be - vetoed. Default value: 1/3. - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.gov.v1beta1.QueryProposalResponse: + description: >- + Vote represents a prevote, precommit, or commit vote from validators + for + + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator signed two + conflicting votes. + tendermint.types.Evidence: type: object properties: - proposal: + duplicate_vote_evidence: type: object properties: - proposal_id: - type: string - format: uint64 - content: + vote_a: type: object properties: - '@type': + type: type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might - be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte description: >- - final_tally_result is the final tally result of the proposal. When - - querying a proposal via gRPC, this field is not populated until - the + Vote represents a prevote, precommit, or commit vote from + validators for - proposal's voting period has ended. + consensus. + vote_b: type: object properties: - 'yes': + type: type: string - abstain: + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: type: string - 'no': + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: type: string - no_with_veto: + format: date-time + validator_address: type: string - submit_time: + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for + + consensus. + total_voting_power: type: string - format: date-time - deposit_end_time: + format: int64 + validator_power: + type: string + format: int64 + timestamp: type: string format: date-time - total_deposit: + description: >- + DuplicateVoteEvidence contains evidence of a validator signed two + conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing + a block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was committed by + a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: type: array items: type: object properties: - denom: + address: type: string - amount: + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - voting_start_time: + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: type: string - format: date-time - voting_end_time: + format: int64 + timestamp: type: string format: date-time - description: Proposal defines the core field members of a governance proposal. - description: >- - QueryProposalResponse is the response type for the Query/Proposal RPC - method. - cosmos.gov.v1beta1.QueryProposalsResponse: - type: object - properties: - proposals: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - content: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON + description: >- + LightClientAttackEvidence contains evidence of a set of validators + attempting to mislead a light client. + tendermint.types.EvidenceList: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - representation, that representation will be embedded adding a - field + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for - `value` which holds the custom JSON in addition to the `@type` + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - field. Example (for message [google.protobuf.Duration][]): + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote from + validators for - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - status: - type: string - enum: - - PROPOSAL_STATUS_UNSPECIFIED - - PROPOSAL_STATUS_DEPOSIT_PERIOD - - PROPOSAL_STATUS_VOTING_PERIOD - - PROPOSAL_STATUS_PASSED - - PROPOSAL_STATUS_REJECTED - - PROPOSAL_STATUS_FAILED - default: PROPOSAL_STATUS_UNSPECIFIED - description: |- - ProposalStatus enumerates the valid statuses of a proposal. - - - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. - - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. - - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. - - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. - - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. - final_tally_result: + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time description: >- - final_tally_result is the final tally result of the proposal. - When - - querying a proposal via gRPC, this field is not populated until - the - - proposal's voting period has ended. + DuplicateVoteEvidence contains evidence of a validator signed + two conflicting votes. + light_client_attack_evidence: type: object properties: - 'yes': - type: string - abstain: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and the + rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the + previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included in a + Commit. + description: >- + Commit contains the evidence that a block was + committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: type: string - 'no': + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: type: string - no_with_veto: + format: int64 + timestamp: type: string - submit_time: - type: string - format: date-time - deposit_end_time: - type: string - format: date-time - total_deposit: - type: array - items: + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + tendermint.types.Header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + tendermint.types.LightBlock: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info type: object properties: - denom: + block: type: string - amount: + format: uint64 + app: type: string + format: uint64 description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method + Consensus captures the consensus rules for processing a block + in the blockchain, - signatures required by gogoproto. - voting_start_time: - type: string - format: date-time - voting_end_time: - type: string - format: date-time - description: Proposal defines the core field members of a governance proposal. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + including all blockchain data structures and the rules of the + application's - was set, its value is undefined otherwise - description: |- - QueryProposalsResponse is the response type for the Query/Proposals RPC - method. - cosmos.gov.v1beta1.QueryTallyResultResponse: - type: object - properties: - tally: - description: tally defines the requested tally. - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - no_with_veto: - type: string - description: >- - QueryTallyResultResponse is the response type for the Query/Tally RPC - method. - cosmos.gov.v1beta1.QueryVoteResponse: - type: object - properties: - vote: - description: vote defined the queried vote. + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. + validator_set: type: object properties: - proposal_id: - type: string - format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set in - queries - - if and only if `len(options) == 1` and that option has weight 1. - In all - - other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: + validators: type: array items: type: object properties: - option: + address: type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: type: string - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' - description: QueryVoteResponse is the response type for the Query/Vote RPC method. - cosmos.gov.v1beta1.QueryVotesResponse: - type: object - properties: - votes: - type: array - items: - type: object - properties: - proposal_id: - type: string - format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set - in queries - - if and only if `len(options) == 1` and that option has weight 1. - In all - - other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: - type: array - items: + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: type: object properties: - option: + ed25519: type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: + format: byte + secp256k1: type: string - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - description: votes defined the queried votes. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: QueryVotesResponse is the response type for the Query/Votes RPC method. - cosmos.gov.v1beta1.TallyParams: - type: object - properties: - quorum: - type: string - format: byte - description: |- - Minimum percentage of total stake needed to vote for a result to be - considered valid. - threshold: - type: string - format: byte - description: >- - Minimum proportion of Yes votes for proposal to pass. Default value: - 0.5. - veto_threshold: - type: string - format: byte - description: |- - Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. - description: TallyParams defines the params for tallying votes on governance proposals. - cosmos.gov.v1beta1.TallyResult: - type: object - properties: - 'yes': - type: string - abstain: - type: string - 'no': - type: string - no_with_veto: - type: string - description: TallyResult defines a standard tally for a governance proposal. - cosmos.gov.v1beta1.Vote: + format: int64 + tendermint.types.LightClientAttackEvidence: type: object properties: - proposal_id: - type: string - format: uint64 - voter: - type: string - option: - description: >- - Deprecated: Prefer to use `options` instead. This field is set in - queries + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, - if and only if `len(options) == 1` and that option has weight 1. In - all + including all blockchain data structures and the rules of + the application's - other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs from the previous + block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the signature is + for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a + set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use with + Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - options: + format: int64 + byzantine_validators: type: array items: type: object properties: - option: + address: type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given - governance proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: type: string - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - title: 'Since: cosmos-sdk 0.43' - description: |- - Vote defines a vote on a governance proposal. - A Vote consists of a proposal ID, the voter, and the vote option. - cosmos.gov.v1beta1.VoteOption: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - cosmos.gov.v1beta1.VotingParams: - type: object - properties: - voting_period: - type: string - description: Length of the voting period. - description: VotingParams defines the params for voting on governance proposals. - cosmos.gov.v1beta1.WeightedVoteOption: - type: object - properties: - option: - type: string - enum: - - VOTE_OPTION_UNSPECIFIED - - VOTE_OPTION_YES - - VOTE_OPTION_ABSTAIN - - VOTE_OPTION_NO - - VOTE_OPTION_NO_WITH_VETO - default: VOTE_OPTION_UNSPECIFIED - description: >- - VoteOption enumerates the valid vote options for a given governance - proposal. - - - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. - - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. - - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. - - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - weight: - type: string - description: |- - WeightedVoteOption defines a unit of vote for vote split. - - Since: cosmos-sdk 0.43 - cosmos.mint.v1beta1.Params: - type: object - properties: - mint_denom: - type: string - title: type of coin to mint - inflation_rate_change: - type: string - title: maximum annual change in inflation rate - inflation_max: - type: string - title: maximum inflation rate - inflation_min: - type: string - title: minimum inflation rate - goal_bonded: - type: string - title: goal of percent bonded atoms - blocks_per_year: + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: type: string - format: uint64 - title: expected blocks per year - description: Params holds parameters for the mint module. - cosmos.mint.v1beta1.QueryAnnualProvisionsResponse: - type: object - properties: - annual_provisions: + format: int64 + timestamp: type: string - format: byte - description: annual_provisions is the current minting annual provisions value. - description: |- - QueryAnnualProvisionsResponse is the response type for the - Query/AnnualProvisions RPC method. - cosmos.mint.v1beta1.QueryInflationResponse: + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of validators + attempting to mislead a light client. + tendermint.types.PartSetHeader: type: object properties: - inflation: + total: + type: integer + format: int64 + hash: type: string format: byte - description: inflation is the current minting inflation value. - description: |- - QueryInflationResponse is the response type for the Query/Inflation RPC - method. - cosmos.mint.v1beta1.QueryParamsResponse: + title: PartsetHeader + tendermint.types.SignedHeader: type: object properties: - params: - description: params defines the parameters of the module. + header: type: object properties: - mint_denom: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: type: string - title: type of coin to mint - inflation_rate_change: + height: type: string - title: maximum annual change in inflation rate - inflation_max: + format: int64 + time: type: string - title: maximum inflation rate - inflation_min: + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: type: string - title: minimum inflation rate - goal_bonded: + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: type: string - title: goal of percent bonded atoms - blocks_per_year: + format: byte + title: transactions + validators_hash: type: string - format: uint64 - title: expected blocks per year - description: QueryParamsResponse is the response type for the Query/Params RPC method. - cosmos.nft.v1beta1.Class: - type: object - properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT classification, similar to - the contract address of ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT classification. - Optional - symbol: - type: string - title: symbol is an abbreviated name for nft classification. Optional - description: - type: string - title: description is a brief description of nft classification. Optional - uri: - type: string - title: >- - uri for the class metadata stored off chain. It can define schema for - Class and NFT `Data` attributes. Optional - uri_hash: - type: string - title: uri_hash is a hash of the document pointed by uri. Optional - data: - title: data is the app specific metadata of the NFT class. Optional + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + commit: type: object properties: - '@type': + height: type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up a - type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) might be - - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set of + validators. + tendermint.types.SignedMsgType: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. - cosmos.nft.v1beta1.MsgSendResponse: - type: object - description: MsgSendResponse defines the Msg/Send response type. - cosmos.nft.v1beta1.NFT: + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + tendermint.types.Validator: type: object properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the contract address of - ERC721 - id: + address: type: string - title: id is a unique identifier of the NFT - uri: + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: type: string - title: uri for the NFT metadata stored off chain - uri_hash: + format: int64 + proposer_priority: type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional + format: int64 + tendermint.types.ValidatorSet: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: type: object properties: - '@type': + address: type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up a - type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning with - - type.googleapis.com. + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: PublicKey defines the keys available for use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + tendermint.types.Vote: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: |- + SignedMsgType is a type of signed message in the consensus. + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: |- + Vote represents a prevote, precommit, or commit vote from validators for + consensus. + tendermint.version.Consensus: + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in the + blockchain, - Schemes other than `http`, `https` (or the empty scheme) might be + including all blockchain data structures and the rules of the + application's - used with implementation specific semantics. - additionalProperties: {} + state transition machine. + cosmos.consensus.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + cosmos.consensus.v1.QueryParamsResponse: + type: object + properties: + params: description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - + params are the tendermint consensus params stored in the consensus + module. - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== + Please note that `params.version` is not populated in this response, + it is - The JSON representation of an `Any` value uses the regular + tracked separately in the x/upgrade module. + type: object + properties: + block: + type: object + properties: + max_bytes: + type: string + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + The basic formula for calculating this is: MaxAgeDuration / + {average block - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom JSON + It should correspond with an app's "unbonding period" or other + similar - representation, that representation will be embedded adding a field + mechanism for handling [Nothing-At-Stake - `value` which holds the custom JSON in addition to the `@type` + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can + be committed in a single block. - field. Example (for message [google.protobuf.Duration][]): + and should fall comfortably under the max block bytes. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - cosmos.nft.v1beta1.QueryBalanceResponse: + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: >- + QueryParamsResponse defines the response type for querying x/consensus + parameters. + tendermint.types.BlockParams: type: object properties: - amount: + max_bytes: type: string - format: uint64 - title: QueryBalanceResponse is the response type for the Query/Balance RPC method - cosmos.nft.v1beta1.QueryClassResponse: + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: + type: string + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + tendermint.types.ConsensusParams: type: object properties: - class: + block: type: object properties: - id: - type: string - title: >- - id defines the unique identifier of the NFT classification, - similar to the contract address of ERC721 - name: - type: string - title: >- - name defines the human-readable name of the NFT classification. - Optional - symbol: + max_bytes: type: string - title: symbol is an abbreviated name for nft classification. Optional - description: - type: string - title: description is a brief description of nft classification. Optional - uri: + format: int64 + title: |- + Max block size, in bytes. + Note: must be greater than 0 + max_gas: type: string - title: >- - uri for the class metadata stored off chain. It can define schema - for Class and NFT `Data` attributes. Optional - uri_hash: + format: int64 + title: |- + Max gas per block. + Note: must be greater or equal to -1 + description: BlockParams contains limits on the block size. + evidence: + type: object + properties: + max_age_num_blocks: type: string - title: uri_hash is a hash of the document pointed by uri. Optional - data: - title: data is the app specific metadata of the NFT class. Optional - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - + format: int64 + description: >- + Max age of evidence, in blocks. - In practice, teams usually precompile into the binary all - types that they - expect it to use in the context of Any. However, for URLs - which use the + The basic formula for calculating this is: MaxAgeDuration / + {average block - scheme `http`, `https`, or no scheme, one can optionally set - up a type + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. - server that maps type URLs to message definitions as follows: + It should correspond with an app's "unbonding period" or other + similar - * If no scheme is provided, `https` is assumed. + mechanism for handling [Nothing-At-Stake - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. - Note: this functionality is not currently available in the - official + and should fall comfortably under the max block bytes. - protobuf release, and it is not used for type URLs beginning - with + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + validator: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + version: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + description: |- + ConsensusParams contains consensus critical parameters that determine the + validity of blocks. + tendermint.types.EvidenceParams: + type: object + properties: + max_age_num_blocks: + type: string + format: int64 + description: >- + Max age of evidence, in blocks. - type.googleapis.com. + The basic formula for calculating this is: MaxAgeDuration / {average + block - Schemes other than `http`, `https` (or the empty scheme) might - be + time}. + max_age_duration: + type: string + description: >- + Max age of evidence, in time. - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - URL that describes the type of the serialized message. + It should correspond with an app's "unbonding period" or other similar + mechanism for handling [Nothing-At-Stake - Protobuf library provides support to pack/unpack Any values in the - form + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + max_bytes: + type: string + format: int64 + title: >- + This sets the maximum size of total evidence in bytes that can be + committed in a single block. - of utility functions or additional generated methods of the Any - type. + and should fall comfortably under the max block bytes. + Default is 1048576 or 1MB + description: EvidenceParams determine how we handle evidence of malfeasance. + tendermint.types.ValidatorParams: + type: object + properties: + pub_key_types: + type: array + items: + type: string + description: |- + ValidatorParams restrict the public key types validators can use. + NOTE: uses ABCI pubkey naming, not Amino names. + tendermint.types.VersionParams: + type: object + properties: + app: + type: string + format: uint64 + description: VersionParams contains the ABCI application version. + cosmos.crisis.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. - Example 1: Pack and unpack a message in C++. + Since: cosmos-sdk 0.47 + cosmos.crisis.v1beta1.MsgVerifyInvariantResponse: + type: object + description: MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. + cosmos.base.v1beta1.DecCoin: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + cosmos.distribution.v1beta1.DelegationDelegatorReward: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. - Example 2: Pack and unpack a message in Java. + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse: + type: object + description: |- + MsgCommunityPoolSpendResponse defines the response to executing a + MsgCommunityPoolSpend message. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Since: cosmos-sdk 0.47 + cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse: + type: object + description: >- + MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response + type. + cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse: + type: object + description: |- + MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + type. + cosmos.distribution.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. - Example 3: Pack and unpack a message in Python. + Since: cosmos-sdk 0.47 + cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: 'Since: cosmos-sdk 0.46' + description: |- + MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + response type. + cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - Example 4: Pack and unpack a message in Go + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: 'Since: cosmos-sdk 0.46' + description: |- + MsgWithdrawValidatorCommissionResponse defines the + Msg/WithdrawValidatorCommission response type. + cosmos.distribution.v1beta1.Params: + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is no + longer used - The pack methods provided by protobuf library will by default use + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: Params defines the set of params for the distribution module. + cosmos.distribution.v1beta1.QueryCommunityPoolResponse: + type: object + properties: + pool: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: pool defines community pool's coins. + description: >- + QueryCommunityPoolResponse is the response type for the + Query/CommunityPool - methods only use the fully qualified type name after the last '/' + RPC method. + cosmos.distribution.v1beta1.QueryDelegationRewardsResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. - in the type URL, for example "foo.bar.com/x/y.z" will yield type + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: rewards defines the rewards accrued by a delegation. + description: |- + QueryDelegationRewardsResponse is the response type for the + Query/DelegationRewards RPC method. + cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + validator_address: + type: string + reward: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. - name "y.z". + NOTE: The amount field is an Dec which implements the custom + method + signatures required by gogoproto. + description: |- + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. + description: rewards defines all the rewards accrued by a delegator. + total: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. - JSON + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: total defines the sum of all the rewards. + description: |- + QueryDelegationTotalRewardsResponse is the response type for the + Query/DelegationTotalRewards RPC method. + cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: string + description: validators defines the validators a delegator is delegating for. + description: |- + QueryDelegatorValidatorsResponse is the response type for the + Query/DelegatorValidators RPC method. + cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse: + type: object + properties: + withdraw_address: + type: string + description: withdraw_address defines the delegator address to query for. + description: |- + QueryDelegatorWithdrawAddressResponse is the response type for the + Query/DelegatorWithdrawAddress RPC method. + cosmos.distribution.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + community_tax: + type: string + base_proposer_reward: + type: string + description: >- + Deprecated: The base_proposer_reward field is deprecated and is no + longer used - ==== + in the x/distribution module's reward mechanism. + bonus_proposer_reward: + type: string + description: >- + Deprecated: The bonus_proposer_reward field is deprecated and is + no longer used - The JSON representation of an `Any` value uses the regular + in the x/distribution module's reward mechanism. + withdraw_addr_enabled: + type: boolean + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.distribution.v1beta1.QueryValidatorCommissionResponse: + type: object + properties: + commission: + description: commission defines the commission the validator received. + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + NOTE: The amount field is an Dec which implements the custom + method - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + signatures required by gogoproto. + title: |- + QueryValidatorCommissionResponse is the response type for the + Query/ValidatorCommission RPC method + cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse: + type: object + properties: + operator_address: + type: string + description: operator_address defines the validator operator address. + self_bond_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: self_bond_rewards defines the self delegations rewards. + commission: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + DecCoin defines a token with a denomination and a decimal amount. - If the embedded message type is well-known and has a custom JSON + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: commission defines the commission the validator received. + description: >- + QueryValidatorDistributionInfoResponse is the response type for the + Query/ValidatorDistributionInfo RPC method. + cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse: + type: object + properties: + rewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + DecCoin defines a token with a denomination and a decimal + amount. - representation, that representation will be embedded adding a - field - `value` which holds the custom JSON in addition to the `@type` + NOTE: The amount field is an Dec which implements the custom + method - field. Example (for message [google.protobuf.Duration][]): + signatures required by gogoproto. + description: >- + ValidatorOutstandingRewards represents outstanding (un-withdrawn) + rewards - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. - title: QueryClassResponse is the response type for the Query/Class RPC method - cosmos.nft.v1beta1.QueryClassesResponse: + for a validator inexpensive to track, allows simple sanity checks. + description: |- + QueryValidatorOutstandingRewardsResponse is the response type for the + Query/ValidatorOutstandingRewards RPC method. + cosmos.distribution.v1beta1.QueryValidatorSlashesResponse: type: object properties: - classes: + slashes: type: array items: type: object properties: - id: + validator_period: type: string - title: >- - id defines the unique identifier of the NFT classification, - similar to the contract address of ERC721 - name: + format: uint64 + fraction: type: string - title: >- - name defines the human-readable name of the NFT classification. - Optional - symbol: + description: |- + ValidatorSlashEvent represents a validator slash event. + Height is implicit within the store key. + This is needed to calculate appropriate amount of staking tokens + for delegations which are withdrawn after a slash has occurred. + description: slashes defines the slashes the validator received. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryValidatorSlashesResponse is the response type for the + Query/ValidatorSlashes RPC method. + cosmos.distribution.v1beta1.ValidatorAccumulatedCommission: + type: object + properties: + commission: + type: array + items: + type: object + properties: + denom: type: string - title: symbol is an abbreviated name for nft classification. Optional - description: + amount: type: string - title: >- - description is a brief description of nft classification. - Optional - uri: + description: |- + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + ValidatorAccumulatedCommission represents accumulated commission + for a validator kept as a running counter, can be withdrawn at any time. + cosmos.distribution.v1beta1.ValidatorOutstandingRewards: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + denom: type: string - title: >- - uri for the class metadata stored off chain. It can define - schema for Class and NFT `Data` attributes. Optional - uri_hash: + amount: type: string - title: uri_hash is a hash of the document pointed by uri. Optional - data: - title: data is the app specific metadata of the NFT class. Optional - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + description: |- + DecCoin defines a token with a denomination and a decimal amount. - protocol buffer message. This string must contain at least + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. + description: |- + ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + for a validator inexpensive to track, allows simple sanity checks. + cosmos.distribution.v1beta1.ValidatorSlashEvent: + type: object + properties: + validator_period: + type: string + format: uint64 + fraction: + type: string + description: |- + ValidatorSlashEvent represents a validator slash event. + Height is implicit within the store key. + This is needed to calculate appropriate amount of staking tokens + for delegations which are withdrawn after a slash has occurred. + cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse: + type: object + properties: + hash: + type: string + format: byte + description: hash defines the hash of the evidence. + description: MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. + cosmos.evidence.v1beta1.QueryAllEvidenceResponse: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - one "/" character. The last segment of the URL's path must - represent + protocol buffer message. This string must contain at least - the fully qualified name of the type (as in + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up + a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty scheme) might + be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in - the form + Protobuf library provides support to pack/unpack Any values in the + form - of utility functions or additional generated methods of the Any - type. + of utility functions or additional generated methods of the Any + type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default - use + The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last - '/' + methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a - field + representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: Class defines the class of the nft type. + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: evidence returns all evidences. pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -55261,37 +56380,174 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + description: >- + QueryAllEvidenceResponse is the response type for the Query/AllEvidence + RPC - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: QueryClassesResponse is the response type for the Query/Classes RPC method - cosmos.nft.v1beta1.QueryNFTResponse: + method. + cosmos.evidence.v1beta1.QueryEvidenceResponse: type: object properties: - nft: + evidence: + description: evidence returns the requested evidence. type: object properties: - class_id: + '@type': type: string - title: >- - class_id associated with the NFT, similar to the contract address - of ERC721 - id: + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryEvidenceResponse is the response type for the Query/Evidence RPC + method. + cosmos.feegrant.v1beta1.Grant: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of their + funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': type: string - title: id is a unique identifier of the NFT - uri: + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse: + type: object + description: >- + MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response + type. + cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse: + type: object + description: >- + MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse + response type. + cosmos.feegrant.v1beta1.QueryAllowanceResponse: + type: object + properties: + allowance: + description: allowance is a allowance granted for grantee by granter. + type: object + properties: + granter: type: string - title: uri for the NFT metadata stored off chain - uri_hash: + description: >- + granter is the address of the user granting an allowance of their + funds. + grantee: type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. type: object properties: '@type': @@ -55350,136 +56606,30 @@ definitions: used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. - title: QueryNFTResponse is the response type for the Query/NFT RPC method - cosmos.nft.v1beta1.QueryNFTsResponse: + title: Grant is stored in the KVStore to record a grant with full context + description: >- + QueryAllowanceResponse is the response type for the Query/Allowance RPC + method. + cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse: type: object properties: - nfts: + allowances: type: array - items: - type: object - properties: - class_id: - type: string - title: >- - class_id associated with the NFT, similar to the contract - address of ERC721 - id: - type: string - title: id is a unique identifier of the NFT - uri: + items: + type: object + properties: + granter: type: string - title: uri for the NFT metadata stored off chain - uri_hash: + description: >- + granter is the address of the user granting an allowance of + their funds. + grantee: type: string - title: uri_hash is a hash of the document pointed by uri - data: - title: data is an app specific data of the NFT. Optional + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. type: object properties: '@type': @@ -55540,114 +56690,117 @@ definitions: used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. + title: Grant is stored in the KVStore to record a grant with full context + description: allowances that have been issued by the granter. + pagination: + description: pagination defines an pagination for the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + was set, its value is undefined otherwise + description: >- + QueryAllowancesByGranterResponse is the response type for the + Query/AllowancesByGranter RPC method. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Since: cosmos-sdk 0.46 + cosmos.feegrant.v1beta1.QueryAllowancesResponse: + type: object + properties: + allowances: + type: array + items: + type: object + properties: + granter: + type: string + description: >- + granter is the address of the user granting an allowance of + their funds. + grantee: + type: string + description: >- + grantee is the address of the user being granted an allowance of + another user's funds. + allowance: + description: allowance can be any of basic, periodic, allowed fee allowance. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - The pack methods provided by protobuf library will by default - use + protocol buffer message. This string must contain at least - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + one "/" character. The last segment of the URL's path must + represent - methods only use the fully qualified type name after the last - '/' + the fully qualified name of the type (as in - in the type URL, for example "foo.bar.com/x/y.z" will yield type + `path/google.protobuf.Duration`). The name should be in a + canonical form - name "y.z". + (e.g., leading "." is not accepted). + In practice, teams usually precompile into the binary all + types that they - JSON + expect it to use in the context of Any. However, for URLs + which use the - ==== + scheme `http`, `https`, or no scheme, one can optionally set + up a type - The JSON representation of an `Any` value uses the regular + server that maps type URLs to message definitions as + follows: - representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + * If no scheme is provided, `https` is assumed. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + Note: this functionality is not currently available in the + official - If the embedded message type is well-known and has a custom JSON + protobuf release, and it is not used for type URLs beginning + with - representation, that representation will be embedded adding a - field + type.googleapis.com. - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + Schemes other than `http`, `https` (or the empty scheme) + might be - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: NFT defines the NFT. + used with implementation specific semantics. + additionalProperties: {} + title: Grant is stored in the KVStore to record a grant with full context + description: allowances are allowance's granted for grantee by granter. pagination: + description: pagination defines an pagination for the response. type: object properties: next_key: @@ -55665,248 +56818,536 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + description: >- + QueryAllowancesResponse is the response type for the Query/Allowances RPC + method. + cosmos.gov.v1.Deposit: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: QueryNFTsResponse is the response type for the Query/NFTs RPC methods - cosmos.nft.v1beta1.QueryOwnerResponse: + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: |- + Deposit defines an amount deposited by an account address to an active + proposal. + cosmos.gov.v1.DepositParams: type: object properties: - owner: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: type: string - title: QueryOwnerResponse is the response type for the Query/Owner RPC method - cosmos.nft.v1beta1.QuerySupplyResponse: + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1.MsgDepositResponse: + type: object + description: MsgDepositResponse defines the Msg/Deposit response type. + cosmos.gov.v1.MsgExecLegacyContentResponse: + type: object + description: >- + MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response + type. + cosmos.gov.v1.MsgSubmitProposalResponse: type: object properties: - amount: + proposal_id: type: string format: uint64 - title: QuerySupplyResponse is the response type for the Query/Supply RPC method - cosmos.params.v1beta1.ParamChange: + description: proposal_id defines the unique id of the proposal. + description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + cosmos.gov.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.gov.v1.MsgVoteResponse: + type: object + description: MsgVoteResponse defines the Msg/Vote response type. + cosmos.gov.v1.MsgVoteWeightedResponse: + type: object + description: MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + cosmos.gov.v1.Params: type: object properties: - subspace: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: type: string - key: + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: type: string - value: + description: Duration of the voting period. + quorum: + type: string + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: + type: string + description: >- + The ratio representing the proportion of the deposit value that must + be paid at proposal submission. + expedited_voting_period: + type: string + description: |- + Duration of the voting period of an expedited proposal. + + Since: cosmos-sdk 0.50 + expedited_threshold: + type: string + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.67. + + + Since: cosmos-sdk 0.50 + expedited_min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum expedited deposit for a proposal to enter voting period. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: |- + Params defines the parameters for the x/gov module. + + Since: cosmos-sdk 0.47 + cosmos.gov.v1.Proposal: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up + a type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. + status: + description: status defines the proposal status. type: string - description: |- - ParamChange defines an individual parameter change, for use in - ParameterChangeProposal. - cosmos.params.v1beta1.QueryParamsResponse: - type: object - properties: - param: - description: param defines the queried parameter. + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: |- + final_tally_result is the final tally result of the proposal. When + querying a proposal via gRPC, this field is not populated until the + proposal's voting period has ended. type: object properties: - subspace: + yes_count: type: string - key: + description: yes_count is the number of yes votes on a proposal. + abstain_count: type: string - value: + description: abstain_count is the number of abstain votes on a proposal. + no_count: type: string - description: QueryParamsResponse is response type for the Query/Params RPC method. - cosmos.params.v1beta1.QuerySubspacesResponse: - type: object - properties: - subspaces: + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: type: array items: type: object properties: - subspace: + denom: type: string - keys: - type: array - items: - type: string - description: >- - Subspace defines a parameter subspace name and all the keys that - exist for - - the subspace. - - - Since: cosmos-sdk 0.46 - description: |- - QuerySubspacesResponse defines the response types for querying for all - registered subspaces and all keys for a subspace. + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - Since: cosmos-sdk 0.46 - cosmos.params.v1beta1.Subspace: - type: object - properties: - subspace: + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: type: string - keys: - type: array - items: - type: string - description: |- - Subspace defines a parameter subspace name and all the keys that exist for - the subspace. - - Since: cosmos-sdk 0.46 - cosmos.slashing.v1beta1.MsgUnjailResponse: - type: object - title: MsgUnjailResponse defines the Msg/Unjail response type - cosmos.slashing.v1beta1.Params: - type: object - properties: - signed_blocks_window: + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: type: string - format: int64 - min_signed_per_window: + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: type: string - format: byte - downtime_jail_duration: + description: metadata is any arbitrary metadata attached to the proposal. + title: type: string - slash_fraction_double_sign: + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: type: string - format: byte - slash_fraction_downtime: + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: type: string - format: byte - description: Params represents the parameters used for by the slashing module. - cosmos.slashing.v1beta1.QueryParamsResponse: - type: object - properties: - params: - type: object - properties: - signed_blocks_window: - type: string - format: int64 - min_signed_per_window: - type: string - format: byte - downtime_jail_duration: - type: string - slash_fraction_double_sign: - type: string - format: byte - slash_fraction_downtime: - type: string - format: byte - description: Params represents the parameters used for by the slashing module. - title: QueryParamsResponse is the response type for the Query/Params RPC method - cosmos.slashing.v1beta1.QuerySigningInfoResponse: + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + expedited: + type: boolean + title: expedited defines if the proposal is expedited + description: Proposal defines the core field members of a governance proposal. + cosmos.gov.v1.ProposalStatus: + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + description: |- + ProposalStatus enumerates the valid statuses of a proposal. + + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + cosmos.gov.v1.QueryDepositResponse: type: object properties: - val_signing_info: - title: val_signing_info is the signing info of requested val cons address + deposit: + description: deposit defines the requested deposit. type: object properties: - address: - type: string - start_height: - type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a bonded - - in a block and may have signed a precommit or not. This in - conjunction with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: + proposal_id: type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to liveness - downtime. - tombstoned: - type: boolean - description: >- - Whether or not a validator has been tombstoned (killed out of - validator set). It is set - - once the validator commits an equivocation or for any other - configured misbehiavor. - missed_blocks_counter: + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. - description: >- - ValidatorSigningInfo defines a validator's signing info for monitoring - their - liveness activity. - title: >- - QuerySigningInfoResponse is the response type for the Query/SigningInfo - RPC + NOTE: The amount field is an Int which implements the custom + method - method - cosmos.slashing.v1beta1.QuerySigningInfosResponse: + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit RPC + method. + cosmos.gov.v1.QueryDepositsResponse: type: object properties: - info: + deposits: type: array items: type: object properties: - address: - type: string - start_height: + proposal_id: type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - index_offset: + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: type: string - format: int64 - description: >- - Index which is incremented each time the validator was a bonded - - in a block and may have signed a precommit or not. This in - conjunction with the + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to liveness - downtime. - tombstoned: - type: boolean - description: >- - Whether or not a validator has been tombstoned (killed out of - validator set). It is set - once the validator commits an equivocation or for any other - configured misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. + NOTE: The amount field is an Int which implements the custom + method - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. + signatures required by gogoproto. + description: amount to be deposited by depositor. description: >- - ValidatorSigningInfo defines a validator's signing info for - monitoring their + Deposit defines an amount deposited by an account address to an + active - liveness activity. - title: info is the signing info of all validators + proposal. + description: deposits defines the requested deposits. pagination: + description: pagination defines the pagination in the response. type: object properties: next_key: @@ -55924,303 +57365,190 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: >- - QuerySigningInfosResponse is the response type for the Query/SigningInfos - RPC - - method - cosmos.slashing.v1beta1.ValidatorSigningInfo: - type: object - properties: - address: - type: string - start_height: - type: string - format: int64 - title: Height at which validator was first a candidate OR was unjailed - index_offset: - type: string - format: int64 - description: >- - Index which is incremented each time the validator was a bonded - - in a block and may have signed a precommit or not. This in conjunction - with the - - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. - jailed_until: - type: string - format: date-time - description: >- - Timestamp until which the validator is jailed due to liveness - downtime. - tombstoned: - type: boolean - description: >- - Whether or not a validator has been tombstoned (killed out of - validator set). It is set - - once the validator commits an equivocation or for any other configured - misbehiavor. - missed_blocks_counter: - type: string - format: int64 - description: >- - A counter kept to avoid unnecessary array reads. - - Note that `Sum(MissedBlocksBitArray)` always equals - `MissedBlocksCounter`. description: >- - ValidatorSigningInfo defines a validator's signing info for monitoring - their - - liveness activity. - cosmos.staking.v1beta1.BondStatus: - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - description: |- - BondStatus is the status of a validator. - - - BOND_STATUS_UNSPECIFIED: UNSPECIFIED defines an invalid validator status. - - BOND_STATUS_UNBONDED: UNBONDED defines a validator that is not bonded. - - BOND_STATUS_UNBONDING: UNBONDING defines a validator that is unbonding. - - BOND_STATUS_BONDED: BONDED defines a validator that is bonded. - cosmos.staking.v1beta1.Commission: + QueryDepositsResponse is the response type for the Query/Deposits RPC + method. + cosmos.gov.v1.QueryParamsResponse: type: object properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be used for - creating a validator. + voting_params: + description: |- + Deprecated: Prefer to use `params` instead. + voting_params defines the parameters related to voting. type: object properties: - rate: - type: string - description: rate is the commission rate charged to delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which validator can - ever charge, as a fraction. - max_change_rate: + voting_period: type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - description: Commission defines commission parameters for a given validator. - cosmos.staking.v1beta1.CommissionRates: - type: object - properties: - rate: - type: string - description: rate is the commission rate charged to delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which validator can ever - charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the validator - commission, as a fraction. - description: >- - CommissionRates defines the initial commission rates to be used for - creating - - a validator. - cosmos.staking.v1beta1.Delegation: - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: - type: string - description: validator_address is the bech32-encoded address of the validator. - shares: - type: string - description: shares define the delegation shares received. - description: |- - Delegation represents the bond with tokens held by an account. It is - owned by one delegator, and is associated with the voting power of one - validator. - cosmos.staking.v1beta1.DelegationResponse: - type: object - properties: - delegation: + description: Duration of the voting period. + deposit_params: + description: |- + Deprecated: Prefer to use `params` instead. + deposit_params defines the parameters related to deposit. type: object properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: - type: string - description: validator_address is the bech32-encoded address of the validator. - shares: + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: type: string - description: shares define the delegation shares received. + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + tally_params: description: |- - Delegation represents the bond with tokens held by an account. It is - owned by one delegator, and is associated with the voting power of one - validator. - balance: + Deprecated: Prefer to use `params` instead. + tally_params defines the parameters related to tally. type: object properties: - denom: + quorum: type: string - amount: + description: >- + Minimum percentage of total stake needed to vote for a result to + be + + considered valid. + threshold: type: string - description: |- - Coin defines a token with a denomination and an amount. + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: |- - DelegationResponse is equivalent to Delegation except that it contains a - balance in addition to shares which is more suitable for client responses. - cosmos.staking.v1beta1.Description: - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: security_contact defines an optional email for security contact. - details: - type: string - description: details define other optional details. - description: Description defines a validator description. - cosmos.staking.v1beta1.HistoricalInfo: - type: object - properties: - header: + vetoed. Default value: 1/3. + params: + description: |- + params defines all the paramaters of x/gov module. + + Since: cosmos-sdk 0.47 type: object properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, + min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - including all blockchain data structures and the rules of the - application's - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: type: string - format: byte - title: transactions - validators_hash: + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 + + months. + voting_period: type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: + description: Duration of the voting period. + quorum: type: string - format: byte - title: validators for the next block - consensus_hash: + description: >- + Minimum percentage of total stake needed to vote for a result to + be + considered valid. + threshold: type: string - format: byte - title: consensus params for current block - app_hash: + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: type: string - format: byte - title: state after txs from the previous block - last_results_hash: + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + vetoed. Default value: 1/3. + min_initial_deposit_ratio: type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: + description: >- + The ratio representing the proportion of the deposit value that + must be paid at proposal submission. + expedited_voting_period: type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: + description: |- + Duration of the voting period of an expedited proposal. + + Since: cosmos-sdk 0.50 + expedited_threshold: type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - valset: - type: array - items: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.67. + + + Since: cosmos-sdk 0.50 + expedited_min_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: Minimum expedited deposit for a proposal to enter voting period. + burn_vote_quorum: + type: boolean + title: burn deposits if a proposal does not meet quorum + burn_proposal_deposit_prevote: + type: boolean + title: burn deposits if the proposal does not enter voting period + burn_vote_veto: + type: boolean + title: burn deposits if quorum with vote type no_veto is met + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.gov.v1.QueryProposalResponse: + type: object + properties: + proposal: + description: proposal is the requested governance proposal. + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: type: object properties: '@type': @@ -56267,779 +57595,1060 @@ definitions: on changes to types. (Use versioned type names to manage breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages are the arbitrary messages to be executed if the proposal + passes. + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + expedited: + type: boolean + title: expedited defines if the proposal is expedited + description: >- + QueryProposalResponse is the response type for the Query/Proposal RPC + method. + cosmos.gov.v1.QueryProposalsResponse: + type: object + properties: + proposals: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id defines the unique id of the proposal. + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - protobuf release, and it is not used for type URLs beginning - with + If the embedded message type is well-known and has a custom + JSON - type.googleapis.com. + representation, that representation will be embedded adding a + field + `value` which holds the custom JSON in addition to the `@type` - Schemes other than `http`, `https` (or the empty scheme) - might be + field. Example (for message [google.protobuf.Duration][]): - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } description: >- - jailed defined whether the validator has been jailed from bonded - status or not. + messages are the arbitrary messages to be executed if the + proposal passes. status: - description: status is the validator status (bonded/unbonding/unbonded). + description: status defines the proposal status. type: string enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. + final_tally_result is the final tally result of the proposal. + When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. type: object properties: - moniker: + yes_count: type: string - description: moniker defines a human-readable name for the validator. - identity: + description: yes_count is the number of yes votes on a proposal. + abstain_count: type: string - description: >- - identity defines an optional identity signature (ex. UPort - or Keybase). - website: + description: abstain_count is the number of abstain votes on a proposal. + no_count: type: string - description: website defines an optional website link. - security_contact: + description: no_count is the number of no votes on a proposal. + no_with_veto_count: type: string description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: + no_with_veto_count is the number of no with veto votes on a + proposal. + submit_time: type: string format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: + description: submit_time is the time of proposal submission. + deposit_end_time: type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 - description: >- - Validator defines a validator, together with the total amount of the - - Validator's bond shares and their exchange rate to coins. Slashing - results in - - a decrease in the exchange rate, allowing correct calculation of - future - - undelegations without iterating over delegators. When coins are - delegated to - - this validator, the validator is credited with a delegation whose - number of - - bond shares is based on the amount of coins delegated divided by the - current - - exchange rate. Voting power can be calculated as total bonded shares + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - multiplied by exchange rate. - description: >- - HistoricalInfo contains header and validator information for a given - block. - It is stored as part of staking module's state, which persists the `n` - most + NOTE: The amount field is an Int which implements the custom + method - recent HistoricalInfo + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the proposal. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + proposer: + type: string + description: 'Since: cosmos-sdk 0.47' + title: Proposer is the address of the proposal sumbitter + expedited: + type: boolean + title: expedited defines if the proposal is expedited + description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - (`n` is set by the staking module's `historical_entries` parameter). - cosmos.staking.v1beta1.MsgBeginRedelegateResponse: + was set, its value is undefined otherwise + description: |- + QueryProposalsResponse is the response type for the Query/Proposals RPC + method. + cosmos.gov.v1.QueryTallyResultResponse: type: object properties: - completion_time: - type: string - format: date-time - description: MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. - cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse: - type: object - description: 'Since: cosmos-sdk 0.46' - title: MsgCancelUnbondingDelegationResponse - cosmos.staking.v1beta1.MsgCreateValidatorResponse: - type: object - description: MsgCreateValidatorResponse defines the Msg/CreateValidator response type. - cosmos.staking.v1beta1.MsgDelegateResponse: - type: object - description: MsgDelegateResponse defines the Msg/Delegate response type. - cosmos.staking.v1beta1.MsgEditValidatorResponse: + tally: + description: tally defines the requested tally. + type: object + properties: + yes_count: + type: string + description: yes_count is the number of yes votes on a proposal. + abstain_count: + type: string + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: >- + no_with_veto_count is the number of no with veto votes on a + proposal. + description: >- + QueryTallyResultResponse is the response type for the Query/Tally RPC + method. + cosmos.gov.v1.QueryVoteResponse: type: object - description: MsgEditValidatorResponse defines the Msg/EditValidator response type. - cosmos.staking.v1beta1.MsgUndelegateResponse: + properties: + vote: + description: vote defines the queried vote. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: QueryVoteResponse is the response type for the Query/Vote RPC method. + cosmos.gov.v1.QueryVotesResponse: type: object properties: - completion_time: - type: string - format: date-time - description: MsgUndelegateResponse defines the Msg/Undelegate response type. - cosmos.staking.v1beta1.Params: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: QueryVotesResponse is the response type for the Query/Votes RPC method. + cosmos.gov.v1.TallyParams: type: object properties: - unbonding_time: + quorum: type: string - description: unbonding_time is the time duration of unbonding. - max_validators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - max_entries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding delegation or - redelegation (per pair/trio). - historical_entries: - type: integer - format: int64 - description: historical_entries is the number of historical entries to persist. - bond_denom: + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: type: string - description: bond_denom defines the bondable coin denomination. - min_commission_rate: + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: type: string - title: >- - min_commission_rate is the chain-wide minimum commission rate that a - validator can charge their delegators - description: Params defines the parameters for the staking module. - cosmos.staking.v1beta1.Pool: + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + description: TallyParams defines the params for tallying votes on governance proposals. + cosmos.gov.v1.TallyResult: type: object properties: - not_bonded_tokens: + yes_count: type: string - bonded_tokens: + description: yes_count is the number of yes votes on a proposal. + abstain_count: type: string - description: |- - Pool is used for tracking bonded and not-bonded token supply of the bond - denomination. - cosmos.staking.v1beta1.QueryDelegationResponse: - type: object - properties: - delegation_response: - description: delegation_responses defines the delegation info of a delegation. - type: object - properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an account. It - is - - owned by one delegator, and is associated with the voting power of - one - - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - description: >- - QueryDelegationResponse is response type for the Query/Delegation RPC - method. - cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse: + description: abstain_count is the number of abstain votes on a proposal. + no_count: + type: string + description: no_count is the number of no votes on a proposal. + no_with_veto_count: + type: string + description: no_with_veto_count is the number of no with veto votes on a proposal. + description: TallyResult defines a standard tally for a governance proposal. + cosmos.gov.v1.Vote: type: object properties: - delegation_responses: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + options: type: array items: type: object properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. - description: >- - Delegation represents the bond with tokens held by an account. - It is - - owned by one delegator, and is associated with the voting power - of one - - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string + option: description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - description: >- - DelegationResponse is equivalent to Delegation except that it - contains a + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + description: options is the weighted vote options. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the vote. + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + cosmos.gov.v1.VoteOption: + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + description: >- + VoteOption enumerates the valid vote options for a given governance + proposal. - balance in addition to shares which is more suitable for client - responses. - description: delegation_responses defines all the delegations' info of a delegator. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.gov.v1.VotingParams: + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + description: VotingParams defines the params for voting on governance proposals. + cosmos.gov.v1.WeightedVoteOption: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: WeightedVoteOption defines a unit of vote for vote split. + cosmos.gov.v1beta1.Deposit: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - was set, its value is undefined otherwise + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: amount to be deposited by depositor. description: |- - QueryDelegatorDelegationsResponse is response type for the - Query/DelegatorDelegations RPC method. - cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse: + Deposit defines an amount deposited by an account address to an active + proposal. + cosmos.gov.v1beta1.DepositParams: type: object properties: - unbonding_responses: + min_deposit: type: array items: type: object properties: - delegator_address: + denom: type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: + amount: type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. - description: |- - entries are the unbonding delegation entries. - - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's unbonding - bonds + description: |- + Coin defines a token with a denomination and an amount. - for a single validator in an time-ordered list. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 - was set, its value is undefined otherwise + months. + description: DepositParams defines the params for deposits on governance proposals. + cosmos.gov.v1beta1.MsgDepositResponse: + type: object + description: MsgDepositResponse defines the Msg/Deposit response type. + cosmos.gov.v1beta1.MsgSubmitProposalResponse: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + description: MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + cosmos.gov.v1beta1.MsgVoteResponse: + type: object + description: MsgVoteResponse defines the Msg/Vote response type. + cosmos.gov.v1beta1.MsgVoteWeightedResponse: + type: object description: |- - QueryUnbondingDelegatorDelegationsResponse is response type for the - Query/UnbondingDelegatorDelegations RPC method. - cosmos.staking.v1beta1.QueryDelegatorValidatorResponse: + MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + + Since: cosmos-sdk 0.43 + cosmos.gov.v1beta1.Proposal: type: object properties: - validator: - description: validator defines the validator info. + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. type: object properties: - operator_address: + '@type': type: string description: >- - operator_address defines the address of the validator's operator; - bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as - a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up a + type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might - be + Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: |- + final_tally_result is the final tally result of the proposal. When + querying a proposal via gRPC, this field is not populated until the + proposal's voting period has ended. + type: object + properties: + 'yes': type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: + description: yes is the number of yes votes on a proposal. + abstain: type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: + description: abstain is the number of abstain votes on a proposal. + 'no': type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - min_self_delegation: + description: no is the number of no votes on a proposal. + no_with_veto: type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. - - - Since: cosmos-sdk 0.46 - description: |- - QueryDelegatorValidatorResponse response type for the - Query/DelegatorValidator RPC method. - cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse: - type: object - properties: - validators: + description: no_with_veto is the number of no with veto votes on a proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: type: array items: type: object properties: - operator_address: + denom: type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - Schemes other than `http`, `https` (or the empty scheme) - might be + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + cosmos.gov.v1beta1.ProposalStatus: + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + description: |- + ProposalStatus enumerates the valid statuses of a proposal. - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. + - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + cosmos.gov.v1beta1.QueryDepositResponse: + type: object + properties: + deposit: + description: deposit defines the requested deposit. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: type: object properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort - or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: + denom: type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - update_time: + amount: type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 - description: >- - Validator defines a validator, together with the total amount of the + Coin defines a token with a denomination and an amount. - Validator's bond shares and their exchange rate to coins. Slashing - results in - a decrease in the exchange rate, allowing correct calculation of - future + NOTE: The amount field is an Int which implements the custom + method - undelegations without iterating over delegators. When coins are - delegated to + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + QueryDepositResponse is the response type for the Query/Deposit RPC + method. + cosmos.gov.v1beta1.QueryDepositsResponse: + type: object + properties: + deposits: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + depositor: + type: string + description: depositor defines the deposit addresses from the proposals. + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - this validator, the validator is credited with a delegation whose - number of - bond shares is based on the amount of coins delegated divided by the - current + NOTE: The amount field is an Int which implements the custom + method - exchange rate. Voting power can be calculated as total bonded shares + signatures required by gogoproto. + description: amount to be deposited by depositor. + description: >- + Deposit defines an amount deposited by an account address to an + active - multiplied by exchange rate. - description: validators defines the validators' info of a delegator. + proposal. + description: deposits defines the requested deposits. pagination: description: pagination defines the pagination in the response. type: object @@ -57059,463 +58668,364 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - QueryDelegatorValidatorsResponse is response type for the - Query/DelegatorValidators RPC method. - cosmos.staking.v1beta1.QueryHistoricalInfoResponse: + description: >- + QueryDepositsResponse is the response type for the Query/Deposits RPC + method. + cosmos.gov.v1beta1.QueryParamsResponse: type: object properties: - hist: - description: hist defines the historical info at the given height. + voting_params: + description: voting_params defines the parameters related to voting. type: object properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - valset: + voting_period: + type: string + description: Duration of the voting period. + deposit_params: + description: deposit_params defines the parameters related to deposit. + type: object + properties: + min_deposit: type: array items: type: object properties: - operator_address: + denom: type: string - description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of - the serialized + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - protocol buffer message. This string must contain at - least - one "/" character. The last segment of the URL's path - must represent + NOTE: The amount field is an Int which implements the custom + method - the fully qualified name of the type (as in + signatures required by gogoproto. + description: Minimum deposit for a proposal to enter voting period. + max_deposit_period: + type: string + description: >- + Maximum period for Atom holders to deposit on a proposal. Initial + value: 2 - `path/google.protobuf.Duration`). The name should be in - a canonical form + months. + tally_params: + description: tally_params defines the parameters related to tally. + type: object + properties: + quorum: + type: string + format: byte + description: >- + Minimum percentage of total stake needed to vote for a result to + be - (e.g., leading "." is not accepted). + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. Default + value: 0.5. + veto_threshold: + type: string + format: byte + description: >- + Minimum value of Veto votes to Total votes ratio for proposal to + be + vetoed. Default value: 1/3. + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.gov.v1beta1.QueryProposalResponse: + type: object + properties: + proposal: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - In practice, teams usually precompile into the binary - all types that they + protocol buffer message. This string must contain at least - expect it to use in the context of Any. However, for - URLs which use the + one "/" character. The last segment of the URL's path must + represent - scheme `http`, `https`, or no scheme, one can optionally - set up a type + the fully qualified name of the type (as in - server that maps type URLs to message definitions as - follows: + `path/google.protobuf.Duration`). The name should be in a + canonical form + (e.g., leading "." is not accepted). - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based - on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + In practice, teams usually precompile into the binary all + types that they - Note: this functionality is not currently available in - the official + expect it to use in the context of Any. However, for URLs + which use the - protobuf release, and it is not used for type URLs - beginning with + scheme `http`, `https`, or no scheme, one can optionally set + up a type - type.googleapis.com. + server that maps type URLs to message definitions as follows: - Schemes other than `http`, `https` (or the empty scheme) - might be + * If no scheme is provided, `https` is assumed. - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from - bonded status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a - validator's delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. - UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which - this validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to - be used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, - as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase - of the validator commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result is the final tally result of the proposal. When + + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: + type: array + items: + type: object + properties: + denom: + type: string + amount: type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 description: >- - Validator defines a validator, together with the total amount of - the - - Validator's bond shares and their exchange rate to coins. - Slashing results in - - a decrease in the exchange rate, allowing correct calculation of - future - - undelegations without iterating over delegators. When coins are - delegated to - - this validator, the validator is credited with a delegation - whose number of - - bond shares is based on the amount of coins delegated divided by - the current + Coin defines a token with a denomination and an amount. - exchange rate. Voting power can be calculated as total bonded - shares - multiplied by exchange rate. - description: >- - QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo - RPC + NOTE: The amount field is an Int which implements the custom + method - method. - cosmos.staking.v1beta1.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - unbonding_time: - type: string - description: unbonding_time is the time duration of unbonding. - max_validators: - type: integer - format: int64 - description: max_validators is the maximum number of validators. - max_entries: - type: integer - format: int64 - description: >- - max_entries is the max entries for either unbonding delegation or - redelegation (per pair/trio). - historical_entries: - type: integer - format: int64 - description: historical_entries is the number of historical entries to persist. - bond_denom: - type: string - description: bond_denom defines the bondable coin denomination. - min_commission_rate: - type: string - title: >- - min_commission_rate is the chain-wide minimum commission rate that - a validator can charge their delegators - description: QueryParamsResponse is response type for the Query/Params RPC method. - cosmos.staking.v1beta1.QueryPoolResponse: - type: object - properties: - pool: - description: pool defines the pool info. - type: object - properties: - not_bonded_tokens: + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: type: string - bonded_tokens: + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: type: string - description: QueryPoolResponse is response type for the Query/Pool RPC method. - cosmos.staking.v1beta1.QueryRedelegationsResponse: + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + description: >- + QueryProposalResponse is the response type for the Query/Proposal RPC + method. + cosmos.gov.v1beta1.QueryProposalsResponse: type: object properties: - redelegation_responses: + proposals: type: array items: type: object properties: - redelegation: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + content: + description: content is the proposal's content. type: object properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation source - operator address. - validator_dst_address: + '@type': type: string description: >- - validator_dst_address is the validator redelegation - destination operator address. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator - shares created by redelegation. - description: >- - RedelegationEntry defines a redelegation object with - relevant metadata. - description: |- - entries are the redelegation entries. + A URL/resource name that uniquely identifies the type of the + serialized - redelegation entries + protocol buffer message. This string must contain at least + + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + status: + description: status defines the proposal status. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_DEPOSIT_PERIOD + - PROPOSAL_STATUS_VOTING_PERIOD + - PROPOSAL_STATUS_PASSED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_FAILED + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: description: >- - Redelegation contains the list of a particular delegator's - redelegating bonds + final_tally_result is the final tally result of the proposal. + When - from a particular source validator to a particular destination - validator. - entries: + querying a proposal via gRPC, this field is not populated until + the + + proposal's voting period has ended. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: >- + no_with_veto is the number of no with veto votes on a + proposal. + submit_time: + type: string + format: date-time + description: submit_time is the time of proposal submission. + deposit_end_time: + type: string + format: date-time + description: deposit_end_time is the end time for deposition. + total_deposit: type: array items: type: object properties: - redelegation_entry: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the - redelegation took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator - shares created by redelegation. - description: >- - RedelegationEntry defines a redelegation object with - relevant metadata. - balance: + denom: + type: string + amount: type: string description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry - except that it - - contains a balance in addition to shares which is more - suitable for client + Coin defines a token with a denomination and an amount. - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except that its - entries - contain a balance in addition to shares which is more suitable for - client + NOTE: The amount field is an Int which implements the custom + method - responses. + signatures required by gogoproto. + description: total_deposit is the total deposit on the proposal. + voting_start_time: + type: string + format: date-time + description: voting_start_time is the starting time to vote on a proposal. + voting_end_time: + type: string + format: date-time + description: voting_end_time is the end time of voting on a proposal. + description: Proposal defines the core field members of a governance proposal. + description: proposals defines all the requested governance proposals. pagination: description: pagination defines the pagination in the response. type: object @@ -57535,571 +59045,1008 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise + description: |- + QueryProposalsResponse is the response type for the Query/Proposals RPC + method. + cosmos.gov.v1beta1.QueryTallyResultResponse: + type: object + properties: + tally: + description: tally defines the requested tally. + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. description: >- - QueryRedelegationsResponse is response type for the Query/Redelegations - RPC - + QueryTallyResultResponse is the response type for the Query/Tally RPC method. - cosmos.staking.v1beta1.QueryUnbondingDelegationResponse: + cosmos.gov.v1beta1.QueryVoteResponse: type: object properties: - unbond: - description: unbond defines the unbonding information of a delegation. + vote: + description: vote defines the queried vote. type: object properties: - delegator_address: + proposal_id: type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: type: string - description: validator_address is the bech32-encoded address of the validator. - entries: + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set in + queries + + if and only if `len(options) == 1` and that option has weight 1. + In all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: type: array items: type: object properties: - creation_height: - type: string - format: int64 + option: description: >- - creation_height is the height which the unbonding took - place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: + option defines the valid vote options, it must not contain + duplicate vote options. type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: type: string - description: balance defines the tokens to receive at completion. + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: QueryVoteResponse is the response type for the Query/Vote RPC method. + cosmos.gov.v1beta1.QueryVotesResponse: + type: object + properties: + votes: + type: array + items: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. + Deprecated: Prefer to use `options` instead. This field is set + in queries + + if and only if `len(options) == 1` and that option has weight 1. + In all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: + type: array + items: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. + + Since: cosmos-sdk 0.43 + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + description: votes defines the queried votes. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte description: |- - entries are the unbonding delegation entries. + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - unbonding delegation entries - description: |- - QueryDelegationResponse is response type for the Query/UnbondingDelegation - RPC method. - cosmos.staking.v1beta1.QueryValidatorDelegationsResponse: + was set, its value is undefined otherwise + description: QueryVotesResponse is the response type for the Query/Votes RPC method. + cosmos.gov.v1beta1.TallyParams: type: object properties: - delegation_responses: + quorum: + type: string + format: byte + description: |- + Minimum percentage of total stake needed to vote for a result to be + considered valid. + threshold: + type: string + format: byte + description: >- + Minimum proportion of Yes votes for proposal to pass. Default value: + 0.5. + veto_threshold: + type: string + format: byte + description: |- + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + description: TallyParams defines the params for tallying votes on governance proposals. + cosmos.gov.v1beta1.TallyResult: + type: object + properties: + 'yes': + type: string + description: yes is the number of yes votes on a proposal. + abstain: + type: string + description: abstain is the number of abstain votes on a proposal. + 'no': + type: string + description: no is the number of no votes on a proposal. + no_with_veto: + type: string + description: no_with_veto is the number of no with veto votes on a proposal. + description: TallyResult defines a standard tally for a governance proposal. + cosmos.gov.v1beta1.Vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal_id defines the unique id of the proposal. + voter: + type: string + description: voter is the voter address of the proposal. + option: + description: >- + Deprecated: Prefer to use `options` instead. This field is set in + queries + + if and only if `len(options) == 1` and that option has weight 1. In + all + + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + options: type: array items: type: object properties: - delegation: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - shares: - type: string - description: shares define the delegation shares received. + option: description: >- - Delegation represents the bond with tokens held by an account. - It is + option defines the valid vote options, it must not contain + duplicate vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. - owned by one delegator, and is associated with the voting power - of one + Since: cosmos-sdk 0.43 + description: |- + options is the weighted vote options. - validator. - balance: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + Since: cosmos-sdk 0.43 + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. + cosmos.gov.v1beta1.VoteOption: + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + description: >- + VoteOption enumerates the valid vote options for a given governance + proposal. + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.gov.v1beta1.VotingParams: + type: object + properties: + voting_period: + type: string + description: Duration of the voting period. + description: VotingParams defines the params for voting on governance proposals. + cosmos.gov.v1beta1.WeightedVoteOption: + type: object + properties: + option: + description: >- + option defines the valid vote options, it must not contain duplicate + vote options. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + weight: + type: string + description: weight is the vote weight associated with the vote option. + description: |- + WeightedVoteOption defines a unit of vote for vote split. - NOTE: The amount field is an Int which implements the custom - method + Since: cosmos-sdk 0.43 + cosmos.group.v1.Exec: + type: string + enum: + - EXEC_UNSPECIFIED + - EXEC_TRY + default: EXEC_UNSPECIFIED + description: |- + Exec defines modes of execution of a proposal on creation or on new vote. + + - EXEC_UNSPECIFIED: An empty value means that there should be a separate + MsgExec request for the proposal to execute. + - EXEC_TRY: Try to execute the proposal immediately. + If the proposal is not allowed per the DecisionPolicy, + the proposal will still be open and could + be executed at a later point. + cosmos.group.v1.GroupInfo: + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership structure + that - signatures required by gogoproto. - description: >- - DelegationResponse is equivalent to Delegation except that it - contains a + would break existing proposals. Whenever any members weight is + changed, - balance in addition to shares which is more suitable for client - responses. - pagination: - description: pagination defines the pagination in the response. + or any member is added or removed this version is incremented and will + + cause proposals based on older versions of this group to fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: created_at is a timestamp specifying when a group was created. + description: GroupInfo represents the high-level on-chain information for a group. + cosmos.group.v1.GroupMember: + type: object + properties: + group_id: + type: string + format: uint64 + description: group_id is the unique ID of the group. + member: + description: member is the member data. type: object properties: - next_key: + address: type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + description: address is the member's account address. + weight: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - title: |- - QueryValidatorDelegationsResponse is response type for the - Query/ValidatorDelegations RPC method - cosmos.staking.v1beta1.QueryValidatorResponse: + description: >- + weight is the member's voting weight that should be greater than + 0. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the member. + added_at: + type: string + format: date-time + description: added_at is a timestamp specifying when a member was added. + description: GroupMember represents the relationship between a group and a member. + cosmos.group.v1.GroupPolicyInfo: type: object properties: - validator: - description: validator defines the validator info. + address: + type: string + description: address is the account address of group policy. + group_id: + type: string + format: uint64 + description: group_id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group admin. + metadata: + type: string + title: |- + metadata is any arbitrary metadata attached to the group policy. + the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + version: + type: string + format: uint64 + description: >- + version is used to track changes to a group's GroupPolicyInfo + structure that + + would create a different result on a running proposal. + decision_policy: + description: decision_policy specifies the group policy's decision policy. type: object properties: - operator_address: + '@type': type: string description: >- - operator_address defines the address of the validator's operator; - bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as - a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent + A URL/resource name that uniquely identifies the type of the + serialized - the fully qualified name of the type (as in + protocol buffer message. This string must contain at least - `path/google.protobuf.Duration`). The name should be in a - canonical form + one "/" character. The last segment of the URL's path must + represent - (e.g., leading "." is not accepted). + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a + canonical form - In practice, teams usually precompile into the binary all - types that they + (e.g., leading "." is not accepted). - expect it to use in the context of Any. However, for URLs - which use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + In practice, teams usually precompile into the binary all types + that they - server that maps type URLs to message definitions as follows: + expect it to use in the context of Any. However, for URLs which + use the + scheme `http`, `https`, or no scheme, one can optionally set up a + type - * If no scheme is provided, `https` is assumed. + server that maps type URLs to message definitions as follows: - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available in the - official + * If no scheme is provided, `https` is assumed. - protobuf release, and it is not used for type URLs beginning - with + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - type.googleapis.com. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning with - Schemes other than `http`, `https` (or the empty scheme) might - be + type.googleapis.com. - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. - type: object - properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: - type: string - description: >- - security_contact defines an optional email for security - contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. + Schemes other than `http`, `https` (or the empty scheme) might be - Since: cosmos-sdk 0.46 - title: QueryValidatorResponse is response type for the Query/Validator RPC method - cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse: + used with implementation specific semantics. + additionalProperties: {} + created_at: + type: string + format: date-time + description: created_at is a timestamp specifying when a group policy was created. + description: >- + GroupPolicyInfo represents the high-level on-chain information for a group + policy. + cosmos.group.v1.Member: type: object properties: - unbonding_responses: + address: + type: string + description: address is the member's account address. + weight: + type: string + description: weight is the member's voting weight that should be greater than 0. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the member. + added_at: + type: string + format: date-time + description: added_at is a timestamp specifying when a member was added. + description: |- + Member represents a group member with an account address, + non-zero weight, metadata and added_at timestamp. + cosmos.group.v1.MemberRequest: + type: object + properties: + address: + type: string + description: address is the member's account address. + weight: + type: string + description: weight is the member's voting weight that should be greater than 0. + metadata: + type: string + description: metadata is any arbitrary metadata attached to the member. + description: |- + MemberRequest represents a group member to be used in Msg server requests. + Contrary to `Member`, it doesn't have any `added_at` field + since this field cannot be set as part of requests. + cosmos.group.v1.MsgCreateGroupPolicyResponse: + type: object + properties: + address: + type: string + description: address is the account address of the newly created group policy. + description: MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. + cosmos.group.v1.MsgCreateGroupResponse: + type: object + properties: + group_id: + type: string + format: uint64 + description: group_id is the unique ID of the newly created group. + description: MsgCreateGroupResponse is the Msg/CreateGroup response type. + cosmos.group.v1.MsgCreateGroupWithPolicyResponse: + type: object + properties: + group_id: + type: string + format: uint64 + description: group_id is the unique ID of the newly created group with policy. + group_policy_address: + type: string + description: >- + group_policy_address is the account address of the newly created group + policy. + description: >- + MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response + type. + cosmos.group.v1.MsgExecResponse: + type: object + properties: + result: + description: result is the final result of the proposal execution. + type: string + enum: + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN + - PROPOSAL_EXECUTOR_RESULT_SUCCESS + - PROPOSAL_EXECUTOR_RESULT_FAILURE + default: PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + description: MsgExecResponse is the Msg/Exec request type. + cosmos.group.v1.MsgLeaveGroupResponse: + type: object + description: MsgLeaveGroupResponse is the Msg/LeaveGroup response type. + cosmos.group.v1.MsgSubmitProposalResponse: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal is the unique ID of the proposal. + description: MsgSubmitProposalResponse is the Msg/SubmitProposal response type. + cosmos.group.v1.MsgUpdateGroupAdminResponse: + type: object + description: MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. + cosmos.group.v1.MsgUpdateGroupMembersResponse: + type: object + description: MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. + cosmos.group.v1.MsgUpdateGroupMetadataResponse: + type: object + description: >- + MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response + type. + cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse: + type: object + description: >- + MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin + response type. + cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse: + type: object + description: >- + MsgUpdateGroupPolicyDecisionPolicyResponse is the + Msg/UpdateGroupPolicyDecisionPolicy response type. + cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse: + type: object + description: >- + MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata + response type. + cosmos.group.v1.MsgVoteResponse: + type: object + description: MsgVoteResponse is the Msg/Vote response type. + cosmos.group.v1.MsgWithdrawProposalResponse: + type: object + description: MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. + cosmos.group.v1.Proposal: + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique id of the proposal. + group_policy_address: + type: string + description: group_policy_address is the account address of group policy. + metadata: + type: string + title: |- + metadata is any arbitrary metadata attached to the proposal. + the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#proposal-4 + proposers: type: array items: - type: object - properties: - delegator_address: - type: string - description: >- - delegator_address is the bech32-encoded address of the - delegator. - validator_address: - type: string - description: >- - validator_address is the bech32-encoded address of the - validator. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height is the height which the unbonding took - place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - description: >- - UnbondingDelegationEntry defines an unbonding object with - relevant metadata. - description: |- - entries are the unbonding delegation entries. + type: string + description: proposers are the account addresses of the proposers. + submit_time: + type: string + format: date-time + description: submit_time is a timestamp specifying when a proposal was submitted. + group_version: + type: string + format: uint64 + description: |- + group_version tracks the version of the group at proposal submission. + This field is here for informational purposes only. + group_policy_version: + type: string + format: uint64 + description: >- + group_policy_version tracks the version of the group policy at + proposal submission. - unbonding delegation entries - description: >- - UnbondingDelegation stores all of a single delegator's unbonding - bonds + When a decision policy is changed, existing proposals from previous + policy - for a single validator in an time-ordered list. - pagination: - description: pagination defines the pagination in the response. + versions will become invalid with the `ABORTED` status. + + This field is here for informational purposes only. + status: + description: >- + status represents the high level position in the life cycle of the + proposal. Initial value is Submitted. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_SUBMITTED + - PROPOSAL_STATUS_ACCEPTED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_ABORTED + - PROPOSAL_STATUS_WITHDRAWN + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result contains the sums of all weighted votes for this + + proposal for each vote option. It is empty at submission, and only + + populated after tallying, at voting period end or at proposal + execution, + + whichever happens first. type: object properties: - next_key: + yes_count: type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + description: yes_count is the weighted sum of yes votes. + abstain_count: type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: abstain_count is the weighted sum of abstainers. + no_count: + type: string + description: no_count is the weighted sum of no votes. + no_with_veto_count: + type: string + description: no_with_veto_count is the weighted sum of veto. + voting_period_end: + type: string + format: date-time + description: >- + voting_period_end is the timestamp before which voting must be done. - was set, its value is undefined otherwise - description: |- - QueryValidatorUnbondingDelegationsResponse is response type for the - Query/ValidatorUnbondingDelegations RPC method. - cosmos.staking.v1beta1.QueryValidatorsResponse: - type: object - properties: - validators: + Unless a successful MsgExec is called before (to execute a proposal + whose + + tally is successful before the voting period ends), tallying will be + done + + at this point, and the `final_tally_result`and `status` fields will be + + accordingly updated. + executor_result: + description: >- + executor_result is the final result of the proposal execution. Initial + value is NotRun. + type: string + enum: + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN + - PROPOSAL_EXECUTOR_RESULT_SUCCESS + - PROPOSAL_EXECUTOR_RESULT_FAILURE + default: PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + messages: type: array items: type: object properties: - operator_address: + '@type': type: string description: >- - operator_address defines the address of the validator's - operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up + a type - server that maps type URLs to message definitions as - follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) - might be + Schemes other than `http`, `https` (or the empty scheme) might + be - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of `sdk.Msg`s that will be executed if the proposal + passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + description: >- + Proposal defines a group proposal. Any member of a group can submit a + proposal + + for a group policy to decide upon. + + A proposal consists of a set of `sdk.Msg`s that will be executed if the + proposal + + passes as well as some optional metadata associated with the proposal. + cosmos.group.v1.ProposalExecutorResult: + type: string + enum: + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN + - PROPOSAL_EXECUTOR_RESULT_SUCCESS + - PROPOSAL_EXECUTOR_RESULT_FAILURE + default: PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + description: |- + ProposalExecutorResult defines types of proposal executor results. + + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED: An empty value is not allowed. + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN: We have not yet run the executor. + - PROPOSAL_EXECUTOR_RESULT_SUCCESS: The executor was successful and proposed action updated state. + - PROPOSAL_EXECUTOR_RESULT_FAILURE: The executor returned an error and proposed action didn't update state. + cosmos.group.v1.ProposalStatus: + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_SUBMITTED + - PROPOSAL_STATUS_ACCEPTED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_ABORTED + - PROPOSAL_STATUS_WITHDRAWN + default: PROPOSAL_STATUS_UNSPECIFIED + description: |- + ProposalStatus defines proposal statuses. + + - PROPOSAL_STATUS_UNSPECIFIED: An empty value is invalid and not allowed. + - PROPOSAL_STATUS_SUBMITTED: Initial status of a proposal when submitted. + - PROPOSAL_STATUS_ACCEPTED: Final status of a proposal when the final tally is done and the outcome + passes the group policy's decision policy. + - PROPOSAL_STATUS_REJECTED: Final status of a proposal when the final tally is done and the outcome + is rejected by the group policy's decision policy. + - PROPOSAL_STATUS_ABORTED: Final status of a proposal when the group policy is modified before the + final tally. + - PROPOSAL_STATUS_WITHDRAWN: A proposal can be withdrawn before the voting start time by the owner. + When this happens the final status is Withdrawn. + cosmos.group.v1.QueryGroupInfoResponse: + type: object + properties: + info: + description: info is the GroupInfo of the group. + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership structure + that + + would break existing proposals. Whenever any members weight is + changed, + + or any member is added or removed this version is incremented and + will + + cause proposals based on older versions of this group to fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: created_at is a timestamp specifying when a group was created. + description: QueryGroupInfoResponse is the Query/GroupInfo response type. + cosmos.group.v1.QueryGroupMembersResponse: + type: object + properties: + members: + type: array + items: + type: object + properties: + group_id: type: string - description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. + format: uint64 + description: group_id is the unique ID of the group. + member: + description: member is the member data. type: object properties: - moniker: - type: string - description: moniker defines a human-readable name for the validator. - identity: - type: string - description: >- - identity defines an optional identity signature (ex. UPort - or Keybase). - website: + address: type: string - description: website defines an optional website link. - security_contact: + description: address is the member's account address. + weight: type: string description: >- - security_contact defines an optional email for security - contact. - details: + weight is the member's voting weight that should be greater + than 0. + metadata: type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the - validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial commission rates to be - used for creating a validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which - validator can ever charge, as a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum daily increase of - the validator commission, as a fraction. - update_time: + description: metadata is any arbitrary metadata attached to the member. + added_at: type: string format: date-time - description: >- - update_time is the last time the commission rate was - changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum - self delegation. - - - Since: cosmos-sdk 0.46 + description: added_at is a timestamp specifying when a member was added. description: >- - Validator defines a validator, together with the total amount of the - - Validator's bond shares and their exchange rate to coins. Slashing - results in - - a decrease in the exchange rate, allowing correct calculation of - future - - undelegations without iterating over delegators. When coins are - delegated to - - this validator, the validator is credited with a delegation whose - number of - - bond shares is based on the amount of coins delegated divided by the - current - - exchange rate. Voting power can be calculated as total bonded shares - - multiplied by exchange rate. - description: validators contains all the queried validators. + GroupMember represents the relationship between a group and a + member. + description: members are the members of the group with given group_id. pagination: description: pagination defines the pagination in the response. type: object @@ -58119,2157 +60066,1899 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - title: >- - QueryValidatorsResponse is response type for the Query/Validators RPC - method - cosmos.staking.v1beta1.Redelegation: + description: QueryGroupMembersResponse is the Query/GroupMembersResponse response type. + cosmos.group.v1.QueryGroupPoliciesByAdminResponse: type: object properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation source operator - address. - validator_dst_address: - type: string - description: >- - validator_dst_address is the validator redelegation destination - operator address. - entries: + group_policies: type: array items: type: object properties: - creation_height: + address: type: string - format: int64 - description: >- - creation_height defines the height which the redelegation took - place. - completion_time: + description: address is the account address of group policy. + group_id: type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: + format: uint64 + description: group_id is the unique ID of the group. + admin: type: string - description: >- - initial_balance defines the initial balance when redelegation - started. - shares_dst: + description: admin is the account address of the group admin. + metadata: type: string - description: >- - shares_dst is the amount of destination-validator shares created - by redelegation. - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - description: |- - entries are the redelegation entries. - - redelegation entries - description: >- - Redelegation contains the list of a particular delegator's redelegating - bonds - - from a particular source validator to a particular destination validator. - cosmos.staking.v1beta1.RedelegationEntry: - type: object - properties: - creation_height: - type: string - format: int64 - description: creation_height defines the height which the redelegation took place. - completion_time: - type: string - format: date-time - description: completion_time defines the unix time for redelegation completion. - initial_balance: - type: string - description: initial_balance defines the initial balance when redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares created by - redelegation. - description: RedelegationEntry defines a redelegation object with relevant metadata. - cosmos.staking.v1beta1.RedelegationEntryResponse: - type: object - properties: - redelegation_entry: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation took - place. - completion_time: - type: string - format: date-time - description: completion_time defines the unix time for redelegation completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when redelegation - started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares created - by redelegation. - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry except that - it - - contains a balance in addition to shares which is more suitable for client - - responses. - cosmos.staking.v1beta1.RedelegationResponse: - type: object - properties: - redelegation: - type: object - properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_src_address: - type: string - description: >- - validator_src_address is the validator redelegation source - operator address. - validator_dst_address: - type: string - description: >- - validator_dst_address is the validator redelegation destination - operator address. - entries: - type: array - items: - type: object - properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: - type: string - description: >- - shares_dst is the amount of destination-validator shares - created by redelegation. - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - description: |- - entries are the redelegation entries. - - redelegation entries - description: >- - Redelegation contains the list of a particular delegator's - redelegating bonds + title: >- + metadata is any arbitrary metadata attached to the group policy. - from a particular source validator to a particular destination - validator. - entries: - type: array - items: - type: object - properties: - redelegation_entry: + the recommended format of the metadata is to be found here: + + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + version: + type: string + format: uint64 + description: >- + version is used to track changes to a group's GroupPolicyInfo + structure that + + would create a different result on a running proposal. + decision_policy: + description: decision_policy specifies the group policy's decision policy. type: object properties: - creation_height: - type: string - format: int64 - description: >- - creation_height defines the height which the redelegation - took place. - completion_time: - type: string - format: date-time - description: >- - completion_time defines the unix time for redelegation - completion. - initial_balance: - type: string - description: >- - initial_balance defines the initial balance when - redelegation started. - shares_dst: + '@type': type: string description: >- - shares_dst is the amount of destination-validator shares - created by redelegation. - description: >- - RedelegationEntry defines a redelegation object with relevant - metadata. - balance: - type: string - description: >- - RedelegationEntryResponse is equivalent to a RedelegationEntry - except that it + A URL/resource name that uniquely identifies the type of the + serialized - contains a balance in addition to shares which is more suitable for - client + protocol buffer message. This string must contain at least - responses. - description: >- - RedelegationResponse is equivalent to a Redelegation except that its - entries + one "/" character. The last segment of the URL's path must + represent - contain a balance in addition to shares which is more suitable for client + the fully qualified name of the type (as in - responses. - cosmos.staking.v1beta1.UnbondingDelegation: + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all + types that they + + expect it to use in the context of Any. However, for URLs + which use the + + scheme `http`, `https`, or no scheme, one can optionally set + up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group policy was + created. + description: >- + GroupPolicyInfo represents the high-level on-chain information for a + group policy. + description: group_policies are the group policies info with provided admin. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin + response type. + cosmos.group.v1.QueryGroupPoliciesByGroupResponse: type: object properties: - delegator_address: - type: string - description: delegator_address is the bech32-encoded address of the delegator. - validator_address: - type: string - description: validator_address is the bech32-encoded address of the validator. - entries: + group_policies: type: array items: type: object properties: - creation_height: + address: type: string - format: int64 - description: creation_height is the height which the unbonding took place. - completion_time: + description: address is the account address of group policy. + group_id: type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: + format: uint64 + description: group_id is the unique ID of the group. + admin: type: string - description: >- - initial_balance defines the tokens initially scheduled to - receive at completion. - balance: + description: admin is the account address of the group admin. + metadata: type: string - description: balance defines the tokens to receive at completion. - description: >- - UnbondingDelegationEntry defines an unbonding object with relevant - metadata. - description: |- - entries are the unbonding delegation entries. + title: >- + metadata is any arbitrary metadata attached to the group policy. - unbonding delegation entries - description: |- - UnbondingDelegation stores all of a single delegator's unbonding bonds - for a single validator in an time-ordered list. - cosmos.staking.v1beta1.UnbondingDelegationEntry: - type: object - properties: - creation_height: - type: string - format: int64 - description: creation_height is the height which the unbonding took place. - completion_time: - type: string - format: date-time - description: completion_time is the unix time for unbonding completion. - initial_balance: - type: string - description: >- - initial_balance defines the tokens initially scheduled to receive at - completion. - balance: - type: string - description: balance defines the tokens to receive at completion. - description: >- - UnbondingDelegationEntry defines an unbonding object with relevant - metadata. - cosmos.staking.v1beta1.Validator: - type: object - properties: - operator_address: - type: string - description: >- - operator_address defines the address of the validator's operator; bech - encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as a - Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + the recommended format of the metadata is to be found here: - protocol buffer message. This string must contain at least + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + version: + type: string + format: uint64 + description: >- + version is used to track changes to a group's GroupPolicyInfo + structure that - one "/" character. The last segment of the URL's path must - represent + would create a different result on a running proposal. + decision_policy: + description: decision_policy specifies the group policy's decision policy. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - the fully qualified name of the type (as in + protocol buffer message. This string must contain at least - `path/google.protobuf.Duration`). The name should be in a - canonical form + one "/" character. The last segment of the URL's path must + represent - (e.g., leading "." is not accepted). + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a + canonical form - In practice, teams usually precompile into the binary all types - that they + (e.g., leading "." is not accepted). - expect it to use in the context of Any. However, for URLs which - use the - scheme `http`, `https`, or no scheme, one can optionally set up a - type + In practice, teams usually precompile into the binary all + types that they - server that maps type URLs to message definitions as follows: + expect it to use in the context of Any. However, for URLs + which use the + scheme `http`, `https`, or no scheme, one can optionally set + up a type - * If no scheme is provided, `https` is assumed. + server that maps type URLs to message definitions as + follows: - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - Note: this functionality is not currently available in the - official + * If no scheme is provided, `https` is assumed. - protobuf release, and it is not used for type URLs beginning with + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - type.googleapis.com. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning + with - Schemes other than `http`, `https` (or the empty scheme) might be + type.googleapis.com. - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean - description: >- - jailed defined whether the validator has been jailed from bonded - status or not. - status: - description: status is the validator status (bonded/unbonding/unbonded). - type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: - type: string - description: tokens define the delegated tokens (incl. self-delegation). - delegator_shares: - type: string + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. + additionalProperties: {} + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group policy was + created. + description: >- + GroupPolicyInfo represents the high-level on-chain information for a + group policy. description: >- - delegator_shares defines total shares issued to a validator's - delegators. - description: - description: description defines the description terms for the validator. + group_policies are the group policies info associated with the + provided group. + pagination: + description: pagination defines the pagination in the response. type: object properties: - moniker: + next_key: type: string - description: moniker defines a human-readable name for the validator. - identity: + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: type: string - description: >- - identity defines an optional identity signature (ex. UPort or - Keybase). - website: + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup + response type. + cosmos.group.v1.QueryGroupPolicyInfoResponse: + type: object + properties: + info: + description: info is the GroupPolicyInfo of the group policy. + type: object + properties: + address: type: string - description: website defines an optional website link. - security_contact: + description: address is the account address of group policy. + group_id: type: string - description: security_contact defines an optional email for security contact. - details: + format: uint64 + description: group_id is the unique ID of the group. + admin: type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the height at which this - validator has begun unbonding. - unbonding_time: - type: string - format: date-time - description: >- - unbonding_time defines, if unbonding, the min time for the validator - to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: + description: admin is the account address of the group admin. + metadata: + type: string + title: |- + metadata is any arbitrary metadata attached to the group policy. + the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + version: + type: string + format: uint64 description: >- - commission_rates defines the initial commission rates to be used - for creating a validator. + version is used to track changes to a group's GroupPolicyInfo + structure that + + would create a different result on a running proposal. + decision_policy: + description: decision_policy specifies the group policy's decision policy. type: object properties: - rate: - type: string - description: >- - rate is the commission rate charged to delegators, as a - fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission rate which validator - can ever charge, as a fraction. - max_change_rate: + '@type': type: string description: >- - max_change_rate defines the maximum daily increase of the - validator commission, as a fraction. - update_time: - type: string - format: date-time - description: update_time is the last time the commission rate was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self declared minimum self - delegation. + A URL/resource name that uniquely identifies the type of the + serialized + protocol buffer message. This string must contain at least - Since: cosmos-sdk 0.46 - description: >- - Validator defines a validator, together with the total amount of the + one "/" character. The last segment of the URL's path must + represent - Validator's bond shares and their exchange rate to coins. Slashing results - in + the fully qualified name of the type (as in - a decrease in the exchange rate, allowing correct calculation of future + `path/google.protobuf.Duration`). The name should be in a + canonical form - undelegations without iterating over delegators. When coins are delegated - to + (e.g., leading "." is not accepted). - this validator, the validator is credited with a delegation whose number - of - bond shares is based on the amount of coins delegated divided by the - current + In practice, teams usually precompile into the binary all + types that they - exchange rate. Voting power can be calculated as total bonded shares + expect it to use in the context of Any. However, for URLs + which use the - multiplied by exchange rate. - cosmos.base.abci.v1beta1.ABCIMessageLog: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key and value - are + scheme `http`, `https`, or no scheme, one can optionally set + up a type - strings instead of raw bytes. - description: |- - StringEvent defines en Event object wrapper where all the attributes - contain key/value pairs that are strings instead of raw bytes. - description: |- - Events contains a slice of Event objects that were emitted during some - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI message - log. - cosmos.base.abci.v1beta1.Attribute: - type: object - properties: - key: - type: string - value: - type: string - description: |- - Attribute defines an attribute wrapper where the key and value are - strings instead of raw bytes. - cosmos.base.abci.v1beta1.GasInfo: - type: object - properties: - gas_wanted: - type: string - format: uint64 - description: GasWanted is the maximum units of work we allow this tx to perform. - gas_used: - type: string - format: uint64 - description: GasUsed is the amount of gas actually consumed. - description: GasInfo defines tx execution gas context. - cosmos.base.abci.v1beta1.Result: - type: object - properties: - data: - type: string - format: byte - description: >- - Data is any data returned from message or handler execution. It MUST - be + server that maps type URLs to message definitions as follows: - length prefixed in order to separate data from multiple message - executions. - Deprecated. This field is still populated, but prefer msg_response - instead + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be - because it also contains the Msg response typeURL. - log: - type: string - description: Log contains the log information from message or handler execution. - events: + used with implementation specific semantics. + additionalProperties: {} + created_at: + type: string + format: date-time + description: >- + created_at is a timestamp specifying when a group policy was + created. + description: QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. + cosmos.group.v1.QueryGroupsByAdminResponse: + type: object + properties: + groups: type: array items: type: object properties: - type: + id: type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with an - event. - description: >- - Event allows application developers to attach additional information - to + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership + structure that - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. + would break existing proposals. Whenever any members weight is + changed, - Later, transactions may be queried using these events. - description: >- - Events contains a slice of Event objects that were emitted during - message + or any member is added or removed this version is incremented + and will - or handler execution. - msg_responses: + cause proposals based on older versions of this group to fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: created_at is a timestamp specifying when a group was created. + description: >- + GroupInfo represents the high-level on-chain information for a + group. + description: groups are the groups info with the provided admin. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response + type. + cosmos.group.v1.QueryGroupsByMemberResponse: + type: object + properties: + groups: type: array items: type: object properties: - '@type': + id: type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership + structure that + would break existing proposals. Whenever any members weight is + changed, - In practice, teams usually precompile into the binary all types - that they + or any member is added or removed this version is incremented + and will - expect it to use in the context of Any. However, for URLs which - use the + cause proposals based on older versions of this group to fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: created_at is a timestamp specifying when a group was created. + description: >- + GroupInfo represents the high-level on-chain information for a + group. + description: groups are the groups info with the provided group member. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - scheme `http`, `https`, or no scheme, one can optionally set up - a type + was set, its value is undefined otherwise + description: QueryGroupsByMemberResponse is the Query/GroupsByMember response type. + cosmos.group.v1.QueryGroupsResponse: + type: object + properties: + groups: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique ID of the group. + admin: + type: string + description: admin is the account address of the group's admin. + metadata: + type: string + description: metadata is any arbitrary metadata to attached to the group. + version: + type: string + format: uint64 + title: >- + version is used to track changes to a group's membership + structure that - server that maps type URLs to message definitions as follows: + would break existing proposals. Whenever any members weight is + changed, + or any member is added or removed this version is incremented + and will - * If no scheme is provided, `https` is assumed. + cause proposals based on older versions of this group to fail + total_weight: + type: string + description: total_weight is the sum of the group members' weights. + created_at: + type: string + format: date-time + description: created_at is a timestamp specifying when a group was created. + description: >- + GroupInfo represents the high-level on-chain information for a + group. + description: '`groups` is all the groups present in state.' + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + was set, its value is undefined otherwise + description: |- + QueryGroupsResponse is the Query/Groups response type. - Note: this functionality is not currently available in the - official + Since: cosmos-sdk 0.47.1 + cosmos.group.v1.QueryProposalResponse: + type: object + properties: + proposal: + description: proposal is the proposal info. + type: object + properties: + id: + type: string + format: uint64 + description: id is the unique id of the proposal. + group_policy_address: + type: string + description: group_policy_address is the account address of group policy. + metadata: + type: string + title: |- + metadata is any arbitrary metadata attached to the proposal. + the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#proposal-4 + proposers: + type: array + items: + type: string + description: proposers are the account addresses of the proposers. + submit_time: + type: string + format: date-time + description: >- + submit_time is a timestamp specifying when a proposal was + submitted. + group_version: + type: string + format: uint64 + description: >- + group_version tracks the version of the group at proposal + submission. - protobuf release, and it is not used for type URLs beginning - with + This field is here for informational purposes only. + group_policy_version: + type: string + format: uint64 + description: >- + group_policy_version tracks the version of the group policy at + proposal submission. - type.googleapis.com. + When a decision policy is changed, existing proposals from + previous policy + versions will become invalid with the `ABORTED` status. - Schemes other than `http`, `https` (or the empty scheme) might - be + This field is here for informational purposes only. + status: + description: >- + status represents the high level position in the life cycle of the + proposal. Initial value is Submitted. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_SUBMITTED + - PROPOSAL_STATUS_ACCEPTED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_ABORTED + - PROPOSAL_STATUS_WITHDRAWN + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result contains the sums of all weighted votes for + this - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + proposal for each vote option. It is empty at submission, and only - URL that describes the type of the serialized message. + populated after tallying, at voting period end or at proposal + execution, + whichever happens first. + type: object + properties: + yes_count: + type: string + description: yes_count is the weighted sum of yes votes. + abstain_count: + type: string + description: abstain_count is the weighted sum of abstainers. + no_count: + type: string + description: no_count is the weighted sum of no votes. + no_with_veto_count: + type: string + description: no_with_veto_count is the weighted sum of veto. + voting_period_end: + type: string + format: date-time + description: >- + voting_period_end is the timestamp before which voting must be + done. - Protobuf library provides support to pack/unpack Any values in the - form + Unless a successful MsgExec is called before (to execute a + proposal whose - of utility functions or additional generated methods of the Any - type. + tally is successful before the voting period ends), tallying will + be done + at this point, and the `final_tally_result`and `status` fields + will be - Example 1: Pack and unpack a message in C++. + accordingly updated. + executor_result: + description: >- + executor_result is the final result of the proposal execution. + Initial value is NotRun. + type: string + enum: + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN + - PROPOSAL_EXECUTOR_RESULT_SUCCESS + - PROPOSAL_EXECUTOR_RESULT_FAILURE + default: PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + protocol buffer message. This string must contain at least - Example 2: Pack and unpack a message in Java. + one "/" character. The last segment of the URL's path must + represent - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + the fully qualified name of the type (as in - Example 3: Pack and unpack a message in Python. + `path/google.protobuf.Duration`). The name should be in a + canonical form - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + (e.g., leading "." is not accepted). - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + In practice, teams usually precompile into the binary all + types that they - The pack methods provided by protobuf library will by default use + expect it to use in the context of Any. However, for URLs + which use the - 'type.googleapis.com/full.type.name' as the type URL and the unpack + scheme `http`, `https`, or no scheme, one can optionally set + up a type - methods only use the fully qualified type name after the last '/' + server that maps type URLs to message definitions as + follows: - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in the + official - JSON + protobuf release, and it is not used for type URLs beginning + with - ==== + type.googleapis.com. - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + Schemes other than `http`, `https` (or the empty scheme) + might be - additional field `@type` which contains the type URL. Example: + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + URL that describes the type of the serialized message. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom JSON + Protobuf library provides support to pack/unpack Any values in + the form - representation, that representation will be embedded adding a field + of utility functions or additional generated methods of the Any + type. - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + Example 1: Pack and unpack a message in C++. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - msg_responses contains the Msg handler responses type packed in Anys. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - Since: cosmos-sdk 0.46 - description: Result is the union of ResponseFormat and ResponseCheckTx. - cosmos.base.abci.v1beta1.StringEvent: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: |- - Attribute defines an attribute wrapper where the key and value are - strings instead of raw bytes. - description: |- - StringEvent defines en Event object wrapper where all the attributes - contain key/value pairs that are strings instead of raw bytes. - cosmos.base.abci.v1beta1.TxResponse: - type: object - properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: - type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key and - value are + Example 2: Pack and unpack a message in Java. - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all the - attributes + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - contain key/value pairs that are strings instead of raw bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some + Example 3: Pack and unpack a message in Python. - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI - message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: - type: string - description: Additional information. May be non-deterministic. - gas_wanted: - type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: - type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - protocol buffer message. This string must contain at least + Example 4: Pack and unpack a message in Go - one "/" character. The last segment of the URL's path must - represent + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - the fully qualified name of the type (as in + The pack methods provided by protobuf library will by default + use - `path/google.protobuf.Duration`). The name should be in a - canonical form + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - (e.g., leading "." is not accepted). + methods only use the fully qualified type name after the last + '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type - In practice, teams usually precompile into the binary all types - that they + name "y.z". - expect it to use in the context of Any. However, for URLs which - use the - scheme `http`, `https`, or no scheme, one can optionally set up a - type - server that maps type URLs to message definitions as follows: + JSON + ==== - * If no scheme is provided, `https` is assumed. + The JSON representation of an `Any` value uses the regular - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + representation of the deserialized, embedded message, with an - Note: this functionality is not currently available in the - official + additional field `@type` which contains the type URL. Example: - protobuf release, and it is not used for type URLs beginning with + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - type.googleapis.com. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + If the embedded message type is well-known and has a custom JSON - Schemes other than `http`, `https` (or the empty scheme) might be + representation, that representation will be embedded adding a + field - used with implementation specific semantics. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the weighted median - of + `value` which holds the custom JSON in addition to the `@type` - the timestamps of the valid votes in the block.LastCommit. For height - == 1, + field. Example (for message [google.protobuf.Duration][]): - it's genesis time. - events: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of `sdk.Msg`s that will be executed if the + proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + description: QueryProposalResponse is the Query/Proposal response type. + cosmos.group.v1.QueryProposalsByGroupPolicyResponse: + type: object + properties: + proposals: type: array items: type: object properties: - type: + id: type: string - attributes: + format: uint64 + description: id is the unique id of the proposal. + group_policy_address: + type: string + description: group_policy_address is the account address of group policy. + metadata: + type: string + title: |- + metadata is any arbitrary metadata attached to the proposal. + the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#proposal-4 + proposers: type: array items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with an - event. - description: >- - Event allows application developers to attach additional information - to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. - - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a transaction. - Note, + type: string + description: proposers are the account addresses of the proposers. + submit_time: + type: string + format: date-time + description: >- + submit_time is a timestamp specifying when a proposal was + submitted. + group_version: + type: string + format: uint64 + description: >- + group_version tracks the version of the group at proposal + submission. - these events include those emitted by processing all the messages and - those + This field is here for informational purposes only. + group_policy_version: + type: string + format: uint64 + description: >- + group_policy_version tracks the version of the group policy at + proposal submission. - emitted from the ante. Whereas Logs contains the events, with + When a decision policy is changed, existing proposals from + previous policy - additional metadata, emitted only by processing the messages. + versions will become invalid with the `ABORTED` status. + This field is here for informational purposes only. + status: + description: >- + status represents the high level position in the life cycle of + the proposal. Initial value is Submitted. + type: string + enum: + - PROPOSAL_STATUS_UNSPECIFIED + - PROPOSAL_STATUS_SUBMITTED + - PROPOSAL_STATUS_ACCEPTED + - PROPOSAL_STATUS_REJECTED + - PROPOSAL_STATUS_ABORTED + - PROPOSAL_STATUS_WITHDRAWN + default: PROPOSAL_STATUS_UNSPECIFIED + final_tally_result: + description: >- + final_tally_result contains the sums of all weighted votes for + this - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: >- - TxResponse defines a structure containing relevant tx data and metadata. - The + proposal for each vote option. It is empty at submission, and + only - tags are stringified and the log is JSON decoded. - cosmos.crypto.multisig.v1beta1.CompactBitArray: - type: object - properties: - extra_bits_stored: - type: integer - format: int64 - elems: - type: string - format: byte - description: |- - CompactBitArray is an implementation of a space efficient bit array. - This is used to ensure that the encoded data takes up a minimal amount of - space after proto encoding. - This is not thread safe, and is not intended for concurrent usage. - cosmos.tx.signing.v1beta1.SignMode: - type: string - enum: - - SIGN_MODE_UNSPECIFIED - - SIGN_MODE_DIRECT - - SIGN_MODE_TEXTUAL - - SIGN_MODE_DIRECT_AUX - - SIGN_MODE_LEGACY_AMINO_JSON - - SIGN_MODE_EIP_191 - default: SIGN_MODE_UNSPECIFIED - description: |- - SignMode represents a signing mode with its own security guarantees. + populated after tallying, at voting period end or at proposal + execution, - This enum should be considered a registry of all known sign modes - in the Cosmos ecosystem. Apps are not expected to support all known - sign modes. Apps that would like to support custom sign modes are - encouraged to open a small PR against this file to add a new case - to this SignMode enum describing their sign mode so that different - apps have a consistent version of this enum. + whichever happens first. + type: object + properties: + yes_count: + type: string + description: yes_count is the weighted sum of yes votes. + abstain_count: + type: string + description: abstain_count is the weighted sum of abstainers. + no_count: + type: string + description: no_count is the weighted sum of no votes. + no_with_veto_count: + type: string + description: no_with_veto_count is the weighted sum of veto. + voting_period_end: + type: string + format: date-time + description: >- + voting_period_end is the timestamp before which voting must be + done. - - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected. - - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - verified with raw bytes from Tx. - - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some - human-readable textual representation on top of the binary representation - from SIGN_MODE_DIRECT. It is currently not supported. - - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses - SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - require signers signing over other signers' `signer_info`. It also allows - for adding Tips in transactions. + Unless a successful MsgExec is called before (to execute a + proposal whose - Since: cosmos-sdk 0.46 - - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - Amino JSON and will be removed in the future. - - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + tally is successful before the voting period ends), tallying + will be done - Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, - but is not implemented on the SDK by default. To enable EIP-191, you need - to pass a custom `TxConfig` that has an implementation of - `SignModeHandler` for EIP-191. The SDK may decide to fully support - EIP-191 in the future. + at this point, and the `final_tally_result`and `status` fields + will be - Since: cosmos-sdk 0.45.2 - cosmos.tx.v1beta1.AuthInfo: - type: object - properties: - signer_infos: - type: array - items: - type: object - $ref: '#/definitions/cosmos.tx.v1beta1.SignerInfo' - description: >- - signer_infos defines the signing modes for the required signers. The - number + accordingly updated. + executor_result: + description: >- + executor_result is the final result of the proposal execution. + Initial value is NotRun. + type: string + enum: + - PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + - PROPOSAL_EXECUTOR_RESULT_NOT_RUN + - PROPOSAL_EXECUTOR_RESULT_SUCCESS + - PROPOSAL_EXECUTOR_RESULT_FAILURE + default: PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - and order of elements must match the required signers from TxBody's + protocol buffer message. This string must contain at least - messages. The first element is the primary signer and the one which - pays + one "/" character. The last segment of the URL's path must + represent - the fee. - fee: - description: >- - Fee is the fee and gas limit for the transaction. The first signer is - the + the fully qualified name of the type (as in - primary signer and the one which pays the fee. The fee can be - calculated + `path/google.protobuf.Duration`). The name should be in a + canonical form - based on the cost of evaluating the body and doing signature - verification + (e.g., leading "." is not accepted). - of the signers. This can be estimated via simulation. - type: object - properties: - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + In practice, teams usually precompile into the binary all + types that they - NOTE: The amount field is an Int which implements the custom - method + expect it to use in the context of Any. However, for URLs + which use the - signatures required by gogoproto. - title: amount is the amount of coins to be paid as a fee - gas_limit: - type: string - format: uint64 - title: >- - gas_limit is the maximum gas that can be used in transaction - processing + scheme `http`, `https`, or no scheme, one can optionally + set up a type - before an out of gas error occurs - payer: - type: string - description: >- - if unset, the first signer is responsible for paying the fees. If - set, the specified account must pay the fees. + server that maps type URLs to message definitions as + follows: - the payer must be a tx signer (and thus have signed this field in - AuthInfo). - setting this field does *not* change the ordering of required - signers for the transaction. - granter: - type: string - title: >- - if set, the fee payer (either the first signer or the value of the - payer field) requests that a fee grant be used + * If no scheme is provided, `https` is assumed. - to pay fees instead of the fee payer's own balance. If an - appropriate fee grant does not exist or the chain does + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - not support fee grants, this will fail - tip: - description: >- - Tip is the optional tip used for transactions fees paid in another - denom. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs + beginning with - This field is ignored if the chain didn't enable tips, i.e. didn't add - the + type.googleapis.com. - `TipDecorator` in its posthandler. + Schemes other than `http`, `https` (or the empty scheme) + might be - Since: cosmos-sdk 0.46 - type: object - properties: - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + URL that describes the type of the serialized message. - NOTE: The amount field is an Int which implements the custom - method - signatures required by gogoproto. - title: amount is the amount of the tip - tipper: - type: string - title: tipper is the address of the account paying for the tip - description: |- - AuthInfo describes the fee and signer modes that are used to sign a - transaction. - cosmos.tx.v1beta1.BroadcastMode: - type: string - enum: - - BROADCAST_MODE_UNSPECIFIED - - BROADCAST_MODE_BLOCK - - BROADCAST_MODE_SYNC - - BROADCAST_MODE_ASYNC - default: BROADCAST_MODE_UNSPECIFIED - description: >- - BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC - method. + Protobuf library provides support to pack/unpack Any values in + the form - - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. - - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - a CheckTx execution response only. - - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - immediately. - cosmos.tx.v1beta1.BroadcastTxRequest: - type: object - properties: - tx_bytes: - type: string - format: byte - description: tx_bytes is the raw transaction. - mode: - type: string - enum: - - BROADCAST_MODE_UNSPECIFIED - - BROADCAST_MODE_BLOCK - - BROADCAST_MODE_SYNC - - BROADCAST_MODE_ASYNC - default: BROADCAST_MODE_UNSPECIFIED - description: >- - BroadcastMode specifies the broadcast mode for the TxService.Broadcast - RPC method. + of utility functions or additional generated methods of the + Any type. - - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering - - BROADCAST_MODE_BLOCK: BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - the tx to be committed in a block. - - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - a CheckTx execution response only. - - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - immediately. - description: |- - BroadcastTxRequest is the request type for the Service.BroadcastTxRequest - RPC method. - cosmos.tx.v1beta1.BroadcastTxResponse: - type: object - properties: - tx_response: - description: tx_response is the queried TxResponses. - type: object - properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: - type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: - type: string - description: Result bytes, if any. - raw_log: - type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key - and value are - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all the - attributes + Example 1: Pack and unpack a message in C++. - contain key/value pairs that are strings instead of raw - bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI - message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: - type: string - description: Additional information. May be non-deterministic. - gas_wanted: - type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: - type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + Example 2: Pack and unpack a message in Java. - protocol buffer message. This string must contain at least + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - one "/" character. The last segment of the URL's path must - represent + Example 3: Pack and unpack a message in Python. - the fully qualified name of the type (as in + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - `path/google.protobuf.Duration`). The name should be in a - canonical form + Example 4: Pack and unpack a message in Go - (e.g., leading "." is not accepted). + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + The pack methods provided by protobuf library will by default + use - In practice, teams usually precompile into the binary all - types that they + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - expect it to use in the context of Any. However, for URLs - which use the + methods only use the fully qualified type name after the last + '/' - scheme `http`, `https`, or no scheme, one can optionally set - up a type + in the type URL, for example "foo.bar.com/x/y.z" will yield + type - server that maps type URLs to message definitions as follows: + name "y.z". - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + JSON - Note: this functionality is not currently available in the - official + ==== - protobuf release, and it is not used for type URLs beginning - with + The JSON representation of an `Any` value uses the regular - type.googleapis.com. + representation of the deserialized, embedded message, with an + additional field `@type` which contains the type URL. Example: - Schemes other than `http`, `https` (or the empty scheme) might - be + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - used with implementation specific semantics. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the weighted - median of + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - the timestamps of the valid votes in the block.LastCommit. For - height == 1, + If the embedded message type is well-known and has a custom + JSON - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with - an event. - description: >- - Event allows application developers to attach additional - information to + representation, that representation will be embedded adding a + field - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. + `value` which holds the custom JSON in addition to the `@type` - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a transaction. - Note, + field. Example (for message [google.protobuf.Duration][]): - these events include those emitted by processing all the messages - and those + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of `sdk.Msg`s that will be executed if the + proposal passes. + title: + type: string + description: 'Since: cosmos-sdk 0.47' + title: title is the title of the proposal + summary: + type: string + description: 'Since: cosmos-sdk 0.47' + title: summary is a short summary of the proposal + description: >- + Proposal defines a group proposal. Any member of a group can submit + a proposal - emitted from the ante. Whereas Logs contains the events, with + for a group policy to decide upon. - additional metadata, emitted only by processing the messages. + A proposal consists of a set of `sdk.Msg`s that will be executed if + the proposal + passes as well as some optional metadata associated with the + proposal. + description: proposals are the proposals with given group policy. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: |- - BroadcastTxResponse is the response type for the - Service.BroadcastTx method. - cosmos.tx.v1beta1.Fee: + was set, its value is undefined otherwise + description: >- + QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy + response type. + cosmos.group.v1.QueryTallyResultResponse: type: object properties: - amount: + tally: + description: tally defines the requested tally. + type: object + properties: + yes_count: + type: string + description: yes_count is the weighted sum of yes votes. + abstain_count: + type: string + description: abstain_count is the weighted sum of abstainers. + no_count: + type: string + description: no_count is the weighted sum of no votes. + no_with_veto_count: + type: string + description: no_with_veto_count is the weighted sum of veto. + description: QueryTallyResultResponse is the Query/TallyResult response type. + cosmos.group.v1.QueryVoteByProposalVoterResponse: + type: object + properties: + vote: + description: vote is the vote with given proposal_id and voter. + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal is the unique ID of the proposal. + voter: + type: string + description: voter is the account address of the voter. + option: + description: option is the voter's choice on the proposal. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + metadata: + type: string + description: metadata is any arbitrary metadata attached to the vote. + submit_time: + type: string + format: date-time + description: submit_time is the timestamp when the vote was submitted. + description: >- + QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response + type. + cosmos.group.v1.QueryVotesByProposalResponse: + type: object + properties: + votes: type: array items: type: object properties: - denom: + proposal_id: type: string - amount: + format: uint64 + description: proposal is the unique ID of the proposal. + voter: type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: amount is the amount of coins to be paid as a fee - gas_limit: - type: string - format: uint64 - title: >- - gas_limit is the maximum gas that can be used in transaction - processing - - before an out of gas error occurs - payer: - type: string - description: >- - if unset, the first signer is responsible for paying the fees. If set, - the specified account must pay the fees. - - the payer must be a tx signer (and thus have signed this field in - AuthInfo). - - setting this field does *not* change the ordering of required signers - for the transaction. - granter: - type: string - title: >- - if set, the fee payer (either the first signer or the value of the - payer field) requests that a fee grant be used - - to pay fees instead of the fee payer's own balance. If an appropriate - fee grant does not exist or the chain does - - not support fee grants, this will fail - description: >- - Fee includes the amount of coins paid in fees and the maximum - - gas to be used by the transaction. The ratio yields an effective - "gasprice", + description: voter is the account address of the voter. + option: + description: option is the voter's choice on the proposal. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + metadata: + type: string + description: metadata is any arbitrary metadata attached to the vote. + submit_time: + type: string + format: date-time + description: submit_time is the timestamp when the vote was submitted. + description: Vote represents a vote for a proposal. + description: votes are the list of votes for given proposal_id. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - which must be above some miminum to be accepted into the mempool. - cosmos.tx.v1beta1.GetBlockWithTxsResponse: + was set, its value is undefined otherwise + description: QueryVotesByProposalResponse is the Query/VotesByProposal response type. + cosmos.group.v1.QueryVotesByVoterResponse: type: object properties: - txs: + votes: type: array items: type: object - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: txs are the transactions in the block. - block_id: + properties: + proposal_id: + type: string + format: uint64 + description: proposal is the unique ID of the proposal. + voter: + type: string + description: voter is the account address of the voter. + option: + description: option is the voter's choice on the proposal. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + metadata: + type: string + description: metadata is any arbitrary metadata attached to the vote. + submit_time: + type: string + format: date-time + description: submit_time is the timestamp when the vote was submitted. + description: Vote represents a vote for a proposal. + description: votes are the list of votes by given voter. + pagination: + description: pagination defines the pagination in the response. type: object properties: - hash: + next_key: type: string format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - block: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - including all blockchain data structures and the rules of the - application's + was set, its value is undefined otherwise + description: QueryVotesByVoterResponse is the Query/VotesByVoter response type. + cosmos.group.v1.TallyResult: + type: object + properties: + yes_count: + type: string + description: yes_count is the weighted sum of yes votes. + abstain_count: + type: string + description: abstain_count is the weighted sum of abstainers. + no_count: + type: string + description: no_count is the weighted sum of no votes. + no_with_veto_count: + type: string + description: no_with_veto_count is the weighted sum of veto. + description: TallyResult represents the sum of weighted votes for each vote option. + cosmos.group.v1.Vote: + type: object + properties: + proposal_id: + type: string + format: uint64 + description: proposal is the unique ID of the proposal. + voter: + type: string + description: voter is the account address of the voter. + option: + description: option is the voter's choice on the proposal. + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + metadata: + type: string + description: metadata is any arbitrary metadata attached to the vote. + submit_time: + type: string + format: date-time + description: submit_time is the timestamp when the vote was submitted. + description: Vote represents a vote for a proposal. + cosmos.group.v1.VoteOption: + type: string + enum: + - VOTE_OPTION_UNSPECIFIED + - VOTE_OPTION_YES + - VOTE_OPTION_ABSTAIN + - VOTE_OPTION_NO + - VOTE_OPTION_NO_WITH_VETO + default: VOTE_OPTION_UNSPECIFIED + description: |- + VoteOption enumerates the valid vote options for a given proposal. - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: commit from validators from the last block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: root hash of all results from the txs from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: Header defines the structure of a block header. - data: - type: object - properties: - txs: - type: array - items: - type: string - format: byte - description: >- - Txs that will be applied by state @ block.Height+1. + - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + return an error. + - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option. + - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option. + - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option. + - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + cosmos.mint.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. - NOTE: not all txs here are valid. We're just agreeing on the - order first. + Since: cosmos-sdk 0.47 + cosmos.mint.v1beta1.Params: + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: Params defines the parameters for the x/mint module. + cosmos.mint.v1beta1.QueryAnnualProvisionsResponse: + type: object + properties: + annual_provisions: + type: string + format: byte + description: annual_provisions is the current minting annual provisions value. + description: |- + QueryAnnualProvisionsResponse is the response type for the + Query/AnnualProvisions RPC method. + cosmos.mint.v1beta1.QueryInflationResponse: + type: object + properties: + inflation: + type: string + format: byte + description: inflation is the current minting inflation value. + description: |- + QueryInflationResponse is the response type for the Query/Inflation RPC + method. + cosmos.mint.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + mint_denom: + type: string + title: type of coin to mint + inflation_rate_change: + type: string + title: maximum annual change in inflation rate + inflation_max: + type: string + title: maximum inflation rate + inflation_min: + type: string + title: minimum inflation rate + goal_bonded: + type: string + title: goal of percent bonded atoms + blocks_per_year: + type: string + format: uint64 + title: expected blocks per year + description: QueryParamsResponse is the response type for the Query/Params RPC method. + cosmos.nft.v1beta1.Class: + type: object + properties: + id: + type: string + title: >- + id defines the unique identifier of the NFT classification, similar to + the contract address of ERC721 + name: + type: string + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: + type: string + title: symbol is an abbreviated name for nft classification. Optional + description: + type: string + title: description is a brief description of nft classification. Optional + uri: + type: string + title: >- + uri for the class metadata stored off chain. It can define schema for + Class and NFT `Data` attributes. Optional + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - This means that block.AppHash does not include these txs. - title: Data contains the set of transactions included in the block - evidence: - type: object - properties: - evidence: - type: array - items: - type: object - properties: - duplicate_vote_evidence: - type: object - properties: - vote_a: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + protocol buffer message. This string must contain at least - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + one "/" character. The last segment of the URL's path must + represent - consensus. - vote_b: - type: object - properties: - type: - type: string - enum: - - SIGNED_MSG_TYPE_UNKNOWN - - SIGNED_MSG_TYPE_PREVOTE - - SIGNED_MSG_TYPE_PRECOMMIT - - SIGNED_MSG_TYPE_PROPOSAL - default: SIGNED_MSG_TYPE_UNKNOWN - description: >- - SignedMsgType is a type of signed message in the - consensus. + the fully qualified name of the type (as in - - SIGNED_MSG_TYPE_PREVOTE: Votes - - SIGNED_MSG_TYPE_PROPOSAL: Proposals - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - description: zero if vote is nil. - timestamp: - type: string - format: date-time - validator_address: - type: string - format: byte - validator_index: - type: integer - format: int32 - signature: - type: string - format: byte - description: >- - Vote represents a prevote, precommit, or commit vote - from validators for + `path/google.protobuf.Duration`). The name should be in a + canonical form - consensus. - total_voting_power: - type: string - format: int64 - validator_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - DuplicateVoteEvidence contains evidence of a validator - signed two conflicting votes. - light_client_attack_evidence: - type: object - properties: - conflicting_block: - type: object - properties: - signed_header: - type: object - properties: - header: - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules - for processing a block in the - blockchain, + (e.g., leading "." is not accepted). - including all blockchain data structures - and the rules of the application's - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - last_commit_hash: - type: string - format: byte - description: >- - commit from validators from the last - block - title: hashes of block data - data_hash: - type: string - format: byte - title: transactions - validators_hash: - type: string - format: byte - description: validators for the current block - title: >- - hashes from the app output from the prev - block - next_validators_hash: - type: string - format: byte - title: validators for the next block - consensus_hash: - type: string - format: byte - title: consensus params for current block - app_hash: - type: string - format: byte - title: state after txs from the previous block - last_results_hash: - type: string - format: byte - title: >- - root hash of all results from the txs - from the previous block - evidence_hash: - type: string - format: byte - description: evidence included in the block - title: consensus info - proposer_address: - type: string - format: byte - title: original proposer of the block - description: >- - Header defines the structure of a block - header. - commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: >- - BlockIdFlag indicates which BlcokID the - signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: >- - CommitSig is a part of the Vote included - in a Commit. - description: >- - Commit contains the evidence that a block - was committed by a set of validators. - validator_set: - type: object - properties: - validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - proposer: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for - use with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - common_height: - type: string - format: int64 - byzantine_validators: - type: array - items: - type: object - properties: - address: - type: string - format: byte - pub_key: - type: object - properties: - ed25519: - type: string - format: byte - secp256k1: - type: string - format: byte - title: >- - PublicKey defines the keys available for use - with Validators - voting_power: - type: string - format: int64 - proposer_priority: - type: string - format: int64 - total_voting_power: - type: string - format: int64 - timestamp: - type: string - format: date-time - description: >- - LightClientAttackEvidence contains evidence of a set of - validators attempting to mislead a light client. - last_commit: - type: object - properties: - height: - type: string - format: int64 - round: - type: integer - format: int32 - block_id: - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - title: BlockID - signatures: - type: array - items: - type: object - properties: - block_id_flag: - type: string - enum: - - BLOCK_ID_FLAG_UNKNOWN - - BLOCK_ID_FLAG_ABSENT - - BLOCK_ID_FLAG_COMMIT - - BLOCK_ID_FLAG_NIL - default: BLOCK_ID_FLAG_UNKNOWN - title: BlockIdFlag indicates which BlcokID the signature is for - validator_address: - type: string - format: byte - timestamp: - type: string - format: date-time - signature: - type: string - format: byte - description: CommitSig is a part of the Vote included in a Commit. - description: >- - Commit contains the evidence that a block was committed by a set - of validators. - pagination: - description: pagination defines a pagination for the response. + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + cosmos.nft.v1beta1.MsgSendResponse: + type: object + description: MsgSendResponse defines the Msg/Send response type. + cosmos.nft.v1beta1.NFT: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract address of + ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional type: object properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + '@type': type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - was set, its value is undefined otherwise - description: >- - GetBlockWithTxsResponse is the response type for the - Service.GetBlockWithTxs method. + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - Since: cosmos-sdk 0.45.2 - cosmos.tx.v1beta1.GetTxResponse: + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in a + canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary all types + that they + + expect it to use in the context of Any. However, for URLs which + use the + + scheme `http`, `https`, or no scheme, one can optionally set up a + type + + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + cosmos.nft.v1beta1.QueryBalanceResponse: type: object properties: - tx: - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: tx is the queried transaction. - tx_response: - description: tx_response is the queried TxResponses. + amount: + type: string + format: uint64 + title: amount is the number of all NFTs of a given class owned by the owner + title: QueryBalanceResponse is the response type for the Query/Balance RPC method + cosmos.nft.v1beta1.QueryClassResponse: + type: object + properties: + class: + description: class defines the class of the nft type. type: object properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: + id: type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: + title: >- + id defines the unique identifier of the NFT classification, + similar to the contract address of ERC721 + name: type: string - description: Result bytes, if any. - raw_log: + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the key - and value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all the - attributes - - contain key/value pairs that are strings instead of raw - bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx ABCI - message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: + title: symbol is an abbreviated name for nft classification. Optional + description: type: string - description: Additional information. May be non-deterministic. - gas_wanted: + title: description is a brief description of nft classification. Optional + uri: type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: + title: >- + uri for the class metadata stored off chain. It can define schema + for Class and NFT `Data` attributes. Optional + uri_hash: type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional type: object properties: '@type': @@ -60300,187 +61989,175 @@ definitions: scheme `http`, `https`, or no scheme, one can optionally set up a type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the + official + + protobuf release, and it is not used for type URLs beginning + with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - * If no scheme is provided, `https` is assumed. + methods only use the fully qualified type name after the last '/' - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Note: this functionality is not currently available in the - official + name "y.z". - protobuf release, and it is not used for type URLs beginning - with - type.googleapis.com. + JSON - Schemes other than `http`, `https` (or the empty scheme) might - be + ==== - used with implementation specific semantics. - additionalProperties: {} - timestamp: - type: string - description: >- - Time of the previous block. For heights > 1, it's the weighted - median of + The JSON representation of an `Any` value uses the regular - the timestamps of the valid votes in the block.LastCommit. For - height == 1, + representation of the deserialized, embedded message, with an - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with - an event. - description: >- - Event allows application developers to attach additional - information to + additional field `@type` which contains the type URL. Example: - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a transaction. - Note, + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - these events include those emitted by processing all the messages - and those + If the embedded message type is well-known and has a custom JSON - emitted from the ante. Whereas Logs contains the events, with + representation, that representation will be embedded adding a + field - additional metadata, emitted only by processing the messages. + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: GetTxResponse is the response type for the Service.GetTx method. - cosmos.tx.v1beta1.GetTxsEventResponse: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: QueryClassResponse is the response type for the Query/Class RPC method + cosmos.nft.v1beta1.QueryClassesResponse: type: object properties: - txs: - type: array - items: - type: object - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: txs is the list of queried transactions. - tx_responses: + classes: type: array items: type: object properties: - height: - type: string - format: int64 - title: The block height - txhash: - type: string - description: The transaction hash. - codespace: + id: type: string - title: Namespace for the Code - code: - type: integer - format: int64 - description: Response code. - data: + title: >- + id defines the unique identifier of the NFT classification, + similar to the contract address of ERC721 + name: type: string - description: Result bytes, if any. - raw_log: + title: >- + name defines the human-readable name of the NFT classification. + Optional + symbol: type: string - description: |- - The output of the application's logger (raw string). May be - non-deterministic. - logs: - type: array - items: - type: object - properties: - msg_index: - type: integer - format: int64 - log: - type: string - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - value: - type: string - description: >- - Attribute defines an attribute wrapper where the - key and value are - - strings instead of raw bytes. - description: >- - StringEvent defines en Event object wrapper where all - the attributes - - contain key/value pairs that are strings instead of raw - bytes. - description: >- - Events contains a slice of Event objects that were emitted - during some - - execution. - description: >- - ABCIMessageLog defines a structure containing an indexed tx - ABCI message log. - description: >- - The output of the application's logger (typed). May be - non-deterministic. - info: + title: symbol is an abbreviated name for nft classification. Optional + description: type: string - description: Additional information. May be non-deterministic. - gas_wanted: + title: >- + description is a brief description of nft classification. + Optional + uri: type: string - format: int64 - description: Amount of gas requested for transaction. - gas_used: + title: >- + uri for the class metadata stored off chain. It can define + schema for Class and NFT `Data` attributes. Optional + uri_hash: type: string - format: int64 - description: Amount of gas consumed by transaction. - tx: - description: The request transaction bytes. + title: uri_hash is a hash of the document pointed by uri. Optional + data: + title: data is the app specific metadata of the NFT class. Optional type: object properties: '@type': @@ -60541,475 +62218,345 @@ definitions: used with implementation specific semantics. additionalProperties: {} - timestamp: - type: string description: >- - Time of the previous block. For heights > 1, it's the weighted - median of + `Any` contains an arbitrary serialized protocol buffer message + along with a - the timestamps of the valid votes in the block.LastCommit. For - height == 1, + URL that describes the type of the serialized message. - it's genesis time. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated - with an event. - description: >- - Event allows application developers to attach additional - information to - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. + Protobuf library provides support to pack/unpack Any values in + the form - Later, transactions may be queried using these events. - description: >- - Events defines all the events emitted by processing a - transaction. Note, + of utility functions or additional generated methods of the Any + type. - these events include those emitted by processing all the - messages and those - emitted from the ante. Whereas Logs contains the events, with + Example 1: Pack and unpack a message in C++. - additional metadata, emitted only by processing the messages. + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - description: >- - TxResponse defines a structure containing relevant tx data and - metadata. The + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - tags are stringified and the log is JSON decoded. - description: tx_responses is the list of queried TxResponses. - pagination: - description: |- - pagination defines a pagination for the response. - Deprecated post v0.46.x: use total instead. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + Example 3: Pack and unpack a message in Python. - was set, its value is undefined otherwise - total: - type: string - format: uint64 - title: total is total number of results available - description: |- - GetTxsEventResponse is the response type for the Service.TxsByEvents - RPC method. - cosmos.tx.v1beta1.ModeInfo: - type: object - properties: - single: - title: single represents a single signer - type: object - properties: - mode: - title: mode is the signing mode of the single signer - type: string - enum: - - SIGN_MODE_UNSPECIFIED - - SIGN_MODE_DIRECT - - SIGN_MODE_TEXTUAL - - SIGN_MODE_DIRECT_AUX - - SIGN_MODE_LEGACY_AMINO_JSON - - SIGN_MODE_EIP_191 - default: SIGN_MODE_UNSPECIFIED - description: >- - SignMode represents a signing mode with its own security - guarantees. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - This enum should be considered a registry of all known sign modes + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - in the Cosmos ecosystem. Apps are not expected to support all - known + The pack methods provided by protobuf library will by default + use - sign modes. Apps that would like to support custom sign modes are + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - encouraged to open a small PR against this file to add a new case + methods only use the fully qualified type name after the last + '/' - to this SignMode enum describing their sign mode so that different + in the type URL, for example "foo.bar.com/x/y.z" will yield type - apps have a consistent version of this enum. + name "y.z". - - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected. - - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - verified with raw bytes from Tx. - - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some - human-readable textual representation on top of the binary - representation - from SIGN_MODE_DIRECT. It is currently not supported. - - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses - SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode - does not - require signers signing over other signers' `signer_info`. It also - allows + JSON - for adding Tips in transactions. + ==== + The JSON representation of an `Any` value uses the regular - Since: cosmos-sdk 0.46 - - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - Amino JSON and will be removed in the future. - - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + representation of the deserialized, embedded message, with an + additional field `@type` which contains the type URL. Example: - Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum - variant, + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - but is not implemented on the SDK by default. To enable EIP-191, - you need + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - to pass a custom `TxConfig` that has an implementation of + If the embedded message type is well-known and has a custom JSON - `SignModeHandler` for EIP-191. The SDK may decide to fully support + representation, that representation will be embedded adding a + field - EIP-191 in the future. + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): - Since: cosmos-sdk 0.45.2 - multi: - $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo.Multi' - title: multi represents a nested multisig signer - description: ModeInfo describes the signing mode of a single or nested multisig signer. - cosmos.tx.v1beta1.ModeInfo.Multi: - type: object - properties: - bitarray: - title: bitarray specifies which keys within the multisig are signing + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: Class defines the class of the nft type. + description: class defines the class of the nft type. + pagination: + description: pagination defines the pagination in the response. type: object properties: - extra_bits_stored: - type: integer - format: int64 - elems: + next_key: type: string format: byte - description: >- - CompactBitArray is an implementation of a space efficient bit array. - - This is used to ensure that the encoded data takes up a minimal amount - of - - space after proto encoding. + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - This is not thread safe, and is not intended for concurrent usage. - mode_infos: - type: array - items: - type: object - $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' - title: |- - mode_infos is the corresponding modes of the signers of the multisig - which could include nested multisig public keys - title: Multi is the mode info for a multisig public key - cosmos.tx.v1beta1.ModeInfo.Single: + was set, its value is undefined otherwise + title: QueryClassesResponse is the response type for the Query/Classes RPC method + cosmos.nft.v1beta1.QueryNFTResponse: type: object properties: - mode: - title: mode is the signing mode of the single signer - type: string - enum: - - SIGN_MODE_UNSPECIFIED - - SIGN_MODE_DIRECT - - SIGN_MODE_TEXTUAL - - SIGN_MODE_DIRECT_AUX - - SIGN_MODE_LEGACY_AMINO_JSON - - SIGN_MODE_EIP_191 - default: SIGN_MODE_UNSPECIFIED - description: >- - SignMode represents a signing mode with its own security guarantees. + nft: + title: owner is the owner address of the nft + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract address + of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + protocol buffer message. This string must contain at least - This enum should be considered a registry of all known sign modes + one "/" character. The last segment of the URL's path must + represent - in the Cosmos ecosystem. Apps are not expected to support all known + the fully qualified name of the type (as in - sign modes. Apps that would like to support custom sign modes are + `path/google.protobuf.Duration`). The name should be in a + canonical form - encouraged to open a small PR against this file to add a new case + (e.g., leading "." is not accepted). - to this SignMode enum describing their sign mode so that different - apps have a consistent version of this enum. + In practice, teams usually precompile into the binary all + types that they - - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected. - - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - verified with raw bytes from Tx. - - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some - human-readable textual representation on top of the binary - representation + expect it to use in the context of Any. However, for URLs + which use the - from SIGN_MODE_DIRECT. It is currently not supported. - - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses - SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does - not + scheme `http`, `https`, or no scheme, one can optionally set + up a type - require signers signing over other signers' `signer_info`. It also - allows + server that maps type URLs to message definitions as follows: - for adding Tips in transactions. + * If no scheme is provided, `https` is assumed. - Since: cosmos-sdk 0.46 - - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - Amino JSON and will be removed in the future. - - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in the + official - Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + protobuf release, and it is not used for type URLs beginning + with - but is not implemented on the SDK by default. To enable EIP-191, you - need + type.googleapis.com. - to pass a custom `TxConfig` that has an implementation of - `SignModeHandler` for EIP-191. The SDK may decide to fully support + Schemes other than `http`, `https` (or the empty scheme) might + be - EIP-191 in the future. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + URL that describes the type of the serialized message. - Since: cosmos-sdk 0.45.2 - title: |- - Single is the mode info for a single signer. It is structured as a message - to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - future - cosmos.tx.v1beta1.OrderBy: - type: string - enum: - - ORDER_BY_UNSPECIFIED - - ORDER_BY_ASC - - ORDER_BY_DESC - default: ORDER_BY_UNSPECIFIED - description: >- - - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting - order. OrderBy defaults to ASC in this case. - - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order - - ORDER_BY_DESC: ORDER_BY_DESC defines descending order - title: OrderBy defines the sorting order - cosmos.tx.v1beta1.SignerInfo: - type: object - properties: - public_key: - description: >- - public_key is the public key of the signer. It is optional for - accounts - that already exist in state. If unset, the verifier can use the - required \ + Protobuf library provides support to pack/unpack Any values in the + form - signer address for this position and lookup the public key. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + of utility functions or additional generated methods of the Any + type. - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + Example 1: Pack and unpack a message in C++. - the fully qualified name of the type (as in + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - `path/google.protobuf.Duration`). The name should be in a - canonical form + Example 2: Pack and unpack a message in Java. - (e.g., leading "." is not accepted). + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. - In practice, teams usually precompile into the binary all types - that they + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - expect it to use in the context of Any. However, for URLs which - use the + Example 4: Pack and unpack a message in Go - scheme `http`, `https`, or no scheme, one can optionally set up a - type + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - server that maps type URLs to message definitions as follows: + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - * If no scheme is provided, `https` is assumed. + methods only use the fully qualified type name after the last '/' - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + in the type URL, for example "foo.bar.com/x/y.z" will yield type - Note: this functionality is not currently available in the - official + name "y.z". - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + JSON - Schemes other than `http`, `https` (or the empty scheme) might be + ==== - used with implementation specific semantics. - additionalProperties: {} - mode_info: - $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' - title: |- - mode_info describes the signing mode of the signer and is a nested - structure to support nested multisig pubkey's - sequence: - type: string - format: uint64 - description: >- - sequence is the sequence of the account, which describes the + The JSON representation of an `Any` value uses the regular - number of committed transactions signed by a given address. It is used - to + representation of the deserialized, embedded message, with an - prevent replay attacks. - description: |- - SignerInfo describes the public key and signing mode of a single top-level - signer. - cosmos.tx.v1beta1.SimulateRequest: - type: object - properties: - tx: - $ref: '#/definitions/cosmos.tx.v1beta1.Tx' - description: |- - tx is the transaction to simulate. - Deprecated. Send raw tx bytes instead. - tx_bytes: - type: string - format: byte - description: |- - tx_bytes is the raw transaction. + additional field `@type` which contains the type URL. Example: - Since: cosmos-sdk 0.43 - description: |- - SimulateRequest is the request type for the Service.Simulate - RPC method. - cosmos.tx.v1beta1.SimulateResponse: - type: object - properties: - gas_info: - description: gas_info is the information about gas used in the simulation. - type: object - properties: - gas_wanted: - type: string - format: uint64 - description: >- - GasWanted is the maximum units of work we allow this tx to - perform. - gas_used: - type: string - format: uint64 - description: GasUsed is the amount of gas actually consumed. - result: - description: result is the result of the simulation. - type: object - properties: - data: - type: string - format: byte - description: >- - Data is any data returned from message or handler execution. It - MUST be + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - length prefixed in order to separate data from multiple message - executions. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - Deprecated. This field is still populated, but prefer msg_response - instead + If the embedded message type is well-known and has a custom JSON - because it also contains the Msg response typeURL. - log: - type: string - description: >- - Log contains the log information from message or handler - execution. - events: - type: array - items: - type: object - properties: - type: - type: string - attributes: - type: array - items: - type: object - properties: - key: - type: string - format: byte - value: - type: string - format: byte - index: - type: boolean - title: nondeterministic - description: >- - EventAttribute is a single key-value pair, associated with - an event. - description: >- - Event allows application developers to attach additional - information to + representation, that representation will be embedded adding a + field - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. + `value` which holds the custom JSON in addition to the `@type` - Later, transactions may be queried using these events. - description: >- - Events contains a slice of Event objects that were emitted during - message + field. Example (for message [google.protobuf.Duration][]): - or handler execution. - msg_responses: - type: array - items: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: QueryNFTResponse is the response type for the Query/NFT RPC method + cosmos.nft.v1beta1.QueryNFTsResponse: + type: object + properties: + nfts: + type: array + items: + type: object + properties: + class_id: + type: string + title: >- + class_id associated with the NFT, similar to the contract + address of ERC721 + id: + type: string + title: id is a unique identifier of the NFT + uri: + type: string + title: uri for the NFT metadata stored off chain + uri_hash: + type: string + title: uri_hash is a hash of the document pointed by uri + data: + title: data is an app specific data of the NFT. Optional type: object properties: '@type': @@ -61172,258 +62719,588 @@ definitions: field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: NFT defines the NFT. + title: NFT defines the NFT + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + title: QueryNFTsResponse is the response type for the Query/NFTs RPC methods + cosmos.nft.v1beta1.QueryOwnerResponse: + type: object + properties: + owner: + type: string + title: owner is the owner address of the nft + title: QueryOwnerResponse is the response type for the Query/Owner RPC method + cosmos.nft.v1beta1.QuerySupplyResponse: + type: object + properties: + amount: + type: string + format: uint64 + title: amount is the number of all NFTs from the given class + title: QuerySupplyResponse is the response type for the Query/Supply RPC method + cosmos.params.v1beta1.ParamChange: + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: |- + ParamChange defines an individual parameter change, for use in + ParameterChangeProposal. + cosmos.params.v1beta1.QueryParamsResponse: + type: object + properties: + param: + description: param defines the queried parameter. + type: object + properties: + subspace: + type: string + key: + type: string + value: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + cosmos.params.v1beta1.QuerySubspacesResponse: + type: object + properties: + subspaces: + type: array + items: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: >- + Subspace defines a parameter subspace name and all the keys that + exist for + + the subspace. + + + Since: cosmos-sdk 0.46 + description: |- + QuerySubspacesResponse defines the response types for querying for all + registered subspaces and all keys for a subspace. + + Since: cosmos-sdk 0.46 + cosmos.params.v1beta1.Subspace: + type: object + properties: + subspace: + type: string + keys: + type: array + items: + type: string + description: |- + Subspace defines a parameter subspace name and all the keys that exist for + the subspace. + + Since: cosmos-sdk 0.46 + cosmos.slashing.v1beta1.MsgUnjailResponse: + type: object + title: MsgUnjailResponse defines the Msg/Unjail response type + cosmos.slashing.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.slashing.v1beta1.Params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: Params represents the parameters used for by the slashing module. + cosmos.slashing.v1beta1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + signed_blocks_window: + type: string + format: int64 + min_signed_per_window: + type: string + format: byte + downtime_jail_duration: + type: string + slash_fraction_double_sign: + type: string + format: byte + slash_fraction_downtime: + type: string + format: byte + description: Params represents the parameters used for by the slashing module. + title: QueryParamsResponse is the response type for the Query/Params RPC method + cosmos.slashing.v1beta1.QuerySigningInfoResponse: + type: object + properties: + val_signing_info: + title: val_signing_info is the signing info of requested val cons address + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded + + in a block and may have signed a precommit or not. This in + conjunction with the + + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set + + once the validator commits an equivocation or for any other + configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 description: >- - msg_responses contains the Msg handler responses type packed in - Anys. + A counter kept to avoid unnecessary array reads. + + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for monitoring + their + liveness activity. + title: >- + QuerySigningInfoResponse is the response type for the Query/SigningInfo + RPC - Since: cosmos-sdk 0.46 - description: |- - SimulateResponse is the response type for the - Service.SimulateRPC method. - cosmos.tx.v1beta1.Tip: + method + cosmos.slashing.v1beta1.QuerySigningInfosResponse: type: object properties: - amount: + info: type: array items: type: object properties: - denom: + address: type: string - amount: + start_height: type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - title: amount is the amount of the tip - tipper: - type: string - title: tipper is the address of the account paying for the tip - description: |- - Tip is the tip used for meta-transactions. - - Since: cosmos-sdk 0.46 - cosmos.tx.v1beta1.Tx: - type: object - properties: - body: - title: body is the processable content of the transaction - type: object - properties: - messages: - type: array - items: - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all - types that they - - expect it to use in the context of Any. However, for URLs - which use the - - scheme `http`, `https`, or no scheme, one can optionally set - up a type - - server that maps type URLs to message definitions as - follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official - - protobuf release, and it is not used for type URLs beginning - with - - type.googleapis.com. - - - Schemes other than `http`, `https` (or the empty scheme) - might be - - used with implementation specific semantics. - additionalProperties: {} + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". + Index which is incremented each time the validator was a bonded + in a block and may have signed a precommit or not. This in + conjunction with the + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set - JSON + once the validator commits an equivocation or for any other + configured misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. - ==== + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for + monitoring their - The JSON representation of an `Any` value uses the regular + liveness activity. + title: info is the signing info of all validators + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - representation of the deserialized, embedded message, with an + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. - additional field `@type` which contains the type URL. Example: + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + title: >- + QuerySigningInfosResponse is the response type for the Query/SigningInfos + RPC - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + method + cosmos.slashing.v1beta1.ValidatorSigningInfo: + type: object + properties: + address: + type: string + start_height: + type: string + format: int64 + title: Height at which validator was first a candidate OR was unjailed + index_offset: + type: string + format: int64 + description: >- + Index which is incremented each time the validator was a bonded - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + in a block and may have signed a precommit or not. This in conjunction + with the - If the embedded message type is well-known and has a custom JSON + `SignedBlocksWindow` param determines the index in the + `MissedBlocksBitArray`. + jailed_until: + type: string + format: date-time + description: >- + Timestamp until which the validator is jailed due to liveness + downtime. + tombstoned: + type: boolean + description: >- + Whether or not a validator has been tombstoned (killed out of + validator set). It is set - representation, that representation will be embedded adding a - field + once the validator commits an equivocation or for any other configured + misbehiavor. + missed_blocks_counter: + type: string + format: int64 + description: >- + A counter kept to avoid unnecessary array reads. - `value` which holds the custom JSON in addition to the `@type` + Note that `Sum(MissedBlocksBitArray)` always equals + `MissedBlocksCounter`. + description: >- + ValidatorSigningInfo defines a validator's signing info for monitoring + their - field. Example (for message [google.protobuf.Duration][]): + liveness activity. + cosmos.staking.v1beta1.BondStatus: + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + description: |- + BondStatus is the status of a validator. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + - BOND_STATUS_UNSPECIFIED: UNSPECIFIED defines an invalid validator status. + - BOND_STATUS_UNBONDED: UNBONDED defines a validator that is not bonded. + - BOND_STATUS_UNBONDING: UNBONDING defines a validator that is unbonding. + - BOND_STATUS_BONDED: BONDED defines a validator that is bonded. + cosmos.staking.v1beta1.Commission: + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be used for + creating a validator. + type: object + properties: + rate: + type: string + description: rate is the commission rate charged to delegators, as a fraction. + max_rate: + type: string description: >- - messages is a list of messages to be executed. The required - signers of - - those messages define the number and order of elements in - AuthInfo's - - signer_infos and Tx's signatures. Each required signer address is - added to + max_rate defines the maximum commission rate which validator can + ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + description: Commission defines commission parameters for a given validator. + cosmos.staking.v1beta1.CommissionRates: + type: object + properties: + rate: + type: string + description: rate is the commission rate charged to delegators, as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator can ever + charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the validator + commission, as a fraction. + description: >- + CommissionRates defines the initial commission rates to be used for + creating - the list only the first time it occurs. + a validator. + cosmos.staking.v1beta1.Delegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + shares: + type: string + description: shares define the delegation shares received. + description: |- + Delegation represents the bond with tokens held by an account. It is + owned by one delegator, and is associated with the voting power of one + validator. + cosmos.staking.v1beta1.DelegationResponse: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + shares: + type: string + description: shares define the delegation shares received. + description: |- + Delegation represents the bond with tokens held by an account. It is + owned by one delegator, and is associated with the voting power of one + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. - By convention, the first required signer (usually from the first - message) + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: |- + DelegationResponse is equivalent to Delegation except that it contains a + balance in addition to shares which is more suitable for client responses. + cosmos.staking.v1beta1.Description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: security_contact defines an optional email for security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + cosmos.staking.v1beta1.HistoricalInfo: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, - is referred to as the primary signer and pays the fee for the - whole + including all blockchain data structures and the rules of the + application's - transaction. - memo: + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: type: string - description: >- - memo is any arbitrary note/comment to be added to the transaction. - - WARNING: in clients, any publicly exposed text should not be - called memo, - - but should be called `note` instead (see - https://github.com/cosmos/cosmos-sdk/issues/9122). - timeout_height: + format: byte + title: transactions + validators_hash: type: string - format: uint64 - title: |- - timeout is the block height after which this transaction will not - be processed by the chain - extension_options: - type: array - items: + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the validator, + as a Protobuf Any. type: object properties: '@type': @@ -61484,123 +63361,632 @@ definitions: used with implementation specific semantics. additionalProperties: {} + jailed: + type: boolean description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. - URL that describes the type of the serialized message. + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the - Protobuf library provides support to pack/unpack Any values in - the form + Validator's bond shares and their exchange rate to coins. Slashing + results in - of utility functions or additional generated methods of the Any - type. + a decrease in the exchange rate, allowing correct calculation of + future + undelegations without iterating over delegators. When coins are + delegated to - Example 1: Pack and unpack a message in C++. + this validator, the validator is credited with a delegation whose + number of - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + bond shares is based on the amount of coins delegated divided by the + current - Example 2: Pack and unpack a message in Java. + exchange rate. Voting power can be calculated as total bonded shares - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + multiplied by exchange rate. + description: >- + HistoricalInfo contains header and validator information for a given + block. - Example 3: Pack and unpack a message in Python. + It is stored as part of staking module's state, which persists the `n` + most - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + recent HistoricalInfo + + (`n` is set by the staking module's `historical_entries` parameter). + cosmos.staking.v1beta1.MsgBeginRedelegateResponse: + type: object + properties: + completion_time: + type: string + format: date-time + description: MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. + cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse: + type: object + description: 'Since: cosmos-sdk 0.46' + title: MsgCancelUnbondingDelegationResponse + cosmos.staking.v1beta1.MsgCreateValidatorResponse: + type: object + description: MsgCreateValidatorResponse defines the Msg/CreateValidator response type. + cosmos.staking.v1beta1.MsgDelegateResponse: + type: object + description: MsgDelegateResponse defines the Msg/Delegate response type. + cosmos.staking.v1beta1.MsgEditValidatorResponse: + type: object + description: MsgEditValidatorResponse defines the Msg/EditValidator response type. + cosmos.staking.v1beta1.MsgUndelegateResponse: + type: object + properties: + completion_time: + type: string + format: date-time + description: MsgUndelegateResponse defines the Msg/Undelegate response type. + cosmos.staking.v1beta1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + cosmos.staking.v1beta1.Params: + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding delegation or + redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: historical_entries is the number of historical entries to persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission rate that a + validator can charge their delegators + description: Params defines the parameters for the x/staking module. + cosmos.staking.v1beta1.Pool: + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: |- + Pool is used for tracking bonded and not-bonded token supply of the bond + denomination. + cosmos.staking.v1beta1.QueryDelegationResponse: + type: object + properties: + delegation_response: + description: delegation_responses defines the delegation info of a delegation. + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. It + is + + owned by one delegator, and is associated with the voting power of + one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + QueryDelegationResponse is response type for the Query/Delegation RPC + method. + cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse: + type: object + properties: + delegation_responses: + type: array + items: + type: object + properties: + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. + description: >- + Delegation represents the bond with tokens held by an account. + It is + + owned by one delegator, and is associated with the voting power + of one + + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for client + responses. + description: delegation_responses defines all the delegations' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryDelegatorDelegationsResponse is response type for the + Query/DelegatorDelegations RPC method. + cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries + description: >- + UnbondingDelegation stores all of a single delegator's unbonding + bonds + + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + QueryUnbondingDelegatorDelegationsResponse is response type for the + Query/UnbondingDelegatorDelegations RPC method. + cosmos.staking.v1beta1.QueryDelegatorValidatorResponse: + type: object + properties: + validator: + description: validator defines the validator info. + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; + bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the validator, as + a Protobuf Any. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - Example 4: Pack and unpack a message in Go + protocol buffer message. This string must contain at least - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + one "/" character. The last segment of the URL's path must + represent - The pack methods provided by protobuf library will by default - use + the fully qualified name of the type (as in - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + `path/google.protobuf.Duration`). The name should be in a + canonical form - methods only use the fully qualified type name after the last - '/' + (e.g., leading "." is not accepted). - in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + In practice, teams usually precompile into the binary all + types that they + expect it to use in the context of Any. However, for URLs + which use the + scheme `http`, `https`, or no scheme, one can optionally set + up a type - JSON + server that maps type URLs to message definitions as follows: - ==== - The JSON representation of an `Any` value uses the regular + * If no scheme is provided, `https` is assumed. - representation of the deserialized, embedded message, with an + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - additional field `@type` which contains the type URL. Example: + Note: this functionality is not currently available in the + official - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + protobuf release, and it is not used for type URLs beginning + with - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + type.googleapis.com. - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a - field + Schemes other than `http`, `https` (or the empty scheme) might + be - `value` which holds the custom JSON in addition to the `@type` + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 title: >- - extension_options are arbitrary options that can be added by - chains - - when the default options are not sufficient. If any of these are - present - - and can't be handled, the transaction will be rejected - non_critical_extension_options: + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: type: array items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: |- + QueryDelegatorValidatorResponse response type for the + Query/DelegatorValidator RPC method. + cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse: + type: object + properties: + validators: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the validator, + as a Protobuf Any. type: object properties: '@type': @@ -61661,794 +64047,1668 @@ definitions: used with implementation specific semantics. additionalProperties: {} + jailed: + type: boolean description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in - the form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default - use - - 'type.googleapis.com/full.type.name' as the type URL and the - unpack - - methods only use the fully qualified type name after the last - '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a - field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - extension_options are arbitrary options that can be added by - chains - - when the default options are not sufficient. If any of these are - present - - and can't be handled, they will be ignored - description: TxBody is the body of a transaction that all signers sign over. - auth_info: - $ref: '#/definitions/cosmos.tx.v1beta1.AuthInfo' - title: |- - auth_info is the authorization related content of the transaction, - specifically signers, signer modes and fee - signatures: - type: array - items: - type: string - format: byte - description: >- - signatures is a list of signatures that matches the length and order - of - - AuthInfo's signer_infos to allow connecting signature meta information - like - - public key and signing mode by position. - description: Tx is the standard type used for broadcasting transactions. - cosmos.tx.v1beta1.TxBody: - type: object - properties: - messages: - type: array - items: - type: object - properties: - '@type': + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: type: string description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up - a type + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. - server that maps type URLs to message definitions as follows: + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the - * If no scheme is provided, `https` is assumed. + Validator's bond shares and their exchange rate to coins. Slashing + results in - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + a decrease in the exchange rate, allowing correct calculation of + future - Note: this functionality is not currently available in the - official + undelegations without iterating over delegators. When coins are + delegated to - protobuf release, and it is not used for type URLs beginning - with + this validator, the validator is credited with a delegation whose + number of - type.googleapis.com. + bond shares is based on the amount of coins delegated divided by the + current + exchange rate. Voting power can be calculated as total bonded shares - Schemes other than `http`, `https` (or the empty scheme) might - be + multiplied by exchange rate. + description: validators defines the validators' info of a delegator. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + was set, its value is undefined otherwise + description: |- + QueryDelegatorValidatorsResponse is response type for the + Query/DelegatorValidators RPC method. + cosmos.staking.v1beta1.QueryHistoricalInfoResponse: + type: object + properties: + hist: + description: hist defines the historical info at the given height. + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, - URL that describes the type of the serialized message. + including all blockchain data structures and the rules of the + application's + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + valset: + type: array + items: + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the + validator, as a Protobuf Any. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized - Protobuf library provides support to pack/unpack Any values in the - form + protocol buffer message. This string must contain at + least - of utility functions or additional generated methods of the Any - type. + one "/" character. The last segment of the URL's path + must represent + the fully qualified name of the type (as in - Example 1: Pack and unpack a message in C++. + `path/google.protobuf.Duration`). The name should be in + a canonical form - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + (e.g., leading "." is not accepted). - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + In practice, teams usually precompile into the binary + all types that they - Example 3: Pack and unpack a message in Python. + expect it to use in the context of Any. However, for + URLs which use the - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + scheme `http`, `https`, or no scheme, one can optionally + set up a type - Example 4: Pack and unpack a message in Go + server that maps type URLs to message definitions as + follows: - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - The pack methods provided by protobuf library will by default use + * If no scheme is provided, `https` is assumed. - 'type.googleapis.com/full.type.name' as the type URL and the unpack + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - methods only use the fully qualified type name after the last '/' + Note: this functionality is not currently available in + the official - in the type URL, for example "foo.bar.com/x/y.z" will yield type + protobuf release, and it is not used for type URLs + beginning with - name "y.z". + type.googleapis.com. + Schemes other than `http`, `https` (or the empty scheme) + might be - JSON + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from + bonded status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which + this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to + be used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, + as a fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase + of the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. - ==== - The JSON representation of an `Any` value uses the regular + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been + stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding + of this validator + description: >- + Validator defines a validator, together with the total amount of + the - representation of the deserialized, embedded message, with an + Validator's bond shares and their exchange rate to coins. + Slashing results in - additional field `@type` which contains the type URL. Example: + a decrease in the exchange rate, allowing correct calculation of + future - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + undelegations without iterating over delegators. When coins are + delegated to - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + this validator, the validator is credited with a delegation + whose number of - If the embedded message type is well-known and has a custom JSON + bond shares is based on the amount of coins delegated divided by + the current - representation, that representation will be embedded adding a field + exchange rate. Voting power can be calculated as total bonded + shares - `value` which holds the custom JSON in addition to the `@type` + multiplied by exchange rate. + description: >- + QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo + RPC - field. Example (for message [google.protobuf.Duration][]): + method. + cosmos.staking.v1beta1.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + unbonding_time: + type: string + description: unbonding_time is the time duration of unbonding. + max_validators: + type: integer + format: int64 + description: max_validators is the maximum number of validators. + max_entries: + type: integer + format: int64 + description: >- + max_entries is the max entries for either unbonding delegation or + redelegation (per pair/trio). + historical_entries: + type: integer + format: int64 + description: historical_entries is the number of historical entries to persist. + bond_denom: + type: string + description: bond_denom defines the bondable coin denomination. + min_commission_rate: + type: string + title: >- + min_commission_rate is the chain-wide minimum commission rate that + a validator can charge their delegators + description: QueryParamsResponse is response type for the Query/Params RPC method. + cosmos.staking.v1beta1.QueryPoolResponse: + type: object + properties: + pool: + description: pool defines the pool info. + type: object + properties: + not_bonded_tokens: + type: string + bonded_tokens: + type: string + description: QueryPoolResponse is response type for the Query/Pool RPC method. + cosmos.staking.v1beta1.QueryRedelegationsResponse: + type: object + properties: + redelegation_responses: + type: array + items: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source + operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation + destination operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator + shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + RedelegationEntry defines a redelegation object with + relevant metadata. + description: |- + entries are the redelegation entries. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - messages is a list of messages to be executed. The required signers of + redelegation entries + description: >- + Redelegation contains the list of a particular delegator's + redelegating bonds - those messages define the number and order of elements in AuthInfo's + from a particular source validator to a particular destination + validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the + redelegation took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator + shares created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + RedelegationEntry defines a redelegation object with + relevant metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry + except that it - signer_infos and Tx's signatures. Each required signer address is - added to + contains a balance in addition to shares which is more + suitable for client - the list only the first time it occurs. + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except that its + entries - By convention, the first required signer (usually from the first - message) + contain a balance in addition to shares which is more suitable for + client - is referred to as the primary signer and pays the fee for the whole + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - transaction. - memo: - type: string - description: >- - memo is any arbitrary note/comment to be added to the transaction. + was set, its value is undefined otherwise + description: >- + QueryRedelegationsResponse is response type for the Query/Redelegations + RPC - WARNING: in clients, any publicly exposed text should not be called - memo, + method. + cosmos.staking.v1beta1.QueryUnbondingDelegationResponse: + type: object + properties: + unbond: + description: unbond defines the unbonding information of a delegation. + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: |- + entries are the unbonding delegation entries. - but should be called `note` instead (see - https://github.com/cosmos/cosmos-sdk/issues/9122). - timeout_height: - type: string - format: uint64 - title: |- - timeout is the block height after which this transaction will not - be processed by the chain - extension_options: + unbonding delegation entries + description: |- + QueryDelegationResponse is response type for the Query/UnbondingDelegation + RPC method. + cosmos.staking.v1beta1.QueryValidatorDelegationsResponse: + type: object + properties: + delegation_responses: type: array items: type: object properties: - '@type': - type: string + delegation: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + shares: + type: string + description: shares define the delegation shares received. description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up - a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official + Delegation represents the bond with tokens held by an account. + It is - protobuf release, and it is not used for type URLs beginning - with + owned by one delegator, and is associated with the voting power + of one - type.googleapis.com. + validator. + balance: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - Schemes other than `http`, `https` (or the empty scheme) might - be + NOTE: The amount field is an Int which implements the custom + method - used with implementation specific semantics. - additionalProperties: {} + signatures required by gogoproto. description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any - type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. + DelegationResponse is equivalent to Delegation except that it + contains a - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + balance in addition to shares which is more suitable for client + responses. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - Example 3: Pack and unpack a message in Python. + was set, its value is undefined otherwise + title: |- + QueryValidatorDelegationsResponse is response type for the + Query/ValidatorDelegations RPC method + cosmos.staking.v1beta1.QueryValidatorResponse: + type: object + properties: + validator: + description: validator defines the validator info. + type: object + properties: + operator_address: + type: string + description: >- + operator_address defines the address of the validator's operator; + bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the validator, as + a Protobuf Any. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + protocol buffer message. This string must contain at least - Example 4: Pack and unpack a message in Go + one "/" character. The last segment of the URL's path must + represent - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + the fully qualified name of the type (as in - The pack methods provided by protobuf library will by default use + `path/google.protobuf.Duration`). The name should be in a + canonical form - 'type.googleapis.com/full.type.name' as the type URL and the unpack + (e.g., leading "." is not accepted). - methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + In practice, teams usually precompile into the binary all + types that they - name "y.z". + expect it to use in the context of Any. However, for URLs + which use the + scheme `http`, `https`, or no scheme, one can optionally set + up a type + server that maps type URLs to message definitions as follows: - JSON - ==== + * If no scheme is provided, `https` is assumed. - The JSON representation of an `Any` value uses the regular + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - representation of the deserialized, embedded message, with an + Note: this functionality is not currently available in the + official - additional field `@type` which contains the type URL. Example: + protobuf release, and it is not used for type URLs beginning + with - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + type.googleapis.com. - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom JSON + Schemes other than `http`, `https` (or the empty scheme) might + be - representation, that representation will be embedded adding a field + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + title: QueryValidatorResponse is response type for the Query/Validator RPC method + cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse: + type: object + properties: + unbonding_responses: + type: array + items: + type: object + properties: + delegator_address: + type: string + description: >- + delegator_address is the bech32-encoded address of the + delegator. + validator_address: + type: string + description: >- + validator_address is the bech32-encoded address of the + validator. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height is the height which the unbonding took + place. + completion_time: + type: string + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been + stopped by external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with + relevant metadata. + description: |- + entries are the unbonding delegation entries. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - extension_options are arbitrary options that can be added by chains + unbonding delegation entries + description: >- + UnbondingDelegation stores all of a single delegator's unbonding + bonds - when the default options are not sufficient. If any of these are - present + for a single validator in an time-ordered list. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - and can't be handled, the transaction will be rejected - non_critical_extension_options: + was set, its value is undefined otherwise + description: |- + QueryValidatorUnbondingDelegationsResponse is response type for the + Query/ValidatorUnbondingDelegations RPC method. + cosmos.staking.v1beta1.QueryValidatorsResponse: + type: object + properties: + validators: type: array items: type: object properties: - '@type': + operator_address: type: string description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they - - expect it to use in the context of Any. However, for URLs which - use the - - scheme `http`, `https`, or no scheme, one can optionally set up - a type - - server that maps type URLs to message definitions as follows: - - - * If no scheme is provided, `https` is assumed. - - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) - - Note: this functionality is not currently available in the - official + operator_address defines the address of the validator's + operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the validator, + as a Protobuf Any. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - protobuf release, and it is not used for type URLs beginning - with + protocol buffer message. This string must contain at least - type.googleapis.com. + one "/" character. The last segment of the URL's path must + represent + the fully qualified name of the type (as in - Schemes other than `http`, `https` (or the empty scheme) might - be + `path/google.protobuf.Duration`). The name should be in a + canonical form - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + (e.g., leading "." is not accepted). - URL that describes the type of the serialized message. + In practice, teams usually precompile into the binary all + types that they - Protobuf library provides support to pack/unpack Any values in the - form + expect it to use in the context of Any. However, for URLs + which use the - of utility functions or additional generated methods of the Any - type. + scheme `http`, `https`, or no scheme, one can optionally set + up a type + server that maps type URLs to message definitions as + follows: - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + * If no scheme is provided, `https` is assumed. - Example 2: Pack and unpack a message in Java. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Note: this functionality is not currently available in the + official - Example 3: Pack and unpack a message in Python. + protobuf release, and it is not used for type URLs beginning + with - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + type.googleapis.com. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Schemes other than `http`, `https` (or the empty scheme) + might be - The pack methods provided by protobuf library will by default use + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the + validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be + used for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which + validator can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of + the validator commission, as a fraction. + update_time: + type: string + format: date-time + description: >- + update_time is the last time the commission rate was + changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum + self delegation. - 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped + by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of + this validator + description: >- + Validator defines a validator, together with the total amount of the - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Validator's bond shares and their exchange rate to coins. Slashing + results in - name "y.z". + a decrease in the exchange rate, allowing correct calculation of + future + undelegations without iterating over delegators. When coins are + delegated to + this validator, the validator is credited with a delegation whose + number of - JSON + bond shares is based on the amount of coins delegated divided by the + current - ==== + exchange rate. Voting power can be calculated as total bonded shares - The JSON representation of an `Any` value uses the regular + multiplied by exchange rate. + description: validators contains all the queried validators. + pagination: + description: pagination defines the pagination in the response. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total - representation of the deserialized, embedded message, with an + was set, its value is undefined otherwise + title: >- + QueryValidatorsResponse is response type for the Query/Validators RPC + method + cosmos.staking.v1beta1.Redelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source operator + address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation destination + operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation took + place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when redelegation + started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created + by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: |- + entries are the redelegation entries. - additional field `@type` which contains the type URL. Example: + redelegation entries + description: >- + Redelegation contains the list of a particular delegator's redelegating + bonds - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + from a particular source validator to a particular destination validator. + cosmos.staking.v1beta1.RedelegationEntry: + type: object + properties: + creation_height: + type: string + format: int64 + description: creation_height defines the height which the redelegation took place. + completion_time: + type: string + format: date-time + description: completion_time defines the unix time for redelegation completion. + initial_balance: + type: string + description: initial_balance defines the initial balance when redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created by + redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: RedelegationEntry defines a redelegation object with relevant metadata. + cosmos.staking.v1beta1.RedelegationEntryResponse: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation took + place. + completion_time: + type: string + format: date-time + description: completion_time defines the unix time for redelegation completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when redelegation + started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares created + by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry except that + it - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + contains a balance in addition to shares which is more suitable for client - If the embedded message type is well-known and has a custom JSON + responses. + cosmos.staking.v1beta1.RedelegationResponse: + type: object + properties: + redelegation: + type: object + properties: + delegator_address: + type: string + description: delegator_address is the bech32-encoded address of the delegator. + validator_src_address: + type: string + description: >- + validator_src_address is the validator redelegation source + operator address. + validator_dst_address: + type: string + description: >- + validator_dst_address is the validator redelegation destination + operator address. + entries: + type: array + items: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares + created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + description: |- + entries are the redelegation entries. - representation, that representation will be embedded adding a field + redelegation entries + description: >- + Redelegation contains the list of a particular delegator's + redelegating bonds - `value` which holds the custom JSON in addition to the `@type` + from a particular source validator to a particular destination + validator. + entries: + type: array + items: + type: object + properties: + redelegation_entry: + type: object + properties: + creation_height: + type: string + format: int64 + description: >- + creation_height defines the height which the redelegation + took place. + completion_time: + type: string + format: date-time + description: >- + completion_time defines the unix time for redelegation + completion. + initial_balance: + type: string + description: >- + initial_balance defines the initial balance when + redelegation started. + shares_dst: + type: string + description: >- + shares_dst is the amount of destination-validator shares + created by redelegation. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped + by external modules + description: >- + RedelegationEntry defines a redelegation object with relevant + metadata. + balance: + type: string + description: >- + RedelegationEntryResponse is equivalent to a RedelegationEntry + except that it - field. Example (for message [google.protobuf.Duration][]): + contains a balance in addition to shares which is more suitable for + client - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - title: >- - extension_options are arbitrary options that can be added by chains + responses. + description: >- + RedelegationResponse is equivalent to a Redelegation except that its + entries - when the default options are not sufficient. If any of these are - present + contain a balance in addition to shares which is more suitable for client - and can't be handled, they will be ignored - description: TxBody is the body of a transaction that all signers sign over. - tendermint.abci.Event: + responses. + cosmos.staking.v1beta1.UnbondingDelegation: type: object properties: - type: + delegator_address: type: string - attributes: + description: delegator_address is the bech32-encoded address of the delegator. + validator_address: + type: string + description: validator_address is the bech32-encoded address of the validator. + entries: type: array items: type: object properties: - key: + creation_height: type: string - format: byte - value: + format: int64 + description: creation_height is the height which the unbonding took place. + completion_time: type: string - format: byte - index: - type: boolean - title: nondeterministic - description: EventAttribute is a single key-value pair, associated with an event. - description: >- - Event allows application developers to attach additional information to - - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: + type: string + description: >- + initial_balance defines the tokens initially scheduled to + receive at completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: + type: string + format: uint64 + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with relevant + metadata. + description: |- + entries are the unbonding delegation entries. - Later, transactions may be queried using these events. - tendermint.abci.EventAttribute: + unbonding delegation entries + description: |- + UnbondingDelegation stores all of a single delegator's unbonding bonds + for a single validator in an time-ordered list. + cosmos.staking.v1beta1.UnbondingDelegationEntry: type: object properties: - key: + creation_height: type: string - format: byte - value: + format: int64 + description: creation_height is the height which the unbonding took place. + completion_time: type: string - format: byte - index: - type: boolean - title: nondeterministic - description: EventAttribute is a single key-value pair, associated with an event. - cosmos.upgrade.v1beta1.ModuleVersion: - type: object - properties: - name: + format: date-time + description: completion_time is the unix time for unbonding completion. + initial_balance: type: string - title: name of the app module - version: + description: >- + initial_balance defines the tokens initially scheduled to receive at + completion. + balance: + type: string + description: balance defines the tokens to receive at completion. + unbonding_id: type: string format: uint64 - title: consensus version of the app module - description: |- - ModuleVersion specifies a module and its consensus version. - - Since: cosmos-sdk 0.43 - cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse: - type: object - description: |- - MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. - - Since: cosmos-sdk 0.46 - cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse: - type: object - description: |- - MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. - - Since: cosmos-sdk 0.46 - cosmos.upgrade.v1beta1.Plan: + title: Incrementing id that uniquely identifies this entry + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + Strictly positive if this entry's unbonding has been stopped by + external modules + description: >- + UnbondingDelegationEntry defines an unbonding object with relevant + metadata. + cosmos.staking.v1beta1.Validator: type: object properties: - name: - type: string - description: >- - Sets the name for the upgrade. This name will be used by the upgraded - - version of the software to apply any special "on-upgrade" commands - during - - the first BeginBlock method after the upgrade is applied. It is also - used - - to detect whether a software version can handle a given upgrade. If no - - upgrade handler with this name has been set in the software, it will - be - - assumed that the software is out-of-date when the upgrade Time or - Height is - - reached and the software will exit. - time: + operator_address: type: string - format: date-time description: >- - Deprecated: Time based upgrades have been deprecated. Time based - upgrade logic - - has been removed from the SDK. - - If this field is not empty, an error will be thrown. - height: - type: string - format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. - info: - type: string - title: |- - Any application specific upgrade info to be included on-chain - such as a git commit that validators could automatically upgrade to - upgraded_client_state: + operator_address defines the address of the validator's operator; bech + encoded in JSON. + consensus_pubkey: description: >- - Deprecated: UpgradedClientState field has been deprecated. IBC upgrade - logic has been - - moved to the IBC module in the sub module 02-client. - - If this field is not empty, an error will be thrown. + consensus_pubkey is the consensus public key of the validator, as a + Protobuf Any. type: object properties: '@type': @@ -62504,1407 +65764,1695 @@ definitions: used with implementation specific semantics. additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed from bonded + status or not. + status: + description: status is the validator status (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: tokens define the delegated tokens (incl. self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a validator's + delegators. + description: + description: description defines the description terms for the validator. + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: security_contact defines an optional email for security contact. + details: + type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height at which this + validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time for the validator + to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: + description: >- + commission_rates defines the initial commission rates to be used + for creating a validator. + type: object + properties: + rate: + type: string + description: >- + rate is the commission rate charged to delegators, as a + fraction. + max_rate: + type: string + description: >- + max_rate defines the maximum commission rate which validator + can ever charge, as a fraction. + max_change_rate: + type: string + description: >- + max_change_rate defines the maximum daily increase of the + validator commission, as a fraction. + update_time: + type: string + format: date-time + description: update_time is the last time the commission rate was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared minimum self + delegation. + + + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has been stopped by + external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an unbonding of this + validator description: >- - Plan specifies information about a planned upgrade and when it should - occur. - cosmos.upgrade.v1beta1.QueryAppliedPlanResponse: + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing results + in + + a decrease in the exchange rate, allowing correct calculation of future + + undelegations without iterating over delegators. When coins are delegated + to + + this validator, the validator is credited with a delegation whose number + of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. + cosmos.base.abci.v1beta1.ABCIMessageLog: type: object properties: - height: - type: string + msg_index: + type: integer format: int64 - description: height is the block height at which the plan was applied. - description: >- - QueryAppliedPlanResponse is the response type for the Query/AppliedPlan - RPC + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key and value + are - method. - cosmos.upgrade.v1beta1.QueryAuthorityResponse: + strings instead of raw bytes. + description: |- + StringEvent defines en Event object wrapper where all the attributes + contain key/value pairs that are strings instead of raw bytes. + description: |- + Events contains a slice of Event objects that were emitted during some + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI message + log. + cosmos.base.abci.v1beta1.Attribute: type: object properties: - address: + key: type: string - description: 'Since: cosmos-sdk 0.46' - title: QueryAuthorityResponse is the response type for Query/Authority - cosmos.upgrade.v1beta1.QueryCurrentPlanResponse: + value: + type: string + description: |- + Attribute defines an attribute wrapper where the key and value are + strings instead of raw bytes. + cosmos.base.abci.v1beta1.GasInfo: type: object properties: - plan: - description: plan is the current upgrade plan. - type: object - properties: - name: - type: string - description: >- - Sets the name for the upgrade. This name will be used by the - upgraded + gas_wanted: + type: string + format: uint64 + description: GasWanted is the maximum units of work we allow this tx to perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + description: GasInfo defines tx execution gas context. + cosmos.base.abci.v1beta1.Result: + type: object + properties: + data: + type: string + format: byte + description: >- + Data is any data returned from message or handler execution. It MUST + be - version of the software to apply any special "on-upgrade" commands - during + length prefixed in order to separate data from multiple message + executions. - the first BeginBlock method after the upgrade is applied. It is - also used + Deprecated. This field is still populated, but prefer msg_response + instead - to detect whether a software version can handle a given upgrade. - If no + because it also contains the Msg response typeURL. + log: + type: string + description: Log contains the log information from message or handler execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with an + event. + description: >- + Event allows application developers to attach additional information + to - upgrade handler with this name has been set in the software, it - will be + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - assumed that the software is out-of-date when the upgrade Time or - Height is + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted during + message - reached and the software will exit. - time: - type: string - format: date-time - description: >- - Deprecated: Time based upgrades have been deprecated. Time based - upgrade logic + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - has been removed from the SDK. + protocol buffer message. This string must contain at least - If this field is not empty, an error will be thrown. - height: - type: string - format: int64 - description: |- - The height at which the upgrade must be performed. - Only used if Time is not set. - info: - type: string - title: >- - Any application specific upgrade info to be included on-chain + one "/" character. The last segment of the URL's path must + represent - such as a git commit that validators could automatically upgrade - to - upgraded_client_state: - description: >- - Deprecated: UpgradedClientState field has been deprecated. IBC - upgrade logic has been + the fully qualified name of the type (as in - moved to the IBC module in the sub module 02-client. + `path/google.protobuf.Duration`). The name should be in a + canonical form - If this field is not empty, an error will be thrown. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + (e.g., leading "." is not accepted). - protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + In practice, teams usually precompile into the binary all types + that they - the fully qualified name of the type (as in + expect it to use in the context of Any. However, for URLs which + use the - `path/google.protobuf.Duration`). The name should be in a - canonical form + scheme `http`, `https`, or no scheme, one can optionally set up + a type - (e.g., leading "." is not accepted). + server that maps type URLs to message definitions as follows: - In practice, teams usually precompile into the binary all - types that they + * If no scheme is provided, `https` is assumed. - expect it to use in the context of Any. However, for URLs - which use the + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - scheme `http`, `https`, or no scheme, one can optionally set - up a type + Note: this functionality is not currently available in the + official - server that maps type URLs to message definitions as follows: + protobuf release, and it is not used for type URLs beginning + with + type.googleapis.com. - * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + Schemes other than `http`, `https` (or the empty scheme) might + be - Note: this functionality is not currently available in the - official + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - protobuf release, and it is not used for type URLs beginning - with + URL that describes the type of the serialized message. - type.googleapis.com. + Protobuf library provides support to pack/unpack Any values in the + form - Schemes other than `http`, `https` (or the empty scheme) might - be + of utility functions or additional generated methods of the Any + type. - used with implementation specific semantics. - additionalProperties: {} - description: >- - QueryCurrentPlanResponse is the response type for the Query/CurrentPlan - RPC - method. - cosmos.upgrade.v1beta1.QueryModuleVersionsResponse: - type: object - properties: - module_versions: - type: array - items: - type: object - properties: - name: - type: string - title: name of the app module - version: - type: string - format: uint64 - title: consensus version of the app module - description: |- - ModuleVersion specifies a module and its consensus version. + Example 1: Pack and unpack a message in C++. - Since: cosmos-sdk 0.43 - description: >- - module_versions is a list of module names with their consensus - versions. - description: >- - QueryModuleVersionsResponse is the response type for the - Query/ModuleVersions + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - RPC method. + Example 2: Pack and unpack a message in Java. + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Since: cosmos-sdk 0.43 - cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse: - type: object - properties: - upgraded_consensus_state: - type: string - format: byte - title: 'Since: cosmos-sdk 0.43' - description: >- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState + Example 3: Pack and unpack a message in Python. - RPC method. - cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse: - type: object - description: >- - MsgCreateVestingAccountResponse defines the - Msg/CreatePeriodicVestingAccount + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - response type. + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - Since: cosmos-sdk 0.46 - cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse: - type: object - description: >- - MsgCreatePermanentLockedAccountResponse defines the - Msg/CreatePermanentLockedAccount response type. + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack - Since: cosmos-sdk 0.46 - cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse: - type: object - description: >- - MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount - response type. - cosmos.vesting.v1beta1.Period: - type: object - properties: - length: - type: string - format: int64 - description: Period duration in seconds. - amount: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. + methods only use the fully qualified type name after the last '/' - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - description: Period defines a length of time and amount of coins that will vest. - ibc.applications.interchain_accounts.host.v1.Params: - type: object - properties: - host_enabled: - type: boolean - description: host_enabled enables or disables the host submodule. - allow_messages: - type: array - items: - type: string - description: >- - allow_messages defines a list of sdk message typeURLs allowed to be - executed on a host chain. - description: |- - Params defines the set of on-chain interchain accounts parameters. - The following parameters may be used to disable the host submodule. - ibc.applications.interchain_accounts.host.v1.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - host_enabled: - type: boolean - description: host_enabled enables or disables the host submodule. - allow_messages: - type: array - items: - type: string - description: >- - allow_messages defines a list of sdk message typeURLs allowed to - be executed on a host chain. - description: QueryParamsResponse is the response type for the Query/Params RPC method. - ibc.applications.transfer.v1.DenomTrace: - type: object - properties: - path: - type: string - description: >- - path defines the chain of port/channel identifiers used for tracing - the + in the type URL, for example "foo.bar.com/x/y.z" will yield type - source of the fungible token. - base_denom: - type: string - description: base denomination of the relayed fungible token. - description: >- - DenomTrace contains the base denomination for ICS20 fungible tokens and - the + name "y.z". - source tracing information path. - ibc.applications.transfer.v1.MsgTransferResponse: - type: object - properties: - sequence: - type: string - format: uint64 - title: sequence number of the transfer packet sent - description: MsgTransferResponse defines the Msg/Transfer response type. - ibc.applications.transfer.v1.Params: - type: object - properties: - send_enabled: - type: boolean - description: >- - send_enabled enables or disables all cross-chain token transfers from - this - chain. - receive_enabled: - type: boolean - description: >- - receive_enabled enables or disables all cross-chain token transfers to - this - chain. - description: >- - Params defines the set of IBC transfer parameters. + JSON - NOTE: To prevent a single token from being transferred, set the + ==== - TransfersEnabled parameter to true and then set the bank module's - SendEnabled + The JSON representation of an `Any` value uses the regular - parameter for the denomination to false. - ibc.applications.transfer.v1.QueryDenomHashResponse: - type: object - properties: - hash: - type: string - description: hash (in hex format) of the denomination trace information. - description: |- - QueryDenomHashResponse is the response type for the Query/DenomHash RPC - method. - ibc.applications.transfer.v1.QueryDenomTraceResponse: - type: object - properties: - denom_trace: - description: denom_trace returns the requested denomination trace information. - type: object - properties: - path: - type: string - description: >- - path defines the chain of port/channel identifiers used for - tracing the + representation of the deserialized, embedded message, with an - source of the fungible token. - base_denom: - type: string - description: base denomination of the relayed fungible token. - description: |- - QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC - method. - ibc.applications.transfer.v1.QueryDenomTracesResponse: - type: object - properties: - denom_traces: - type: array - items: - type: object - properties: - path: - type: string - description: >- - path defines the chain of port/channel identifiers used for - tracing the + additional field `@type` which contains the type URL. Example: - source of the fungible token. - base_denom: - type: string - description: base denomination of the relayed fungible token. - description: >- - DenomTrace contains the base denomination for ICS20 fungible tokens - and the + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - source tracing information path. - description: denom_traces returns all denominations trace information. - pagination: - description: pagination defines the pagination in the response. - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - was set, its value is undefined otherwise - description: >- - QueryConnectionsResponse is the response type for the Query/DenomTraces - RPC + If the embedded message type is well-known and has a custom JSON - method. - ibc.applications.transfer.v1.QueryEscrowAddressResponse: - type: object - properties: - escrow_address: - type: string - title: the escrow account address - description: >- - QueryEscrowAddressResponse is the response type of the EscrowAddress RPC - method. - ibc.applications.transfer.v1.QueryParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - send_enabled: - type: boolean - description: >- - send_enabled enables or disables all cross-chain token transfers - from this + representation, that representation will be embedded adding a field - chain. - receive_enabled: - type: boolean - description: >- - receive_enabled enables or disables all cross-chain token - transfers to this + `value` which holds the custom JSON in addition to the `@type` - chain. - description: QueryParamsResponse is the response type for the Query/Params RPC method. - ibc.core.client.v1.Height: - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: |- - Normally the RevisionHeight is incremented at each height while keeping - RevisionNumber the same. However some consensus algorithms may choose to - reset the height in certain conditions e.g. hard forks, state-machine - breaking changes In these cases, the RevisionNumber is incremented so that - height continues to be monitonically increasing even as the RevisionHeight - gets reset - title: >- - Height is a monotonically increasing data type + field. Example (for message [google.protobuf.Duration][]): - that can be compared against another Height for the purposes of updating - and + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: |- + msg_responses contains the Msg handler responses type packed in Anys. - freezing clients - ibc.core.channel.v1.Channel: + Since: cosmos-sdk 0.46 + description: Result is the union of ResponseFormat and ResponseCheckTx. + cosmos.base.abci.v1beta1.StringEvent: type: object properties: - state: - title: current state of the channel end - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED - description: |- - State defines if a channel is in one of the following states: - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered + type: type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED - description: |- - - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end - type: object - properties: - port_id: - type: string - description: >- - port on the counterparty chain which owns the other end of the - channel. - channel_id: - type: string - title: channel end on the counterparty chain - connection_hops: + attributes: type: array items: - type: string - title: |- - list of connection identifiers, in order, along which packets sent on - this channel will travel - version: - type: string - title: opaque channel version, which is agreed upon during the handshake + type: object + properties: + key: + type: string + value: + type: string + description: |- + Attribute defines an attribute wrapper where the key and value are + strings instead of raw bytes. description: |- - Channel defines pipeline for exactly-once packet delivery between specific - modules on separate blockchains, which has at least one end capable of - sending packets and one end capable of receiving packets. - ibc.core.channel.v1.Counterparty: + StringEvent defines en Event object wrapper where all the attributes + contain key/value pairs that are strings instead of raw bytes. + cosmos.base.abci.v1beta1.TxResponse: type: object properties: - port_id: + height: type: string - description: >- - port on the counterparty chain which owns the other end of the - channel. - channel_id: + format: int64 + title: The block height + txhash: type: string - title: channel end on the counterparty chain - title: Counterparty defines a channel end counterparty - ibc.core.channel.v1.IdentifiedChannel: - type: object - properties: - state: - title: current state of the channel end + description: The transaction hash. + codespace: type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED - description: |- - State defines if a channel is in one of the following states: - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED description: |- - - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end - type: object - properties: - port_id: - type: string - description: >- - port on the counterparty chain which owns the other end of the - channel. - channel_id: - type: string - title: channel end on the counterparty chain - connection_hops: + The output of the application's logger (raw string). May be + non-deterministic. + logs: type: array items: - type: string - title: |- - list of connection identifiers, in order, along which packets sent on - this channel will travel - version: - type: string - title: opaque channel version, which is agreed upon during the handshake - port_id: - type: string - title: port identifier - channel_id: - type: string - title: channel identifier - description: |- - IdentifiedChannel defines a channel with additional port and channel - identifier fields. - ibc.core.channel.v1.MsgAcknowledgementResponse: - type: object - properties: - result: - type: string - enum: - - RESPONSE_RESULT_TYPE_UNSPECIFIED - - RESPONSE_RESULT_TYPE_NOOP - - RESPONSE_RESULT_TYPE_SUCCESS - default: RESPONSE_RESULT_TYPE_UNSPECIFIED - description: |- - - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration - - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully - title: >- - ResponseResultType defines the possible outcomes of the execution of a - message - description: MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. - ibc.core.channel.v1.MsgChannelCloseConfirmResponse: - type: object - description: >- - MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm - response + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key and + value are - type. - ibc.core.channel.v1.MsgChannelCloseInitResponse: - type: object - description: >- - MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response - type. - ibc.core.channel.v1.MsgChannelOpenAckResponse: - type: object - description: MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. - ibc.core.channel.v1.MsgChannelOpenConfirmResponse: - type: object - description: |- - MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response - type. - ibc.core.channel.v1.MsgChannelOpenInitResponse: - type: object - properties: - channel_id: - type: string - version: - type: string - description: MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. - ibc.core.channel.v1.MsgChannelOpenTryResponse: - type: object - properties: - version: - type: string - description: MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. - ibc.core.channel.v1.MsgRecvPacketResponse: - type: object - properties: - result: - type: string - enum: - - RESPONSE_RESULT_TYPE_UNSPECIFIED - - RESPONSE_RESULT_TYPE_NOOP - - RESPONSE_RESULT_TYPE_SUCCESS - default: RESPONSE_RESULT_TYPE_UNSPECIFIED - description: |- - - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration - - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully - title: >- - ResponseResultType defines the possible outcomes of the execution of a - message - description: MsgRecvPacketResponse defines the Msg/RecvPacket response type. - ibc.core.channel.v1.MsgTimeoutOnCloseResponse: - type: object - properties: - result: - type: string - enum: - - RESPONSE_RESULT_TYPE_UNSPECIFIED - - RESPONSE_RESULT_TYPE_NOOP - - RESPONSE_RESULT_TYPE_SUCCESS - default: RESPONSE_RESULT_TYPE_UNSPECIFIED - description: |- - - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration - - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully - title: >- - ResponseResultType defines the possible outcomes of the execution of a - message - description: MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. - ibc.core.channel.v1.MsgTimeoutResponse: - type: object - properties: - result: - type: string - enum: - - RESPONSE_RESULT_TYPE_UNSPECIFIED - - RESPONSE_RESULT_TYPE_NOOP - - RESPONSE_RESULT_TYPE_SUCCESS - default: RESPONSE_RESULT_TYPE_UNSPECIFIED - description: |- - - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration - - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully - title: >- - ResponseResultType defines the possible outcomes of the execution of a - message - description: MsgTimeoutResponse defines the Msg/Timeout response type. - ibc.core.channel.v1.Order: - type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED - description: |- - - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - title: Order defines if a channel is ORDERED or UNORDERED - ibc.core.channel.v1.Packet: - type: object - properties: - sequence: - type: string - format: uint64 - description: >- - number corresponds to the order of sends and receives, where a Packet + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes - with an earlier sequence number must be sent and received before a - Packet + contain key/value pairs that are strings instead of raw bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some - with a later sequence number. - source_port: - type: string - description: identifies the port on the sending chain. - source_channel: - type: string - description: identifies the channel end on the sending chain. - destination_port: - type: string - description: identifies the port on the receiving chain. - destination_channel: - type: string - description: identifies the channel end on the receiving chain. - data: - type: string - format: byte - title: actual opaque bytes transferred directly to the application module - timeout_height: - title: block height after which the packet times out - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may choose - to - - reset the height in certain conditions e.g. hard forks, state-machine - - breaking changes In these cases, the RevisionNumber is incremented so - that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - timeout_timestamp: - type: string - format: uint64 - title: block timestamp (in nanoseconds) after which the packet times out - title: >- - Packet defines a type that carries data across different chains through - IBC - ibc.core.channel.v1.PacketState: - type: object - properties: - port_id: - type: string - description: channel port identifier. - channel_id: + The output of the application's logger (typed). May be + non-deterministic. + info: type: string - description: channel unique identifier. - sequence: + description: Additional information. May be non-deterministic. + gas_wanted: type: string - format: uint64 - description: packet sequence. - data: + format: int64 + description: Amount of gas requested for transaction. + gas_used: type: string - format: byte - description: embedded data that represents packet state. - description: |- - PacketState defines the generic type necessary to retrieve and store - packet commitments, acknowledgements, and receipts. - Caller is responsible for knowing the context necessary to interpret this - state as a commitment, acknowledgement, or a receipt. - ibc.core.channel.v1.QueryChannelClientStateResponse: - type: object - properties: - identified_client_state: - title: client state associated with the channel + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. type: object properties: - client_id: + '@type': type: string - title: client identifier - client_state: - title: client state - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all - types that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs - which use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set - up a type + scheme `http`, `https`, or no scheme, one can optionally set up a + type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning - with + protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might - be + Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted median + of - URL that describes the type of the serialized message. + the timestamps of the valid votes in the block.LastCommit. For height + == 1, + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with an + event. + description: >- + Event allows application developers to attach additional information + to - Protobuf library provides support to pack/unpack Any values in the - form + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - of utility functions or additional generated methods of the Any - type. + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + these events include those emitted by processing all the messages and + those - Example 1: Pack and unpack a message in C++. + emitted from the ante. Whereas Logs contains the events, with - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + additional metadata, emitted only by processing the messages. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: >- + TxResponse defines a structure containing relevant tx data and metadata. + The - Example 3: Pack and unpack a message in Python. + tags are stringified and the log is JSON decoded. + cosmos.crypto.multisig.v1beta1.CompactBitArray: + type: object + properties: + extra_bits_stored: + type: integer + format: int64 + elems: + type: string + format: byte + description: |- + CompactBitArray is an implementation of a space efficient bit array. + This is used to ensure that the encoded data takes up a minimal amount of + space after proto encoding. + This is not thread safe, and is not intended for concurrent usage. + cosmos.tx.signing.v1beta1.SignMode: + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: |- + SignMode represents a signing mode with its own security guarantees. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + This enum should be considered a registry of all known sign modes + in the Cosmos ecosystem. Apps are not expected to support all known + sign modes. Apps that would like to support custom sign modes are + encouraged to open a small PR against this file to add a new case + to this SignMode enum describing their sign mode so that different + apps have a consistent version of this enum. - Example 4: Pack and unpack a message in Go + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary representation + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + require signers signing over other signers' `signer_info`. It also allows + for adding Tips in transactions. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - The pack methods provided by protobuf library will by default use + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + but is not implemented on the SDK by default. To enable EIP-191, you need + to pass a custom `TxConfig` that has an implementation of + `SignModeHandler` for EIP-191. The SDK may decide to fully support + EIP-191 in the future. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + Since: cosmos-sdk 0.45.2 + cosmos.tx.v1beta1.AuthInfo: + type: object + properties: + signer_infos: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.SignerInfo' + description: >- + signer_infos defines the signing modes for the required signers. The + number - methods only use the fully qualified type name after the last '/' + and order of elements must match the required signers from TxBody's - in the type URL, for example "foo.bar.com/x/y.z" will yield type + messages. The first element is the primary signer and the one which + pays - name "y.z". + the fee. + fee: + description: >- + Fee is the fee and gas limit for the transaction. The first signer is + the + primary signer and the one which pays the fee. The fee can be + calculated + based on the cost of evaluating the body and doing signature + verification - JSON + of the signers. This can be estimated via simulation. + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - ==== - The JSON representation of an `Any` value uses the regular + NOTE: The amount field is an Int which implements the custom + method - representation of the deserialized, embedded message, with an + signatures required by gogoproto. + title: amount is the amount of coins to be paid as a fee + gas_limit: + type: string + format: uint64 + title: >- + gas_limit is the maximum gas that can be used in transaction + processing - additional field `@type` which contains the type URL. Example: + before an out of gas error occurs + payer: + type: string + description: >- + if unset, the first signer is responsible for paying the fees. If + set, the specified account must pay the fees. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + the payer must be a tx signer (and thus have signed this field in + AuthInfo). - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + setting this field does *not* change the ordering of required + signers for the transaction. + granter: + type: string + title: >- + if set, the fee payer (either the first signer or the value of the + payer field) requests that a fee grant be used - If the embedded message type is well-known and has a custom JSON + to pay fees instead of the fee payer's own balance. If an + appropriate fee grant does not exist or the chain does - representation, that representation will be embedded adding a - field + not support fee grants, this will fail + tip: + description: >- + Tip is the optional tip used for transactions fees paid in another + denom. - `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + This field is ignored if the chain didn't enable tips, i.e. didn't add + the - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - IdentifiedClientState defines a client state with an additional client - identifier field. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved + `TipDecorator` in its posthandler. + + + Since: cosmos-sdk 0.46 type: object properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - RevisionNumber the same. However some consensus algorithms may choose - to - reset the height in certain conditions e.g. hard forks, state-machine + NOTE: The amount field is an Int which implements the custom + method - breaking changes In these cases, the RevisionNumber is incremented so - that + signatures required by gogoproto. + title: amount is the amount of the tip + tipper: + type: string + title: tipper is the address of the account paying for the tip + description: |- + AuthInfo describes the fee and signer modes that are used to sign a + transaction. + cosmos.tx.v1beta1.BroadcastMode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC + method. - height continues to be monitonically increasing even as the - RevisionHeight + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + cosmos.tx.v1beta1.BroadcastTxRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + mode: + type: string + enum: + - BROADCAST_MODE_UNSPECIFIED + - BROADCAST_MODE_BLOCK + - BROADCAST_MODE_SYNC + - BROADCAST_MODE_ASYNC + default: BROADCAST_MODE_UNSPECIFIED + description: >- + BroadcastMode specifies the broadcast mode for the TxService.Broadcast + RPC method. - gets reset - title: |- - QueryChannelClientStateResponse is the Response type for the - Query/QueryChannelClientState RPC method - ibc.core.channel.v1.QueryChannelConsensusStateResponse: + - BROADCAST_MODE_UNSPECIFIED: zero-value for mode ordering + - BROADCAST_MODE_BLOCK: DEPRECATED: use BROADCAST_MODE_SYNC instead, + BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + - BROADCAST_MODE_SYNC: BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + a CheckTx execution response only. + - BROADCAST_MODE_ASYNC: BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + immediately. + description: |- + BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + RPC method. + cosmos.tx.v1beta1.BroadcastTxResponse: type: object properties: - consensus_state: - title: consensus state associated with the channel + tx_response: + description: tx_response is the queried TxResponses. type: object properties: - '@type': + height: type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they + format: int64 + title: The block height + txhash: + type: string + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key + and value are - expect it to use in the context of Any. However, for URLs which - use the + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes - scheme `http`, `https`, or no scheme, one can optionally set up a - type + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some - server that maps type URLs to message definitions as follows: + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized + protocol buffer message. This string must contain at least - * If no scheme is provided, `https` is assumed. + one "/" character. The last segment of the URL's path must + represent - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + the fully qualified name of the type (as in - Note: this functionality is not currently available in the - official + `path/google.protobuf.Duration`). The name should be in a + canonical form - protobuf release, and it is not used for type URLs beginning with + (e.g., leading "." is not accepted). - type.googleapis.com. + In practice, teams usually precompile into the binary all + types that they - Schemes other than `http`, `https` (or the empty scheme) might be + expect it to use in the context of Any. However, for URLs + which use the - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + scheme `http`, `https`, or no scheme, one can optionally set + up a type - URL that describes the type of the serialized message. + server that maps type URLs to message definitions as follows: - Protobuf library provides support to pack/unpack Any values in the - form + * If no scheme is provided, `https` is assumed. - of utility functions or additional generated methods of the Any type. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in the + official - Example 1: Pack and unpack a message in C++. + protobuf release, and it is not used for type URLs beginning + with - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + type.googleapis.com. - Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Schemes other than `http`, `https` (or the empty scheme) might + be - Example 3: Pack and unpack a message in Python. + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + the timestamps of the valid votes in the block.LastCommit. For + height == 1, - Example 4: Pack and unpack a message in Go + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - The pack methods provided by protobuf library will by default use + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, - 'type.googleapis.com/full.type.name' as the type URL and the unpack + these events include those emitted by processing all the messages + and those - methods only use the fully qualified type name after the last '/' + emitted from the ante. Whereas Logs contains the events, with - in the type URL, for example "foo.bar.com/x/y.z" will yield type + additional metadata, emitted only by processing the messages. - name "y.z". + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: |- + BroadcastTxResponse is the response type for the + Service.BroadcastTx method. + cosmos.tx.v1beta1.Fee: + type: object + properties: + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: amount is the amount of coins to be paid as a fee + gas_limit: + type: string + format: uint64 + title: >- + gas_limit is the maximum gas that can be used in transaction + processing - JSON + before an out of gas error occurs + payer: + type: string + description: >- + if unset, the first signer is responsible for paying the fees. If set, + the specified account must pay the fees. - ==== + the payer must be a tx signer (and thus have signed this field in + AuthInfo). - The JSON representation of an `Any` value uses the regular + setting this field does *not* change the ordering of required signers + for the transaction. + granter: + type: string + title: >- + if set, the fee payer (either the first signer or the value of the + payer field) requests that a fee grant be used - representation of the deserialized, embedded message, with an + to pay fees instead of the fee payer's own balance. If an appropriate + fee grant does not exist or the chain does - additional field `@type` which contains the type URL. Example: + not support fee grants, this will fail + description: >- + Fee includes the amount of coins paid in fees and the maximum - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + gas to be used by the transaction. The ratio yields an effective + "gasprice", - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + which must be above some miminum to be accepted into the mempool. + cosmos.tx.v1beta1.GetBlockWithTxsResponse: + type: object + properties: + txs: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: txs are the transactions in the block. + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + block: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, - If the embedded message type is well-known and has a custom JSON + including all blockchain data structures and the rules of the + application's - representation, that representation will be embedded adding a field + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: commit from validators from the last block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: root hash of all results from the txs from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: Header defines the structure of a block header. + data: + type: object + properties: + txs: + type: array + items: + type: string + format: byte + description: >- + Txs that will be applied by state @ block.Height+1. - `value` which holds the custom JSON in addition to the `@type` + NOTE: not all txs here are valid. We're just agreeing on the + order first. - field. Example (for message [google.protobuf.Duration][]): + This means that block.AppHash does not include these txs. + title: Data contains the set of transactions included in the block + evidence: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + duplicate_vote_evidence: + type: object + properties: + vote_a: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - client_id: - type: string - title: client ID associated with the consensus state - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for - RevisionNumber the same. However some consensus algorithms may choose - to + consensus. + vote_b: + type: object + properties: + type: + type: string + enum: + - SIGNED_MSG_TYPE_UNKNOWN + - SIGNED_MSG_TYPE_PREVOTE + - SIGNED_MSG_TYPE_PRECOMMIT + - SIGNED_MSG_TYPE_PROPOSAL + default: SIGNED_MSG_TYPE_UNKNOWN + description: >- + SignedMsgType is a type of signed message in the + consensus. - reset the height in certain conditions e.g. hard forks, state-machine + - SIGNED_MSG_TYPE_PREVOTE: Votes + - SIGNED_MSG_TYPE_PROPOSAL: Proposals + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + description: zero if vote is nil. + timestamp: + type: string + format: date-time + validator_address: + type: string + format: byte + validator_index: + type: integer + format: int32 + signature: + type: string + format: byte + description: >- + Vote represents a prevote, precommit, or commit vote + from validators for - breaking changes In these cases, the RevisionNumber is incremented so - that + consensus. + total_voting_power: + type: string + format: int64 + validator_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + DuplicateVoteEvidence contains evidence of a validator + signed two conflicting votes. + light_client_attack_evidence: + type: object + properties: + conflicting_block: + type: object + properties: + signed_header: + type: object + properties: + header: + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, - height continues to be monitonically increasing even as the - RevisionHeight + including all blockchain data structures + and the rules of the application's - gets reset - title: |- - QueryChannelClientStateResponse is the Response type for the - Query/QueryChannelClientState RPC method - ibc.core.channel.v1.QueryChannelResponse: - type: object - properties: - channel: - title: channel associated with the request identifiers - type: object - properties: - state: - title: current state of the channel end - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED - description: |- - State defines if a channel is in one of the following states: - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered - type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED - description: |- - - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + last_commit_hash: + type: string + format: byte + description: >- + commit from validators from the last + block + title: hashes of block data + data_hash: + type: string + format: byte + title: transactions + validators_hash: + type: string + format: byte + description: validators for the current block + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + title: validators for the next block + consensus_hash: + type: string + format: byte + title: consensus params for current block + app_hash: + type: string + format: byte + title: state after txs from the previous block + last_results_hash: + type: string + format: byte + title: >- + root hash of all results from the txs + from the previous block + evidence_hash: + type: string + format: byte + description: evidence included in the block + title: consensus info + proposer_address: + type: string + format: byte + title: original proposer of the block + description: >- + Header defines the structure of a block + header. + commit: + type: object + properties: + height: + type: string + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: >- + BlockIdFlag indicates which BlcokID the + signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: >- + CommitSig is a part of the Vote included + in a Commit. + description: >- + Commit contains the evidence that a block + was committed by a set of validators. + validator_set: + type: object + properties: + validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + proposer: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for + use with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + common_height: + type: string + format: int64 + byzantine_validators: + type: array + items: + type: object + properties: + address: + type: string + format: byte + pub_key: + type: object + properties: + ed25519: + type: string + format: byte + secp256k1: + type: string + format: byte + title: >- + PublicKey defines the keys available for use + with Validators + voting_power: + type: string + format: int64 + proposer_priority: + type: string + format: int64 + total_voting_power: + type: string + format: int64 + timestamp: + type: string + format: date-time + description: >- + LightClientAttackEvidence contains evidence of a set of + validators attempting to mislead a light client. + last_commit: type: object properties: - port_id: - type: string - description: >- - port on the counterparty chain which owns the other end of the - channel. - channel_id: - type: string - title: channel end on the counterparty chain - connection_hops: - type: array - items: - type: string - title: >- - list of connection identifiers, in order, along which packets sent - on - - this channel will travel - version: - type: string - title: opaque channel version, which is agreed upon during the handshake - description: >- - Channel defines pipeline for exactly-once packet delivery between - specific - - modules on separate blockchains, which has at least one end capable of - - sending packets and one end capable of receiving packets. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may choose - to - - reset the height in certain conditions e.g. hard forks, state-machine - - breaking changes In these cases, the RevisionNumber is incremented so - that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - description: >- - QueryChannelResponse is the response type for the Query/Channel RPC - method. - - Besides the Channel end, it includes a proof and the height from which the - - proof was retrieved. - ibc.core.channel.v1.QueryChannelsResponse: - type: object - properties: - channels: - type: array - items: - type: object - properties: - state: - title: current state of the channel end - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED - description: |- - State defines if a channel is in one of the following states: - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered - type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED - description: |- - - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end - type: object - properties: - port_id: - type: string - description: >- - port on the counterparty chain which owns the other end of - the channel. - channel_id: - type: string - title: channel end on the counterparty chain - connection_hops: - type: array - items: + height: type: string - title: >- - list of connection identifiers, in order, along which packets - sent on - - this channel will travel - version: - type: string - title: >- - opaque channel version, which is agreed upon during the - handshake - port_id: - type: string - title: port identifier - channel_id: - type: string - title: channel identifier - description: |- - IdentifiedChannel defines a channel with additional port and channel - identifier fields. - description: list of stored channels of the chain. + format: int64 + round: + type: integer + format: int32 + block_id: + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + title: BlockID + signatures: + type: array + items: + type: object + properties: + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + title: BlockIdFlag indicates which BlcokID the signature is for + validator_address: + type: string + format: byte + timestamp: + type: string + format: date-time + signature: + type: string + format: byte + description: CommitSig is a part of the Vote included in a Commit. + description: >- + Commit contains the evidence that a block was committed by a set + of validators. pagination: - title: pagination response + description: pagination defines a pagination for the response. type: object properties: next_key: @@ -63922,849 +67470,670 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + description: >- + GetBlockWithTxsResponse is the response type for the + Service.GetBlockWithTxs method. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height + + Since: cosmos-sdk 0.45.2 + cosmos.tx.v1beta1.GetTxResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the queried transaction. + tx_response: + description: tx_response is the queried TxResponses. type: object properties: - revision_number: + height: type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + format: int64 + title: The block height + txhash: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may choose - to - - reset the height in certain conditions e.g. hard forks, state-machine - - breaking changes In these cases, the RevisionNumber is incremented so - that - - height continues to be monitonically increasing even as the - RevisionHeight - - gets reset - description: >- - QueryChannelsResponse is the response type for the Query/Channels RPC - method. - ibc.core.channel.v1.QueryConnectionChannelsResponse: - type: object - properties: - channels: - type: array - items: - type: object - properties: - state: - title: current state of the channel end - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED - description: |- - State defines if a channel is in one of the following states: - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ordering: - title: whether the channel is ordered or unordered - type: string - enum: - - ORDER_NONE_UNSPECIFIED - - ORDER_UNORDERED - - ORDER_ORDERED - default: ORDER_NONE_UNSPECIFIED - description: |- - - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in - which they were sent. - - ORDER_ORDERED: packets are delivered exactly in the order which they were sent - counterparty: - title: counterparty channel end + description: The transaction hash. + codespace: + type: string + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. + data: + type: string + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: type: object properties: - port_id: - type: string - description: >- - port on the counterparty chain which owns the other end of - the channel. - channel_id: + msg_index: + type: integer + format: int64 + log: type: string - title: channel end on the counterparty chain - connection_hops: - type: array - items: - type: string - title: >- - list of connection identifiers, in order, along which packets - sent on + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the key + and value are - this channel will travel - version: - type: string - title: >- - opaque channel version, which is agreed upon during the - handshake - port_id: - type: string - title: port identifier - channel_id: - type: string - title: channel identifier - description: |- - IdentifiedChannel defines a channel with additional port and channel - identifier fields. - description: list of channels associated with a connection. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all the + attributes - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx ABCI + message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + format: int64 + description: Amount of gas requested for transaction. + gas_used: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may choose - to + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - reset the height in certain conditions e.g. hard forks, state-machine + protocol buffer message. This string must contain at least - breaking changes In these cases, the RevisionNumber is incremented so - that + one "/" character. The last segment of the URL's path must + represent - height continues to be monitonically increasing even as the - RevisionHeight + the fully qualified name of the type (as in - gets reset - title: |- - QueryConnectionChannelsResponse is the Response type for the - Query/QueryConnectionChannels RPC method - ibc.core.channel.v1.QueryNextSequenceReceiveResponse: - type: object - properties: - next_sequence_receive: - type: string - format: uint64 - title: next sequence receive number - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + `path/google.protobuf.Duration`). The name should be in a + canonical form - RevisionNumber the same. However some consensus algorithms may choose - to + (e.g., leading "." is not accepted). - reset the height in certain conditions e.g. hard forks, state-machine - breaking changes In these cases, the RevisionNumber is incremented so - that + In practice, teams usually precompile into the binary all + types that they - height continues to be monitonically increasing even as the - RevisionHeight + expect it to use in the context of Any. However, for URLs + which use the - gets reset - title: |- - QuerySequenceResponse is the request type for the - Query/QueryNextSequenceReceiveResponse RPC method - ibc.core.channel.v1.QueryPacketAcknowledgementResponse: - type: object - properties: - acknowledgement: - type: string - format: byte - title: packet associated with the request fields - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + scheme `http`, `https`, or no scheme, one can optionally set + up a type - RevisionNumber the same. However some consensus algorithms may choose - to + server that maps type URLs to message definitions as follows: - reset the height in certain conditions e.g. hard forks, state-machine - breaking changes In these cases, the RevisionNumber is incremented so - that + * If no scheme is provided, `https` is assumed. - height continues to be monitonically increasing even as the - RevisionHeight + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - gets reset - title: |- - QueryPacketAcknowledgementResponse defines the client query response for a - packet which also includes a proof and the height from which the - proof was retrieved - ibc.core.channel.v1.QueryPacketAcknowledgementsResponse: - type: object - properties: - acknowledgements: - type: array - items: - type: object - properties: - port_id: - type: string - description: channel port identifier. - channel_id: - type: string - description: channel unique identifier. - sequence: - type: string - format: uint64 - description: packet sequence. - data: - type: string - format: byte - description: embedded data that represents packet state. - description: >- - PacketState defines the generic type necessary to retrieve and store + Note: this functionality is not currently available in the + official - packet commitments, acknowledgements, and receipts. + protobuf release, and it is not used for type URLs beginning + with - Caller is responsible for knowing the context necessary to interpret - this + type.googleapis.com. - state as a commitment, acknowledgement, or a receipt. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + Schemes other than `http`, `https` (or the empty scheme) might + be - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + used with implementation specific semantics. + additionalProperties: {} + timestamp: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may choose - to - - reset the height in certain conditions e.g. hard forks, state-machine - - breaking changes In these cases, the RevisionNumber is incremented so - that + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of - height continues to be monitonically increasing even as the - RevisionHeight + the timestamps of the valid votes in the block.LastCommit. For + height == 1, - gets reset - title: |- - QueryPacketAcknowledgemetsResponse is the request type for the - Query/QueryPacketAcknowledgements RPC method - ibc.core.channel.v1.QueryPacketCommitmentResponse: - type: object - properties: - commitment: - type: string - format: byte - title: packet associated with the request fields - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to - RevisionNumber the same. However some consensus algorithms may choose - to + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - reset the height in certain conditions e.g. hard forks, state-machine + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, - breaking changes In these cases, the RevisionNumber is incremented so - that + these events include those emitted by processing all the messages + and those - height continues to be monitonically increasing even as the - RevisionHeight + emitted from the ante. Whereas Logs contains the events, with - gets reset - title: >- - QueryPacketCommitmentResponse defines the client query response for a - packet + additional metadata, emitted only by processing the messages. - which also includes a proof and the height from which the proof was - retrieved - ibc.core.channel.v1.QueryPacketCommitmentsResponse: + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: GetTxResponse is the response type for the Service.GetTx method. + cosmos.tx.v1beta1.GetTxsEventResponse: type: object properties: - commitments: + txs: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: txs is the list of queried transactions. + tx_responses: type: array items: type: object properties: - port_id: + height: type: string - description: channel port identifier. - channel_id: + format: int64 + title: The block height + txhash: type: string - description: channel unique identifier. - sequence: + description: The transaction hash. + codespace: type: string - format: uint64 - description: packet sequence. + title: Namespace for the Code + code: + type: integer + format: int64 + description: Response code. data: type: string - format: byte - description: embedded data that represents packet state. - description: >- - PacketState defines the generic type necessary to retrieve and store + description: Result bytes, if any. + raw_log: + type: string + description: |- + The output of the application's logger (raw string). May be + non-deterministic. + logs: + type: array + items: + type: object + properties: + msg_index: + type: integer + format: int64 + log: + type: string + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + description: >- + Attribute defines an attribute wrapper where the + key and value are - packet commitments, acknowledgements, and receipts. + strings instead of raw bytes. + description: >- + StringEvent defines en Event object wrapper where all + the attributes - Caller is responsible for knowing the context necessary to interpret - this + contain key/value pairs that are strings instead of raw + bytes. + description: >- + Events contains a slice of Event objects that were emitted + during some - state as a commitment, acknowledgement, or a receipt. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + execution. + description: >- + ABCIMessageLog defines a structure containing an indexed tx + ABCI message log. + description: >- + The output of the application's logger (typed). May be + non-deterministic. + info: + type: string + description: Additional information. May be non-deterministic. + gas_wanted: + type: string + format: int64 + description: Amount of gas requested for transaction. + gas_used: + type: string + format: int64 + description: Amount of gas consumed by transaction. + tx: + description: The request transaction bytes. + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + protocol buffer message. This string must contain at least - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + one "/" character. The last segment of the URL's path must + represent - RevisionNumber the same. However some consensus algorithms may choose - to + the fully qualified name of the type (as in - reset the height in certain conditions e.g. hard forks, state-machine + `path/google.protobuf.Duration`). The name should be in a + canonical form - breaking changes In these cases, the RevisionNumber is incremented so - that + (e.g., leading "." is not accepted). - height continues to be monitonically increasing even as the - RevisionHeight - gets reset - title: |- - QueryPacketCommitmentsResponse is the request type for the - Query/QueryPacketCommitments RPC method - ibc.core.channel.v1.QueryPacketReceiptResponse: - type: object - properties: - received: - type: boolean - title: success flag for if receipt exists - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + In practice, teams usually precompile into the binary all + types that they - RevisionNumber the same. However some consensus algorithms may choose - to + expect it to use in the context of Any. However, for URLs + which use the - reset the height in certain conditions e.g. hard forks, state-machine + scheme `http`, `https`, or no scheme, one can optionally set + up a type - breaking changes In these cases, the RevisionNumber is incremented so - that + server that maps type URLs to message definitions as + follows: - height continues to be monitonically increasing even as the - RevisionHeight - gets reset - title: >- - QueryPacketReceiptResponse defines the client query response for a packet + * If no scheme is provided, `https` is assumed. - receipt which also includes a proof, and the height from which the proof - was + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - retrieved - ibc.core.channel.v1.QueryUnreceivedAcksResponse: - type: object - properties: - sequences: - type: array - items: - type: string - format: uint64 - title: list of unreceived acknowledgement sequences - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + Note: this functionality is not currently available in the + official - RevisionNumber the same. However some consensus algorithms may choose - to + protobuf release, and it is not used for type URLs beginning + with - reset the height in certain conditions e.g. hard forks, state-machine + type.googleapis.com. - breaking changes In these cases, the RevisionNumber is incremented so - that - height continues to be monitonically increasing even as the - RevisionHeight + Schemes other than `http`, `https` (or the empty scheme) + might be - gets reset - title: |- - QueryUnreceivedAcksResponse is the response type for the - Query/UnreceivedAcks RPC method - ibc.core.channel.v1.QueryUnreceivedPacketsResponse: - type: object - properties: - sequences: - type: array - items: - type: string - format: uint64 - title: list of unreceived packet sequences - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + used with implementation specific semantics. + additionalProperties: {} + timestamp: + type: string + description: >- + Time of the previous block. For heights > 1, it's the weighted + median of - RevisionNumber the same. However some consensus algorithms may choose - to + the timestamps of the valid votes in the block.LastCommit. For + height == 1, - reset the height in certain conditions e.g. hard forks, state-machine + it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated + with an event. + description: >- + Event allows application developers to attach additional + information to - breaking changes In these cases, the RevisionNumber is incremented so - that + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - height continues to be monitonically increasing even as the - RevisionHeight + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, - gets reset - title: |- - QueryUnreceivedPacketsResponse is the response type for the - Query/UnreceivedPacketCommitments RPC method - ibc.core.channel.v1.ResponseResultType: - type: string - enum: - - RESPONSE_RESULT_TYPE_UNSPECIFIED - - RESPONSE_RESULT_TYPE_NOOP - - RESPONSE_RESULT_TYPE_SUCCESS - default: RESPONSE_RESULT_TYPE_UNSPECIFIED - description: |- - - RESPONSE_RESULT_TYPE_UNSPECIFIED: Default zero value enumeration - - RESPONSE_RESULT_TYPE_NOOP: The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - - RESPONSE_RESULT_TYPE_SUCCESS: The message was executed successfully - title: >- - ResponseResultType defines the possible outcomes of the execution of a - message - ibc.core.channel.v1.State: - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - - STATE_CLOSED - default: STATE_UNINITIALIZED_UNSPECIFIED - description: |- - State defines if a channel is in one of the following states: - CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A channel has just started the opening handshake. - - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - - STATE_OPEN: A channel has completed the handshake. Open channels are - ready to send and receive packets. - - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive - packets. - ibc.core.client.v1.IdentifiedClientState: - type: object - properties: - client_id: - type: string - title: client identifier - client_state: - title: client state - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + these events include those emitted by processing all the + messages and those - protocol buffer message. This string must contain at least + emitted from the ante. Whereas Logs contains the events, with - one "/" character. The last segment of the URL's path must - represent + additional metadata, emitted only by processing the messages. - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + description: >- + TxResponse defines a structure containing relevant tx data and + metadata. The - (e.g., leading "." is not accepted). + tags are stringified and the log is JSON decoded. + description: tx_responses is the list of queried TxResponses. + pagination: + description: |- + pagination defines a pagination for the response. + Deprecated post v0.46.x: use total instead. + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + was set, its value is undefined otherwise + total: + type: string + format: uint64 + title: total is total number of results available + description: |- + GetTxsEventResponse is the response type for the Service.TxsByEvents + RPC method. + cosmos.tx.v1beta1.ModeInfo: + type: object + properties: + single: + title: single represents a single signer + type: object + properties: + mode: + title: mode is the signing mode of the single signer + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security + guarantees. - In practice, teams usually precompile into the binary all types - that they - expect it to use in the context of Any. However, for URLs which - use the + This enum should be considered a registry of all known sign modes - scheme `http`, `https`, or no scheme, one can optionally set up a - type + in the Cosmos ecosystem. Apps are not expected to support all + known - server that maps type URLs to message definitions as follows: + sign modes. Apps that would like to support custom sign modes are + encouraged to open a small PR against this file to add a new case - * If no scheme is provided, `https` is assumed. + to this SignMode enum describing their sign mode so that different - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + apps have a consistent version of this enum. - Note: this functionality is not currently available in the - official + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary + representation - protobuf release, and it is not used for type URLs beginning with + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode + does not - type.googleapis.com. + require signers signing over other signers' `signer_info`. It also + allows + for adding Tips in transactions. - Schemes other than `http`, `https` (or the empty scheme) might be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - URL that describes the type of the serialized message. + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum + variant, - Protobuf library provides support to pack/unpack Any values in the - form + but is not implemented on the SDK by default. To enable EIP-191, + you need - of utility functions or additional generated methods of the Any type. + to pass a custom `TxConfig` that has an implementation of + `SignModeHandler` for EIP-191. The SDK may decide to fully support - Example 1: Pack and unpack a message in C++. + EIP-191 in the future. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - Example 2: Pack and unpack a message in Java. + Since: cosmos-sdk 0.45.2 + multi: + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo.Multi' + title: multi represents a nested multisig signer + description: ModeInfo describes the signing mode of a single or nested multisig signer. + cosmos.tx.v1beta1.ModeInfo.Multi: + type: object + properties: + bitarray: + title: bitarray specifies which keys within the multisig are signing + type: object + properties: + extra_bits_stored: + type: integer + format: int64 + elems: + type: string + format: byte + description: >- + CompactBitArray is an implementation of a space efficient bit array. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + This is used to ensure that the encoded data takes up a minimal amount + of - Example 3: Pack and unpack a message in Python. + space after proto encoding. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + This is not thread safe, and is not intended for concurrent usage. + mode_infos: + type: array + items: + type: object + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' + title: |- + mode_infos is the corresponding modes of the signers of the multisig + which could include nested multisig public keys + title: Multi is the mode info for a multisig public key + cosmos.tx.v1beta1.ModeInfo.Single: + type: object + properties: + mode: + title: mode is the signing mode of the single signer + type: string + enum: + - SIGN_MODE_UNSPECIFIED + - SIGN_MODE_DIRECT + - SIGN_MODE_TEXTUAL + - SIGN_MODE_DIRECT_AUX + - SIGN_MODE_LEGACY_AMINO_JSON + - SIGN_MODE_EIP_191 + default: SIGN_MODE_UNSPECIFIED + description: >- + SignMode represents a signing mode with its own security guarantees. - Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + This enum should be considered a registry of all known sign modes - The pack methods provided by protobuf library will by default use + in the Cosmos ecosystem. Apps are not expected to support all known - 'type.googleapis.com/full.type.name' as the type URL and the unpack + sign modes. Apps that would like to support custom sign modes are - methods only use the fully qualified type name after the last '/' + encouraged to open a small PR against this file to add a new case - in the type URL, for example "foo.bar.com/x/y.z" will yield type + to this SignMode enum describing their sign mode so that different - name "y.z". + apps have a consistent version of this enum. + - SIGN_MODE_UNSPECIFIED: SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + rejected. + - SIGN_MODE_DIRECT: SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + verified with raw bytes from Tx. + - SIGN_MODE_TEXTUAL: SIGN_MODE_TEXTUAL is a future signing mode that will verify some + human-readable textual representation on top of the binary + representation + from SIGN_MODE_DIRECT. It is currently not supported. + - SIGN_MODE_DIRECT_AUX: SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does + not - JSON + require signers signing over other signers' `signer_info`. It also + allows - ==== + for adding Tips in transactions. - The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + Since: cosmos-sdk 0.46 + - SIGN_MODE_LEGACY_AMINO_JSON: SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + Amino JSON and will be removed in the future. + - SIGN_MODE_EIP_191: SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + but is not implemented on the SDK by default. To enable EIP-191, you + need - If the embedded message type is well-known and has a custom JSON + to pass a custom `TxConfig` that has an implementation of - representation, that representation will be embedded adding a field + `SignModeHandler` for EIP-191. The SDK may decide to fully support - `value` which holds the custom JSON in addition to the `@type` + EIP-191 in the future. - field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - IdentifiedClientState defines a client state with an additional client - identifier field. - ibc.core.client.v1.ConsensusStateWithHeight: + Since: cosmos-sdk 0.45.2 + title: |- + Single is the mode info for a single signer. It is structured as a message + to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + future + cosmos.tx.v1beta1.OrderBy: + type: string + enum: + - ORDER_BY_UNSPECIFIED + - ORDER_BY_ASC + - ORDER_BY_DESC + default: ORDER_BY_UNSPECIFIED + description: >- + - ORDER_BY_UNSPECIFIED: ORDER_BY_UNSPECIFIED specifies an unknown sorting + order. OrderBy defaults to ASC in this case. + - ORDER_BY_ASC: ORDER_BY_ASC defines ascending order + - ORDER_BY_DESC: ORDER_BY_DESC defines descending order + title: OrderBy defines the sorting order + cosmos.tx.v1beta1.SignerInfo: type: object properties: - height: - title: consensus state height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision + public_key: description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may choose - to - - reset the height in certain conditions e.g. hard forks, state-machine - - breaking changes In these cases, the RevisionNumber is incremented so - that + public_key is the public key of the signer. It is optional for + accounts - height continues to be monitonically increasing even as the - RevisionHeight + that already exist in state. If unset, the verifier can use the + required \ - gets reset - consensus_state: - title: consensus state + signer address for this position and lookup the public key. type: object properties: '@type': @@ -64820,365 +68189,330 @@ definitions: used with implementation specific semantics. additionalProperties: {} + mode_info: + $ref: '#/definitions/cosmos.tx.v1beta1.ModeInfo' + title: |- + mode_info describes the signing mode of the signer and is a nested + structure to support nested multisig pubkey's + sequence: + type: string + format: uint64 description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): + sequence is the sequence of the account, which describes the - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: >- - ConsensusStateWithHeight defines a consensus state with an additional - height + number of committed transactions signed by a given address. It is used + to - field. - ibc.core.client.v1.MsgCreateClientResponse: - type: object - description: MsgCreateClientResponse defines the Msg/CreateClient response type. - ibc.core.client.v1.MsgSubmitMisbehaviourResponse: - type: object + prevent replay attacks. description: |- - MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response - type. - ibc.core.client.v1.MsgUpdateClientResponse: - type: object - description: MsgUpdateClientResponse defines the Msg/UpdateClient response type. - ibc.core.client.v1.MsgUpgradeClientResponse: - type: object - description: MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. - ibc.core.client.v1.Params: + SignerInfo describes the public key and signing mode of a single top-level + signer. + cosmos.tx.v1beta1.SimulateRequest: type: object properties: - allowed_clients: - type: array - items: - type: string - description: allowed_clients defines the list of allowed client state types. - description: Params defines the set of IBC light client parameters. - ibc.core.client.v1.QueryClientParamsResponse: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: |- + tx is the transaction to simulate. + Deprecated. Send raw tx bytes instead. + tx_bytes: + type: string + format: byte + description: |- + tx_bytes is the raw transaction. + + Since: cosmos-sdk 0.43 + description: |- + SimulateRequest is the request type for the Service.Simulate + RPC method. + cosmos.tx.v1beta1.SimulateResponse: type: object properties: - params: - description: params defines the parameters of the module. + gas_info: + description: gas_info is the information about gas used in the simulation. type: object properties: - allowed_clients: - type: array - items: - type: string - description: allowed_clients defines the list of allowed client state types. - description: >- - QueryClientParamsResponse is the response type for the Query/ClientParams - RPC - - method. - ibc.core.client.v1.QueryClientStateResponse: - type: object - properties: - client_state: - title: client state associated with the request identifier + gas_wanted: + type: string + format: uint64 + description: >- + GasWanted is the maximum units of work we allow this tx to + perform. + gas_used: + type: string + format: uint64 + description: GasUsed is the amount of gas actually consumed. + result: + description: result is the result of the simulation. type: object properties: - '@type': + data: type: string + format: byte description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent + Data is any data returned from message or handler execution. It + MUST be - the fully qualified name of the type (as in + length prefixed in order to separate data from multiple message + executions. - `path/google.protobuf.Duration`). The name should be in a - canonical form + Deprecated. This field is still populated, but prefer msg_response + instead - (e.g., leading "." is not accepted). + because it also contains the Msg response typeURL. + log: + type: string + description: >- + Log contains the log information from message or handler + execution. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - In practice, teams usually precompile into the binary all types - that they + Later, transactions may be queried using these events. + description: >- + Events contains a slice of Event objects that were emitted during + message - expect it to use in the context of Any. However, for URLs which - use the + or handler execution. + msg_responses: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - scheme `http`, `https`, or no scheme, one can optionally set up a - type + protocol buffer message. This string must contain at least - server that maps type URLs to message definitions as follows: + one "/" character. The last segment of the URL's path must + represent + the fully qualified name of the type (as in - * If no scheme is provided, `https` is assumed. + `path/google.protobuf.Duration`). The name should be in a + canonical form - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + (e.g., leading "." is not accepted). - Note: this functionality is not currently available in the - official - protobuf release, and it is not used for type URLs beginning with + In practice, teams usually precompile into the binary all + types that they - type.googleapis.com. + expect it to use in the context of Any. However, for URLs + which use the + scheme `http`, `https`, or no scheme, one can optionally set + up a type - Schemes other than `http`, `https` (or the empty scheme) might be + server that maps type URLs to message definitions as + follows: - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - URL that describes the type of the serialized message. + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Protobuf library provides support to pack/unpack Any values in the - form + Note: this functionality is not currently available in the + official - of utility functions or additional generated methods of the Any type. + protobuf release, and it is not used for type URLs beginning + with + type.googleapis.com. - Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + Schemes other than `http`, `https` (or the empty scheme) + might be - Example 2: Pack and unpack a message in Java. + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + URL that describes the type of the serialized message. - Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + Protobuf library provides support to pack/unpack Any values in + the form - Example 4: Pack and unpack a message in Go + of utility functions or additional generated methods of the Any + type. - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - The pack methods provided by protobuf library will by default use + Example 1: Pack and unpack a message in C++. - 'type.googleapis.com/full.type.name' as the type URL and the unpack + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - methods only use the fully qualified type name after the last '/' + Example 2: Pack and unpack a message in Java. - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - name "y.z". + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + Example 4: Pack and unpack a message in Go - JSON + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - ==== + The pack methods provided by protobuf library will by default + use - The JSON representation of an `Any` value uses the regular + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - representation of the deserialized, embedded message, with an + methods only use the fully qualified type name after the last + '/' - additional field `@type` which contains the type URL. Example: + in the type URL, for example "foo.bar.com/x/y.z" will yield type - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + name "y.z". - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field + JSON - `value` which holds the custom JSON in addition to the `@type` + ==== - field. Example (for message [google.protobuf.Duration][]): + The JSON representation of an `Any` value uses the regular - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + representation of the deserialized, embedded message, with an - RevisionNumber the same. However some consensus algorithms may choose - to + additional field `@type` which contains the type URL. Example: - reset the height in certain conditions e.g. hard forks, state-machine + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - breaking changes In these cases, the RevisionNumber is incremented so - that + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - height continues to be monitonically increasing even as the - RevisionHeight + If the embedded message type is well-known and has a custom JSON - gets reset - description: >- - QueryClientStateResponse is the response type for the Query/ClientState - RPC + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + msg_responses contains the Msg handler responses type packed in + Anys. - method. Besides the client state, it includes a proof and the height from - which the proof was retrieved. - ibc.core.client.v1.QueryClientStatesResponse: + Since: cosmos-sdk 0.46 + description: |- + SimulateResponse is the response type for the + Service.SimulateRPC method. + cosmos.tx.v1beta1.Tip: type: object properties: - client_states: + amount: type: array items: type: object properties: - client_id: + denom: + type: string + amount: type: string - title: client identifier - client_state: - title: client state + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: amount is the amount of the tip + tipper: + type: string + title: tipper is the address of the account paying for the tip + description: |- + Tip is the tip used for meta-transactions. + + Since: cosmos-sdk 0.46 + cosmos.tx.v1beta1.Tx: + type: object + properties: + body: + title: body is the processable content of the transaction + type: object + properties: + messages: + type: array + items: type: object properties: '@type': @@ -65345,364 +68679,221 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - description: >- - IdentifiedClientState defines a client state with an additional - client - - identifier field. - description: list of stored ClientStates of the chain. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - description: >- - QueryClientStatesResponse is the response type for the Query/ClientStates - RPC - - method. - ibc.core.client.v1.QueryClientStatusResponse: - type: object - properties: - status: - type: string - description: >- - QueryClientStatusResponse is the response type for the Query/ClientStatus - RPC - - method. It returns the current status of the IBC client. - ibc.core.client.v1.QueryConsensusStateHeightsResponse: - type: object - properties: - consensus_state_heights: - type: array - items: - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may - choose to - - reset the height in certain conditions e.g. hard forks, - state-machine - - breaking changes In these cases, the RevisionNumber is incremented - so that + description: >- + messages is a list of messages to be executed. The required + signers of - height continues to be monitonically increasing even as the - RevisionHeight + those messages define the number and order of elements in + AuthInfo's - gets reset - title: >- - Height is a monotonically increasing data type + signer_infos and Tx's signatures. Each required signer address is + added to - that can be compared against another Height for the purposes of - updating and + the list only the first time it occurs. - freezing clients - title: consensus state heights - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total + By convention, the first required signer (usually from the first + message) - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + is referred to as the primary signer and pays the fee for the + whole - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryConsensusStateHeightsResponse is the response type for the - Query/ConsensusStateHeights RPC method - ibc.core.client.v1.QueryConsensusStateResponse: - type: object - properties: - consensus_state: - title: >- - consensus state associated with the client identifier at the given - height - type: object - properties: - '@type': + transaction. + memo: type: string description: >- - A URL/resource name that uniquely identifies the type of the - serialized - - protocol buffer message. This string must contain at least - - one "/" character. The last segment of the URL's path must - represent - - the fully qualified name of the type (as in - - `path/google.protobuf.Duration`). The name should be in a - canonical form - - (e.g., leading "." is not accepted). - - - In practice, teams usually precompile into the binary all types - that they + memo is any arbitrary note/comment to be added to the transaction. - expect it to use in the context of Any. However, for URLs which - use the + WARNING: in clients, any publicly exposed text should not be + called memo, - scheme `http`, `https`, or no scheme, one can optionally set up a - type + but should be called `note` instead (see + https://github.com/cosmos/cosmos-sdk/issues/9122). + timeout_height: + type: string + format: uint64 + title: |- + timeout is the block height after which this transaction will not + be processed by the chain + extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - server that maps type URLs to message definitions as follows: + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must + represent - * If no scheme is provided, `https` is assumed. + the fully qualified name of the type (as in - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + `path/google.protobuf.Duration`). The name should be in a + canonical form - Note: this functionality is not currently available in the - official + (e.g., leading "." is not accepted). - protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + In practice, teams usually precompile into the binary all + types that they + expect it to use in the context of Any. However, for URLs + which use the - Schemes other than `http`, `https` (or the empty scheme) might be + scheme `http`, `https`, or no scheme, one can optionally set + up a type - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + server that maps type URLs to message definitions as + follows: - URL that describes the type of the serialized message. + * If no scheme is provided, `https` is assumed. - Protobuf library provides support to pack/unpack Any values in the - form + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - of utility functions or additional generated methods of the Any type. + Note: this functionality is not currently available in the + official + protobuf release, and it is not used for type URLs beginning + with - Example 1: Pack and unpack a message in C++. + type.googleapis.com. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - Example 2: Pack and unpack a message in Java. + Schemes other than `http`, `https` (or the empty scheme) + might be - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a - Example 3: Pack and unpack a message in Python. + URL that describes the type of the serialized message. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - Example 4: Pack and unpack a message in Go + Protobuf library provides support to pack/unpack Any values in + the form - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + of utility functions or additional generated methods of the Any + type. - The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + Example 1: Pack and unpack a message in C++. - methods only use the fully qualified type name after the last '/' + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Example 2: Pack and unpack a message in Java. - name "y.z". + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + Example 3: Pack and unpack a message in Python. + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - JSON + Example 4: Pack and unpack a message in Go - ==== + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The JSON representation of an `Any` value uses the regular + The pack methods provided by protobuf library will by default + use - representation of the deserialized, embedded message, with an + 'type.googleapis.com/full.type.name' as the type URL and the + unpack - additional field `@type` which contains the type URL. Example: + methods only use the fully qualified type name after the last + '/' - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + in the type URL, for example "foo.bar.com/x/y.z" will yield type - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + name "y.z". - If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + JSON - field. Example (for message [google.protobuf.Duration][]): + ==== - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + The JSON representation of an `Any` value uses the regular - RevisionNumber the same. However some consensus algorithms may choose - to + representation of the deserialized, embedded message, with an - reset the height in certain conditions e.g. hard forks, state-machine + additional field `@type` which contains the type URL. Example: - breaking changes In these cases, the RevisionNumber is incremented so - that + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - height continues to be monitonically increasing even as the - RevisionHeight + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - gets reset - title: >- - QueryConsensusStateResponse is the response type for the - Query/ConsensusState + If the embedded message type is well-known and has a custom JSON - RPC method - ibc.core.client.v1.QueryConsensusStatesResponse: - type: object - properties: - consensus_states: - type: array - items: - type: object - properties: - height: - title: consensus state height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + representation, that representation will be embedded adding a + field - RevisionNumber the same. However some consensus algorithms may - choose to + `value` which holds the custom JSON in addition to the `@type` - reset the height in certain conditions e.g. hard forks, - state-machine + field. Example (for message [google.protobuf.Duration][]): - breaking changes In these cases, the RevisionNumber is - incremented so that + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by + chains - height continues to be monitonically increasing even as the - RevisionHeight + when the default options are not sufficient. If any of these are + present - gets reset - consensus_state: - title: consensus state + and can't be handled, the transaction will be rejected + non_critical_extension_options: + type: array + items: type: object properties: '@type': @@ -65869,874 +69060,770 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } - description: >- - ConsensusStateWithHeight defines a consensus state with an - additional height - - field. - title: consensus states associated with the identifier - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 title: >- - total is total number of results available if - PageRequest.count_total + extension_options are arbitrary options that can be added by + chains - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + when the default options are not sufficient. If any of these are + present - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - title: |- - QueryConsensusStatesResponse is the response type for the - Query/ConsensusStates RPC method - ibc.core.client.v1.QueryUpgradedClientStateResponse: + and can't be handled, they will be ignored + description: TxBody is the body of a transaction that all signers sign over. + auth_info: + $ref: '#/definitions/cosmos.tx.v1beta1.AuthInfo' + title: |- + auth_info is the authorization related content of the transaction, + specifically signers, signer modes and fee + signatures: + type: array + items: + type: string + format: byte + description: >- + signatures is a list of signatures that matches the length and order + of + + AuthInfo's signer_infos to allow connecting signature meta information + like + + public key and signing mode by position. + description: Tx is the standard type used for broadcasting transactions. + cosmos.tx.v1beta1.TxBody: type: object properties: - upgraded_client_state: - title: client state associated with the request identifier - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + messages: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - protocol buffer message. This string must contain at least + protocol buffer message. This string must contain at least - one "/" character. The last segment of the URL's path must - represent + one "/" character. The last segment of the URL's path must + represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + `path/google.protobuf.Duration`). The name should be in a + canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into the binary all types - that they + In practice, teams usually precompile into the binary all types + that they - expect it to use in the context of Any. However, for URLs which - use the + expect it to use in the context of Any. However, for URLs which + use the - scheme `http`, `https`, or no scheme, one can optionally set up a - type + scheme `http`, `https`, or no scheme, one can optionally set up + a type - server that maps type URLs to message definitions as follows: + server that maps type URLs to message definitions as follows: - * If no scheme is provided, `https` is assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently available in the - official + Note: this functionality is not currently available in the + official - protobuf release, and it is not used for type URLs beginning with + protobuf release, and it is not used for type URLs beginning + with - type.googleapis.com. + type.googleapis.com. - Schemes other than `http`, `https` (or the empty scheme) might be + Schemes other than `http`, `https` (or the empty scheme) might + be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - URL that describes the type of the serialized message. + URL that describes the type of the serialized message. - Protobuf library provides support to pack/unpack Any values in the - form + Protobuf library provides support to pack/unpack Any values in the + form - of utility functions or additional generated methods of the Any type. + of utility functions or additional generated methods of the Any + type. - Example 1: Pack and unpack a message in C++. + Example 1: Pack and unpack a message in C++. - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { + Foo foo = ...; + Any any; + any.PackFrom(foo); ... - } + if (any.UnpackTo(&foo)) { + ... + } - Example 2: Pack and unpack a message in Java. + Example 2: Pack and unpack a message in Java. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) + foo = Foo(...) + any = Any() + any.Pack(foo) ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } ... - } + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field + representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - QueryUpgradedClientStateResponse is the response type for the - Query/UpgradedClientState RPC method. - ibc.core.client.v1.QueryUpgradedConsensusStateResponse: - type: object - properties: - upgraded_consensus_state: - title: Consensus state associated with the request identifier - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + description: >- + messages is a list of messages to be executed. The required signers of - protocol buffer message. This string must contain at least + those messages define the number and order of elements in AuthInfo's - one "/" character. The last segment of the URL's path must - represent + signer_infos and Tx's signatures. Each required signer address is + added to - the fully qualified name of the type (as in + the list only the first time it occurs. - `path/google.protobuf.Duration`). The name should be in a - canonical form + By convention, the first required signer (usually from the first + message) - (e.g., leading "." is not accepted). + is referred to as the primary signer and pays the fee for the whole + transaction. + memo: + type: string + description: >- + memo is any arbitrary note/comment to be added to the transaction. - In practice, teams usually precompile into the binary all types - that they + WARNING: in clients, any publicly exposed text should not be called + memo, - expect it to use in the context of Any. However, for URLs which - use the + but should be called `note` instead (see + https://github.com/cosmos/cosmos-sdk/issues/9122). + timeout_height: + type: string + format: uint64 + title: |- + timeout is the block height after which this transaction will not + be processed by the chain + extension_options: + type: array + items: + type: object + properties: + '@type': + type: string + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - scheme `http`, `https`, or no scheme, one can optionally set up a - type + protocol buffer message. This string must contain at least - server that maps type URLs to message definitions as follows: + one "/" character. The last segment of the URL's path must + represent + the fully qualified name of the type (as in - * If no scheme is provided, `https` is assumed. + `path/google.protobuf.Duration`). The name should be in a + canonical form - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + (e.g., leading "." is not accepted). - Note: this functionality is not currently available in the - official - protobuf release, and it is not used for type URLs beginning with + In practice, teams usually precompile into the binary all types + that they - type.googleapis.com. + expect it to use in the context of Any. However, for URLs which + use the + scheme `http`, `https`, or no scheme, one can optionally set up + a type - Schemes other than `http`, `https` (or the empty scheme) might be + server that maps type URLs to message definitions as follows: - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - URL that describes the type of the serialized message. + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + Note: this functionality is not currently available in the + official - Protobuf library provides support to pack/unpack Any values in the - form + protobuf release, and it is not used for type URLs beginning + with - of utility functions or additional generated methods of the Any type. + type.googleapis.com. - Example 1: Pack and unpack a message in C++. + Schemes other than `http`, `https` (or the empty scheme) might + be - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - Example 2: Pack and unpack a message in Java. + URL that describes the type of the serialized message. - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - Example 3: Pack and unpack a message in Python. + Protobuf library provides support to pack/unpack Any values in the + form - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } ... - } + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - The pack methods provided by protobuf library will by default use + The pack methods provided by protobuf library will by default use - 'type.googleapis.com/full.type.name' as the type URL and the unpack + 'type.googleapis.com/full.type.name' as the type URL and the unpack - methods only use the fully qualified type name after the last '/' + methods only use the fully qualified type name after the last '/' - in the type URL, for example "foo.bar.com/x/y.z" will yield type + in the type URL, for example "foo.bar.com/x/y.z" will yield type - name "y.z". + name "y.z". - JSON + JSON - ==== + ==== - The JSON representation of an `Any` value uses the regular + The JSON representation of an `Any` value uses the regular - representation of the deserialized, embedded message, with an + representation of the deserialized, embedded message, with an - additional field `@type` which contains the type URL. Example: + additional field `@type` which contains the type URL. Example: - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - If the embedded message type is well-known and has a custom JSON + If the embedded message type is well-known and has a custom JSON - representation, that representation will be embedded adding a field + representation, that representation will be embedded adding a field - `value` which holds the custom JSON in addition to the `@type` + `value` which holds the custom JSON in addition to the `@type` - field. Example (for message [google.protobuf.Duration][]): + field. Example (for message [google.protobuf.Duration][]): - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState RPC method. - ibc.core.commitment.v1.MerklePrefix: - type: object - properties: - key_prefix: - type: string - format: byte - title: |- - MerklePrefix is merkle path prefixed to the key. - The constructed key from the Path and the key will be append(Path.KeyPath, - append(Path.KeyPrefix, key...)) - ibc.core.connection.v1.ConnectionEnd: - type: object - properties: - client_id: - type: string - description: client associated with this connection. - versions: + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by chains + + when the default options are not sufficient. If any of these are + present + + and can't be handled, the transaction will be rejected + non_critical_extension_options: type: array items: type: object properties: - identifier: + '@type': type: string - title: unique version identifier - features: - type: array - items: - type: string - title: list of features compatible with the specified identifier - description: >- - Version defines the versioning scheme used to negotiate the IBC - verison in - - the connection handshake. - description: >- - IBC version which can be utilised to determine encodings or protocols - for - - channels or packets utilising this connection. - state: - description: current state of the connection end. - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - default: STATE_UNINITIALIZED_UNSPECIFIED - counterparty: - description: counterparty chain associated with this connection. - type: object - properties: - client_id: - type: string - description: >- - identifies the client on the counterparty chain associated with a - given - - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty chain associated - with a - - given connection. - prefix: - description: commitment merkle prefix of the counterparty chain. - type: object - properties: - key_prefix: - type: string - format: byte - title: >- - MerklePrefix is merkle path prefixed to the key. + description: >- + A URL/resource name that uniquely identifies the type of the + serialized - The constructed key from the Path and the key will be - append(Path.KeyPath, + protocol buffer message. This string must contain at least - append(Path.KeyPrefix, key...)) - delay_period: - type: string - format: uint64 - description: >- - delay period that must pass before a consensus state can be used for + one "/" character. The last segment of the URL's path must + represent - packet-verification NOTE: delay period logic is only implemented by - some + the fully qualified name of the type (as in - clients. - description: |- - ConnectionEnd defines a stateful object on a chain connected to another - separate one. - NOTE: there must only be 2 defined ConnectionEnds to establish - a connection between two chains. - ibc.core.connection.v1.Counterparty: - type: object - properties: - client_id: - type: string - description: >- - identifies the client on the counterparty chain associated with a - given + `path/google.protobuf.Duration`). The name should be in a + canonical form - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty chain associated - with a + (e.g., leading "." is not accepted). - given connection. - prefix: - description: commitment merkle prefix of the counterparty chain. - type: object - properties: - key_prefix: - type: string - format: byte - title: >- - MerklePrefix is merkle path prefixed to the key. - The constructed key from the Path and the key will be - append(Path.KeyPath, + In practice, teams usually precompile into the binary all types + that they - append(Path.KeyPrefix, key...)) - description: >- - Counterparty defines the counterparty chain associated with a connection - end. - ibc.core.connection.v1.IdentifiedConnection: - type: object - properties: - id: - type: string - description: connection identifier. - client_id: - type: string - description: client associated with this connection. - versions: - type: array - items: - type: object - properties: - identifier: - type: string - title: unique version identifier - features: - type: array - items: - type: string - title: list of features compatible with the specified identifier - description: >- - Version defines the versioning scheme used to negotiate the IBC - verison in + expect it to use in the context of Any. However, for URLs which + use the - the connection handshake. - title: >- - IBC version which can be utilised to determine encodings or protocols - for + scheme `http`, `https`, or no scheme, one can optionally set up + a type - channels or packets utilising this connection - state: - description: current state of the connection end. - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - default: STATE_UNINITIALIZED_UNSPECIFIED - counterparty: - description: counterparty chain associated with this connection. - type: object - properties: - client_id: - type: string - description: >- - identifies the client on the counterparty chain associated with a - given + server that maps type URLs to message definitions as follows: - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty chain associated - with a - given connection. - prefix: - description: commitment merkle prefix of the counterparty chain. - type: object - properties: - key_prefix: - type: string - format: byte - title: >- - MerklePrefix is merkle path prefixed to the key. + * If no scheme is provided, `https` is assumed. - The constructed key from the Path and the key will be - append(Path.KeyPath, + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - append(Path.KeyPrefix, key...)) - delay_period: - type: string - format: uint64 - description: delay period associated with this connection. - description: |- - IdentifiedConnection defines a connection with additional connection - identifier field. - ibc.core.connection.v1.MsgConnectionOpenAckResponse: - type: object - description: >- - MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response - type. - ibc.core.connection.v1.MsgConnectionOpenConfirmResponse: - type: object - description: |- - MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm - response type. - ibc.core.connection.v1.MsgConnectionOpenInitResponse: - type: object - description: |- - MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response - type. - ibc.core.connection.v1.MsgConnectionOpenTryResponse: - type: object - description: >- - MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response - type. - ibc.core.connection.v1.Params: - type: object - properties: - max_expected_time_per_block: - type: string - format: uint64 - description: >- - maximum expected time per block (in nanoseconds), used to enforce - block delay. This parameter should reflect the + Note: this functionality is not currently available in the + official - largest amount of time that the chain might reasonably take to produce - the next block under normal operating + protobuf release, and it is not used for type URLs beginning + with - conditions. A safe choice is 3-5x the expected time per block. - description: Params defines the set of Connection parameters. - ibc.core.connection.v1.QueryClientConnectionsResponse: - type: object - properties: - connection_paths: - type: array - items: - type: string - description: slice of all the connection paths associated with a client. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was generated - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + type.googleapis.com. - RevisionNumber the same. However some consensus algorithms may choose - to - reset the height in certain conditions e.g. hard forks, state-machine + Schemes other than `http`, `https` (or the empty scheme) might + be - breaking changes In these cases, the RevisionNumber is incremented so - that + used with implementation specific semantics. + additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a - height continues to be monitonically increasing even as the - RevisionHeight + URL that describes the type of the serialized message. - gets reset - title: |- - QueryClientConnectionsResponse is the response type for the - Query/ClientConnections RPC method - ibc.core.connection.v1.QueryConnectionClientStateResponse: - type: object - properties: - identified_client_state: - title: client state associated with the channel - type: object - properties: - client_id: - type: string - title: client identifier - client_state: - title: client state - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies the type of the - serialized - protocol buffer message. This string must contain at least + Protobuf library provides support to pack/unpack Any values in the + form - one "/" character. The last segment of the URL's path must - represent + of utility functions or additional generated methods of the Any + type. - the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name should be in a - canonical form + Example 1: Pack and unpack a message in C++. - (e.g., leading "." is not accepted). + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + Example 2: Pack and unpack a message in Java. - In practice, teams usually precompile into the binary all - types that they + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } - expect it to use in the context of Any. However, for URLs - which use the + Example 3: Pack and unpack a message in Python. - scheme `http`, `https`, or no scheme, one can optionally set - up a type + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... - server that maps type URLs to message definitions as follows: + Example 4: Pack and unpack a message in Go + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } - * If no scheme is provided, `https` is assumed. + The pack methods provided by protobuf library will by default use - * An HTTP GET on the URL must yield a [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup results based on - the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + 'type.googleapis.com/full.type.name' as the type URL and the unpack - Note: this functionality is not currently available in the - official + methods only use the fully qualified type name after the last '/' - protobuf release, and it is not used for type URLs beginning - with + in the type URL, for example "foo.bar.com/x/y.z" will yield type - type.googleapis.com. + name "y.z". - Schemes other than `http`, `https` (or the empty scheme) might - be - used with implementation specific semantics. - additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message - along with a + JSON - URL that describes the type of the serialized message. + ==== + The JSON representation of an `Any` value uses the regular - Protobuf library provides support to pack/unpack Any values in the - form + representation of the deserialized, embedded message, with an - of utility functions or additional generated methods of the Any - type. + additional field `@type` which contains the type URL. Example: + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } - Example 1: Pack and unpack a message in C++. + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } + If the embedded message type is well-known and has a custom JSON - Example 2: Pack and unpack a message in Java. + representation, that representation will be embedded adding a field - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } + `value` which holds the custom JSON in addition to the `@type` - Example 3: Pack and unpack a message in Python. + field. Example (for message [google.protobuf.Duration][]): - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + title: >- + extension_options are arbitrary options that can be added by chains - Example 4: Pack and unpack a message in Go + when the default options are not sufficient. If any of these are + present - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } + and can't be handled, they will be ignored + description: TxBody is the body of a transaction that all signers sign over. + cosmos.tx.v1beta1.TxDecodeAminoRequest: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + RPC method. - The pack methods provided by protobuf library will by default use + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeAminoResponse: + type: object + properties: + amino_json: + type: string + description: |- + TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + RPC method. - 'type.googleapis.com/full.type.name' as the type URL and the - unpack + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeRequest: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the raw transaction. + description: |- + TxDecodeRequest is the request type for the Service.TxDecode + RPC method. - methods only use the fully qualified type name after the last '/' + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxDecodeResponse: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the decoded transaction. + description: |- + TxDecodeResponse is the response type for the + Service.TxDecode method. - in the type URL, for example "foo.bar.com/x/y.z" will yield type + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoRequest: + type: object + properties: + amino_json: + type: string + description: |- + TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + RPC method. - name "y.z". + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeAminoResponse: + type: object + properties: + amino_binary: + type: string + format: byte + description: |- + TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + RPC method. + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeRequest: + type: object + properties: + tx: + $ref: '#/definitions/cosmos.tx.v1beta1.Tx' + description: tx is the transaction to encode. + description: |- + TxEncodeRequest is the request type for the Service.TxEncode + RPC method. + Since: cosmos-sdk 0.47 + cosmos.tx.v1beta1.TxEncodeResponse: + type: object + properties: + tx_bytes: + type: string + format: byte + description: tx_bytes is the encoded transaction bytes. + description: |- + TxEncodeResponse is the response type for the + Service.TxEncode method. - JSON + Since: cosmos-sdk 0.47 + tendermint.abci.Event: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: EventAttribute is a single key-value pair, associated with an event. + description: >- + Event allows application developers to attach additional information to - ==== + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. - The JSON representation of an `Any` value uses the regular + Later, transactions may be queried using these events. + tendermint.abci.EventAttribute: + type: object + properties: + key: + type: string + value: + type: string + index: + type: boolean + title: nondeterministic + description: EventAttribute is a single key-value pair, associated with an event. + cosmos.upgrade.v1beta1.ModuleVersion: + type: object + properties: + name: + type: string + title: name of the app module + version: + type: string + format: uint64 + title: consensus version of the app module + description: |- + ModuleVersion specifies a module and its consensus version. - representation of the deserialized, embedded message, with an + Since: cosmos-sdk 0.43 + cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse: + type: object + description: |- + MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. - additional field `@type` which contains the type URL. Example: + Since: cosmos-sdk 0.46 + cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse: + type: object + description: |- + MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } + Since: cosmos-sdk 0.46 + cosmos.upgrade.v1beta1.Plan: + type: object + properties: + name: + type: string + description: >- + Sets the name for the upgrade. This name will be used by the upgraded - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } + version of the software to apply any special "on-upgrade" commands + during - If the embedded message type is well-known and has a custom JSON + the first BeginBlock method after the upgrade is applied. It is also + used - representation, that representation will be embedded adding a - field + to detect whether a software version can handle a given upgrade. If no - `value` which holds the custom JSON in addition to the `@type` + upgrade handler with this name has been set in the software, it will + be - field. Example (for message [google.protobuf.Duration][]): + assumed that the software is out-of-date when the upgrade Time or + Height is - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - description: |- - IdentifiedClientState defines a client state with an additional client - identifier field. - proof: + reached and the software will exit. + time: type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision + format: date-time description: >- - Normally the RevisionHeight is incremented at each height while - keeping - - RevisionNumber the same. However some consensus algorithms may choose - to + Deprecated: Time based upgrades have been deprecated. Time based + upgrade logic - reset the height in certain conditions e.g. hard forks, state-machine + has been removed from the SDK. - breaking changes In these cases, the RevisionNumber is incremented so - that + If this field is not empty, an error will be thrown. + height: + type: string + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: |- + Any application specific upgrade info to be included on-chain + such as a git commit that validators could automatically upgrade to + upgraded_client_state: + description: >- + Deprecated: UpgradedClientState field has been deprecated. IBC upgrade + logic has been - height continues to be monitonically increasing even as the - RevisionHeight + moved to the IBC module in the sub module 02-client. - gets reset - title: |- - QueryConnectionClientStateResponse is the response type for the - Query/ConnectionClientState RPC method - ibc.core.connection.v1.QueryConnectionConsensusStateResponse: - type: object - properties: - consensus_state: - title: consensus state associated with the channel + If this field is not empty, an error will be thrown. type: object properties: '@type': @@ -66792,476 +69879,236 @@ definitions: used with implementation specific semantics. additionalProperties: {} - description: >- - `Any` contains an arbitrary serialized protocol buffer message along - with a - - URL that describes the type of the serialized message. - - - Protobuf library provides support to pack/unpack Any values in the - form - - of utility functions or additional generated methods of the Any type. - - - Example 1: Pack and unpack a message in C++. - - Foo foo = ...; - Any any; - any.PackFrom(foo); - ... - if (any.UnpackTo(&foo)) { - ... - } - - Example 2: Pack and unpack a message in Java. - - Foo foo = ...; - Any any = Any.pack(foo); - ... - if (any.is(Foo.class)) { - foo = any.unpack(Foo.class); - } - - Example 3: Pack and unpack a message in Python. - - foo = Foo(...) - any = Any() - any.Pack(foo) - ... - if any.Is(Foo.DESCRIPTOR): - any.Unpack(foo) - ... - - Example 4: Pack and unpack a message in Go - - foo := &pb.Foo{...} - any, err := anypb.New(foo) - if err != nil { - ... - } - ... - foo := &pb.Foo{} - if err := any.UnmarshalTo(foo); err != nil { - ... - } - - The pack methods provided by protobuf library will by default use - - 'type.googleapis.com/full.type.name' as the type URL and the unpack - - methods only use the fully qualified type name after the last '/' - - in the type URL, for example "foo.bar.com/x/y.z" will yield type - - name "y.z". - - - - JSON - - ==== - - The JSON representation of an `Any` value uses the regular - - representation of the deserialized, embedded message, with an - - additional field `@type` which contains the type URL. Example: - - package google.profile; - message Person { - string first_name = 1; - string last_name = 2; - } - - { - "@type": "type.googleapis.com/google.profile.Person", - "firstName": , - "lastName": - } - - If the embedded message type is well-known and has a custom JSON - - representation, that representation will be embedded adding a field - - `value` which holds the custom JSON in addition to the `@type` - - field. Example (for message [google.protobuf.Duration][]): - - { - "@type": "type.googleapis.com/google.protobuf.Duration", - "value": "1.212s" - } - client_id: + description: >- + Plan specifies information about a planned upgrade and when it should + occur. + cosmos.upgrade.v1beta1.QueryAppliedPlanResponse: + type: object + properties: + height: type: string - title: client ID associated with the consensus state - proof: + format: int64 + description: height is the block height at which the plan was applied. + description: >- + QueryAppliedPlanResponse is the response type for the Query/AppliedPlan + RPC + + method. + cosmos.upgrade.v1beta1.QueryAuthorityResponse: + type: object + properties: + address: type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved + description: 'Since: cosmos-sdk 0.46' + title: QueryAuthorityResponse is the response type for Query/Authority + cosmos.upgrade.v1beta1.QueryCurrentPlanResponse: + type: object + properties: + plan: + description: plan is the current upgrade plan. type: object properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: + name: type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + description: >- + Sets the name for the upgrade. This name will be used by the + upgraded - RevisionNumber the same. However some consensus algorithms may choose - to + version of the software to apply any special "on-upgrade" commands + during - reset the height in certain conditions e.g. hard forks, state-machine + the first BeginBlock method after the upgrade is applied. It is + also used - breaking changes In these cases, the RevisionNumber is incremented so - that + to detect whether a software version can handle a given upgrade. + If no - height continues to be monitonically increasing even as the - RevisionHeight + upgrade handler with this name has been set in the software, it + will be - gets reset - title: |- - QueryConnectionConsensusStateResponse is the response type for the - Query/ConnectionConsensusState RPC method - ibc.core.connection.v1.QueryConnectionParamsResponse: - type: object - properties: - params: - description: params defines the parameters of the module. - type: object - properties: - max_expected_time_per_block: + assumed that the software is out-of-date when the upgrade Time or + Height is + + reached and the software will exit. + time: type: string - format: uint64 + format: date-time description: >- - maximum expected time per block (in nanoseconds), used to enforce - block delay. This parameter should reflect the + Deprecated: Time based upgrades have been deprecated. Time based + upgrade logic - largest amount of time that the chain might reasonably take to - produce the next block under normal operating + has been removed from the SDK. - conditions. A safe choice is 3-5x the expected time per block. - description: >- - QueryConnectionParamsResponse is the response type for the - Query/ConnectionParams RPC method. - ibc.core.connection.v1.QueryConnectionResponse: - type: object - properties: - connection: - title: connection associated with the request identifier - type: object - properties: - client_id: + If this field is not empty, an error will be thrown. + height: type: string - description: client associated with this connection. - versions: - type: array - items: - type: object - properties: - identifier: - type: string - title: unique version identifier - features: - type: array - items: - type: string - title: list of features compatible with the specified identifier - description: >- - Version defines the versioning scheme used to negotiate the IBC - verison in + format: int64 + description: The height at which the upgrade must be performed. + info: + type: string + title: >- + Any application specific upgrade info to be included on-chain - the connection handshake. + such as a git commit that validators could automatically upgrade + to + upgraded_client_state: description: >- - IBC version which can be utilised to determine encodings or - protocols for + Deprecated: UpgradedClientState field has been deprecated. IBC + upgrade logic has been - channels or packets utilising this connection. - state: - description: current state of the connection end. - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - default: STATE_UNINITIALIZED_UNSPECIFIED - counterparty: - description: counterparty chain associated with this connection. + moved to the IBC module in the sub module 02-client. + + If this field is not empty, an error will be thrown. type: object properties: - client_id: + '@type': type: string description: >- - identifies the client on the counterparty chain associated - with a given + A URL/resource name that uniquely identifies the type of the + serialized - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty chain - associated with a + protocol buffer message. This string must contain at least - given connection. - prefix: - description: commitment merkle prefix of the counterparty chain. - type: object - properties: - key_prefix: - type: string - format: byte - title: >- - MerklePrefix is merkle path prefixed to the key. + one "/" character. The last segment of the URL's path must + represent + + the fully qualified name of the type (as in - The constructed key from the Path and the key will be - append(Path.KeyPath, + `path/google.protobuf.Duration`). The name should be in a + canonical form - append(Path.KeyPrefix, key...)) - delay_period: - type: string - format: uint64 - description: >- - delay period that must pass before a consensus state can be used - for + (e.g., leading "." is not accepted). - packet-verification NOTE: delay period logic is only implemented - by some - clients. - description: >- - ConnectionEnd defines a stateful object on a chain connected to - another + In practice, teams usually precompile into the binary all + types that they - separate one. + expect it to use in the context of Any. However, for URLs + which use the - NOTE: there must only be 2 defined ConnectionEnds to establish + scheme `http`, `https`, or no scheme, one can optionally set + up a type - a connection between two chains. - proof: - type: string - format: byte - title: merkle proof of existence - proof_height: - title: height at which the proof was retrieved - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision - description: >- - Normally the RevisionHeight is incremented at each height while - keeping + server that maps type URLs to message definitions as follows: - RevisionNumber the same. However some consensus algorithms may choose - to - reset the height in certain conditions e.g. hard forks, state-machine + * If no scheme is provided, `https` is assumed. - breaking changes In these cases, the RevisionNumber is incremented so - that + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on + the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - height continues to be monitonically increasing even as the - RevisionHeight + Note: this functionality is not currently available in the + official - gets reset - description: >- - QueryConnectionResponse is the response type for the Query/Connection RPC + protobuf release, and it is not used for type URLs beginning + with - method. Besides the connection end, it includes a proof and the height - from + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) might + be + + used with implementation specific semantics. + additionalProperties: {} + description: >- + QueryCurrentPlanResponse is the response type for the Query/CurrentPlan + RPC - which the proof was retrieved. - ibc.core.connection.v1.QueryConnectionsResponse: + method. + cosmos.upgrade.v1beta1.QueryModuleVersionsResponse: type: object properties: - connections: + module_versions: type: array items: type: object properties: - id: - type: string - description: connection identifier. - client_id: - type: string - description: client associated with this connection. - versions: - type: array - items: - type: object - properties: - identifier: - type: string - title: unique version identifier - features: - type: array - items: - type: string - title: list of features compatible with the specified identifier - description: >- - Version defines the versioning scheme used to negotiate the - IBC verison in - - the connection handshake. - title: >- - IBC version which can be utilised to determine encodings or - protocols for - - channels or packets utilising this connection - state: - description: current state of the connection end. + name: type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - default: STATE_UNINITIALIZED_UNSPECIFIED - counterparty: - description: counterparty chain associated with this connection. - type: object - properties: - client_id: - type: string - description: >- - identifies the client on the counterparty chain associated - with a given - - connection. - connection_id: - type: string - description: >- - identifies the connection end on the counterparty chain - associated with a - - given connection. - prefix: - description: commitment merkle prefix of the counterparty chain. - type: object - properties: - key_prefix: - type: string - format: byte - title: >- - MerklePrefix is merkle path prefixed to the key. - - The constructed key from the Path and the key will be - append(Path.KeyPath, - - append(Path.KeyPrefix, key...)) - delay_period: + title: name of the app module + version: type: string format: uint64 - description: delay period associated with this connection. + title: consensus version of the app module description: |- - IdentifiedConnection defines a connection with additional connection - identifier field. - description: list of stored connections of the chain. - pagination: - title: pagination response - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. + ModuleVersion specifies a module and its consensus version. - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - height: - title: query block height - type: object - properties: - revision_number: - type: string - format: uint64 - title: the revision that the client is currently on - revision_height: - type: string - format: uint64 - title: the height within the given revision + Since: cosmos-sdk 0.43 description: >- - Normally the RevisionHeight is incremented at each height while - keeping + module_versions is a list of module names with their consensus + versions. + description: >- + QueryModuleVersionsResponse is the response type for the + Query/ModuleVersions - RevisionNumber the same. However some consensus algorithms may choose - to + RPC method. - reset the height in certain conditions e.g. hard forks, state-machine - breaking changes In these cases, the RevisionNumber is incremented so - that + Since: cosmos-sdk 0.43 + cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse: + type: object + properties: + upgraded_consensus_state: + type: string + format: byte + title: 'Since: cosmos-sdk 0.43' + description: >- + QueryUpgradedConsensusStateResponse is the response type for the + Query/UpgradedConsensusState + + RPC method. + cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse: + type: object + description: >- + MsgCreateVestingAccountResponse defines the + Msg/CreatePeriodicVestingAccount + + response type. - height continues to be monitonically increasing even as the - RevisionHeight - gets reset + Since: cosmos-sdk 0.46 + cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse: + type: object description: >- - QueryConnectionsResponse is the response type for the Query/Connections - RPC + MsgCreatePermanentLockedAccountResponse defines the + Msg/CreatePermanentLockedAccount response type. - method. - ibc.core.connection.v1.State: - type: string - enum: - - STATE_UNINITIALIZED_UNSPECIFIED - - STATE_INIT - - STATE_TRYOPEN - - STATE_OPEN - default: STATE_UNINITIALIZED_UNSPECIFIED - description: |- - State defines if a connection is in one of the following states: - INIT, TRYOPEN, OPEN or UNINITIALIZED. - - - STATE_UNINITIALIZED_UNSPECIFIED: Default State - - STATE_INIT: A connection end has just started the opening handshake. - - STATE_TRYOPEN: A connection end has acknowledged the handshake step on the counterparty - chain. - - STATE_OPEN: A connection end has completed the handshake. - ibc.core.connection.v1.Version: + + Since: cosmos-sdk 0.46 + cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse: + type: object + description: >- + MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount + response type. + cosmos.vesting.v1beta1.Period: type: object properties: - identifier: + length: type: string - title: unique version identifier - features: + format: int64 + description: Period duration in seconds. + amount: type: array items: - type: string - title: list of features compatible with the specified identifier - description: |- - Version defines the versioning scheme used to negotiate the IBC verison in - the connection handshake. + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: Period defines a length of time and amount of coins that will vest. lavanet.lava.conflict.ConflictRelayData: type: object properties: @@ -67301,8 +70148,22 @@ definitions: type: string format: int64 unresponsive_providers: - type: string - format: byte + type: array + items: + type: object + properties: + address: + type: string + disconnections: + type: string + format: uint64 + errors: + type: string + format: uint64 + timestamp_s: + type: string + format: int64 + title: sdk needs the suffix _list for repeated fields lava_chain_id: type: string sig: @@ -67324,6 +70185,9 @@ definitions: project_sig: type: string format: byte + virtual_epoch: + type: string + format: uint64 qos_excellence_report: type: object properties: @@ -67364,9 +70228,14 @@ definitions: value: type: string addon: + type: string + extensions: type: array items: type: string + seen_block: + type: string + format: int64 reply: type: object properties: @@ -67626,6 +70495,13 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } + lavanet.lava.conflict.QueryConsumerConflictsResponse: + type: object + properties: + conflicts: + type: array + items: + type: string lavanet.lava.conflict.QueryGetConflictVoteResponse: type: object properties: @@ -67709,6 +70585,21 @@ definitions: votersRewardPercent: type: string description: QueryParamsResponse is response type for the Query/Params RPC method. + lavanet.lava.conflict.QueryProviderConflictsResponse: + type: object + properties: + reported: + type: array + items: + type: string + not_voted: + type: array + items: + type: string + committed: + type: array + items: + type: string lavanet.lava.conflict.ReplyMetadata: type: object properties: @@ -67769,8 +70660,22 @@ definitions: type: string format: int64 unresponsive_providers: - type: string - format: byte + type: array + items: + type: object + properties: + address: + type: string + disconnections: + type: string + format: uint64 + errors: + type: string + format: uint64 + timestamp_s: + type: string + format: int64 + title: sdk needs the suffix _list for repeated fields lava_chain_id: type: string sig: @@ -67792,6 +70697,9 @@ definitions: project_sig: type: string format: byte + virtual_epoch: + type: string + format: uint64 qos_excellence_report: type: object properties: @@ -67832,9 +70740,14 @@ definitions: value: type: string addon: + type: string + extensions: type: array items: type: string + seen_block: + type: string + format: int64 reply: type: object properties: @@ -67892,8 +70805,22 @@ definitions: type: string format: int64 unresponsive_providers: - type: string - format: byte + type: array + items: + type: object + properties: + address: + type: string + disconnections: + type: string + format: uint64 + errors: + type: string + format: uint64 + timestamp_s: + type: string + format: int64 + title: sdk needs the suffix _list for repeated fields lava_chain_id: type: string sig: @@ -67915,6 +70842,9 @@ definitions: project_sig: type: string format: byte + virtual_epoch: + type: string + format: uint64 qos_excellence_report: type: object properties: @@ -67955,619 +70885,1619 @@ definitions: value: type: string addon: + type: string + extensions: type: array items: type: string + seen_block: + type: string + format: int64 reply: type: object properties: - hash_all_data_hash: - type: string - format: byte - sig: - type: string - format: byte - latest_block: - type: string - format: int64 - finalized_blocks_hashes: + hash_all_data_hash: + type: string + format: byte + sig: + type: string + format: byte + latest_block: + type: string + format: int64 + finalized_blocks_hashes: + type: string + format: byte + sig_blocks: + type: string + format: byte + lavanet.lava.conflict.Rewards: + type: object + properties: + winnerRewardPercent: + type: string + clientRewardPercent: + type: string + votersRewardPercent: + type: string + lavanet.lava.conflict.Vote: + type: object + properties: + address: + type: string + Hash: + type: string + format: byte + Result: + type: string + format: int64 + lavanet.lava.pairing.Badge: + type: object + properties: + cu_allocation: + type: string + format: uint64 + epoch: + type: string + format: uint64 + address: + type: string + lava_chain_id: + type: string + project_sig: + type: string + format: byte + virtual_epoch: + type: string + format: uint64 + lavanet.lava.pairing.Metadata: + type: object + properties: + name: + type: string + value: + type: string + lavanet.lava.pairing.QualityOfServiceReport: + type: object + properties: + latency: + type: string + availability: + type: string + sync: + type: string + lavanet.lava.pairing.RelayPrivateData: + type: object + properties: + connection_type: + type: string + api_url: + type: string + title: >- + some relays have associated urls that are filled with params + ('/block/{height}') + data: + type: string + format: byte + request_block: + type: string + format: int64 + api_interface: + type: string + salt: + type: string + format: byte + metadata: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + addon: + type: string + extensions: + type: array + items: + type: string + seen_block: + type: string + format: int64 + lavanet.lava.pairing.RelayReply: + type: object + properties: + data: + type: string + format: byte + sig: + type: string + format: byte + title: sign the data hash+query hash+nonce + latest_block: + type: string + format: int64 + finalized_blocks_hashes: + type: string + format: byte + sig_blocks: + type: string + format: byte + title: >- + sign + latest_block+finalized_blocks_hashes+session_id+block_height+relay_num + metadata: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + lavanet.lava.pairing.RelayRequest: + type: object + properties: + relay_session: + type: object + properties: + spec_id: + type: string + content_hash: + type: string + format: byte + session_id: + type: string + format: uint64 + cu_sum: + type: string + format: uint64 + title: total compute unit used including this relay + provider: + type: string + relay_num: + type: string + format: uint64 + qos_report: + type: object + properties: + latency: + type: string + availability: + type: string + sync: + type: string + epoch: + type: string + format: int64 + unresponsive_providers: + type: array + items: + type: object + properties: + address: + type: string + disconnections: + type: string + format: uint64 + errors: + type: string + format: uint64 + timestamp_s: + type: string + format: int64 + title: sdk needs the suffix _list for repeated fields + lava_chain_id: + type: string + sig: + type: string + format: byte + badge: + type: object + properties: + cu_allocation: + type: string + format: uint64 + epoch: + type: string + format: uint64 + address: + type: string + lava_chain_id: + type: string + project_sig: + type: string + format: byte + virtual_epoch: + type: string + format: uint64 + qos_excellence_report: + type: object + properties: + latency: + type: string + availability: + type: string + sync: + type: string + relay_data: + type: object + properties: + connection_type: + type: string + api_url: + type: string + title: >- + some relays have associated urls that are filled with params + ('/block/{height}') + data: + type: string + format: byte + request_block: + type: string + format: int64 + api_interface: + type: string + salt: + type: string + format: byte + metadata: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + addon: + type: string + extensions: + type: array + items: + type: string + seen_block: + type: string + format: int64 + lavanet.lava.pairing.RelaySession: + type: object + properties: + spec_id: + type: string + content_hash: + type: string + format: byte + session_id: + type: string + format: uint64 + cu_sum: + type: string + format: uint64 + title: total compute unit used including this relay + provider: + type: string + relay_num: + type: string + format: uint64 + qos_report: + type: object + properties: + latency: + type: string + availability: + type: string + sync: + type: string + epoch: + type: string + format: int64 + unresponsive_providers: + type: array + items: + type: object + properties: + address: + type: string + disconnections: + type: string + format: uint64 + errors: + type: string + format: uint64 + timestamp_s: + type: string + format: int64 + title: sdk needs the suffix _list for repeated fields + lava_chain_id: + type: string + sig: + type: string + format: byte + badge: + type: object + properties: + cu_allocation: + type: string + format: uint64 + epoch: + type: string + format: uint64 + address: + type: string + lava_chain_id: + type: string + project_sig: + type: string + format: byte + virtual_epoch: + type: string + format: uint64 + qos_excellence_report: + type: object + properties: + latency: + type: string + availability: + type: string + sync: + type: string + lavanet.lava.pairing.ReportedProvider: + type: object + properties: + address: + type: string + disconnections: + type: string + format: uint64 + errors: + type: string + format: uint64 + timestamp_s: + type: string + format: int64 + lavanet.lava.downtime.v1.Params: + type: object + properties: + downtime_duration: + type: string + description: |- + downtime_duration defines the minimum time elapsed between blocks + that we consider the chain to be down. + epoch_duration: + type: string + title: >- + epoch_duration defines an estimation of the time elapsed between + epochs + description: Params defines the parameters of the downtime module. + lavanet.lava.downtime.v1.QueryDowntimeResponse: + type: object + properties: + cumulative_downtime_duration: + type: string + description: >- + QueryDowntimeResponse is the response type for the Query/QueryDowntime RPC + method. + lavanet.lava.downtime.v1.QueryParamsResponse: + type: object + properties: + params: + type: object + properties: + downtime_duration: + type: string + description: |- + downtime_duration defines the minimum time elapsed between blocks + that we consider the chain to be down. + epoch_duration: + type: string + title: >- + epoch_duration defines an estimation of the time elapsed between + epochs + description: Params defines the parameters of the downtime module. + lavanet.lava.dualstaking.Delegation: + type: object + properties: + provider: + type: string + title: provider receives the delegated funds + chainID: + type: string + title: chainID to which staking delegate funds + delegator: + type: string + title: delegator that owns the delegated funds + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + timestamp: + type: string + format: int64 + title: Unix timestamp of the delegation (+ month) + lavanet.lava.dualstaking.DelegatorRewardInfo: + type: object + properties: + provider: + type: string + chain_id: + type: string + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + lavanet.lava.dualstaking.MsgClaimRewardsResponse: + type: object + lavanet.lava.dualstaking.MsgDelegateResponse: + type: object + lavanet.lava.dualstaking.MsgRedelegateResponse: + type: object + lavanet.lava.dualstaking.MsgUnbondResponse: + type: object + lavanet.lava.dualstaking.Params: + type: object + properties: + min_self_delegation: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: min self delegation for provider + description: Params defines the parameters for the module. + lavanet.lava.dualstaking.QueryDelegatorProvidersResponse: + type: object + properties: + delegations: + type: array + items: + type: object + properties: + provider: + type: string + title: provider receives the delegated funds + chainID: + type: string + title: chainID to which staking delegate funds + delegator: + type: string + title: delegator that owns the delegated funds + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + timestamp: + type: string + format: int64 + title: Unix timestamp of the delegation (+ month) + lavanet.lava.dualstaking.QueryDelegatorRewardsResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + provider: + type: string + chain_id: + type: string + amount: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + lavanet.lava.dualstaking.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + min_self_delegation: + type: object + properties: + denom: type: string - format: byte - sig_blocks: + amount: type: string - format: byte - lavanet.lava.conflict.Rewards: - type: object - properties: - winnerRewardPercent: - type: string - clientRewardPercent: - type: string - votersRewardPercent: - type: string - lavanet.lava.conflict.Vote: + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: min self delegation for provider + description: QueryParamsResponse is response type for the Query/Params RPC method. + lavanet.lava.dualstaking.QueryProviderDelegatorsResponse: type: object properties: - address: - type: string - Hash: - type: string - format: byte - Result: - type: string - format: int64 - lavanet.lava.pairing.Badge: + delegations: + type: array + items: + type: object + properties: + provider: + type: string + title: provider receives the delegated funds + chainID: + type: string + title: chainID to which staking delegate funds + delegator: + type: string + title: delegator that owns the delegated funds + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + timestamp: + type: string + format: int64 + title: Unix timestamp of the delegation (+ month) + lavanet.lava.epochstorage.BlockReport: type: object properties: - cu_allocation: - type: string - format: uint64 epoch: type: string format: uint64 - address: - type: string - lava_chain_id: + latest_block: type: string - project_sig: + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of the + provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + lavanet.lava.epochstorage.Endpoint: + type: object + properties: + iPPORT: type: string - format: byte - lavanet.lava.pairing.Metadata: + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + lavanet.lava.epochstorage.EpochDetails: type: object properties: - name: + startBlock: type: string - value: + format: uint64 + earliestStart: type: string - lavanet.lava.pairing.QualityOfServiceReport: + format: uint64 + deletedEpochs: + type: array + items: + type: string + format: uint64 + lavanet.lava.epochstorage.FixatedParams: type: object properties: - latency: + index: type: string - availability: + parameter: type: string - sync: + format: byte + fixationBlock: type: string - lavanet.lava.pairing.RelayPrivateData: + format: uint64 + lavanet.lava.epochstorage.Params: type: object properties: - connection_type: - type: string - api_url: + unstakeHoldBlocks: type: string - title: >- - some relays have associated urls that are filled with params - ('/block/{height}') - data: + format: uint64 + epochBlocks: type: string - format: byte - request_block: + format: uint64 + epochsToSave: type: string - format: int64 - api_interface: + format: uint64 + latestParamChange: type: string - salt: + format: uint64 + unstakeHoldBlocksStatic: type: string - format: byte - metadata: + format: uint64 + description: Params defines the parameters for the module. + lavanet.lava.epochstorage.QueryAllFixatedParamsResponse: + type: object + properties: + fixatedParams: type: array items: type: object properties: - name: + index: type: string - value: + parameter: type: string - addon: - type: array - items: - type: string - extensions: - type: array - items: - type: string - lavanet.lava.pairing.RelayReply: + format: byte + fixationBlock: + type: string + format: uint64 + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + lavanet.lava.epochstorage.QueryAllStakeStorageResponse: type: object properties: - data: - type: string - format: byte - sig: - type: string - format: byte - title: sign the data hash+query hash+nonce - latest_block: - type: string - format: int64 - finalized_blocks_hashes: - type: string - format: byte - sig_blocks: - type: string - format: byte - title: >- - sign - latest_block+finalized_blocks_hashes+session_id+block_height+relay_num - metadata: + stakeStorage: type: array items: type: object properties: - name: + index: type: string - value: + stakeEntries: + type: array + items: + type: object + properties: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + address: + type: string + stake_applied_block: + type: string + format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding + blocks of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync + score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: >- + moniker defines a human-readable name for the + validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for + security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + epochBlockHash: type: string - lavanet.lava.pairing.RelayRequest: + format: byte + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + lavanet.lava.epochstorage.QueryGetEpochDetailsResponse: + type: object + properties: + EpochDetails: + type: object + properties: + startBlock: + type: string + format: uint64 + earliestStart: + type: string + format: uint64 + deletedEpochs: + type: array + items: + type: string + format: uint64 + lavanet.lava.epochstorage.QueryGetFixatedParamsResponse: + type: object + properties: + fixatedParams: + type: object + properties: + index: + type: string + parameter: + type: string + format: byte + fixationBlock: + type: string + format: uint64 + lavanet.lava.epochstorage.QueryGetStakeStorageResponse: + type: object + properties: + stakeStorage: + type: object + properties: + index: + type: string + stakeEntries: + type: array + items: + type: object + properties: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + address: + type: string + stake_applied_block: + type: string + format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks + of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + epochBlockHash: + type: string + format: byte + lavanet.lava.epochstorage.QueryParamsResponse: type: object properties: - relay_session: + params: + description: params holds all the parameters of this module. type: object properties: - spec_id: - type: string - content_hash: - type: string - format: byte - session_id: + unstakeHoldBlocks: type: string format: uint64 - cu_sum: + epochBlocks: type: string format: uint64 - title: total compute unit used including this relay - provider: - type: string - relay_num: + epochsToSave: type: string format: uint64 - qos_report: - type: object - properties: - latency: - type: string - availability: - type: string - sync: - type: string - epoch: - type: string - format: int64 - unresponsive_providers: - type: string - format: byte - lava_chain_id: + latestParamChange: type: string - sig: + format: uint64 + unstakeHoldBlocksStatic: type: string - format: byte - badge: - type: object - properties: - cu_allocation: - type: string - format: uint64 - epoch: - type: string - format: uint64 - address: - type: string - lava_chain_id: - type: string - project_sig: - type: string - format: byte - qos_excellence_report: - type: object - properties: - latency: - type: string - availability: - type: string - sync: - type: string - relay_data: + format: uint64 + description: QueryParamsResponse is response type for the Query/Params RPC method. + lavanet.lava.epochstorage.StakeEntry: + type: object + properties: + stake: type: object properties: - connection_type: - type: string - api_url: - type: string - title: >- - some relays have associated urls that are filled with params - ('/block/{height}') - data: - type: string - format: byte - request_block: - type: string - format: int64 - api_interface: + denom: type: string - salt: + amount: type: string - format: byte - metadata: - type: array - items: - type: object - properties: - name: - type: string - value: - type: string - addon: - type: array - items: - type: string - extensions: - type: array - items: - type: string - lavanet.lava.pairing.RelaySession: - type: object - properties: - spec_id: - type: string - content_hash: - type: string - format: byte - session_id: + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + address: type: string - format: uint64 - cu_sum: + stake_applied_block: type: string format: uint64 - title: total compute unit used including this relay - provider: + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: type: string - relay_num: + moniker: type: string - format: uint64 - qos_report: + delegate_total: type: object properties: - latency: + denom: type: string - availability: + amount: type: string - sync: + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: type: string - epoch: - type: string - format: int64 - unresponsive_providers: - type: string - format: byte - lava_chain_id: + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: delegation limit + delegate_commission: type: string - sig: + format: uint64 + title: delegation commission (precentage 0-100) + last_change: type: string - format: byte - badge: + format: uint64 + block_report: type: object properties: - cu_allocation: - type: string - format: uint64 epoch: type: string format: uint64 - address: - type: string - lava_chain_id: - type: string - project_sig: + latest_block: type: string - format: byte - qos_excellence_report: + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of the + provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: type: object properties: - latency: + moniker: type: string - availability: + description: moniker defines a human-readable name for the validator. + identity: type: string - sync: + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: type: string - lavanet.lava.downtime.v1.Downtime: - type: object - properties: - block: + description: website defines an optional website link. + security_contact: + type: string + description: security_contact defines an optional email for security contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: type: string format: uint64 - description: block defines the block that took time to produce. - duration: + jail_end_time: type: string - description: >- - duration defines the time elapsed between the previous block and this - one. - - this defines the effective downtime duration. - description: Downtime defines a single downtime record. - lavanet.lava.downtime.v1.Params: + format: int64 + lavanet.lava.epochstorage.StakeStorage: type: object properties: - downtime_duration: + index: type: string - description: |- - downtime_duration defines the minimum time elapsed between blocks - that we consider the chain to be down. - description: Params defines the parameters of the downtime module. - lavanet.lava.downtime.v1.QueryDowntimeResponse: - type: object - properties: - downtimes: + stakeEntries: type: array items: type: object properties: - block: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + address: + type: string + stake_applied_block: type: string format: uint64 - description: block defines the block that took time to produce. - duration: + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string description: >- - duration defines the time elapsed between the previous block and - this one. + Coin defines a token with a denomination and an amount. - this defines the effective downtime duration. - description: Downtime defines a single downtime record. - cumulative_downtime_duration: + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of + the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + epochBlockHash: type: string - description: >- - QueryDowntimeResponse is the response type for the Query/QueryDowntime RPC - method. - lavanet.lava.downtime.v1.QueryParamsResponse: - type: object - properties: - params: - type: object - properties: - downtime_duration: - type: string - description: |- - downtime_duration defines the minimum time elapsed between blocks - that we consider the chain to be down. - description: Params defines the parameters of the downtime module. - lavanet.lava.epochstorage.Endpoint: + format: byte + lavanet.lava.fixationstore.Entry: type: object properties: - iPPORT: + index: type: string - geolocation: + title: unique entry index (i.e. list key) + block: type: string format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - lavanet.lava.epochstorage.EpochDetails: - type: object - properties: - startBlock: + title: block when the entry was created + stale_at: type: string format: uint64 - earliestStart: + title: block when the entry becomes stale + refcount: type: string format: uint64 - deletedEpochs: + title: reference count + data: + type: string + format: byte + title: the data saved in the entry + delete_at: + type: string + format: uint64 + title: block when the entry becomes deleted + is_latest: + type: boolean + title: is this entry the latest entry now? + lavanet.lava.fixationstore.QueryAllIndicesResponse: + type: object + properties: + indices: type: array items: type: string - format: uint64 - lavanet.lava.epochstorage.FixatedParams: + lavanet.lava.fixationstore.QueryEntryResponse: type: object properties: - index: - type: string - parameter: - type: string - format: byte - fixationBlock: + entry: + type: object + properties: + index: + type: string + title: unique entry index (i.e. list key) + block: + type: string + format: uint64 + title: block when the entry was created + stale_at: + type: string + format: uint64 + title: block when the entry becomes stale + refcount: + type: string + format: uint64 + title: reference count + data: + type: string + format: byte + title: the data saved in the entry + delete_at: + type: string + format: uint64 + title: block when the entry becomes deleted + is_latest: + type: boolean + title: is this entry the latest entry now? + string_data: type: string - format: uint64 - lavanet.lava.epochstorage.Params: + title: 'optional: entry data as a string' + lavanet.lava.fixationstore.QueryStoreKeysResponse: type: object properties: - unstakeHoldBlocks: - type: string - format: uint64 - epochBlocks: - type: string - format: uint64 - epochsToSave: - type: string - format: uint64 - latestParamChange: - type: string - format: uint64 - unstakeHoldBlocksStatic: - type: string - format: uint64 - description: Params defines the parameters for the module. - lavanet.lava.epochstorage.QueryAllFixatedParamsResponse: + keys: + type: array + items: + type: object + properties: + store_key: + type: string + prefix: + type: string + lavanet.lava.fixationstore.QueryVersionsResponse: type: object properties: - fixatedParams: + entries: type: array items: type: object properties: index: type: string - parameter: + title: unique entry index (i.e. list key) + block: + type: string + format: uint64 + title: block when the entry was created + stale_at: + type: string + format: uint64 + title: block when the entry becomes stale + refcount: + type: string + format: uint64 + title: reference count + data: type: string format: byte - fixationBlock: + title: the data saved in the entry + delete_at: type: string format: uint64 - pagination: + title: block when the entry becomes deleted + is_latest: + type: boolean + title: is this entry the latest entry now? + lavanet.lava.fixationstore.StoreKeyAndPrefix: + type: object + properties: + store_key: + type: string + prefix: + type: string + lavanet.lava.pairing.CacheRelayReply: + type: object + properties: + reply: type: object properties: - next_key: + data: type: string format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: + sig: type: string - format: uint64 + format: byte + title: sign the data hash+query hash+nonce + latest_block: + type: string + format: int64 + finalized_blocks_hashes: + type: string + format: byte + sig_blocks: + type: string + format: byte title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - lavanet.lava.epochstorage.QueryAllStakeStorageResponse: + sign + latest_block+finalized_blocks_hashes+session_id+block_height+relay_num + metadata: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + optional_metadata: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + seen_block: + type: string + format: int64 + lavanet.lava.pairing.CacheUsage: type: object properties: - stakeStorage: + CacheHits: + type: string + format: uint64 + CacheMisses: + type: string + format: uint64 + lavanet.lava.pairing.ChainIDPayout: + type: object + properties: + chain_id: + type: string + payouts: type: array items: type: object properties: - index: + provider: type: string - stakeEntries: - type: array - items: - type: object - properties: - stake: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - epochBlockHash: + amount: type: string - format: byte - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - lavanet.lava.epochstorage.QueryGetEpochDetailsResponse: + format: uint64 + lavanet.lava.pairing.GenerateBadgeResponse: type: object properties: - EpochDetails: + badge: type: object properties: - startBlock: + cu_allocation: type: string format: uint64 - earliestStart: + epoch: type: string format: uint64 - deletedEpochs: - type: array - items: - type: string - format: uint64 - lavanet.lava.epochstorage.QueryGetFixatedParamsResponse: - type: object - properties: - fixatedParams: - type: object - properties: - index: + address: type: string - parameter: + lava_chain_id: + type: string + project_sig: type: string format: byte - fixationBlock: + virtual_epoch: type: string format: uint64 - lavanet.lava.epochstorage.QueryGetStakeStorageResponse: - type: object - properties: - stakeStorage: + get_pairing_response: type: object properties: - index: - type: string - stakeEntries: + providers: type: array items: type: object @@ -68597,264 +72527,514 @@ definitions: items: type: object properties: - iPPORT: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 + chain: + type: string + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks + of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + current_epoch: + type: string + format: uint64 + time_left_to_next_pairing: + type: string + format: uint64 + spec_last_updated_block: + type: string + format: uint64 + block_of_next_pairing: + type: string + format: uint64 + badge_signer_address: + type: string + spec: + type: object + properties: + index: + type: string + name: + type: string + enabled: + type: boolean + reliability_threshold: + type: integer + format: int64 + data_reliability_enabled: + type: boolean + block_distance_for_finalized_data: + type: integer + format: int64 + blocks_in_finalization_proof: + type: integer + format: int64 + average_block_time: + type: string + format: int64 + allowed_block_lag_for_qos_sync: + type: string + format: int64 + block_last_updated: + type: string + format: uint64 + min_stake_provider: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + providers_types: + type: string + enum: + - dynamic + - static + default: dynamic + imports: + type: array + items: + type: string + api_collections: + type: array + items: + type: object + properties: + enabled: + type: boolean + collection_data: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + apis: + type: array + items: + type: object + properties: + enabled: + type: boolean + name: + type: string + compute_units: + type: string + format: uint64 + extra_compute_units: + type: string + format: uint64 + category: + type: object + properties: + deterministic: + type: boolean + local: + type: boolean + subscription: + type: boolean + stateful: + type: integer + format: int64 + hanging_api: + type: boolean + block_parsing: + type: object + properties: + parser_arg: + type: array + items: + type: string + parser_func: + type: string + enum: + - EMPTY + - PARSE_BY_ARG + - PARSE_CANONICAL + - PARSE_DICTIONARY + - PARSE_DICTIONARY_OR_ORDERED + - DEFAULT + default: EMPTY + description: >- + means parameters are non related to block, and + should fetch latest block args: "latest" + title: >- + - PARSE_BY_ARG: means parameters are ordered and + flat expected arguments are: [param index] + (example: PARAMS: [<#BlockNum>,"banana"]) args: 0 + - PARSE_CANONICAL: means parameters are ordered and one of them has named properties, expected arguments are: [param index to object,prop_name in object] (example: PARAMS: ["banana",{prop_name:<#BlockNum>}]) need to configure args: 1,"prop_name" + - PARSE_DICTIONARY: means parameters are named, expected arguments are [prop_name,separator] (example: PARAMS: {prop_name:<#BlockNum>,prop2:"banana"}) args: "prop_name" + - PARSE_DICTIONARY_OR_ORDERED: means parameters are named expected arguments are [prop_name,separator,parameter order if not found] for input of: block=15&address=abc OR ?abc,15 we will do args: block,=,1 + - DEFAULT: reserved + default_value: + type: string + title: >- + default value when set allows parsing failures to + assume the default value + encoding: + type: string + title: 'used to parse byte responses: base64,hex,bech32' + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER + headers: + type: array + items: + type: object + properties: + name: + type: string + kind: + type: string + enum: + - pass_send + - pass_reply + - pass_both + - pass_ignore + default: pass_send + title: >- + - pass_ignore: allows it to pass around but is not + signed + function_tag: + type: string + enum: + - DISABLED + - GET_BLOCKNUM + - GET_BLOCK_BY_NUM + - SET_LATEST_IN_METADATA + - SET_LATEST_IN_BODY + - VERIFICATION + - GET_EARLIEST_BLOCK + default: DISABLED + inheritance_apis: + type: array + items: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + title: by collectionKey + parse_directives: + type: array + items: + type: object + properties: + function_tag: + type: string + enum: + - DISABLED + - GET_BLOCKNUM + - GET_BLOCK_BY_NUM + - SET_LATEST_IN_METADATA + - SET_LATEST_IN_BODY + - VERIFICATION + - GET_EARLIEST_BLOCK + default: DISABLED + function_template: + type: string + result_parsing: + type: object + properties: + parser_arg: + type: array + items: + type: string + parser_func: + type: string + enum: + - EMPTY + - PARSE_BY_ARG + - PARSE_CANONICAL + - PARSE_DICTIONARY + - PARSE_DICTIONARY_OR_ORDERED + - DEFAULT + default: EMPTY + description: >- + means parameters are non related to block, and + should fetch latest block args: "latest" + title: >- + - PARSE_BY_ARG: means parameters are ordered and + flat expected arguments are: [param index] + (example: PARAMS: [<#BlockNum>,"banana"]) args: 0 + - PARSE_CANONICAL: means parameters are ordered and one of them has named properties, expected arguments are: [param index to object,prop_name in object] (example: PARAMS: ["banana",{prop_name:<#BlockNum>}]) need to configure args: 1,"prop_name" + - PARSE_DICTIONARY: means parameters are named, expected arguments are [prop_name,separator] (example: PARAMS: {prop_name:<#BlockNum>,prop2:"banana"}) args: "prop_name" + - PARSE_DICTIONARY_OR_ORDERED: means parameters are named expected arguments are [prop_name,separator,parameter order if not found] for input of: block=15&address=abc OR ?abc,15 we will do args: block,=,1 + - DEFAULT: reserved + default_value: + type: string + title: >- + default value when set allows parsing failures to + assume the default value + encoding: + type: string + title: 'used to parse byte responses: base64,hex,bech32' + api_name: + type: string + extensions: + type: array + items: + type: object + properties: + name: type: string - geolocation: + rule: + type: object + properties: + block: + type: string + format: uint64 + cu_multiplier: type: string format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: + verifications: + type: array + items: + type: object + properties: + name: + type: string + parse_directive: + type: object + properties: + function_tag: + type: string + enum: + - DISABLED + - GET_BLOCKNUM + - GET_BLOCK_BY_NUM + - SET_LATEST_IN_METADATA + - SET_LATEST_IN_BODY + - VERIFICATION + - GET_EARLIEST_BLOCK + default: DISABLED + function_template: + type: string + result_parsing: + type: object + properties: + parser_arg: + type: array + items: + type: string + parser_func: + type: string + enum: + - EMPTY + - PARSE_BY_ARG + - PARSE_CANONICAL + - PARSE_DICTIONARY + - PARSE_DICTIONARY_OR_ORDERED + - DEFAULT + default: EMPTY + description: >- + means parameters are non related to block, and + should fetch latest block args: "latest" + title: >- + - PARSE_BY_ARG: means parameters are ordered + and flat expected arguments are: [param index] + (example: PARAMS: [<#BlockNum>,"banana"]) + args: 0 + - PARSE_CANONICAL: means parameters are ordered and one of them has named properties, expected arguments are: [param index to object,prop_name in object] (example: PARAMS: ["banana",{prop_name:<#BlockNum>}]) need to configure args: 1,"prop_name" + - PARSE_DICTIONARY: means parameters are named, expected arguments are [prop_name,separator] (example: PARAMS: {prop_name:<#BlockNum>,prop2:"banana"}) args: "prop_name" + - PARSE_DICTIONARY_OR_ORDERED: means parameters are named expected arguments are [prop_name,separator,parameter order if not found] for input of: block=15&address=abc OR ?abc,15 we will do args: block,=,1 + - DEFAULT: reserved + default_value: + type: string + title: >- + default value when set allows parsing failures + to assume the default value + encoding: + type: string + title: >- + used to parse byte responses: + base64,hex,bech32 + api_name: + type: string + values: type: array items: - type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - epochBlockHash: - type: string - format: byte - lavanet.lava.epochstorage.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - unstakeHoldBlocks: - type: string - format: uint64 - epochBlocks: - type: string - format: uint64 - epochsToSave: - type: string - format: uint64 - latestParamChange: + type: object + properties: + extension: + type: string + expected_value: + type: string + latest_distance: + type: string + format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: type: string - format: uint64 - unstakeHoldBlocksStatic: + shares: type: string format: uint64 - description: QueryParamsResponse is response type for the Query/Params RPC method. - lavanet.lava.epochstorage.StakeEntry: - type: object - properties: - stake: - type: object - properties: - denom: - type: string - amount: + identity: type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - lavanet.lava.epochstorage.StakeStorage: - type: object - properties: - index: - type: string - stakeEntries: - type: array - items: - type: object - properties: - stake: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - epochBlockHash: - type: string - format: byte - lavanet.lava.pairing.CacheUsage: + lavanet.lava.pairing.LatestBlockReport: type: object properties: - CacheHits: + spec_id: type: string - format: uint64 - CacheMisses: + latest_block: type: string format: uint64 - lavanet.lava.pairing.EpochPayments: - type: object - properties: - index: - type: string - providerPaymentStorageKeys: - type: array - items: - type: string - lavanet.lava.pairing.GenerateBadgeResponse: - type: object - properties: - badge: - type: object - properties: - cu_allocation: - type: string - format: uint64 - epoch: - type: string - format: uint64 - address: - type: string - lava_chain_id: - type: string - project_sig: - type: string - format: byte - pairing_list: - type: array - items: - type: object - properties: - stake: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - address: - type: string - stake_applied_block: - type: string - format: uint64 - endpoints: - type: array - items: - type: object - properties: - iPPORT: - type: string - geolocation: - type: string - format: uint64 - addons: - type: array - items: - type: string - api_interfaces: - type: array - items: - type: string - extensions: - type: array - items: - type: string - geolocation: - type: string - format: uint64 - chain: - type: string - moniker: - type: string - badge_signer_address: - type: string lavanet.lava.pairing.MsgFreezeProviderResponse: type: object lavanet.lava.pairing.MsgRelayPaymentResponse: type: object + properties: + rejected_relays: + type: boolean + title: true if there is any relay in the TX that was rejected lavanet.lava.pairing.MsgStakeProviderResponse: type: object lavanet.lava.pairing.MsgUnfreezeProviderResponse: @@ -68864,22 +73044,9 @@ definitions: lavanet.lava.pairing.Params: type: object properties: - mintCoinsPerCU: - type: string - fraudStakeSlashingFactor: - type: string - fraudSlashingAmount: - type: string - format: uint64 epochBlocksOverlap: type: string format: uint64 - unpayLimit: - type: string - slashLimit: - type: string - dataReliabilityReward: - type: string QoSWeight: type: string recommendedEpochNumToCollectPayment: @@ -68901,156 +73068,25 @@ definitions: lava_epoch: type: string format: uint64 - lavanet.lava.pairing.ProviderPaymentStorage: + lava_latest_block: + type: string + format: uint64 + lavanet.lava.pairing.ProviderCuInfo: type: object properties: - index: - type: string - epoch: + provider: type: string - format: uint64 - uniquePaymentStorageClientProviderKeys: - type: array - items: - type: string - complainersTotalCu: + cu: type: string format: uint64 - title: >- - total CU that were supposed to be served by the provider but didn't - because he was unavailable (so consumers complained about him) - lavanet.lava.pairing.QueryAllEpochPaymentsResponse: - type: object - properties: - epochPayments: - type: array - items: - type: object - properties: - index: - type: string - providerPaymentStorageKeys: - type: array - items: - type: string - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - lavanet.lava.pairing.QueryAllProviderPaymentStorageResponse: - type: object - properties: - providerPaymentStorage: - type: array - items: - type: object - properties: - index: - type: string - epoch: - type: string - format: uint64 - uniquePaymentStorageClientProviderKeys: - type: array - items: - type: string - complainersTotalCu: - type: string - format: uint64 - title: >- - total CU that were supposed to be served by the provider but - didn't because he was unavailable (so consumers complained about - him) - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } - lavanet.lava.pairing.QueryAllUniquePaymentStorageClientProviderResponse: + lavanet.lava.pairing.ProviderPayout: type: object properties: - uniquePaymentStorageClientProvider: - type: array - items: - type: object - properties: - index: - type: string - block: - type: string - format: uint64 - usedCU: - type: string - format: uint64 - pagination: - type: object - properties: - next_key: - type: string - format: byte - description: |- - next_key is the key to be passed to PageRequest.key to - query the next page most efficiently. It will be empty if - there are no more results. - total: - type: string - format: uint64 - title: >- - total is total number of results available if - PageRequest.count_total - - was set, its value is undefined otherwise - description: |- - PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. - - message SomeResponse { - repeated Bar results = 1; - PageResponse page = 2; - } + provider: + type: string + amount: + type: string + format: uint64 lavanet.lava.pairing.QueryEffectivePolicyResponse: type: object properties: @@ -69088,9 +73124,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -69121,18 +73159,75 @@ definitions: items: type: string title: 'protobuf expected in YAML format: used "moretags" to simplify parsing' - lavanet.lava.pairing.QueryGetEpochPaymentsResponse: - type: object - properties: - epochPayments: + pending_policy: type: object properties: - index: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: type: string - providerPaymentStorageKeys: + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's behaviour with + the selected providers feature + selected_providers: type: array items: type: string + title: 'protobuf expected in YAML format: used "moretags" to simplify parsing' lavanet.lava.pairing.QueryGetPairingResponse: type: object properties: @@ -69169,8 +73264,8 @@ definitions: iPPORT: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 addons: type: array items: @@ -69184,12 +73279,98 @@ definitions: items: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 chain: type: string moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of + the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 current_epoch: type: string format: uint64 @@ -69202,42 +73383,6 @@ definitions: block_of_next_pairing: type: string format: uint64 - lavanet.lava.pairing.QueryGetProviderPaymentStorageResponse: - type: object - properties: - providerPaymentStorage: - type: object - properties: - index: - type: string - epoch: - type: string - format: uint64 - uniquePaymentStorageClientProviderKeys: - type: array - items: - type: string - complainersTotalCu: - type: string - format: uint64 - title: >- - total CU that were supposed to be served by the provider but - didn't because he was unavailable (so consumers complained about - him) - lavanet.lava.pairing.QueryGetUniquePaymentStorageClientProviderResponse: - type: object - properties: - uniquePaymentStorageClientProvider: - type: object - properties: - index: - type: string - block: - type: string - format: uint64 - usedCU: - type: string - format: uint64 lavanet.lava.pairing.QueryParamsResponse: type: object properties: @@ -69245,32 +73390,42 @@ definitions: description: params holds all the parameters of this module. type: object properties: - mintCoinsPerCU: - type: string - fraudStakeSlashingFactor: - type: string - fraudSlashingAmount: - type: string - format: uint64 epochBlocksOverlap: type: string format: uint64 - unpayLimit: - type: string - slashLimit: - type: string - dataReliabilityReward: - type: string QoSWeight: type: string recommendedEpochNumToCollectPayment: type: string format: uint64 description: QueryParamsResponse is response type for the Query/Params RPC method. - lavanet.lava.pairing.QueryProvidersResponse: + lavanet.lava.pairing.QueryProviderMonthlyPayoutResponse: type: object properties: - stakeEntry: + total: + type: string + format: uint64 + details: + type: array + items: + type: object + properties: + subscription: + type: string + chain_id: + type: string + amount: + type: string + format: uint64 + lavanet.lava.pairing.QueryProviderPairingChanceResponse: + type: object + properties: + chance: + type: string + lavanet.lava.pairing.QueryProviderResponse: + type: object + properties: + stakeEntries: type: array items: type: object @@ -69303,8 +73458,8 @@ definitions: iPPORT: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 addons: type: array items: @@ -69318,14 +73473,254 @@ definitions: items: type: string geolocation: + type: integer + format: int32 + chain: + type: string + moniker: + type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of + the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + lavanet.lava.pairing.QueryProvidersEpochCuResponse: + type: object + properties: + info: + type: array + items: + type: object + properties: + provider: + type: string + cu: + type: string + format: uint64 + lavanet.lava.pairing.QueryProvidersResponse: + type: object + properties: + stakeEntry: + type: array + items: + type: object + properties: + stake: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + address: + type: string + stake_applied_block: type: string format: uint64 + endpoints: + type: array + items: + type: object + properties: + iPPORT: + type: string + geolocation: + type: integer + format: int32 + addons: + type: array + items: + type: string + api_interfaces: + type: array + items: + type: string + extensions: + type: array + items: + type: string + geolocation: + type: integer + format: int32 chain: type: string moniker: type: string - output: - type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of + the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 lavanet.lava.pairing.QuerySdkPairingResponse: type: object properties: @@ -69365,8 +73760,8 @@ definitions: iPPORT: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 addons: type: array items: @@ -69380,12 +73775,98 @@ definitions: items: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 chain: type: string moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks + of the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. + UPort or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 current_epoch: type: string format: uint64 @@ -69441,21 +73922,6 @@ definitions: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -69553,6 +74019,29 @@ definitions: encoding: type: string title: 'used to parse byte responses: base64,hex,bech32' + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -69580,6 +74069,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -69609,6 +74099,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -69657,15 +74148,15 @@ definitions: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -69685,6 +74176,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -69738,6 +74230,40 @@ definitions: type: string expected_value: type: string + latest_distance: + type: string + format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string + downtime_params: + type: object + properties: + downtime_duration: + type: string + description: |- + downtime_duration defines the minimum time elapsed between blocks + that we consider the chain to be down. + epoch_duration: + type: string + title: >- + epoch_duration defines an estimation of the time elapsed between + epochs + description: Params defines the parameters of the downtime module. lavanet.lava.pairing.QueryStaticProvidersListResponse: type: object properties: @@ -69774,8 +74300,8 @@ definitions: iPPORT: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 addons: type: array items: @@ -69789,12 +74315,121 @@ definitions: items: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 chain: type: string moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of + the provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort + or Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 + lavanet.lava.pairing.QuerySubscriptionMonthlyPayoutResponse: + type: object + properties: + total: + type: string + format: uint64 + details: + type: array + items: + type: object + properties: + chain_id: + type: string + payouts: + type: array + items: + type: object + properties: + provider: + type: string + amount: + type: string + format: uint64 lavanet.lava.pairing.QueryUserEntryResponse: type: object properties: @@ -69829,8 +74464,8 @@ definitions: iPPORT: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 addons: type: array items: @@ -69844,12 +74479,98 @@ definitions: items: type: string geolocation: - type: string - format: uint64 + type: integer + format: int32 chain: type: string moniker: type: string + delegate_total: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation total + delegate_limit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: delegation limit + delegate_commission: + type: string + format: uint64 + title: delegation commission (precentage 0-100) + last_change: + type: string + format: uint64 + block_report: + type: object + properties: + epoch: + type: string + format: uint64 + latest_block: + type: string + format: uint64 + title: >- + BlockReport holds the most up-to-date info regarding blocks of the + provider + + It is set in the relay payment TX logic + + used by the consumer to calculate the provider's sync score + vault: + type: string + description: + type: object + properties: + moniker: + type: string + description: moniker defines a human-readable name for the validator. + identity: + type: string + description: >- + identity defines an optional identity signature (ex. UPort or + Keybase). + website: + type: string + description: website defines an optional website link. + security_contact: + type: string + description: >- + security_contact defines an optional email for security + contact. + details: + type: string + description: details define other optional details. + description: Description defines a validator description. + jails: + type: string + format: uint64 + jail_end_time: + type: string + format: int64 maxCU: type: string format: uint64 @@ -69866,15 +74587,14 @@ definitions: format: uint64 project_id: type: string - lavanet.lava.pairing.UniquePaymentStorageClientProvider: + lavanet.lava.pairing.SubscriptionPayout: type: object properties: - index: + subscription: type: string - block: + chain_id: type: string - format: uint64 - usedCU: + amount: type: string format: uint64 lavanet.lava.plans.ChainPolicy: @@ -69906,6 +74626,8 @@ definitions: type: array items: type: string + mixed: + type: boolean lavanet.lava.plans.ChainRequirement: type: object properties: @@ -69924,6 +74646,8 @@ definitions: type: array items: type: string + mixed: + type: boolean lavanet.lava.plans.Policy: type: object properties: @@ -69958,9 +74682,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -70070,6 +74796,29 @@ definitions: encoding: type: string title: 'used to parse byte responses: base64,hex,bech32' + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER lavanet.lava.spec.ApiCollection: type: object properties: @@ -70151,6 +74900,29 @@ definitions: encoding: type: string title: 'used to parse byte responses: base64,hex,bech32' + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -70176,6 +74948,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -70205,6 +74978,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -70253,15 +75027,15 @@ definitions: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -70281,6 +75055,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -70334,6 +75109,12 @@ definitions: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail lavanet.lava.spec.BlockParser: type: object properties: @@ -70386,15 +75167,15 @@ definitions: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 lavanet.lava.spec.FUNCTION_TAG: type: string enum: @@ -70404,7 +75185,26 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED + lavanet.lava.spec.GenericParser: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER lavanet.lava.spec.Header: type: object properties: @@ -70428,6 +75228,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED lavanet.lava.spec.Header.HeaderType: type: string @@ -70458,6 +75259,17 @@ definitions: - PARSE_DICTIONARY: means parameters are named, expected arguments are [prop_name,separator] (example: PARAMS: {prop_name:<#BlockNum>,prop2:"banana"}) args: "prop_name" - PARSE_DICTIONARY_OR_ORDERED: means parameters are named expected arguments are [prop_name,separator,parameter order if not found] for input of: block=15&address=abc OR ?abc,15 we will do args: block,=,1 - DEFAULT: reserved + lavanet.lava.spec.PARSER_TYPE: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER lavanet.lava.spec.ParseDirective: type: object properties: @@ -70470,6 +75282,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -70521,6 +75334,18 @@ definitions: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + lavanet.lava.spec.ParseValue.VerificationSeverity: + type: string + enum: + - Fail + - Warning + default: Fail lavanet.lava.spec.Rule: type: object properties: @@ -70568,18 +75393,6 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. providers_types: type: string enum: @@ -70673,6 +75486,29 @@ definitions: encoding: type: string title: 'used to parse byte responses: base64,hex,bech32' + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -70698,6 +75534,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -70727,6 +75564,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -70775,15 +75613,15 @@ definitions: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -70803,6 +75641,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -70856,6 +75695,23 @@ definitions: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string lavanet.lava.spec.Spec.ProvidersTypes: type: string enum: @@ -70893,6 +75749,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -70946,6 +75803,12 @@ definitions: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail lavanet.lava.plans.ListInfoStruct: type: object properties: @@ -71041,9 +75904,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71074,6 +75939,17 @@ definitions: items: type: string title: 'protobuf expected in YAML format: used "moretags" to simplify parsing' + projects_limit: + type: string + format: uint64 + title: number of allowed projects + allowed_buyers: + type: array + items: + type: string + title: >- + set of addresses that are the only allowed buyers for the plan (empty + list = everyone is allowed) lavanet.lava.plans.QueryInfoResponse: type: object properties: @@ -71153,9 +76029,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71188,6 +76066,17 @@ definitions: title: >- protobuf expected in YAML format: used "moretags" to simplify parsing + projects_limit: + type: string + format: uint64 + title: number of allowed projects + allowed_buyers: + type: array + items: + type: string + title: >- + set of addresses that are the only allowed buyers for the plan + (empty list = everyone is allowed) lavanet.lava.plans.QueryListResponse: type: object properties: @@ -71293,9 +76182,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71363,9 +76254,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71472,9 +76365,364 @@ definitions: type: array items: type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's behaviour + with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to simplify + parsing + used_cu: + type: string + format: uint64 + subscription_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's behaviour + with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to simplify + parsing + snapshot: + type: string + format: uint64 + title: snapshot id to uniquely identify snapshots + pending_project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription address and + project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + kinds: + type: integer + format: int64 + title: list of the projects keys + admin_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 + total_cu_limit: + type: string + format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's behaviour + with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to simplify + parsing + used_cu: + type: string + format: uint64 + subscription_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean geolocation_profile: + type: integer + format: int32 + total_cu_limit: type: string format: uint64 + epoch_cu_limit: + type: string + format: uint64 + max_providers_to_pair: + type: string + format: uint64 + selected_providers_mode: + type: string + enum: + - ALLOWED + - MIXED + - EXCLUSIVE + - DISABLED + default: ALLOWED + description: |- + - ALLOWED: no providers restrictions + - MIXED: use the selected providers mixed with randomly chosen providers + - EXCLUSIVE: use only the selected providers + - DISABLED: selected providers feature is disabled + title: >- + the enum below determines the pairing algorithm's behaviour + with the selected providers feature + selected_providers: + type: array + items: + type: string + title: >- + protobuf expected in YAML format: used "moretags" to simplify + parsing + snapshot: + type: string + format: uint64 + title: snapshot id to uniquely identify snapshots + lavanet.lava.projects.QueryInfoResponse: + type: object + properties: + project: + type: object + properties: + index: + type: string + title: >- + unique id that will be the combination of subscription address and + project name, cannot be changed once created + subscription: + type: string + title: the subscription address that owns the project + enabled: + type: boolean + title: enabled flag + project_keys: + type: array + items: + type: object + properties: + key: + type: string + title: the address of the project key + kinds: + type: integer + format: int64 + title: list of the projects keys + admin_policy: + type: object + properties: + chain_policies: + type: array + items: + type: object + properties: + chain_id: + type: string + apis: + type: array + items: + type: string + requirements: + type: array + items: + type: object + properties: + collection: + type: object + properties: + api_interface: + type: string + internal_path: + type: string + type: + type: string + add_on: + type: string + extensions: + type: array + items: + type: string + mixed: + type: boolean + geolocation_profile: + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71544,9 +76792,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71583,10 +76833,7 @@ definitions: type: string format: uint64 title: snapshot id to uniquely identify snapshots - lavanet.lava.projects.QueryInfoResponse: - type: object - properties: - project: + pending_project: type: object properties: index: @@ -71646,9 +76893,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71718,9 +76967,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -71764,6 +77015,8 @@ definitions: description: params holds all the parameters of this module. type: object description: QueryParamsResponse is response type for the Query/Params RPC method. + lavanet.lava.protocol.MsgSetVersionResponse: + type: object lavanet.lava.protocol.Params: type: object properties: @@ -71811,6 +77064,325 @@ definitions: consumer_min: type: string description: Params defines the parameters for the module. + lavanet.lava.rewards.IprpcReward: + type: object + properties: + id: + type: string + format: uint64 + title: month id + spec_funds: + type: array + items: + type: object + properties: + spec: + type: string + fund: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: object that holds the list for iprpc funcs for a specific month id + lavanet.lava.rewards.MsgFundIprpcResponse: + type: object + lavanet.lava.rewards.MsgSetIprpcDataResponse: + type: object + lavanet.lava.rewards.Params: + type: object + properties: + min_bonded_target: + type: string + max_bonded_target: + type: string + low_factor: + type: string + leftover_burn_rate: + type: string + max_reward_boost: + type: string + format: uint64 + validators_subscription_participation: + type: string + description: Params defines the parameters for the module. + lavanet.lava.rewards.PoolInfo: + type: object + properties: + name: + type: string + title: pool name + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: pool balance (all types of tokens) + lavanet.lava.rewards.QueryBlockRewardResponse: + type: object + properties: + reward: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + description: >- + QueryBlockRewardResponse is response type for the Query/BlockReward RPC + method. + lavanet.lava.rewards.QueryIprpcProviderRewardEstimationResponse: + type: object + properties: + spec_funds: + type: array + items: + type: object + properties: + spec: + type: string + fund: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + QueryIprpcProviderRewardEstimationResponse is response type for the + Query/IprpcProviderRewardEstimation RPC method. + lavanet.lava.rewards.QueryIprpcSpecRewardResponse: + type: object + properties: + iprpc_rewards: + type: array + items: + type: object + properties: + id: + type: string + format: uint64 + title: month id + spec_funds: + type: array + items: + type: object + properties: + spec: + type: string + fund: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: object that holds the list for iprpc funcs for a specific month id + current_month_id: + type: string + format: uint64 + description: >- + QueryIprpcSpecRewardResponse is response type for the + Query/IprpcSpecReward RPC method. + lavanet.lava.rewards.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + min_bonded_target: + type: string + max_bonded_target: + type: string + low_factor: + type: string + leftover_burn_rate: + type: string + max_reward_boost: + type: string + format: uint64 + validators_subscription_participation: + type: string + description: QueryParamsResponse is response type for the Query/Params RPC method. + lavanet.lava.rewards.QueryPoolsResponse: + type: object + properties: + pools: + type: array + items: + type: object + properties: + name: + type: string + title: pool name + balance: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: pool balance (all types of tokens) + description: details holds all the info of this module's pools. + time_to_refill: + type: string + format: int64 + title: number of seconds until block pools refill + estimated_blocks_to_refill: + type: string + format: int64 + title: estimated number of blocks until block pools are refilled + allocation_pool_months_left: + type: string + format: int64 + title: amount of months until the allocation pools will run out of funds + description: QueryPoolsResponse is response type for the Query/Pools RPC method. + lavanet.lava.rewards.QueryProviderRewardResponse: + type: object + properties: + rewards: + type: array + items: + type: object + properties: + chain_id: + type: string + provider: + type: string + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + description: >- + QueryProviderRewardResponse is response type for the Query/ProviderReward + RPC method. + lavanet.lava.rewards.QueryShowIprpcDataResponse: + type: object + properties: + min_cost: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + iprpc_subscriptions: + type: array + items: + type: string + description: >- + QueryShowIprpcDataResponse is response type for the Query/ShowIprpcData + RPC method. + lavanet.lava.rewards.RewardInfo: + type: object + properties: + chain_id: + type: string + provider: + type: string + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + lavanet.lava.rewards.Specfund: + type: object + properties: + spec: + type: string + fund: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. lavanet.lava.spec.ApiList: type: object properties: @@ -71825,12 +77397,13 @@ definitions: lavanet.lava.spec.Params: type: object properties: - geolocationCount: - type: string - format: uint64 maxCU: type: string format: uint64 + allowlisted_expedited_msgs: + type: array + items: + type: string description: Params defines the parameters for the module. lavanet.lava.spec.QueryAllSpecResponse: type: object @@ -71877,21 +77450,6 @@ definitions: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -71990,6 +77548,29 @@ definitions: encoding: type: string title: 'used to parse byte responses: base64,hex,bech32' + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -72017,6 +77598,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -72046,6 +77628,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -72095,15 +77678,15 @@ definitions: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -72123,6 +77706,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -72179,6 +77763,23 @@ definitions: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string pagination: type: object properties: @@ -72248,21 +77849,6 @@ definitions: Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - min_stake_client: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method @@ -72360,6 +77946,29 @@ definitions: encoding: type: string title: 'used to parse byte responses: base64,hex,bech32' + timeout_ms: + type: string + format: uint64 + parsers: + type: array + items: + type: object + properties: + parse_path: + type: string + value: + type: string + parse_type: + type: string + enum: + - NO_PARSER + - BLOCK_LATEST + - BLOCK_EARLIEST + - RESULT + - EXTENSION_ARG + - IDENTIFIER + - DEFAULT_VALUE + default: NO_PARSER headers: type: array items: @@ -72387,6 +77996,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED inheritance_apis: type: array @@ -72416,6 +78026,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -72464,15 +78075,15 @@ definitions: properties: name: type: string - cu_multiplier: - type: number - format: float rule: type: object properties: block: type: string format: uint64 + cu_multiplier: + type: string + format: uint64 verifications: type: array items: @@ -72492,6 +78103,7 @@ definitions: - SET_LATEST_IN_METADATA - SET_LATEST_IN_BODY - VERIFICATION + - GET_EARLIEST_BLOCK default: DISABLED function_template: type: string @@ -72548,6 +78160,23 @@ definitions: latest_distance: type: string format: uint64 + severity: + type: string + enum: + - Fail + - Warning + default: Fail + contributor: + type: array + items: + type: string + contributor_percentage: + type: string + shares: + type: string + format: uint64 + identity: + type: string lavanet.lava.spec.QueryParamsResponse: type: object properties: @@ -72555,12 +78184,13 @@ definitions: description: params holds all the parameters of this module. type: object properties: - geolocationCount: - type: string - format: uint64 maxCU: type: string format: uint64 + allowlisted_expedited_msgs: + type: array + items: + type: string description: QueryParamsResponse is response type for the Query/Params RPC method. lavanet.lava.spec.QueryShowAllChainsResponse: type: object @@ -72673,9 +78303,11 @@ definitions: type: array items: type: string + mixed: + type: boolean geolocation_profile: - type: string - format: uint64 + type: integer + format: int32 total_cu_limit: type: string format: uint64 @@ -72707,6 +78339,40 @@ definitions: type: string title: 'protobuf expected in YAML format: used "moretags" to simplify parsing' title: used as a container struct for the subscription module + lavanet.lava.subscription.FutureSubscription: + type: object + properties: + creator: + type: string + title: >- + creator pays for the future subscription. Will replace the original + one once activated + plan_index: + type: string + title: index (name) of plan + plan_block: + type: string + format: uint64 + title: when the plan was created + duration_bought: + type: string + format: uint64 + title: total requested duration in months + credit: + title: >- + credit = funds paid for the subscription which are used to pay to + providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. lavanet.lava.subscription.ListInfoStruct: type: object properties: @@ -72716,7 +78382,7 @@ definitions: plan: type: string title: plan assosiated with the subscription - duration_total: + duration_bought: type: string format: uint64 title: total duration in months (purchase/renewal) @@ -72736,8 +78402,66 @@ definitions: type: string format: uint64 title: remaining CU allowance this month + cluster: + type: string + duration_total: + type: string + format: uint64 + auto_renewal_next_plan: + type: string + future_subscription: + type: object + properties: + creator: + type: string + title: >- + creator pays for the future subscription. Will replace the + original one once activated + plan_index: + type: string + title: index (name) of plan + plan_block: + type: string + format: uint64 + title: when the plan was created + duration_bought: + type: string + format: uint64 + title: total requested duration in months + credit: + title: >- + credit = funds paid for the subscription which are used to pay to + providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + credit: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. lavanet.lava.subscription.MsgAddProjectResponse: type: object + lavanet.lava.subscription.MsgAutoRenewalResponse: + type: object lavanet.lava.subscription.MsgBuyResponse: type: object lavanet.lava.subscription.MsgDelProjectResponse: @@ -72768,7 +78492,7 @@ definitions: type: string format: uint64 title: when the plan was created - duration_total: + duration_bought: type: string format: uint64 title: total requested duration in months @@ -72788,6 +78512,74 @@ definitions: type: string format: uint64 title: CU remaining during current month + cluster: + type: string + title: cluster key + duration_total: + type: string + format: uint64 + title: continous subscription usage + future_subscription: + title: future subscription made with buy --advance-purchase + type: object + properties: + creator: + type: string + title: >- + creator pays for the future subscription. Will replace the + original one once activated + plan_index: + type: string + title: index (name) of plan + plan_block: + type: string + format: uint64 + title: when the plan was created + duration_bought: + type: string + format: uint64 + title: total requested duration in months + credit: + title: >- + credit = funds paid for the subscription which are used to pay + to providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + auto_renewal_next_plan: + type: string + title: >- + the next plan to subscribe to. If none is set, then auto renewal + is disabled + credit: + title: >- + credit = funds paid for the subscription which are used to pay to + providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. lavanet.lava.subscription.QueryListProjectsResponse: type: object properties: @@ -72809,7 +78601,7 @@ definitions: plan: type: string title: plan assosiated with the subscription - duration_total: + duration_bought: type: string format: uint64 title: total duration in months (purchase/renewal) @@ -72829,6 +78621,79 @@ definitions: type: string format: uint64 title: remaining CU allowance this month + cluster: + type: string + duration_total: + type: string + format: uint64 + auto_renewal_next_plan: + type: string + future_subscription: + type: object + properties: + creator: + type: string + title: >- + creator pays for the future subscription. Will replace the + original one once activated + plan_index: + type: string + title: index (name) of plan + plan_block: + type: string + format: uint64 + title: when the plan was created + duration_bought: + type: string + format: uint64 + title: total requested duration in months + credit: + title: >- + credit = funds paid for the subscription which are used to + pay to providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + credit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + lavanet.lava.subscription.QueryNextToMonthExpiryResponse: + type: object + properties: + subscriptions: + type: array + items: + type: object + properties: + consumer: + type: string + month_expiry: + type: string + format: uint64 + title: upcoming expiry (of current month) in unix time lavanet.lava.subscription.QueryParamsResponse: type: object properties: @@ -72856,7 +78721,7 @@ definitions: type: string format: uint64 title: when the plan was created - duration_total: + duration_bought: type: string format: uint64 title: total requested duration in months @@ -72876,3 +78741,177 @@ definitions: type: string format: uint64 title: CU remaining during current month + cluster: + type: string + title: cluster key + duration_total: + type: string + format: uint64 + title: continous subscription usage + future_subscription: + title: future subscription made with buy --advance-purchase + type: object + properties: + creator: + type: string + title: >- + creator pays for the future subscription. Will replace the + original one once activated + plan_index: + type: string + title: index (name) of plan + plan_block: + type: string + format: uint64 + title: when the plan was created + duration_bought: + type: string + format: uint64 + title: total requested duration in months + credit: + title: >- + credit = funds paid for the subscription which are used to pay to + providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + auto_renewal_next_plan: + type: string + title: >- + the next plan to subscribe to. If none is set, then auto renewal is + disabled + credit: + title: >- + credit = funds paid for the subscription which are used to pay to + providers. reduced after paying providers + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + lavanet.lava.subscription.TimerExpiryInfo: + type: object + properties: + consumer: + type: string + month_expiry: + type: string + format: uint64 + title: upcoming expiry (of current month) in unix time + lavanet.lava.timerstore.QueryAllTimersResponse: + type: object + properties: + blockTimeTimers: + type: array + items: + type: object + properties: + blockTime: + type: string + blockHeight: + type: string + format: uint64 + key: + type: string + data: + type: string + format: byte + blockHeightTimers: + type: array + items: + type: object + properties: + blockTime: + type: string + blockHeight: + type: string + format: uint64 + key: + type: string + data: + type: string + format: byte + tick: + type: string + lavanet.lava.timerstore.QueryNextResponse: + type: object + properties: + nextBlockHeight: + type: string + format: uint64 + nextBlockTime: + type: string + tick: + type: string + lavanet.lava.timerstore.QueryStoreKeysResponse: + type: object + properties: + keys: + type: array + items: + type: object + properties: + store_key: + type: string + prefix: + type: string + lavanet.lava.timerstore.StoreKeyAndPrefix: + type: object + properties: + store_key: + type: string + prefix: + type: string + lavanet.lava.timerstore.TimerInfo: + type: object + properties: + blockTime: + type: string + blockHeight: + type: string + format: uint64 + key: + type: string + data: + type: string + format: byte + packetforward.v1.MsgUpdateParamsResponse: + type: object + description: |- + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + + Since: cosmos-sdk 0.47 + packetforward.v1.Params: + type: object + properties: + fee_percentage: + type: string + description: Params defines the set of packetforward parameters. + packetforward.v1.QueryParamsResponse: + type: object + properties: + params: + description: params defines the parameters of the module. + type: object + properties: + fee_percentage: + type: string + description: QueryParamsResponse is the response type for the Query/Params RPC method. diff --git a/ecosystem/cache/cache_test.go b/ecosystem/cache/cache_test.go index 6c1620038f..1f2cfbbbbc 100644 --- a/ecosystem/cache/cache_test.go +++ b/ecosystem/cache/cache_test.go @@ -8,12 +8,12 @@ import ( "testing" "time" - "github.com/lavanet/lava/ecosystem/cache" - "github.com/lavanet/lava/ecosystem/cache/format" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/ecosystem/cache" + "github.com/lavanet/lava/v2/ecosystem/cache/format" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" "github.com/tidwall/gjson" ) @@ -31,7 +31,16 @@ const ( func initTest() (context.Context, *cache.RelayerCacheServer) { ctx := context.Background() cs := cache.CacheServer{CacheMaxCost: 2 * 1024 * 1024 * 1024} - cs.InitCache(ctx, cache.DefaultExpirationTimeFinalized, cache.DefaultExpirationForNonFinalized, cache.DisabledFlagOption, cache.DefaultExpirationTimeFinalizedMultiplier, cache.DefaultExpirationTimeNonFinalizedMultiplier) + cs.InitCache( + ctx, + cache.DefaultExpirationTimeFinalized, + cache.DefaultExpirationForNonFinalized, + cache.DefaultExpirationNodeErrors, + cache.DefaultExpirationBlocksHashesToHeights, + cache.DisabledFlagOption, + cache.DefaultExpirationTimeFinalizedMultiplier, + cache.DefaultExpirationTimeNonFinalizedMultiplier, + ) cacheServer := &cache.RelayerCacheServer{CacheServer: &cs} return ctx, cacheServer } @@ -85,11 +94,12 @@ func TestCacheSetGet(t *testing.T) { Finalized: tt.finalized, RequestedBlock: request.RequestBlock, } - _, err = cacheServer.GetRelay(ctx, &messageGet) + reply, err := cacheServer.GetRelay(ctx, &messageGet) + require.NoError(t, err) if tt.valid { - require.NoError(t, err) + require.NotNil(t, reply.Reply) } else { - require.Error(t, err) + require.Nil(t, reply.Reply) } }) } @@ -169,9 +179,9 @@ func TestCacheGetWithoutSet(t *testing.T) { Finalized: tt.finalized, RequestedBlock: request.RequestBlock, } - _, err := cacheServer.GetRelay(ctx, &messageGet) - - require.Error(t, err) + reply, err := cacheServer.GetRelay(ctx, &messageGet) + require.Nil(t, reply.Reply) + require.NoError(t, err) }) } } @@ -333,7 +343,7 @@ func TestCacheSetGetLatest(t *testing.T) { require.Equal(t, cacheReply.GetReply().LatestBlock, latestBlockForRelay) } } else { - require.Error(t, err) + require.Nil(t, cacheReply.Reply) } }) } @@ -410,7 +420,7 @@ func TestCacheSetGetLatestWhenAdvancingLatest(t *testing.T) { require.Equal(t, cacheReply.GetReply().LatestBlock, latestBlockForRelay) } } else { - require.Error(t, err) + require.Nil(t, cacheReply.Reply) } request2 := shallowCopy(request) @@ -435,8 +445,9 @@ func TestCacheSetGetLatestWhenAdvancingLatest(t *testing.T) { RequestedBlock: request.RequestBlock, } // repeat our latest block get, this time we expect it to look for a newer block and fail - _, err = cacheServer.GetRelay(ctx, &messageGet) - require.Error(t, err) + reply, err := cacheServer.GetRelay(ctx, &messageGet) + require.NoError(t, err) + require.Nil(t, reply.Reply) }) } } @@ -462,7 +473,7 @@ func TestCacheSetGetJsonRPCWithID(t *testing.T) { {name: "NonFinalized With Hash", valid: true, delay: time.Millisecond, finalized: false, hash: []byte{1, 2, 3}}, {name: "NonFinalized After delay With Hash", valid: true, delay: cache.DefaultExpirationForNonFinalized + time.Millisecond, finalized: false, hash: []byte{1, 2, 3}}, - // Null ID in get and set + // // Null ID in get and set {name: "Finalized No Hash, with null id in get and set", valid: true, delay: time.Millisecond, finalized: true, hash: nil, nullIdInGet: true, nullIdInSet: true}, {name: "Finalized After delay No Hash, with null id in get and set", valid: true, delay: cache.DefaultExpirationForNonFinalized + time.Millisecond, finalized: true, hash: nil, nullIdInGet: true, nullIdInSet: true}, {name: "NonFinalized No Hash, with null id in get and set", valid: true, delay: time.Millisecond, finalized: false, hash: nil, nullIdInGet: true, nullIdInSet: true}, @@ -472,7 +483,7 @@ func TestCacheSetGetJsonRPCWithID(t *testing.T) { {name: "NonFinalized With Hash, with null id in get and set", valid: true, delay: time.Millisecond, finalized: false, hash: []byte{1, 2, 3}, nullIdInGet: true, nullIdInSet: true}, {name: "NonFinalized After delay With Hash, with null id in get and set", valid: true, delay: cache.DefaultExpirationForNonFinalized + time.Millisecond, finalized: false, hash: []byte{1, 2, 3}, nullIdInGet: true, nullIdInSet: true}, - // Null ID only in get + // // Null ID only in get {name: "Finalized No Hash, with null id only in get", valid: true, delay: time.Millisecond, finalized: true, hash: nil, nullIdInGet: true}, {name: "Finalized After delay No Hash, with null id only in get", valid: true, delay: cache.DefaultExpirationForNonFinalized + time.Millisecond, finalized: true, hash: nil, nullIdInGet: true}, {name: "NonFinalized No Hash, with null id only in get", valid: true, delay: time.Millisecond, finalized: false, hash: nil, nullIdInGet: true}, @@ -482,7 +493,7 @@ func TestCacheSetGetJsonRPCWithID(t *testing.T) { {name: "NonFinalized With Hash, with null id only in get", valid: true, delay: time.Millisecond, finalized: false, hash: []byte{1, 2, 3}, nullIdInGet: true}, {name: "NonFinalized After delay With Hash, with null id only in get", valid: true, delay: cache.DefaultExpirationForNonFinalized + time.Millisecond, finalized: false, hash: []byte{1, 2, 3}, nullIdInGet: true}, - // Null ID only in set + // // Null ID only in set {name: "Finalized No Hash, with null id only in set", valid: true, delay: time.Millisecond, finalized: true, hash: nil, nullIdInSet: true}, {name: "Finalized After delay No Hash, with null id only in set", valid: true, delay: cache.DefaultExpirationForNonFinalized + time.Millisecond, finalized: true, hash: nil, nullIdInSet: true}, {name: "NonFinalized No Hash, with null id only in set", valid: true, delay: time.Millisecond, finalized: false, hash: nil, nullIdInSet: true}, @@ -547,20 +558,21 @@ func TestCacheSetGetJsonRPCWithID(t *testing.T) { } cacheReply, err := cacheServer.GetRelay(ctx, &messageGet) + // because we always need a cache reply. we cant return an error in any case. + // grpc do not allow returning errors + messages + require.NoError(t, err) + if tt.valid { cacheReply.Reply.Data = outputFormatter(cacheReply.Reply.Data) - require.NoError(t, err) - result := gjson.GetBytes(cacheReply.GetReply().Data, format.IDFieldName) extractedID := result.Raw - if tt.nullIdInGet { require.Equal(t, "null", extractedID) } else { require.Equal(t, strconv.FormatInt(changedID, 10), extractedID) } } else { - require.Error(t, err) + require.Nil(t, cacheReply.Reply) } }) } @@ -583,7 +595,16 @@ func TestCacheExpirationMultiplier(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cs := cache.CacheServer{CacheMaxCost: 2 * 1024 * 1024 * 1024} - cs.InitCache(context.Background(), cache.DefaultExpirationTimeFinalized, cache.DefaultExpirationForNonFinalized, cache.DisabledFlagOption, 1, tt.multiplier) + cs.InitCache( + context.Background(), + cache.DefaultExpirationTimeFinalized, + cache.DefaultExpirationForNonFinalized, + cache.DefaultExpirationNodeErrors, + cache.DefaultExpirationBlocksHashesToHeights, + cache.DisabledFlagOption, + cache.DefaultExpirationTimeFinalizedMultiplier, + tt.multiplier, + ) cacheServer := &cache.RelayerCacheServer{CacheServer: &cs} durationActual := cacheServer.CacheServer.ExpirationForChain(cache.DefaultExpirationForNonFinalized) @@ -591,3 +612,246 @@ func TestCacheExpirationMultiplier(t *testing.T) { }) } } + +func TestCacheSetGetBlocksHashesToHeightsHappyFlow(t *testing.T) { + t.Parallel() + const ( + SET_INPUT int = iota + GET_INPUT + EXPECTED_FROM_GET + ) + + type step struct { + blockHashesToHeights []*pairingtypes.BlockHashToHeight + inputOrExpected int + } + + steps := []step{ + { + inputOrExpected: SET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{}, + }, + { + inputOrExpected: GET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + {Hash: "H1"}, + {Hash: "H2"}, + }, + }, + { + inputOrExpected: EXPECTED_FROM_GET, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: spectypes.NOT_APPLICABLE, + }, + { + Hash: "H2", + Height: spectypes.NOT_APPLICABLE, + }, + }, + }, + { + inputOrExpected: SET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: 1, + }, + }, + }, + { + inputOrExpected: GET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + {Hash: "H1"}, + {Hash: "H2"}, + }, + }, + { + inputOrExpected: EXPECTED_FROM_GET, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: 1, + }, + { + Hash: "H2", + Height: spectypes.NOT_APPLICABLE, + }, + }, + }, + { + inputOrExpected: GET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + {Hash: "H1"}, + }, + }, + { + inputOrExpected: EXPECTED_FROM_GET, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: 1, + }, + }, + }, + { + inputOrExpected: GET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + {Hash: "H2"}, + }, + }, + { + inputOrExpected: EXPECTED_FROM_GET, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H2", + Height: spectypes.NOT_APPLICABLE, + }, + }, + }, + { + inputOrExpected: SET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H3", + Height: 3, + }, + }, + }, + { + inputOrExpected: GET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + {Hash: "H1"}, + {Hash: "H2"}, + }, + }, + { + inputOrExpected: EXPECTED_FROM_GET, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: 1, + }, + { + Hash: "H2", + Height: spectypes.NOT_APPLICABLE, + }, + }, + }, + { + inputOrExpected: GET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + {Hash: "H1"}, + {Hash: "H2"}, + {Hash: "H3"}, + }, + }, + { + inputOrExpected: EXPECTED_FROM_GET, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: 1, + }, + { + Hash: "H2", + Height: spectypes.NOT_APPLICABLE, + }, + { + Hash: "H3", + Height: 3, + }, + }, + }, + { + inputOrExpected: SET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: 4, + }, + { + Hash: "H2", + Height: 2, + }, + { + Hash: "H5", + Height: 7, + }, + }, + }, + { + inputOrExpected: GET_INPUT, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + {Hash: "H1"}, + {Hash: "H2"}, + {Hash: "H3"}, + {Hash: "H5"}, + }, + }, + { + inputOrExpected: EXPECTED_FROM_GET, + blockHashesToHeights: []*pairingtypes.BlockHashToHeight{ + { + Hash: "H1", + Height: 4, + }, + { + Hash: "H2", + Height: 2, + }, + { + Hash: "H3", + Height: 3, + }, + { + Hash: "H5", + Height: 7, + }, + }, + }, + } + + t.Run("run cache steps", func(t *testing.T) { + ctx, cacheServer := initTest() + request := getRequest(1230, []byte(StubSig), StubApiInterface) + + var lastCacheResult []*pairingtypes.BlockHashToHeight + for stepNum, step := range steps { + switch step.inputOrExpected { + case SET_INPUT: + messageSet := pairingtypes.RelayCacheSet{ + RequestHash: HashRequest(t, request, StubChainID), + BlockHash: []byte("123456789"), + ChainId: StubChainID, + Response: &pairingtypes.RelayReply{}, + Finalized: true, + RequestedBlock: request.RequestBlock, + BlocksHashesToHeights: step.blockHashesToHeights, + } + + _, err := cacheServer.SetRelay(ctx, &messageSet) + require.NoError(t, err, "step: %d", stepNum) + + // sleep to make sure it's in the cache + time.Sleep(3 * time.Millisecond) + case GET_INPUT: + messageGet := pairingtypes.RelayCacheGet{ + RequestHash: HashRequest(t, request, StubChainID), + BlockHash: []byte("123456789"), + ChainId: StubChainID, + Finalized: true, + RequestedBlock: request.RequestBlock, + BlocksHashesToHeights: step.blockHashesToHeights, + } + + cacheResult, err := cacheServer.GetRelay(ctx, &messageGet) + require.NoError(t, err, "step: %d", stepNum) + lastCacheResult = cacheResult.BlocksHashesToHeights + case EXPECTED_FROM_GET: + require.Equal(t, step.blockHashesToHeights, lastCacheResult, "step: %d", stepNum) + } + } + }) +} diff --git a/ecosystem/cache/command.go b/ecosystem/cache/command.go index 17e8ccd476..c138a59134 100644 --- a/ecosystem/cache/command.go +++ b/ecosystem/cache/command.go @@ -3,7 +3,7 @@ package cache import ( "context" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/rs/zerolog" "github.com/spf13/cobra" ) @@ -44,6 +44,7 @@ longer DefaultExpirationForNonFinalized will reduce sync QoS for "latest" reques cacheCmd.Flags().Duration(ExpirationNonFinalizedFlagName, DefaultExpirationForNonFinalized, "how long does a cache entry lasts in the cache for a non finalized entry") cacheCmd.Flags().Float64(ExpirationTimeFinalizedMultiplierFlagName, DefaultExpirationTimeFinalizedMultiplier, "Multiplier for finalized cache entry expiration. 1 means no change (default), 1.2 means 20% longer.") cacheCmd.Flags().Float64(ExpirationTimeNonFinalizedMultiplierFlagName, DefaultExpirationTimeNonFinalizedMultiplier, "Multiplier for non-finalized cache entry expiration. 1 means no change (default), 1.2 means 20% longer.") + cacheCmd.Flags().Duration(ExpirationBlocksHashesToHeightsFlagName, DefaultExpirationBlocksHashesToHeights, "how long does the cache entry lasts in the cache for a block hash to height entry") cacheCmd.Flags().Duration(ExpirationNodeErrorsOnFinalizedFlagName, DefaultExpirationNodeErrors, "how long does a cache entry lasts in the cache for a finalized node error entry") cacheCmd.Flags().String(FlagMetricsAddress, DisabledFlagOption, "address to listen to prometheus metrics 127.0.0.1:5555, later you can curl http://127.0.0.1:5555/metrics") cacheCmd.Flags().Int64(FlagCacheSizeName, 2*1024*1024*1024, "the maximal amount of entries to save") diff --git a/ecosystem/cache/format/formatter.go b/ecosystem/cache/format/formatter.go index 1075956221..1e886ecf2d 100644 --- a/ecosystem/cache/format/formatter.go +++ b/ecosystem/cache/format/formatter.go @@ -1,7 +1,7 @@ package format import ( - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) // input formatter works on the input data diff --git a/ecosystem/cache/format/formatter_test.go b/ecosystem/cache/format/formatter_test.go index b457b83d8d..8650813279 100644 --- a/ecosystem/cache/format/formatter_test.go +++ b/ecosystem/cache/format/formatter_test.go @@ -3,7 +3,7 @@ package format import ( "testing" - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/ecosystem/cache/format/jsonrpc.go b/ecosystem/cache/format/jsonrpc.go index 9c84a64bdc..1eef0021a3 100644 --- a/ecosystem/cache/format/jsonrpc.go +++ b/ecosystem/cache/format/jsonrpc.go @@ -3,7 +3,7 @@ package format import ( "encoding/json" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/tidwall/gjson" "github.com/tidwall/sjson" ) diff --git a/ecosystem/cache/handlers.go b/ecosystem/cache/handlers.go index d3c6b34db2..49cbd6adba 100644 --- a/ecosystem/cache/handlers.go +++ b/ecosystem/cache/handlers.go @@ -13,12 +13,12 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/lavaprotocol" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" emptypb "google.golang.org/protobuf/types/known/emptypb" ) @@ -85,12 +85,34 @@ func (s *RelayerCacheServer) getSeenBlockForSharedStateMode(chainId string, shar return 0 } +func (s *RelayerCacheServer) getBlockHeightsFromHashes(chainId string, hashes []*pairingtypes.BlockHashToHeight) []*pairingtypes.BlockHashToHeight { + for _, hashToHeight := range hashes { + formattedKey := s.formatChainIdWithHashKey(chainId, hashToHeight.Hash) + value, found := getNonExpiredFromCache(s.CacheServer.blocksHashesToHeightsCache, formattedKey) + if found { + if cacheValue, ok := value.(int64); ok { + hashToHeight.Height = cacheValue + } + } else { + hashToHeight.Height = spectypes.NOT_APPLICABLE + } + } + return hashes +} + func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairingtypes.RelayCacheGet) (*pairingtypes.CacheRelayReply, error) { cacheReply := &pairingtypes.CacheRelayReply{} var cacheReplyTmp *pairingtypes.CacheRelayReply var err error var seenBlock int64 + // validating that if we had an error, we do not return a reply. + defer func() { + if err != nil { + cacheReply.Reply = nil + } + }() + originalRequestedBlock := relayCacheGet.RequestedBlock // save requested block prior to swap if originalRequestedBlock < 0 { // we need to fetch stored latest block information. getLatestBlock := s.getLatestBlock(latestBlockKey(relayCacheGet.ChainId, "")) @@ -104,11 +126,15 @@ func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairin utils.Attribute{Key: "requested_block_parsed", Value: relayCacheGet.RequestedBlock}, utils.Attribute{Key: "seen_block", Value: relayCacheGet.SeenBlock}, ) + + var blockHashes []*pairingtypes.BlockHashToHeight if relayCacheGet.RequestedBlock >= 0 { // we can only fetch - // check seen block is larger than our requested block, we don't need to fetch seen block prior as its already larger than requested block + // we don't need to fetch seen block prior as its already larger than requested block waitGroup := sync.WaitGroup{} - waitGroup.Add(2) // currently we have two groups getRelayInner and getSeenBlock - // fetch all reads at the same time. + waitGroup.Add(3) // currently we have three groups: getRelayInner, getSeenBlock and getBlockHeightsFromHashes + + // fetch all reads at the same time: + // fetch the cache entry go func() { defer waitGroup.Done() cacheReplyTmp, err = s.getRelayInner(relayCacheGet) @@ -116,6 +142,8 @@ func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairin cacheReply = cacheReplyTmp // set cache reply only if its not nil, as we need to store seen block in it. } }() + + // fetch seen block go func() { defer waitGroup.Done() // set seen block if required @@ -124,8 +152,16 @@ func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairin relayCacheGet.SeenBlock = seenBlock // update state. } }() + + // fetch block hashes + go func() { + defer waitGroup.Done() + blockHashes = s.getBlockHeightsFromHashes(relayCacheGet.ChainId, relayCacheGet.BlocksHashesToHeights) + }() + // wait for all reads to complete before moving forward waitGroup.Wait() + if err == nil { // in case we got a hit validate seen block of the reply. // validate that the response seen block is larger or equal to our expectations. if cacheReply.SeenBlock < lavaslices.Min([]int64{relayCacheGet.SeenBlock, relayCacheGet.RequestedBlock}) { // TODO unitest this. @@ -138,6 +174,7 @@ func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairin ) } } + // set seen block. if relayCacheGet.SeenBlock > cacheReply.SeenBlock { cacheReply.SeenBlock = relayCacheGet.SeenBlock @@ -148,22 +185,32 @@ func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairin utils.LogAttr("requested block", relayCacheGet.RequestedBlock), utils.LogAttr("request_hash", string(relayCacheGet.RequestHash)), ) + // even if we don't have information on requested block, we can still check if we have data on the block hash array. + blockHashes = s.getBlockHeightsFromHashes(relayCacheGet.ChainId, relayCacheGet.BlocksHashesToHeights) + } + + cacheReply.BlocksHashesToHeights = blockHashes + if blockHashes != nil { + utils.LavaFormatDebug("block hashes:", utils.LogAttr("hashes", blockHashes)) } // add prometheus metrics asynchronously + cacheHit := cacheReply.Reply != nil go func() { cacheMetricsContext, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() - var hit bool - if err != nil { - s.cacheMiss(cacheMetricsContext, err) - } else { - hit = true + + if cacheHit { s.cacheHit(cacheMetricsContext) + } else { + s.cacheMiss(cacheMetricsContext, err) } - s.CacheServer.CacheMetrics.AddApiSpecific(originalRequestedBlock, relayCacheGet.ChainId, hit) + + s.CacheServer.CacheMetrics.AddApiSpecific(originalRequestedBlock, relayCacheGet.ChainId, cacheHit) }() - return cacheReply, err + // no matter what we return nil from cache. as we need additional info even if we had cache miss + // such as block hashes array, seen block, etc... + return cacheReply, nil } // formatHashKey formats the hash key by adding latestBlock information. @@ -173,6 +220,10 @@ func (s *RelayerCacheServer) formatHashKey(hash []byte, parsedRequestedBlock int return hash } +func (s *RelayerCacheServer) formatChainIdWithHashKey(chainId, hash string) string { + return chainId + "_" + hash +} + func (s *RelayerCacheServer) getRelayInner(relayCacheGet *pairingtypes.RelayCacheGet) (*pairingtypes.CacheRelayReply, error) { // cache key is compressed from: // 1. Request hash including all the information inside RelayPrivateData (Salt can cause issues if not dealt with on consumer side.) @@ -249,6 +300,15 @@ func (s *RelayerCacheServer) setSeenBlockOnSharedStateMode(chainId, sharedStateI s.performInt64WriteWithValidationAndRetry(get, set, seenBlock) } +func (s *RelayerCacheServer) setBlocksHashesToHeights(chainId string, blocksHashesToHeights []*pairingtypes.BlockHashToHeight) { + for _, hashToHeight := range blocksHashesToHeights { + if hashToHeight.Height >= 0 { + formattedKey := s.formatChainIdWithHashKey(chainId, hashToHeight.Hash) + s.CacheServer.blocksHashesToHeightsCache.SetWithTTL(formattedKey, hashToHeight.Height, 1, s.CacheServer.ExpirationBlocksHashesToHeights) + } + } +} + func (s *RelayerCacheServer) SetRelay(ctx context.Context, relayCacheSet *pairingtypes.RelayCacheSet) (*emptypb.Empty, error) { if relayCacheSet.RequestedBlock < 0 { return nil, utils.LavaFormatError("invalid relay cache set data, request block is negative", nil, utils.Attribute{Key: "requestBlock", Value: relayCacheSet.RequestedBlock}) @@ -265,12 +325,14 @@ func (s *RelayerCacheServer) SetRelay(ctx context.Context, relayCacheSet *pairin utils.Attribute{Key: "requestHash", Value: string(relayCacheSet.BlockHash)}, utils.Attribute{Key: "latestKnownBlock", Value: string(relayCacheSet.BlockHash)}, utils.Attribute{Key: "IsNodeError", Value: relayCacheSet.IsNodeError}, + utils.Attribute{Key: "BlocksHashesToHeights", Value: relayCacheSet.BlocksHashesToHeights}, ) // finalized entries can stay there if relayCacheSet.Finalized { cache := s.CacheServer.finalizedCache if relayCacheSet.IsNodeError { - cache.SetWithTTL(cacheKey, cacheValue, cacheValue.Cost(), s.CacheServer.ExpirationNodeErrors) + nodeErrorExpiration := lavaslices.Min([]time.Duration{time.Duration(relayCacheSet.AverageBlockTime), s.CacheServer.ExpirationNodeErrors}) + cache.SetWithTTL(cacheKey, cacheValue, cacheValue.Cost(), nodeErrorExpiration) } else { cache.SetWithTTL(cacheKey, cacheValue, cacheValue.Cost(), s.CacheServer.ExpirationFinalized) } @@ -281,6 +343,7 @@ func (s *RelayerCacheServer) SetRelay(ctx context.Context, relayCacheSet *pairin // Setting the seen block for shared state. s.setSeenBlockOnSharedStateMode(relayCacheSet.ChainId, relayCacheSet.SharedStateId, latestKnownBlock) s.setLatestBlock(latestBlockKey(relayCacheSet.ChainId, ""), latestKnownBlock) + s.setBlocksHashesToHeights(relayCacheSet.ChainId, relayCacheSet.BlocksHashesToHeights) return &emptypb.Empty{}, nil } diff --git a/ecosystem/cache/metrics.go b/ecosystem/cache/metrics.go index 0bd50813c6..57f1a72e6d 100644 --- a/ecosystem/cache/metrics.go +++ b/ecosystem/cache/metrics.go @@ -4,8 +4,8 @@ import ( "net/http" "sync" - "github.com/lavanet/lava/utils" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/ecosystem/cache/server.go b/ecosystem/cache/server.go index aa9a879792..5875a2d856 100644 --- a/ecosystem/cache/server.go +++ b/ecosystem/cache/server.go @@ -11,13 +11,13 @@ import ( "syscall" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/utils/lavaslices" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/utils/lavaslices" "github.com/dgraph-io/ristretto" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/pflag" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" @@ -29,43 +29,62 @@ const ( ExpirationTimeFinalizedMultiplierFlagName = "expiration-multiplier" ExpirationNonFinalizedFlagName = "expiration-non-finalized" ExpirationTimeNonFinalizedMultiplierFlagName = "expiration-non-finalized-multiplier" + ExpirationBlocksHashesToHeightsFlagName = "expiration-blocks-hashes-to-heights" ExpirationNodeErrorsOnFinalizedFlagName = "expiration-finalized-node-errors" FlagCacheSizeName = "max-items" DefaultExpirationForNonFinalized = 500 * time.Millisecond DefaultExpirationTimeFinalizedMultiplier = 1.0 DefaultExpirationTimeNonFinalizedMultiplier = 1.0 + DefaultExpirationBlocksHashesToHeights = 48 * time.Hour DefaultExpirationTimeFinalized = time.Hour - DefaultExpirationNodeErrors = 5 * time.Second + DefaultExpirationNodeErrors = 250 * time.Millisecond CacheNumCounters = 100000000 // expect 10M items unixPrefix = "unix:" ) type CacheServer struct { - finalizedCache *ristretto.Cache - tempCache *ristretto.Cache - ExpirationFinalized time.Duration - ExpirationNonFinalized time.Duration - ExpirationNodeErrors time.Duration + finalizedCache *ristretto.Cache + tempCache *ristretto.Cache // cache for temporary inputs, such as latest blocks + blocksHashesToHeightsCache *ristretto.Cache + ExpirationFinalized time.Duration + ExpirationNonFinalized time.Duration + ExpirationNodeErrors time.Duration + ExpirationBlocksHashesToHeights time.Duration CacheMetrics *CacheMetrics CacheMaxCost int64 } -func (cs *CacheServer) InitCache(ctx context.Context, expiration time.Duration, expirationNonFinalized time.Duration, metricsAddr string, expirationFinalizedMultiplier float64, expirationNonFinalizedMultiplier float64) { +func (cs *CacheServer) InitCache( + ctx context.Context, + expiration time.Duration, + expirationNonFinalized time.Duration, + expirationNodeErrorsOnFinalized time.Duration, + expirationBlocksHashesToHeights time.Duration, + metricsAddr string, + expirationFinalizedMultiplier float64, + expirationNonFinalizedMultiplier float64, +) { cs.ExpirationFinalized = time.Duration(float64(expiration) * expirationFinalizedMultiplier) cs.ExpirationNonFinalized = time.Duration(float64(expirationNonFinalized) * expirationNonFinalizedMultiplier) + cs.ExpirationNodeErrors = expirationNodeErrorsOnFinalized + cs.ExpirationBlocksHashesToHeights = time.Duration(float64(expirationBlocksHashesToHeights)) - cache, err := ristretto.NewCache(&ristretto.Config{NumCounters: CacheNumCounters, MaxCost: cs.CacheMaxCost, BufferItems: 64}) + var err error + cs.tempCache, err = ristretto.NewCache(&ristretto.Config{NumCounters: CacheNumCounters, MaxCost: cs.CacheMaxCost, BufferItems: 64}) if err != nil { utils.LavaFormatFatal("could not create cache", err) } - cs.tempCache = cache - cache, err = ristretto.NewCache(&ristretto.Config{NumCounters: CacheNumCounters, MaxCost: cs.CacheMaxCost, BufferItems: 64}) + cs.finalizedCache, err = ristretto.NewCache(&ristretto.Config{NumCounters: CacheNumCounters, MaxCost: cs.CacheMaxCost, BufferItems: 64}) if err != nil { utils.LavaFormatFatal("could not create finalized cache", err) } - cs.finalizedCache = cache + + cs.blocksHashesToHeightsCache, err = ristretto.NewCache(&ristretto.Config{NumCounters: CacheNumCounters, MaxCost: cs.CacheMaxCost, BufferItems: 64}) + if err != nil { + utils.LavaFormatFatal("could not create blocks hashes to heights cache", err) + } // initialize prometheus cs.CacheMetrics = NewCacheMetricsServer(metricsAddr) @@ -183,6 +202,16 @@ func Server( utils.LavaFormatFatal("failed to read flag", err, utils.Attribute{Key: "flag", Value: ExpirationNonFinalizedFlagName}) } + expirationNodeErrorsOnFinalizedFlagName, err := flags.GetDuration(ExpirationNodeErrorsOnFinalizedFlagName) + if err != nil { + utils.LavaFormatFatal("failed to read flag", err, utils.Attribute{Key: "flag", Value: ExpirationNodeErrorsOnFinalizedFlagName}) + } + + expirationBlocksHashesToHeights, err := flags.GetDuration(ExpirationBlocksHashesToHeightsFlagName) + if err != nil { + utils.LavaFormatFatal("failed to read flag", err, utils.Attribute{Key: "flag", Value: ExpirationBlocksHashesToHeightsFlagName}) + } + expirationFinalizedMultiplier, err := flags.GetFloat64(ExpirationTimeFinalizedMultiplierFlagName) if err != nil { utils.LavaFormatFatal("failed to read flag", err, utils.Attribute{Key: "flag", Value: ExpirationTimeFinalizedMultiplierFlagName}) @@ -199,7 +228,7 @@ func Server( } cs := CacheServer{CacheMaxCost: cacheMaxCost} - cs.InitCache(ctx, expiration, expirationNonFinalized, metricsAddr, expirationFinalizedMultiplier, expirationNonFinalizedMultiplier) + cs.InitCache(ctx, expiration, expirationNonFinalized, expirationNodeErrorsOnFinalizedFlagName, expirationBlocksHashesToHeights, metricsAddr, expirationFinalizedMultiplier, expirationNonFinalizedMultiplier) // TODO: have a state tracker cs.Serve(ctx, listenAddr) } diff --git a/ecosystem/lava-sdk/package.json b/ecosystem/lava-sdk/package.json index 8ad4f14f97..b5829beb2d 100644 --- a/ecosystem/lava-sdk/package.json +++ b/ecosystem/lava-sdk/package.json @@ -36,8 +36,8 @@ "@types/seedrandom": "^3.0.6", "http-server": "^14.1.1", "typescript": "^4.8.4", - "webpack": "^5.74.0", - "webpack-cli": "^4.10.0" + "webpack": "^5.92.1", + "webpack-cli": "^5.1.4" }, "dependencies": { "@cosmjs/amino": "^0.29.4", @@ -65,7 +65,7 @@ "long": "^5.2.1", "lru-cache": "^10.0.1", "prettier": "^2.8.0", - "protobufjs": "^7.1.2", + "protobufjs": "7.2.5", "protoc-gen-js": "^3.21.2", "random": "3.0.4", "rxjs": "^7.5.7", diff --git a/ecosystem/lava-sdk/scripts/prepare_protobufs.sh b/ecosystem/lava-sdk/scripts/prepare_protobufs.sh index 94096c76f9..48d6b692d7 100755 --- a/ecosystem/lava-sdk/scripts/prepare_protobufs.sh +++ b/ecosystem/lava-sdk/scripts/prepare_protobufs.sh @@ -13,9 +13,9 @@ function prepare() { file_path="../../go.mod" expected_lines=( "github.com/gogo/googleapis v1.4.1 // indirect" - "github.com/cosmos/cosmos-sdk v0.47.10" + "github.com/cosmos/cosmos-sdk v0.47.13" "github.com/cosmos/gogoproto v1.4.10" - "github.com/cosmos/cosmos-proto v1.0.0-beta.4" + "github.com/cosmos/cosmos-proto v1.0.0-beta.5" ) missing_lines=() @@ -48,7 +48,7 @@ function prepare() { exit 1 fi - specific_dir="$GOPATH/pkg/mod/github.com/lavanet/cosmos-sdk@v0.47.10-lava-cosmos" + specific_dir="$GOPATH/pkg/mod/github.com/lavanet/cosmos-sdk@v0.47.13-lava-cosmos" if [[ ! -d "$specific_dir" ]]; then echo "Error: The cosmos-sdk directory ('$specific_dir') does not exist under '$GOPATH/pkg/mod'." >&2 @@ -72,7 +72,7 @@ function prepare() { exit 1 fi - cosmosprotosdir="$GOPATH/pkg/mod/github.com/cosmos/cosmos-proto@v1.0.0-beta.4" + cosmosprotosdir="$GOPATH/pkg/mod/github.com/cosmos/cosmos-proto@v1.0.0-beta.5" if [[ ! -d "$cosmosprotosdir" ]]; then echo "Error: The cosmosprotosdir directory ('$cosmosprotosdir') does not exist under '$GOPATH/pkg/mod'." >&2 diff --git a/ecosystem/lava-sdk/scripts/setup_sdk_with_local.sh b/ecosystem/lava-sdk/scripts/setup_sdk_with_local.sh index 6322721e47..51095507e8 100755 --- a/ecosystem/lava-sdk/scripts/setup_sdk_with_local.sh +++ b/ecosystem/lava-sdk/scripts/setup_sdk_with_local.sh @@ -4,7 +4,7 @@ # Make sure you dont push the changes after this script ran. echo "Buying subscription for user1" -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx subscription buy "DefaultPlan" -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE privateKey=$(yes | lavad keys export user1 --unsafe --unarmored-hex) diff --git a/ecosystem/lava-sdk/scripts/setup_sdk_with_local_badge.sh b/ecosystem/lava-sdk/scripts/setup_sdk_with_local_badge.sh index 9dbfc24e71..9cba40d7d5 100755 --- a/ecosystem/lava-sdk/scripts/setup_sdk_with_local_badge.sh +++ b/ecosystem/lava-sdk/scripts/setup_sdk_with_local_badge.sh @@ -4,7 +4,7 @@ # Make sure you dont push the changes after this script ran. echo "Buying subscription for user1" -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx subscription buy "DefaultPlan" -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE privateKey=$(yes | lavad keys export user1 --unsafe --unarmored-hex) diff --git a/ecosystem/lava-sdk/src/lavaprotocol/finalization_consensus.ts b/ecosystem/lava-sdk/src/lavaprotocol/finalization_consensus.ts index 5b774b6adb..41d2f40e2d 100644 --- a/ecosystem/lava-sdk/src/lavaprotocol/finalization_consensus.ts +++ b/ecosystem/lava-sdk/src/lavaprotocol/finalization_consensus.ts @@ -127,7 +127,8 @@ export class FinalizationConsensus { const err = this.discrepancyChecker(finalizedBlocks, consensus); if (err) { finalizationConflict = new FinalizationConflict(); - finalizationConflict.setRelayreply0(reply); + // TODO: Implement conflict logic from finalization_consensus + // finalizationConflict.setRelayreply0(reply); continue; } @@ -167,7 +168,8 @@ export class FinalizationConsensus { ); if (err) { finalizationConflict = new FinalizationConflict(); - finalizationConflict.setRelayreply0(reply); + // TODO: Implement conflict logic from finalization_consensus + // finalizationConflict.setRelayreply0(reply); Logger.info( "Simulation: prev epoch Conflict found in discrepancyChecker", "Consensus idx", diff --git a/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts b/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts index a1868aeb9d..7bbaf9da3b 100644 --- a/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts +++ b/ecosystem/lava-sdk/src/providerOptimizer/providerOptimizer.test.ts @@ -273,91 +273,92 @@ describe("ProviderOptimizer", () => { expect(returnedProviders[0]).not.toBe(providers[chosenIndex]); }); - it("tests provider optimizer updating latency", async () => { - const providerOptimizer = setupProviderOptimizer(); - const providersCount = 2; - const providers = setupProvidersForTest(providersCount); - - const requestCU = 10; - const requestBlock = 1000; - const syncBlock = requestBlock; - - const getProviderData = (providerAddress: string) => { - // @ts-expect-error private method but we need it for testing without exposing it - return providerOptimizer.getProviderData(providerAddress); - }; - const calculateLatencyScore = ( - providerData: ProviderData, - requestCU: number, - requestBlock: number - ) => { - // @ts-expect-error private method but we need it for testing without exposing it - return providerOptimizer.calculateLatencyScore( - providerData, - requestCU, - requestBlock - ); - }; - - let providerAddress = providers[0]; - for (let i = 0; i < 10; i++) { - let { providerData } = getProviderData(providerAddress); - - const currentLatencyScore = calculateLatencyScore( - providerData, - requestCU, - requestBlock - ); - providerOptimizer.appendProbeRelayData( - providerAddress, - TEST_BASE_WORLD_LATENCY, - true - ); - - await sleep(4); - - const data = getProviderData(providerAddress); - providerData = data.providerData; - expect(data.found).toBe(true); - - const newLatencyScore = calculateLatencyScore( - providerData, - requestCU, - requestBlock - ); - expect(currentLatencyScore).toBeGreaterThan(newLatencyScore); - } - - providerAddress = providers[1]; - for (let i = 0; i < 10; i++) { - let { providerData } = getProviderData(providerAddress); - const currentLatencyScore = calculateLatencyScore( - providerData, - requestCU, - requestBlock - ); - providerOptimizer.appendRelayData( - providerAddress, - TEST_BASE_WORLD_LATENCY, - false, - requestCU, - syncBlock - ); - - await sleep(4); - - const data = getProviderData(providerAddress); - providerData = data.providerData; - expect(data.found).toBe(true); - - const newLatencyScore = calculateLatencyScore( - providerData, - requestCU, - requestBlock - ); - expect(currentLatencyScore).toBeGreaterThan(newLatencyScore); - } - }); + // this test fails statistically. we need to solve the issue also on the golang version. + // it("tests provider optimizer updating latency", async () => { + // const providerOptimizer = setupProviderOptimizer(); + // const providersCount = 2; + // const providers = setupProvidersForTest(providersCount); + + // const requestCU = 10; + // const requestBlock = 1000; + // const syncBlock = requestBlock; + + // const getProviderData = (providerAddress: string) => { + // // @ts-expect-error private method but we need it for testing without exposing it + // return providerOptimizer.getProviderData(providerAddress); + // }; + // const calculateLatencyScore = ( + // providerData: ProviderData, + // requestCU: number, + // requestBlock: number + // ) => { + // // @ts-expect-error private method but we need it for testing without exposing it + // return providerOptimizer.calculateLatencyScore( + // providerData, + // requestCU, + // requestBlock + // ); + // }; + + // let providerAddress = providers[0]; + // for (let i = 0; i < 10; i++) { + // let { providerData } = getProviderData(providerAddress); + + // const currentLatencyScore = calculateLatencyScore( + // providerData, + // requestCU, + // requestBlock + // ); + // providerOptimizer.appendProbeRelayData( + // providerAddress, + // TEST_BASE_WORLD_LATENCY, + // true + // ); + + // await sleep(4); + + // const data = getProviderData(providerAddress); + // providerData = data.providerData; + // expect(data.found).toBe(true); + + // const newLatencyScore = calculateLatencyScore( + // providerData, + // requestCU, + // requestBlock + // ); + // expect(currentLatencyScore).toBeGreaterThan(newLatencyScore); + // } + + // providerAddress = providers[1]; + // for (let i = 0; i < 10; i++) { + // let { providerData } = getProviderData(providerAddress); + // const currentLatencyScore = calculateLatencyScore( + // providerData, + // requestCU, + // requestBlock + // ); + // providerOptimizer.appendRelayData( + // providerAddress, + // TEST_BASE_WORLD_LATENCY, + // false, + // requestCU, + // syncBlock + // ); + + // await sleep(4); + + // const data = getProviderData(providerAddress); + // providerData = data.providerData; + // expect(data.found).toBe(true); + + // const newLatencyScore = calculateLatencyScore( + // providerData, + // requestCU, + // requestBlock + // ); + // expect(currentLatencyScore).toBeGreaterThan(newLatencyScore); + // } + // }); it("tests provider optimizer strategies provider count", async () => { const providerOptimizer = setupProviderOptimizer(); diff --git a/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_badge_query.ts b/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_badge_query.ts index dd818005fc..564150eec9 100644 --- a/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_badge_query.ts +++ b/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_badge_query.ts @@ -43,7 +43,7 @@ export class StateBadgeQuery { // fetchPairing fetches pairing for all chainIDs we support public async fetchPairing(): Promise { - Logger.debug("Fetching pairing started"); + Logger.debug("Fetching pairing from badge started"); let timeLeftToNextPairing; let virtualEpoch; @@ -110,7 +110,7 @@ export class StateBadgeQuery { this.virtualEpoch = virtualEpoch; this.currentEpoch = currentEpoch; - Logger.debug("Fetching pairing ended"); + Logger.debug("Fetching pairing from badge ended", timeLeftToNextPairing); return timeLeftToNextPairing; } diff --git a/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_chain_query.ts b/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_chain_query.ts index 5cf6247041..0b3601f12d 100644 --- a/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_chain_query.ts +++ b/ecosystem/lava-sdk/src/stateTracker/stateQuery/state_chain_query.ts @@ -81,7 +81,7 @@ export class StateChainQuery { // fetchPairing fetches pairing for all chainIDs we support public async fetchPairing(): Promise { try { - Logger.debug("Fetching pairing started"); + Logger.debug("Fetching pairing from chain started"); // Save time till next epoch let timeLeftToNextPairing; let currentEpoch; @@ -154,7 +154,7 @@ export class StateChainQuery { this.currentEpoch = currentEpoch; this.downtimeParams = downtimeParams; - Logger.debug("Fetching pairing ended"); + Logger.debug("Fetching pairing from chain ended", timeLeftToNextPairing); // Return timeLeftToNextPairing return timeLeftToNextPairing; diff --git a/ecosystem/lava-sdk/yarn.lock b/ecosystem/lava-sdk/yarn.lock index 6928c1b42e..0352043936 100644 --- a/ecosystem/lava-sdk/yarn.lock +++ b/ecosystem/lava-sdk/yarn.lock @@ -27,7 +27,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.1.tgz" integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== -"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.8.0", "@babel/core@>=7.0.0-beta.0 <8": +"@babel/core@^7.11.6", "@babel/core@^7.12.3": version "7.20.2" resolved "https://registry.npmjs.org/@babel/core/-/core-7.20.2.tgz" integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== @@ -310,16 +310,6 @@ "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" -"@cosmjs/amino@^0.29.4", "@cosmjs/amino@^0.29.5": - version "0.29.5" - resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.5.tgz" - integrity sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw== - dependencies: - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - "@cosmjs/amino@0.27.1": version "0.27.1" resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.1.tgz" @@ -340,18 +330,15 @@ "@cosmjs/math" "0.28.2" "@cosmjs/utils" "0.28.2" -"@cosmjs/crypto@^0.29.4", "@cosmjs/crypto@^0.29.5": +"@cosmjs/amino@^0.29.4", "@cosmjs/amino@^0.29.5": version "0.29.5" - resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.5.tgz" - integrity sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ== + resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.5.tgz" + integrity sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw== dependencies: + "@cosmjs/crypto" "^0.29.5" "@cosmjs/encoding" "^0.29.5" "@cosmjs/math" "^0.29.5" "@cosmjs/utils" "^0.29.5" - "@noble/hashes" "^1" - bn.js "^5.2.0" - elliptic "^6.5.4" - libsodium-wrappers "^0.7.6" "@cosmjs/crypto@0.27.1": version "0.27.1" @@ -382,14 +369,18 @@ elliptic "^6.5.3" libsodium-wrappers "^0.7.6" -"@cosmjs/encoding@^0.29.4", "@cosmjs/encoding@^0.29.5": +"@cosmjs/crypto@^0.29.4", "@cosmjs/crypto@^0.29.5": version "0.29.5" - resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.5.tgz" - integrity sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ== + resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.5.tgz" + integrity sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ== dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers "^0.7.6" "@cosmjs/encoding@0.27.1": version "0.27.1" @@ -409,6 +400,15 @@ bech32 "^1.1.4" readonly-date "^1.0.0" +"@cosmjs/encoding@^0.29.4", "@cosmjs/encoding@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.5.tgz" + integrity sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/json-rpc@0.28.2": version "0.28.2" resolved "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.28.2.tgz" @@ -430,13 +430,6 @@ axios "^0.21.2" fast-deep-equal "^3.1.3" -"@cosmjs/math@^0.29.5": - version "0.29.5" - resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.5.tgz" - integrity sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q== - dependencies: - bn.js "^5.2.0" - "@cosmjs/math@0.27.1": version "0.27.1" resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.1.tgz" @@ -451,18 +444,12 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@^0.29.4": +"@cosmjs/math@^0.29.5": version "0.29.5" - resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz" - integrity sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA== + resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.5.tgz" + integrity sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q== dependencies: - "@cosmjs/amino" "^0.29.5" - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - cosmjs-types "^0.5.2" - long "^4.0.0" + bn.js "^5.2.0" "@cosmjs/proto-signing@0.28.2": version "0.28.2" @@ -478,6 +465,19 @@ long "^4.0.0" protobufjs "~6.10.2" +"@cosmjs/proto-signing@^0.29.4": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz" + integrity sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA== + dependencies: + "@cosmjs/amino" "^0.29.5" + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + cosmjs-types "^0.5.2" + long "^4.0.0" + "@cosmjs/socket@0.28.2": version "0.28.2" resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.28.2.tgz" @@ -529,11 +529,6 @@ readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/utils@^0.29.5": - version "0.29.5" - resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz" - integrity sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ== - "@cosmjs/utils@0.27.1": version "0.27.1" resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz" @@ -544,6 +539,11 @@ resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.2.tgz" integrity sha512-2/1UeE4djz6tt4B0j3YQS+k7BYoMkblfRa3+t3lht9N5/yj05ZxVUiP7hD0lQtNmeCSQgFFmtX6zXWPes+aKQg== +"@cosmjs/utils@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz" + integrity sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ== + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" @@ -631,7 +631,7 @@ resolved "https://registry.npmjs.org/@improbable-eng/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.15.0.tgz" integrity sha512-HLgJfVolGGpjc9DWPhmMmXJx8YGzkek7jcCFO1YYkSOoO81MWRZentPOd/JiKiZuU08wtc4BG+WNuGzsQB5jZA== -"@improbable-eng/grpc-web@^0.15.0", "@improbable-eng/grpc-web@>=0.13.0": +"@improbable-eng/grpc-web@^0.15.0": version "0.15.0" resolved "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.15.0.tgz" integrity sha512-ERft9/0/8CmYalqOVnJnpdDry28q+j+nAlFFARdjyxXDJ+Mhgv9+F600QC8BR9ygOfrXRlAk6CvST2j+JCpQPg== @@ -834,7 +834,7 @@ slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.0.0", "@jest/types@^29.6.3": +"@jest/types@^29.6.3": version "29.6.3" resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz" integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== @@ -854,46 +854,38 @@ "@jridgewell/set-array" "^1.0.0" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": - version "0.3.2" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== +"@jridgewell/gen-mapping@^0.3.2", "@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== dependencies: - "@jridgewell/set-array" "^1.0.1" + "@jridgewell/set-array" "^1.2.1" "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/trace-mapping" "^0.3.24" "@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.0" resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.14" resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.19" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz" - integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" @@ -902,6 +894,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.25" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0": version "1.3.0" resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz" @@ -915,7 +915,7 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== @@ -1754,6 +1754,18 @@ resolved "https://registry.npmjs.org/@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled/-/math-base-special-gamma-lanczos-sum-expg-scaled-0.0.7.tgz" integrity sha512-zjdpS8owElpxosiEs78XawbJ/+pvMsUdEN7ThLiGpTToSqffb/L9FGlD3uD/LiXHgiqs4CwsU1xBaX8cI6tn2A== +"@stdlib/math-base-special-gamma1pm1@^0.0.x": + version "0.0.6" + resolved "https://registry.npmjs.org/@stdlib/math-base-special-gamma1pm1/-/math-base-special-gamma1pm1-0.0.6.tgz" + integrity sha512-MAyGncYTJjdSAUCjezMq9ah+hEc4A3yiyTmBMtJ60xkFzRiMOgI+KZV8Yb3brtRWtMayGmRsarqbroXeAnzJKQ== + dependencies: + "@stdlib/constants-float64-eps" "^0.0.x" + "@stdlib/math-base-assert-is-nan" "^0.0.x" + "@stdlib/math-base-special-expm1" "^0.0.x" + "@stdlib/math-base-special-gamma" "^0.0.x" + "@stdlib/math-base-special-ln" "^0.0.x" + "@stdlib/math-base-special-log1p" "^0.0.x" + "@stdlib/math-base-special-gamma@^0.0.x": version "0.0.6" resolved "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.0.6.tgz" @@ -1773,18 +1785,6 @@ "@stdlib/math-base-special-pow" "^0.0.x" "@stdlib/math-base-special-sin" "^0.0.x" -"@stdlib/math-base-special-gamma1pm1@^0.0.x": - version "0.0.6" - resolved "https://registry.npmjs.org/@stdlib/math-base-special-gamma1pm1/-/math-base-special-gamma1pm1-0.0.6.tgz" - integrity sha512-MAyGncYTJjdSAUCjezMq9ah+hEc4A3yiyTmBMtJ60xkFzRiMOgI+KZV8Yb3brtRWtMayGmRsarqbroXeAnzJKQ== - dependencies: - "@stdlib/constants-float64-eps" "^0.0.x" - "@stdlib/math-base-assert-is-nan" "^0.0.x" - "@stdlib/math-base-special-expm1" "^0.0.x" - "@stdlib/math-base-special-gamma" "^0.0.x" - "@stdlib/math-base-special-ln" "^0.0.x" - "@stdlib/math-base-special-log1p" "^0.0.x" - "@stdlib/math-base-special-gammainc@^0.0.6": version "0.0.6" resolved "https://registry.npmjs.org/@stdlib/math-base-special-gammainc/-/math-base-special-gammainc-0.0.6.tgz" @@ -2454,10 +2454,10 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^0.0.51": - version "0.0.51" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz" - integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/estree@*", "@types/estree@^1.0.5": + version "1.0.5" + resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== "@types/google-protobuf@^3.15.6": version "3.15.6" @@ -2508,7 +2508,7 @@ resolved "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== -"@types/node@*", "@types/node@^20.10.1", "@types/node@>=12.12.47", "@types/node@>=13.7.0": +"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^20.10.1": version "20.10.3" resolved "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz" integrity sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg== @@ -2567,7 +2567,7 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.0.0", "@typescript-eslint/parser@^5.45.0": +"@typescript-eslint/parser@^5.45.0": version "5.46.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.46.0.tgz" integrity sha512-joNO6zMGUZg+C73vwrKXCd8usnsmOYmgW/w5ZW0pG0RGvqeznjtGDk61EqqTpNrFLUYBW2RSBFrxdAZMqA4OZA== @@ -2640,143 +2640,141 @@ resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== +"@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz" + integrity sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg== dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-numbers" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== +"@webassemblyjs/floating-point-hex-parser@1.11.6": + version "1.11.6" + resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz" + integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== +"@webassemblyjs/helper-api-error@1.11.6": + version "1.11.6" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz" + integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== +"@webassemblyjs/helper-buffer@1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz" + integrity sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw== -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== +"@webassemblyjs/helper-numbers@1.11.6": + version "1.11.6" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz" + integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/floating-point-hex-parser" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.11.6": + version "1.11.6" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz" + integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== +"@webassemblyjs/helper-wasm-section@1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz" + integrity sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g== dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/wasm-gen" "1.12.1" -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== +"@webassemblyjs/ieee754@1.11.6": + version "1.11.6" + resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz" + integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== +"@webassemblyjs/leb128@1.11.6": + version "1.11.6" + resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz" + integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" +"@webassemblyjs/utf8@1.11.6": + version "1.11.6" + resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz" + integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== + +"@webassemblyjs/wasm-edit@^1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz" + integrity sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-wasm-section" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-opt" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + "@webassemblyjs/wast-printer" "1.12.1" + +"@webassemblyjs/wasm-gen@1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz" + integrity sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wasm-opt@1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz" + integrity sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + +"@webassemblyjs/wasm-parser@1.12.1", "@webassemblyjs/wasm-parser@^1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz" + integrity sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wast-printer@1.12.1": + version "1.12.1" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz" + integrity sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA== + dependencies: + "@webassemblyjs/ast" "1.12.1" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.2.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz" - integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== +"@webpack-cli/configtest@^2.1.1": + version "2.1.1" + resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz" + integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== -"@webpack-cli/info@^1.5.0": - version "1.5.0" - resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz" - integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== - dependencies: - envinfo "^7.7.3" +"@webpack-cli/info@^2.0.2": + version "2.0.2" + resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz" + integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== -"@webpack-cli/serve@^1.7.0": - version "1.7.0" - resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz" - integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== +"@webpack-cli/serve@^2.0.5": + version "2.0.5" + resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz" + integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -2788,10 +2786,10 @@ resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -acorn-import-assertions@^1.7.6: - version "1.8.0" - resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz" - integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== +acorn-import-attributes@^1.9.5: + version "1.9.5" + resolved "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz" + integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== acorn-jsx@^5.3.2: version "5.3.2" @@ -2803,16 +2801,11 @@ acorn-walk@^8.1.1: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.9.0: +acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: version "8.11.3" resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== -acorn@^8, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: - version "8.8.1" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz" - integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== - adm-zip@^0.5.10: version "0.5.10" resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz" @@ -2823,7 +2816,7 @@ ajv-keywords@^3.5.2: resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.12.4, ajv@^6.12.5, ajv@^6.9.1: +ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -2915,7 +2908,7 @@ axios@^0.21.2: dependencies: follow-redirects "^1.14.0" -babel-jest@^29.0.0, babel-jest@^29.7.0: +babel-jest@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz" integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== @@ -3036,11 +3029,11 @@ brace-expansion@^1.1.7: concat-map "0.0.1" braces@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" brorand@^1.1.0: version "1.1.0" @@ -3052,15 +3045,15 @@ browser-headers@^0.4.1: resolved "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz" integrity sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg== -browserslist@^4.14.5, browserslist@^4.21.3, "browserslist@>= 4.21.0": - version "4.21.4" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz" - integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== +browserslist@^4.21.10, browserslist@^4.21.3: + version "4.23.1" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz" + integrity sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw== dependencies: - caniuse-lite "^1.0.30001400" - electron-to-chromium "^1.4.251" - node-releases "^2.0.6" - update-browserslist-db "^1.0.9" + caniuse-lite "^1.0.30001629" + electron-to-chromium "^1.4.796" + node-releases "^2.0.14" + update-browserslist-db "^1.0.16" bs-logger@0.x: version "0.2.6" @@ -3140,16 +3133,24 @@ camelcase@^6.2.0: resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001400: - version "1.0.30001418" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001418.tgz" - integrity sha512-oIs7+JL3K9JRQ3jPZjlH6qyYDp+nBTCais7hjh0s+fuBwufc7uZ7hPYMXrDOJhV360KGMTcczMRObk0/iMqZRg== +caniuse-lite@^1.0.30001629: + version "1.0.30001640" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz" + integrity sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA== case-anything@^2.1.10: version "2.1.10" resolved "https://registry.npmjs.org/case-anything/-/case-anything-2.1.10.tgz" integrity sha512-JczJwVrCP0jPKh05McyVsuOg6AYosrB9XWZKbQzXeDAm2ClE/PJE/BcrrQrVyGYH7Jg8V/LDupmyL4kFlVsVFQ== +chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chalk@^2.0.0: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" @@ -3159,14 +3160,6 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.2, chalk@4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - char-regex@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" @@ -3245,36 +3238,31 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - color-name@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + colorette@^2.0.14: version "2.0.19" resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^10.0.1: + version "10.0.1" + resolved "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== -commander@^2.8.1: +commander@^2.20.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^7.0.0: - version "7.2.0" - resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - commander@^9.4.1: version "9.4.1" resolved "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz" @@ -3532,10 +3520,10 @@ duplexer3@^0.1.4: resolved "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz" integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== -electron-to-chromium@^1.4.251: - version "1.4.276" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.276.tgz" - integrity sha512-EpuHPqu8YhonqLBXHoU6hDJCD98FCe6KDoet3/gY1qsQ6usjJoHqBH2YIVs8FXaAtHwVL8Uqa/fsYao/vq9VWQ== +electron-to-chromium@^1.4.796: + version "1.4.818" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.818.tgz" + integrity sha512-eGvIk2V0dGImV9gWLq8fDfTTsCAeMDwZqEPMr+jMInxZdnp9Us8UpovYpRCf9NQ7VOFgrN2doNSgvISbsbNpxA== elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" @@ -3567,18 +3555,18 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.10.0: - version "5.10.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz" - integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== +enhanced-resolve@^5.17.0: + version "5.17.0" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz" + integrity sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" envinfo@^7.7.3: - version "7.8.1" - resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + version "7.13.0" + resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.13.0.tgz" + integrity sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q== error-ex@^1.3.1: version "1.3.2" @@ -3587,15 +3575,15 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.5.4" + resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz" + integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.1.1, escalade@^3.1.2: + version "3.1.2" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" @@ -3624,7 +3612,7 @@ eslint-plugin-prettier@^4.2.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@^5.1.1, eslint-scope@5.1.1: +eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -3652,22 +3640,12 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== - -eslint-visitor-keys@^3.4.1: - version "3.4.3" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@^8.57.0, eslint@>=5, eslint@>=7.0.0, eslint@>=7.28.0: +eslint@^8.57.0: version "8.57.0" resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz" integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== @@ -3831,7 +3809,7 @@ fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" -fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0, fast-json-stable-stringify@2.x: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== @@ -3913,10 +3891,10 @@ filenamify@^3.0.0: strip-outer "^1.0.0" trim-repeated "^1.0.0" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" @@ -3972,6 +3950,11 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@^2.3.2: + version "2.3.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" @@ -4001,6 +3984,11 @@ get-package-type@^0.1.0: resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-stream@3.0.0, get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz" + integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== + get-stream@^2.2.0: version "2.3.1" resolved "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz" @@ -4009,11 +3997,6 @@ get-stream@^2.2.0: object-assign "^4.0.1" pinkie-promise "^2.0.0" -get-stream@^3.0.0, get-stream@3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz" - integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== - get-stream@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz" @@ -4088,7 +4071,7 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -google-protobuf@^3.14.0, google-protobuf@^3.15.5, google-protobuf@^3.21.2: +google-protobuf@^3.15.5, google-protobuf@^3.21.2: version "3.21.2" resolved "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz" integrity sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA== @@ -4116,10 +4099,10 @@ got@^8.3.1: url-parse-lax "^3.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.9: - version "4.2.10" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: + version "4.2.11" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== graphemer@^1.4.0: version "1.4.0" @@ -4299,15 +4282,15 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@2: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== into-stream@^3.1.0: version "3.1.0" @@ -4683,7 +4666,7 @@ jest-resolve-dependencies@^29.7.0: jest-regex-util "^29.6.3" jest-snapshot "^29.7.0" -jest-resolve@*, jest-resolve@^29.7.0: +jest-resolve@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== @@ -4836,7 +4819,7 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.0.0, jest@^29.3.1: +jest@^29.3.1: version "29.7.0" resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== @@ -4997,16 +4980,16 @@ long@^5.0.0, long@^5.2.1: resolved "https://registry.npmjs.org/long/-/long-5.2.1.tgz" integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== -lowercase-keys@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - lowercase-keys@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz" integrity sha512-RPlX0+PHuvxVDZ7xX+EBVAp4RsVxP/TdDSN2mJYdiq1Lc4Hz7EUSjUI7RZrKKlmrIzVhf6Jo2stj7++gVarS0A== +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + lru-cache@^10.0.1: version "10.0.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz" @@ -5041,7 +5024,7 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@^1.1.1, make-error@1.x: +make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -5071,7 +5054,7 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" -mime-db@^1.28.0, mime-db@1.52.0: +mime-db@1.52.0, mime-db@^1.28.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== @@ -5127,11 +5110,6 @@ mkdirp@^0.5.6: dependencies: minimist "^1.2.6" -ms@^2.1.1: - version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" @@ -5142,6 +5120,11 @@ ms@2.1.2: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + natural-compare-lite@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz" @@ -5162,10 +5145,10 @@ node-int64@^0.4.0: resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== +node-releases@^2.0.14: + version "2.0.14" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz" + integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== normalize-path@^3.0.0: version "3.0.0" @@ -5343,10 +5326,10 @@ pend@~1.2.0: resolved "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz" integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz" + integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" @@ -5418,7 +5401,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.8.0, prettier@>=2.0.0: +prettier@^2.8.0: version "2.8.0" resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz" integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA== @@ -5445,10 +5428,10 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -protobufjs@^6.11.3: - version "6.11.3" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz" - integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== +protobufjs@7.2.5, protobufjs@^7.0.0: + version "7.2.5" + resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz" + integrity sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -5460,11 +5443,10 @@ protobufjs@^6.11.3: "@protobufjs/path" "^1.1.2" "@protobufjs/pool" "^1.1.0" "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" "@types/node" ">=13.7.0" - long "^4.0.0" + long "^5.0.0" -protobufjs@^6.8.8: +protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2: version "6.11.3" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz" integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== @@ -5483,24 +5465,6 @@ protobufjs@^6.8.8: "@types/node" ">=13.7.0" long "^4.0.0" -protobufjs@^7.0.0, protobufjs@^7.1.2: - version "7.1.2" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz" - integrity sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/node" ">=13.7.0" - long "^5.0.0" - protobufjs@~6.10.2: version "6.10.3" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.3.tgz" @@ -5520,25 +5484,6 @@ protobufjs@~6.10.2: "@types/node" "^13.7.0" long "^4.0.0" -protobufjs@~6.11.2: - version "6.11.3" - resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz" - integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" - "@types/node" ">=13.7.0" - long "^4.0.0" - protoc-gen-js@^3.21.2: version "3.21.2" resolved "https://registry.npmjs.org/protoc-gen-js/-/protoc-gen-js-3.21.2.tgz" @@ -5630,12 +5575,12 @@ readonly-date@^1.0.0: resolved "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz" integrity sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ== -rechoir@^0.7.0: - version "0.7.1" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz" - integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg== +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== dependencies: - resolve "^1.9.0" + resolve "^1.20.0" regexpp@^3.2.0: version "3.2.0" @@ -5674,7 +5619,7 @@ resolve.exports@^2.0.0: resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz" integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== -resolve@^1.1.7, resolve@^1.20.0, resolve@^1.9.0: +resolve@^1.1.7, resolve@^1.20.0: version "1.22.1" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -5724,35 +5669,25 @@ rxjs@^7.5.7: dependencies: tslib "^2.1.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.2.0, safe-buffer@~5.2.0, safe-buffer@5.2.1: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0: +safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -schema-utils@^3.1.0, schema-utils@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz" - integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== +schema-utils@^3.1.1, schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== dependencies: "@types/json-schema" "^7.0.8" ajv "^6.12.5" @@ -5775,6 +5710,13 @@ seek-bzip@^1.0.5: dependencies: commander "^2.8.1" +semver@7.x, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + semver@^5.6.0: version "5.7.2" resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" @@ -5785,17 +5727,10 @@ semver@^6.3.0: resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.7, semver@^7.5.3, semver@^7.5.4, semver@7.x: - version "7.5.4" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -serialize-javascript@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== +serialize-javascript@^6.0.1: + version "6.0.2" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" @@ -5862,14 +5797,6 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-map-support@~0.5.20: - version "0.5.21" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@0.5.13: version "0.5.13" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" @@ -5878,6 +5805,14 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" @@ -5900,20 +5835,6 @@ strict-uri-encode@^1.0.0: resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz" integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - string-length@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" @@ -5931,6 +5852,20 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" @@ -6016,24 +5951,24 @@ tar-stream@^1.5.2: to-buffer "^1.1.1" xtend "^4.0.0" -terser-webpack-plugin@^5.1.3: - version "5.3.6" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz" - integrity sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ== +terser-webpack-plugin@^5.3.10: + version "5.3.10" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz" + integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== dependencies: - "@jridgewell/trace-mapping" "^0.3.14" + "@jridgewell/trace-mapping" "^0.3.20" jest-worker "^27.4.5" schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - terser "^5.14.1" + serialize-javascript "^6.0.1" + terser "^5.26.0" -terser@^5.14.1: - version "5.15.1" - resolved "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz" - integrity sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw== +terser@^5.26.0: + version "5.31.1" + resolved "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz" + integrity sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg== dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20" @@ -6104,7 +6039,7 @@ ts-jest@^29.0.3: semver "7.x" yargs-parser "^21.0.1" -ts-node@^10.9.1, ts-node@>=9.0.0: +ts-node@^10.9.1: version "10.9.1" resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz" integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== @@ -6197,7 +6132,7 @@ type-fest@^0.21.3: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -typescript@^4.8.4, typescript@>=2.7, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", typescript@>=4.3: +typescript@^4.8.4: version "4.8.4" resolved "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz" integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== @@ -6222,13 +6157,13 @@ union@~0.5.0: dependencies: qs "^6.4.0" -update-browserslist-db@^1.0.9: - version "1.0.10" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz" - integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== +update-browserslist-db@^1.0.16: + version "1.1.0" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.1.2" + picocolors "^1.0.1" uri-js@^4.2.2: version "4.4.1" @@ -6280,30 +6215,31 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -watchpack@^2.4.0: - version "2.4.0" - resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz" - integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== +watchpack@^2.4.1: + version "2.4.1" + resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz" + integrity sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" -webpack-cli@^4.10.0, webpack-cli@4.x.x: - version "4.10.0" - resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz" - integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== +webpack-cli@^5.1.4: + version "5.1.4" + resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz" + integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.2.0" - "@webpack-cli/info" "^1.5.0" - "@webpack-cli/serve" "^1.7.0" + "@webpack-cli/configtest" "^2.1.1" + "@webpack-cli/info" "^2.0.2" + "@webpack-cli/serve" "^2.0.5" colorette "^2.0.14" - commander "^7.0.0" + commander "^10.0.1" cross-spawn "^7.0.3" + envinfo "^7.7.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" - interpret "^2.2.0" - rechoir "^0.7.0" + interpret "^3.1.1" + rechoir "^0.8.0" webpack-merge "^5.7.3" webpack-merge@^5.7.3: @@ -6319,34 +6255,34 @@ webpack-sources@^3.2.3: resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.1.0, webpack@^5.74.0, "webpack@4.x.x || 5.x.x": - version "5.74.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz" - integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== +webpack@^5.92.1: + version "5.92.1" + resolved "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz" + integrity sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA== dependencies: "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" + "@types/estree" "^1.0.5" + "@webassemblyjs/ast" "^1.12.1" + "@webassemblyjs/wasm-edit" "^1.12.1" + "@webassemblyjs/wasm-parser" "^1.12.1" acorn "^8.7.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" + acorn-import-attributes "^1.9.5" + browserslist "^4.21.10" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.10.0" - es-module-lexer "^0.9.0" + enhanced-resolve "^5.17.0" + es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" + graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.0" + schema-utils "^3.2.0" tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.4.0" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" webpack-sources "^3.2.3" whatwg-encoding@^2.0.0: @@ -6390,10 +6326,10 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@*, ws@^7: - version "7.5.9" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== +ws@^7: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== xstream@^11.14.0: version "11.14.0" diff --git a/ecosystem/lavajs/package.json b/ecosystem/lavajs/package.json index 6f11ca1bb6..8a78279efa 100644 --- a/ecosystem/lavajs/package.json +++ b/ecosystem/lavajs/package.json @@ -48,7 +48,7 @@ "url": "https://github.com/lavanet/lava/issues" }, "devDependencies": { - "@cosmology/telescope": "^1.5.1", + "@cosmology/telescope": "^1.8.3", "@protobufs/amino": "^0.0.11", "@protobufs/cosmos": "^0.1.0", "@protobufs/cosmos_proto": "^0.0.10", diff --git a/ecosystem/lavajs/proto/cosmos_proto/cosmos.proto b/ecosystem/lavajs/proto/cosmos_proto/cosmos.proto index 5c63b86f06..4fb58159fd 100644 --- a/ecosystem/lavajs/proto/cosmos_proto/cosmos.proto +++ b/ecosystem/lavajs/proto/cosmos_proto/cosmos.proto @@ -5,6 +5,12 @@ import "google/protobuf/descriptor.proto"; option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; +extend google.protobuf.MethodOptions { + + // method_added_in is used to indicate from which version the method was added. + string method_added_in = 93001; +} + extend google.protobuf.MessageOptions { // implements_interface is used to indicate the type name of the interface @@ -13,6 +19,9 @@ extend google.protobuf.MessageOptions { // interfaces. Interfaces should be declared using a declare_interface // file option. repeated string implements_interface = 93001; + + // message_added_in is used to indicate from which version the message was added. + string message_added_in = 93002; } extend google.protobuf.FieldOptions { @@ -27,6 +36,9 @@ extend google.protobuf.FieldOptions { // generators may choose to use this information to map this field to a // language-specific type representing the scalar. string scalar = 93002; + + // field_added_in is used to indicate from which version the field was added. + string field_added_in = 93003; } extend google.protobuf.FileOptions { @@ -46,6 +58,9 @@ extend google.protobuf.FileOptions { // expected that the declaration will be found in a protobuf file named // a/b/scalars.proto in the file descriptor set. repeated ScalarDescriptor declare_scalar = 793022; + + // file_added_in is used to indicate from which the version the file was added. + string file_added_in = 793023; } // InterfaceDescriptor describes an interface type to be used with @@ -94,4 +109,4 @@ enum ScalarType { SCALAR_TYPE_UNSPECIFIED = 0; SCALAR_TYPE_STRING = 1; SCALAR_TYPE_BYTES = 2; -} +} \ No newline at end of file diff --git a/ecosystem/lavajs/scripts/codegen.js b/ecosystem/lavajs/scripts/codegen.js index 71f140f4c6..465910f81c 100644 --- a/ecosystem/lavajs/scripts/codegen.js +++ b/ecosystem/lavajs/scripts/codegen.js @@ -12,23 +12,9 @@ telescope({ outPath, options: { tsDisable: { - files: [ - 'cosmos/authz/v1beta1/tx.amino.ts', - 'cosmos/auth/v1beta1/query.ts', - 'cosmos/authz/v1beta1/authz.ts', - 'cosmos/gov/v1beta1/tx.ts', - 'cosmos/gov/v1beta1/gov.ts', - 'cosmos/staking/v1beta1/staking.ts', - 'tendermint/types/evidence.ts', - 'cosmos/staking/v1beta1/tx.ts', - 'cosmos/orm/query/v1alpha1/query.ts', - 'tendermint/types/types.ts', - 'tendermint/abci/types.ts', - 'lavanet/lava/downtime/v1/genesis.ts', - 'cosmos/upgrade/v1beta1/upgrade.ts', - 'cosmos/staking/v1beta1/tx.amino.ts' - ], - patterns: ['**/*amino.ts', '**/*registry.ts'] + tsDisable: { + disableAll: true + } }, prototypes: { includePackageVar: false, @@ -94,7 +80,8 @@ telescope({ num64: 'bigint', customTypes: { useCosmosSDKDec: true - } + }, + autoFixUndefinedEnumDefault: true }, aminoEncoding: { enabled: true, @@ -107,6 +94,7 @@ telescope({ rpcClients: { enabled: true, camelCase: true + // useConnectComet: true } } }) diff --git a/ecosystem/lavajs/scripts/prepare_protobufs.sh b/ecosystem/lavajs/scripts/prepare_protobufs.sh index 229350e180..71d2d3e87d 100755 --- a/ecosystem/lavajs/scripts/prepare_protobufs.sh +++ b/ecosystem/lavajs/scripts/prepare_protobufs.sh @@ -14,9 +14,9 @@ function prepare() { file_path="../../go.mod" expected_lines=( "github.com/gogo/googleapis v1.4.1 // indirect" - "github.com/cosmos/cosmos-sdk v0.47.10" + "github.com/cosmos/cosmos-sdk v0.47.13" "github.com/cosmos/gogoproto v1.4.10" - "github.com/cosmos/cosmos-proto v1.0.0-beta.4" + "github.com/cosmos/cosmos-proto v1.0.0-beta.5" ) missing_lines=() @@ -54,7 +54,7 @@ function prepare() { fi echo "$(ls $gopath/pkg/mod/github.com/cosmos)" - specific_dir="$gopath/pkg/mod/github.com/lavanet/cosmos-sdk@v0.47.10-lava-cosmos" + specific_dir="$gopath/pkg/mod/github.com/lavanet/cosmos-sdk@v0.47.13-lava-cosmos" if [[ ! -d "$specific_dir" ]]; then echo "Error: The cosmos-sdk directory ('$specific_dir') does not exist under '$gopath/pkg/mod'." >&2 @@ -78,7 +78,7 @@ function prepare() { exit 1 fi - cosmosprotosdir="$gopath/pkg/mod/github.com/cosmos/cosmos-proto@v1.0.0-beta.4" + cosmosprotosdir="$gopath/pkg/mod/github.com/cosmos/cosmos-proto@v1.0.0-beta.5" if [[ ! -d "$cosmosprotosdir" ]]; then echo "Error: The cosmosprotosdir directory ('$cosmosprotosdir') does not exist under '$GOPATH/pkg/mod'." >&2 diff --git a/ecosystem/lavajs/yarn.lock b/ecosystem/lavajs/yarn.lock index a5d4d788a9..91ec935807 100644 --- a/ecosystem/lavajs/yarn.lock +++ b/ecosystem/lavajs/yarn.lock @@ -1286,15 +1286,14 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.1.tgz#e6055cd7d722fa72df9cbd0d39cd1f7a9ac80483" integrity sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA== -"@cosmology/ast@^1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.5.1.tgz#e941690fdc91daca3ddbf17c3ed8e3f4ecacbf61" - integrity sha512-+zqdY4K+zDSNz7DCA2Z+5AqtGMgVmngsOjayNu7mLi/Lfm9r+JGoITrOGQRltRjg/G9yN/UH2VAHnIr5TH94Jg== +"@cosmology/ast@^1.8.1": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.8.1.tgz#35a32fc117b007d6f7c9f5dcc82613989d206883" + integrity sha512-wjJDf3qk0SLaJsS6KJJqQpz+0iLl4V8V1cE7HwgwZT3F4nhTLfyK/13NbJcf0MhEfQ7+tNKFnVJIJJGfUxTPKQ== dependencies: - "@babel/parser" "^7.23.6" "@babel/types" "7.23.6" - "@cosmology/types" "^1.5.0" - "@cosmology/utils" "^1.5.0" + "@cosmology/types" "^1.8.1" + "@cosmology/utils" "^1.8.1" case "1.6.3" dotty "0.1.2" @@ -1306,23 +1305,24 @@ "@babel/runtime" "^7.21.0" axios "0.27.2" -"@cosmology/proto-parser@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.5.0.tgz#1a38a0e2fd8ae79fbf399a89287f1ef2450bdb11" - integrity sha512-JaT62afyETA9kugHg8B6ikISeDcgZO1Jk/QBnjI1F2zwMjTvsAiYZoID9l5dG0zLXH8S61vcx+C1b2zP4Cqcgw== +"@cosmology/proto-parser@^1.8.1": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@cosmology/proto-parser/-/proto-parser-1.8.1.tgz#2b6d8864b9593e518b20cd5dacbbcc68bd028f16" + integrity sha512-XgvhZH2af/6lJRYO19ozbdKdNziJu4p6HTv4u4CmUAgUpVG/tSA81cXTOMM+nJo1PPrhtqh9Nad9ISwLePvx2A== dependencies: - "@cosmology/protobufjs" "6.11.6" - "@cosmology/types" "^1.5.0" - "@cosmology/utils" "^1.5.0" + "@cosmology/protobufjs" "7.3.2" + "@cosmology/types" "^1.8.1" + "@cosmology/utils" "^1.8.1" dotty "0.1.2" + fast-json-patch "3.1.1" glob "8.0.3" minimatch "5.1.0" mkdirp "3.0.0" -"@cosmology/protobufjs@6.11.6": - version "6.11.6" - resolved "https://registry.yarnpkg.com/@cosmology/protobufjs/-/protobufjs-6.11.6.tgz#6f7bd340ab4a27969b1f75b4bff21a74e03b971a" - integrity sha512-k1opGC9CTX5vD2447pUqLmleVv0Kb8RasBUxkZHudVOvuXs2qAAGONmMIEGRCROKTodhTY9fdTnGU2lCZqAwNw== +"@cosmology/protobufjs@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@cosmology/protobufjs/-/protobufjs-7.3.2.tgz#6c2acdaec9e4b7aab4647bb236da1258e7526a87" + integrity sha512-zHf/yqGQ7QSjIYvv7kvGKY9yXNjqj55kWdRyntrXwnte/tY8uMTuCFD/EWC48LGhGu3P7nbzTlhyCGMc3xm9bw== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -1334,24 +1334,24 @@ "@protobufjs/path" "^1.1.2" "@protobufjs/pool" "^1.1.0" "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" + "@types/long" "^5.0.0" "@types/node" ">=13.7.0" - long "^4.0.0" + long "^5.0.0" -"@cosmology/telescope@^1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.5.1.tgz#3e395d452fd97c1eee6fabf0deb2a9ba58bcaecf" - integrity sha512-nGB7AYv5kZeQ311HlYv3znBiKfnBu5E3OHgm2pjbFbl8iDbrL18hlHg0VSr5jRjTHAGRGQ1FnjEoP0XoccPUaA== +"@cosmology/telescope@^1.8.3": + version "1.8.3" + resolved "https://registry.yarnpkg.com/@cosmology/telescope/-/telescope-1.8.3.tgz#1d8eb68ee6eb6475a1a19a6de82ddc2dddac98f2" + integrity sha512-q14TLkHxaB6CGC38bVGGMhVsnMRtyNqkH5j50GHtoP04kCEcATD/zIUPpJsld2XiJJi2YPUzbxf/oYVchpv29Q== dependencies: "@babel/generator" "^7.23.6" "@babel/parser" "^7.23.6" "@babel/traverse" "7.23.6" "@babel/types" "7.23.6" - "@cosmology/ast" "^1.5.1" - "@cosmology/proto-parser" "^1.5.0" - "@cosmology/types" "^1.5.0" - "@cosmology/utils" "^1.5.0" - "@cosmwasm/ts-codegen" "0.34.0" + "@cosmology/ast" "^1.8.1" + "@cosmology/proto-parser" "^1.8.1" + "@cosmology/types" "^1.8.1" + "@cosmology/utils" "^1.8.1" + "@cosmwasm/ts-codegen" "0.35.7" "@types/parse-package-name" "0.1.0" case "1.6.3" dargs "7.0.0" @@ -1366,26 +1366,28 @@ mkdirp "3.0.0" parse-package-name "1.0.0" rimraf "5.0.0" + yaml "^2.3.4" -"@cosmology/types@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.5.0.tgz#0279cd32899e5ec7493ed1e306d2985483a1665c" - integrity sha512-wJhCsDGpscxIhZm9IbNbRUnjtiFhSuyBf5ou0y/utLBGheReXgtbriBdXEqqhVXcRSKqImXqMUHGwKWaBDVAIQ== +"@cosmology/types@^1.8.1": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@cosmology/types/-/types-1.8.1.tgz#782868b232a214b55f41908353be87afa79c9302" + integrity sha512-M/4HZZu0mNwwzK7ITa5A4biVKGVk8EtaQJlHuuctygKvjKcvmmAglna754o9CdkfPEyUXBzYnLU6q7UIFgcO+g== dependencies: case "1.6.3" + fast-json-patch "3.1.1" -"@cosmology/utils@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.5.0.tgz#dafa16e3757b73898b5310fee41e82ae830c1d9b" - integrity sha512-Jm53GUymOuXlPUjECEC2mrTOLmD7e0VdpRSSWgvmUZsfD3HfKw690asykoKTCPXWypO5zox1cTJIcmoNKdoOVw== +"@cosmology/utils@^1.8.1": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@cosmology/utils/-/utils-1.8.1.tgz#9fd7f0815da726f7a2a11d713f7e8886f94f0a6b" + integrity sha512-PrZffk81GQ0pJHH7kRJi9PZVt4qWa/9V3mbUyc3vXIWqeAk1bQ+5O5MLKirtRj4cEM3zt5WnDUISPCrt4VIQkA== dependencies: - "@cosmology/types" "^1.5.0" + "@cosmology/types" "^1.8.1" dotty "0.1.2" -"@cosmwasm/ts-codegen@0.34.0": - version "0.34.0" - resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.34.0.tgz#659bb69fc5f74cbd623567f3090e69072f08b23c" - integrity sha512-Mt/aYj0be9GnA51Arysqr9L8KQNWUJJHoJvtru7hkHmukPSewZDilwHCOJAaehk5gjsP7LFey2o2KEdfzkANhA== +"@cosmwasm/ts-codegen@0.35.7": + version "0.35.7" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.35.7.tgz#b88c03b732824113fc765d560504516faca6f23b" + integrity sha512-qbOAYJPe5O5AjoWytZcsVvM0SBA39sMpiqnVIIgjJiqp4G4D5GjR2/UV3ePpygnIxxKZWMnOpPPUvLMjflblCw== dependencies: "@babel/core" "7.18.10" "@babel/generator" "7.18.12" @@ -1413,7 +1415,7 @@ parse-package-name "1.0.0" rimraf "3.0.2" shelljs "0.8.5" - wasm-ast-types "^0.25.0" + wasm-ast-types "^0.26.4" "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" @@ -2057,6 +2059,13 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/long@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@types/long/-/long-5.0.0.tgz#daaa7b7f74c919c946ff74889d5ca2afe363b2cd" + integrity sha512-eQs9RsucA/LNjnMoJvWG/nXa7Pot/RbBzilF/QRIU/xRl+0ApxrSUFsV5lmf01SvSlqMzJ7Zwxe440wmz2SJGA== + dependencies: + long "*" + "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -2958,6 +2967,11 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== +fast-json-patch@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947" + integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ== + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -4043,16 +4057,16 @@ lodash@^4.17.12, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +long@*, long@^5.0.0, long@^5.2.0, long@^5.2.1: + version "5.2.3" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== + long@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -long@^5.2.0, long@^5.2.1: - version "5.2.3" - resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" - integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -5046,10 +5060,10 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -wasm-ast-types@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.25.0.tgz#9f4056803c99fae6899c1f226e46cf730d9fe2db" - integrity sha512-ZTjXuBqRf3ntxXmskO1TyTTr8UbmAZGr72JGGctizzpdokMtuLsk5q8jHaFUv/qgQni1KuBxZnHIyaj1lnZegQ== +wasm-ast-types@^0.26.4: + version "0.26.4" + resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.26.4.tgz#cade0616c7158a0d05df8d6b8cac5cc098385fd1" + integrity sha512-bMxkQzc/+e7s5W+EBfurl/Y7KnTm0YPeg/cXjyio3PHULKWQULMREgyuJXJWaIa+8sKI1+OI61YeFSJBilm9YQ== dependencies: "@babel/runtime" "^7.18.9" "@babel/types" "7.18.10" @@ -5124,6 +5138,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@^2.3.4: + version "2.4.5" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.5.tgz#60630b206dd6d84df97003d33fc1ddf6296cca5e" + integrity sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg== + yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" diff --git a/ecosystem/lavavisor/cmd/create-service.go b/ecosystem/lavavisor/cmd/create-service.go index b0daccd2f1..3378208f40 100644 --- a/ecosystem/lavavisor/cmd/create-service.go +++ b/ecosystem/lavavisor/cmd/create-service.go @@ -9,12 +9,12 @@ import ( "strings" "github.com/cosmos/cosmos-sdk/client/flags" - processmanager "github.com/lavanet/lava/ecosystem/lavavisor/pkg/process" - lvutil "github.com/lavanet/lava/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" + processmanager "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/process" + lvutil "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/ecosystem/lavavisor/cmd/init.go b/ecosystem/lavavisor/cmd/init.go index af401cc366..35c8fe9eb3 100644 --- a/ecosystem/lavavisor/cmd/init.go +++ b/ecosystem/lavavisor/cmd/init.go @@ -7,11 +7,11 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/app" - processmanager "github.com/lavanet/lava/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/ecosystem/lavavisor/pkg/state" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/app" + processmanager "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/state" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/utils" "github.com/spf13/cobra" ) diff --git a/ecosystem/lavavisor/cmd/pod.go b/ecosystem/lavavisor/cmd/pod.go index fd721e182c..42c4d3c16c 100644 --- a/ecosystem/lavavisor/cmd/pod.go +++ b/ecosystem/lavavisor/cmd/pod.go @@ -8,12 +8,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/app" - processmanager "github.com/lavanet/lava/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/ecosystem/lavavisor/pkg/state" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" + "github.com/lavanet/lava/v2/app" + processmanager "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/state" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" "github.com/spf13/cobra" ) diff --git a/ecosystem/lavavisor/cmd/start.go b/ecosystem/lavavisor/cmd/start.go index 59c40a182c..adc2cc6e76 100644 --- a/ecosystem/lavavisor/cmd/start.go +++ b/ecosystem/lavavisor/cmd/start.go @@ -14,16 +14,16 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/app" - processmanager "github.com/lavanet/lava/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/ecosystem/lavavisor/pkg/state" - lvutil "github.com/lavanet/lava/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/utils/rand" - - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/app" + processmanager "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/state" + lvutil "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v2/utils/rand" + + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) diff --git a/ecosystem/lavavisor/cmd/wrap.go b/ecosystem/lavavisor/cmd/wrap.go index 516801e2e4..234827e0ff 100644 --- a/ecosystem/lavavisor/cmd/wrap.go +++ b/ecosystem/lavavisor/cmd/wrap.go @@ -8,12 +8,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/app" - processmanager "github.com/lavanet/lava/ecosystem/lavavisor/pkg/process" - lvstatetracker "github.com/lavanet/lava/ecosystem/lavavisor/pkg/state" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" + "github.com/lavanet/lava/v2/app" + processmanager "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/process" + lvstatetracker "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/state" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" "github.com/spf13/cobra" "golang.org/x/term" ) diff --git a/ecosystem/lavavisor/pkg/process/fetcher.go b/ecosystem/lavavisor/pkg/process/fetcher.go index 8f5bab0a80..5fa50cd994 100644 --- a/ecosystem/lavavisor/pkg/process/fetcher.go +++ b/ecosystem/lavavisor/pkg/process/fetcher.go @@ -10,9 +10,9 @@ import ( "runtime" "strings" - lvutil "github.com/lavanet/lava/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + lvutil "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) type ProtocolBinaryFetcher struct { diff --git a/ecosystem/lavavisor/pkg/process/fetcher_without_build.go b/ecosystem/lavavisor/pkg/process/fetcher_without_build.go index e9011e6c3f..ef46749694 100644 --- a/ecosystem/lavavisor/pkg/process/fetcher_without_build.go +++ b/ecosystem/lavavisor/pkg/process/fetcher_without_build.go @@ -7,9 +7,9 @@ import ( "os" "path/filepath" - lvutil "github.com/lavanet/lava/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + lvutil "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) type ProtocolBinaryFetcherWithoutBuild struct { @@ -168,7 +168,7 @@ func (pbf *ProtocolBinaryFetcherWithoutBuild) downloadBinaryFromGithub(version, return utils.LavaFormatError("[Lavavisor] failed to clean up binary directory", err) } // URL might need to be updated based on the actual GitHub repository - url := fmt.Sprintf("https://github.com/lavanet/lava/releases/download/v%s/lavap-v%s-linux-amd64", version, version) + url := fmt.Sprintf("https://github.com/lavanet/lava/v2/releases/download/v%s/lavap-v%s-linux-amd64", version, version) utils.LavaFormatInfo("[Lavavisor] Fetching the source from: ", utils.Attribute{Key: "URL", Value: url}) // Send the request resp, err := http.Get(url) diff --git a/ecosystem/lavavisor/pkg/process/linker.go b/ecosystem/lavavisor/pkg/process/linker.go index dbf6e2b0a5..79a6c7f790 100644 --- a/ecosystem/lavavisor/pkg/process/linker.go +++ b/ecosystem/lavavisor/pkg/process/linker.go @@ -5,7 +5,7 @@ import ( "os/exec" "strings" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) // TODOs: diff --git a/ecosystem/lavavisor/pkg/process/process_manager.go b/ecosystem/lavavisor/pkg/process/process_manager.go index 56a99a6d13..fea22ca506 100644 --- a/ecosystem/lavavisor/pkg/process/process_manager.go +++ b/ecosystem/lavavisor/pkg/process/process_manager.go @@ -7,9 +7,9 @@ import ( "os/user" "strings" - protocolVersion "github.com/lavanet/lava/protocol/upgrade" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + protocolVersion "github.com/lavanet/lava/v2/protocol/upgrade" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) func ReloadDaemon() error { diff --git a/ecosystem/lavavisor/pkg/process/version_monitor.go b/ecosystem/lavavisor/pkg/process/version_monitor.go index ce39e2bfd3..5cf2ee8633 100644 --- a/ecosystem/lavavisor/pkg/process/version_monitor.go +++ b/ecosystem/lavavisor/pkg/process/version_monitor.go @@ -12,10 +12,10 @@ import ( "syscall" "time" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) type ProtocolBinaryFetcherInf interface { diff --git a/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go b/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go index e35d35e3d9..d6689b0dd5 100644 --- a/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go +++ b/ecosystem/lavavisor/pkg/state/lavavisor_state_tracker.go @@ -6,11 +6,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/statetracker" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) // Lava visor doesn't require complicated state tracker, it just needs to periodically fetch the protocol version. @@ -31,18 +32,10 @@ func NewLavaVisorStateTracker(ctx context.Context, txFactory tx.Factory, clientC return nil, utils.LavaFormatError("[Lavavisor] Chain ID mismatch", nil, utils.Attribute{Key: "--chain-id", Value: txFactory.ChainID()}, utils.Attribute{Key: "Node chainID", Value: status.NodeInfo.Network}) } specQueryClient := spectypes.NewQueryClient(clientCtx) - specResponse, err := specQueryClient.Spec(ctx, &spectypes.QueryGetSpecRequest{ - ChainID: "LAV1", - }) + specResponse, err := statetracker.GetLavaSpecWithRetry(ctx, specQueryClient) if err != nil { - utils.LavaFormatFatal("blockchain missing LAV1 spec, cant initialize lavavisor", err) + utils.LavaFormatFatal("chain is missing Lava spec, cant initialize lavavisor", err) } - for i := 0; i < updaters.BlockResultRetry && err != nil; i++ { - specResponse, err = specQueryClient.Spec(ctx, &spectypes.QueryGetSpecRequest{ - ChainID: "LAV1", - }) - } - lst := &LavaVisorStateTracker{stateQuery: updaters.NewStateQuery(ctx, clientCtx), averageBlockTime: time.Duration(specResponse.Spec.AverageBlockTime) * time.Millisecond} return lst, nil } diff --git a/ecosystem/lavavisor/pkg/util/common.go b/ecosystem/lavavisor/pkg/util/common.go index 4dc5832fe8..da55671e8f 100644 --- a/ecosystem/lavavisor/pkg/util/common.go +++ b/ecosystem/lavavisor/pkg/util/common.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) func ExpandTilde(path string) (string, error) { diff --git a/go.mod b/go.mod index 53eb149310..786c12344e 100644 --- a/go.mod +++ b/go.mod @@ -1,40 +1,44 @@ -module github.com/lavanet/lava +module github.com/lavanet/lava/v2 go 1.20 require ( github.com/99designs/keyring v1.2.1 // indirect - github.com/btcsuite/btcd v0.22.2 - github.com/cometbft/cometbft v0.37.4 + github.com/cometbft/cometbft v0.37.5 github.com/cometbft/cometbft-db v0.8.0 github.com/confio/ics23/go v0.9.0 // indirect - github.com/cosmos/cosmos-sdk v0.47.10 - github.com/cosmos/ibc-go/v7 v7.3.1 + github.com/cosmos/cosmos-sdk v0.47.13 + github.com/cosmos/ibc-go/v7 v7.4.0 github.com/ethereum/go-ethereum v1.10.18 - github.com/gofiber/fiber/v2 v2.50.0 + github.com/gofiber/fiber/v2 v2.52.5 github.com/gofiber/websocket/v2 v2.0.22 github.com/gogo/protobuf v1.3.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.32.0 + github.com/spf13/cast v1.6.0 + github.com/spf13/cobra v1.8.0 + github.com/stretchr/testify v1.9.0 + google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v2 v2.4.0 ) require ( + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.10.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/btcsuite/btcd/btcec/v2 v2.3.2 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 github.com/dgraph-io/badger/v4 v4.1.0 github.com/fullstorydev/grpcurl v1.8.5 + github.com/goccy/go-json v0.10.2 github.com/gogo/status v1.1.0 - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 + github.com/itchyny/gojq v0.12.16 github.com/jhump/protoreflect v1.15.1 github.com/joho/godotenv v1.3.0 github.com/newrelic/go-agent/v3 v3.20.4 @@ -44,56 +48,57 @@ require ( github.com/tidwall/sjson v1.2.5 go.uber.org/mock v0.3.0 gonum.org/v1/gonum v0.13.0 - google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 + google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( - cloud.google.com/go v0.111.0 // indirect + cloud.google.com/go v0.112.0 // indirect cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.5 // indirect - cloud.google.com/go/storage v1.30.1 // indirect - cosmossdk.io/api v0.3.1 // indirect - cosmossdk.io/core v0.5.1 // indirect + cloud.google.com/go/storage v1.36.0 // indirect + cosmossdk.io/api v0.7.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/tools/rosetta v0.2.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/bufbuild/protocompile v0.4.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.10.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cosmos/cosmos-db v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.1.2 // indirect + github.com/golang/glog v1.2.0 // indirect github.com/golang/mock v1.6.0 // indirect github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/s2a-go v0.1.7 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect + github.com/itchyny/timefmt-go v0.1.6 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -102,21 +107,29 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect - golang.org/x/oauth2 v0.13.0 // indirect - google.golang.org/api v0.149.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/api v0.155.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) @@ -137,7 +150,7 @@ require ( github.com/cosmos/iavl v0.20.1 // indirect github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set v1.8.0 github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -146,8 +159,8 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/fasthttp/websocket v1.5.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect @@ -171,7 +184,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -184,10 +197,10 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.16.0 - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect @@ -196,26 +209,25 @@ require ( github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/viper v1.16.0 - github.com/subosito/gotenv v1.4.2 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/viper v1.18.2 + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.4.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.50.0 // indirect + github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/zondax/hid v0.9.2 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb - golang.org/x/net v0.19.0 - golang.org/x/sync v0.4.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/term v0.15.0 + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 + golang.org/x/net v0.23.0 + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.18.0 golang.org/x/text v0.14.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce @@ -227,4 +239,9 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 -replace github.com/cosmos/cosmos-sdk => github.com/lavanet/cosmos-sdk v0.47.10-lava-cosmos // branch: v0.47.10-lava +replace github.com/cosmos/cosmos-sdk => github.com/lavanet/cosmos-sdk v0.47.13-lava-cosmos // branch: v0.47.13-lava + +replace ( + cosmossdk.io/api => cosmossdk.io/api v0.3.1 + golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb +) diff --git a/go.sum b/go.sum index a5a18b74fb..2b7631814c 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,6 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -18,7 +17,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -34,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= -cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= +cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -173,12 +171,11 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= +cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -193,8 +190,10 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= -cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= +cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= @@ -205,7 +204,6 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -220,15 +218,15 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSu github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -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/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -296,9 +294,8 @@ github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx2 github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= +github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= @@ -360,23 +357,25 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= 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= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= +github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.4 h1:xyvvEqlyfK8MgNIIKVJaMsuIp03wxOcFmVkT26+Ikpg= -github.com/cometbft/cometbft v0.37.4/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8= +github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= +github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -394,8 +393,10 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= +github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= +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/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -408,8 +409,8 @@ github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 h1:MZGDMETv72suFpTAD6VPGqSIm1FJcChtk2HmVh9D+Bo= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= -github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= -github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= +github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M= +github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= @@ -418,7 +419,7 @@ github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzU github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -429,8 +430,9 @@ github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnG github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= @@ -479,7 +481,6 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -491,6 +492,7 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/ethereum/go-ethereum v1.10.18 h1:hLEd5M+UD0GJWPaROiYMRgZXl6bi5YwoTJSthsx5CZw= github.com/ethereum/go-ethereum v1.10.18/go.mod h1:RD3NhcSBjZpj3k+SnQq24wBrmnmie78P5R/P62iNBD8= @@ -498,10 +500,9 @@ github.com/fasthttp/websocket v1.5.0 h1:B4zbe3xXyvIdnqjOZrafVFklCUq5ZLo/TqCt5JA1 github.com/fasthttp/websocket v1.5.0/go.mod h1:n0BlOQvJdPbTuBkZT0O5+jk/sp/1/VCzquR1BehI2F4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= @@ -509,11 +510,11 @@ github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fullstorydev/grpcurl v1.8.5 h1:xYZBGwhLFuHx6VZLdANGx7Ffb/dlY8JZlJz76/TxclM= github.com/fullstorydev/grpcurl v1.8.5/go.mod h1:hmAJ/1FHD4xEdiTQS4Byb5NHVVGZr9iGy8CnX0t6ftA= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= @@ -532,9 +533,6 @@ github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -548,11 +546,10 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= @@ -577,15 +574,14 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/fiber/v2 v2.34.0/go.mod h1:ozRQfS+D7EL1+hMH+gutku0kfx1wLX4hAxDCtDzpj4U= -github.com/gofiber/fiber/v2 v2.50.0 h1:ia0JaB+uw3GpNSCR5nvC5dsaxXjRU5OEu36aytx+zGw= -github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw= +github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo= +github.com/gofiber/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gofiber/websocket/v2 v2.0.22 h1:aR2PomjLYRoQdFLFq5dH4OqJ93NiVfrfQTJqi1zxthU= github.com/gofiber/websocket/v2 v2.0.22/go.mod h1:/F8SLCxN9kEfBvwGW0FBQ4/+yF18GA3Q9ckqynuiSZk= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -601,8 +597,8 @@ github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -637,8 +633,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -689,7 +685,6 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -703,8 +698,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -722,7 +717,6 @@ github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMd github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -762,8 +756,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4= +github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -829,13 +823,15 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= +github.com/itchyny/gojq v0.12.16 h1:yLfgLxhIr/6sJNVmYfQjTIv0jGctu6/DgDoivmxTr7g= +github.com/itchyny/gojq v0.12.16/go.mod h1:6abHbdC2uB9ogMS38XsErnfqJ94UlngIJGlRAIj4jTM= +github.com/itchyny/timefmt-go v0.1.6 h1:ia3s54iciXDdzWzwaVKXZPbiXzxxnv1SPGFfM/myJ5Q= +github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJGxm9/mAERQg= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= -github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= github.com/jhump/protoreflect v1.10.1/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= @@ -857,7 +853,6 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= @@ -877,14 +872,13 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -898,8 +892,8 @@ github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LE github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/lavanet/cosmos-sdk v0.47.10-lava-cosmos h1:LyRJBcgEmYe6ACLKLrgzxJDfoME9PnwsqA0zjdYX4ag= -github.com/lavanet/cosmos-sdk v0.47.10-lava-cosmos/go.mod h1:UWpgWkhcsBIATS68uUC0del7IiBN4hPv/vqg8Zz23uw= +github.com/lavanet/cosmos-sdk v0.47.13-lava-cosmos h1:j9CPgCpsZkw4/0LJKcaQtWaBKIt6fQWKe/wZ7PuqNfI= +github.com/lavanet/cosmos-sdk v0.47.13-lava-cosmos/go.mod h1:pYMzhTfKFn9AJB5X64Epwe9NgYk0y3v7XN8Ks5xqWoo= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= @@ -979,7 +973,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -1042,8 +1035,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -1054,17 +1047,16 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/praserx/ipconv v1.2.1 h1:MWGfrF+OZ0pqIuTlNlMgvJDDbohC3h751oN1+Ov3x4k= github.com/praserx/ipconv v1.2.1/go.mod h1:DSy+AKre/e3w/npsmUDMio+OR/a2rvmMdI7rerOIgqI= @@ -1082,8 +1074,8 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1092,8 +1084,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1112,8 +1104,9 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1132,12 +1125,15 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 h1:Orn7s+r1raRTBKLSc9DmbktTT04sL+vkzsbRD2Q8rOI= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899/go.mod h1:oejLrk1Y/5zOF+c/aHtXqn3TFlzzbAgPWg8zBiAHDas= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= @@ -1155,29 +1151,29 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1186,8 +1182,8 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1198,11 +1194,11 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= @@ -1244,13 +1240,12 @@ github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= github.com/valyala/fasthttp v1.37.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= -github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= -github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= +github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= @@ -1288,21 +1283,29 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1326,34 +1329,17 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -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= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1366,21 +1352,19 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1424,7 +1408,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -1448,8 +1431,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= 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= @@ -1475,8 +1458,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= 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= @@ -1491,8 +1474,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= @@ -1518,7 +1501,6 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1555,7 +1537,6 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1564,7 +1545,6 @@ golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1598,19 +1578,18 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= 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= @@ -1630,7 +1609,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1638,7 +1618,6 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1647,9 +1626,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1666,7 +1643,6 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1689,7 +1665,6 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1698,7 +1673,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= 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= @@ -1765,8 +1741,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY= -google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= +google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= +google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1819,10 +1795,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1889,12 +1863,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= 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= @@ -1937,8 +1911,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= 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= @@ -1956,8 +1930,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/proto/lavanet/lava/conflict/conflict_data.proto b/proto/lavanet/lava/conflict/conflict_data.proto index 318364728f..71a80e4ed6 100644 --- a/proto/lavanet/lava/conflict/conflict_data.proto +++ b/proto/lavanet/lava/conflict/conflict_data.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.conflict; -option go_package = "github.com/lavanet/lava/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v2/x/conflict/types"; import "gogoproto/gogo.proto"; import "lavanet/lava/pairing/relay.proto"; @@ -26,6 +26,14 @@ message ReplyMetadata { } message FinalizationConflict { - lavanet.lava.pairing.RelayReply relayReply0 =1; - lavanet.lava.pairing.RelayReply relayReply1 =2; + RelayFinalization relay_finalization_0 = 1; + RelayFinalization relay_finalization_1 = 2; +} + +message RelayFinalization { + bytes finalized_blocks_hashes = 1; + int64 latest_block = 2; + string consumer_address = 3; + lavanet.lava.pairing.RelaySession relay_session = 4; + bytes sig_blocks = 5; } \ No newline at end of file diff --git a/proto/lavanet/lava/conflict/conflict_vote.proto b/proto/lavanet/lava/conflict/conflict_vote.proto index a0b96b2358..7b94717a40 100644 --- a/proto/lavanet/lava/conflict/conflict_vote.proto +++ b/proto/lavanet/lava/conflict/conflict_vote.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.conflict; -option go_package = "github.com/lavanet/lava/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v2/x/conflict/types"; import "gogoproto/gogo.proto"; message Provider { diff --git a/proto/lavanet/lava/conflict/genesis.proto b/proto/lavanet/lava/conflict/genesis.proto index 96a8c0d5f8..b34437ec99 100644 --- a/proto/lavanet/lava/conflict/genesis.proto +++ b/proto/lavanet/lava/conflict/genesis.proto @@ -6,7 +6,7 @@ import "lavanet/lava/conflict/params.proto"; import "lavanet/lava/conflict/conflict_vote.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v2/x/conflict/types"; // GenesisState defines the conflict module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/conflict/params.proto b/proto/lavanet/lava/conflict/params.proto index 26c5e6cf84..b291f65aa7 100644 --- a/proto/lavanet/lava/conflict/params.proto +++ b/proto/lavanet/lava/conflict/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.conflict; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v2/x/conflict/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/conflict/query.proto b/proto/lavanet/lava/conflict/query.proto index 434de01952..82bf5c279b 100644 --- a/proto/lavanet/lava/conflict/query.proto +++ b/proto/lavanet/lava/conflict/query.proto @@ -8,7 +8,7 @@ import "lavanet/lava/conflict/conflict_vote.proto"; // this line is used by starport scaffolding # 1 import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v2/x/conflict/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/conflict/tx.proto b/proto/lavanet/lava/conflict/tx.proto index cf05fc3136..2e8d73b68a 100644 --- a/proto/lavanet/lava/conflict/tx.proto +++ b/proto/lavanet/lava/conflict/tx.proto @@ -1,17 +1,17 @@ syntax = "proto3"; package lavanet.lava.conflict; - +import "amino/amino.proto"; // this line is used by starport scaffolding # proto/tx/import import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "lavanet/lava/conflict/conflict_data.proto"; -option go_package = "github.com/lavanet/lava/x/conflict/types"; +option go_package = "github.com/lavanet/lava/v2/x/conflict/types"; // Msg defines the Msg service. service Msg { - rpc Detection(MsgDetection) returns (MsgDetectionResponse); + rpc Detection(MsgDetection) returns (MsgDetectionResponse); rpc ConflictVoteCommit(MsgConflictVoteCommit) returns (MsgConflictVoteCommitResponse); rpc ConflictVoteReveal(MsgConflictVoteReveal) returns (MsgConflictVoteRevealResponse); // this line is used by starport scaffolding # proto/tx/rpc @@ -19,16 +19,22 @@ service Msg { // TODO:: change coin type to another proto (define proto in another file int this directory) message MsgDetection { + option (amino.name) = "conflict/Detection"; string creator = 1; - FinalizationConflict finalizationConflict = 2; - ResponseConflict responseConflict = 3; - FinalizationConflict sameProviderConflict = 4; + reserved 2; + reserved 3; + reserved 4; + oneof conflict { + FinalizationConflict finalization_conflict = 5; + ResponseConflict response_conflict = 6; + } } message MsgDetectionResponse { } message MsgConflictVoteCommit { + option (amino.name) = "conflict/ConflictVoteCommit"; string creator = 1; string voteID = 2; bytes hash = 3; @@ -38,6 +44,7 @@ message MsgConflictVoteCommitResponse { } message MsgConflictVoteReveal { + option (amino.name) = "conflict/ConflictVoteReveal"; string creator = 1; string voteID = 2; int64 nonce = 3; diff --git a/proto/lavanet/lava/downtime/v1/downtime.proto b/proto/lavanet/lava/downtime/v1/downtime.proto index f9f6295afa..913d1c5126 100644 --- a/proto/lavanet/lava/downtime/v1/downtime.proto +++ b/proto/lavanet/lava/downtime/v1/downtime.proto @@ -2,7 +2,7 @@ syntax="proto3"; package lavanet.lava.downtime.v1; -option go_package = "github.com/lavanet/lava/x/downtime/v1"; +option go_package = "github.com/lavanet/lava/v2/x/downtime/v1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/lavanet/lava/downtime/v1/genesis.proto b/proto/lavanet/lava/downtime/v1/genesis.proto index 0270954b44..6a80769e7e 100644 --- a/proto/lavanet/lava/downtime/v1/genesis.proto +++ b/proto/lavanet/lava/downtime/v1/genesis.proto @@ -2,7 +2,7 @@ syntax="proto3"; package lavanet.lava.downtime.v1; -option go_package = "github.com/lavanet/lava/x/downtime/v1"; +option go_package = "github.com/lavanet/lava/v2/x/downtime/v1"; import "lavanet/lava/downtime/v1/downtime.proto"; import "google/protobuf/timestamp.proto"; diff --git a/proto/lavanet/lava/downtime/v1/query.proto b/proto/lavanet/lava/downtime/v1/query.proto index a45cbce91d..fba6490f77 100644 --- a/proto/lavanet/lava/downtime/v1/query.proto +++ b/proto/lavanet/lava/downtime/v1/query.proto @@ -2,7 +2,7 @@ syntax="proto3"; package lavanet.lava.downtime.v1; -option go_package = "github.com/lavanet/lava/x/downtime/v1"; +option go_package = "github.com/lavanet/lava/v2/x/downtime/v1"; import "google/protobuf/duration.proto"; import "lavanet/lava/downtime/v1/downtime.proto"; diff --git a/proto/lavanet/lava/dualstaking/delegate.proto b/proto/lavanet/lava/dualstaking/delegate.proto index 54cc89a859..bdcd1f2b5e 100644 --- a/proto/lavanet/lava/dualstaking/delegate.proto +++ b/proto/lavanet/lava/dualstaking/delegate.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.dualstaking; -option go_package = "github.com/lavanet/lava/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v2/x/dualstaking/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/dualstaking/delegator_reward.proto b/proto/lavanet/lava/dualstaking/delegator_reward.proto index b920e30882..251ebfd996 100644 --- a/proto/lavanet/lava/dualstaking/delegator_reward.proto +++ b/proto/lavanet/lava/dualstaking/delegator_reward.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.dualstaking; -option go_package = "github.com/lavanet/lava/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v2/x/dualstaking/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/dualstaking/genesis.proto b/proto/lavanet/lava/dualstaking/genesis.proto index ded67dcce6..b14f44d59f 100644 --- a/proto/lavanet/lava/dualstaking/genesis.proto +++ b/proto/lavanet/lava/dualstaking/genesis.proto @@ -7,7 +7,7 @@ import "lavanet/lava/fixationstore/fixation.proto"; import "lavanet/lava/timerstore/timer.proto"; import "lavanet/lava/dualstaking/delegator_reward.proto"; -option go_package = "github.com/lavanet/lava/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v2/x/dualstaking/types"; // GenesisState defines the dualstaking module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/dualstaking/params.proto b/proto/lavanet/lava/dualstaking/params.proto index a442e93294..0c902b24bf 100644 --- a/proto/lavanet/lava/dualstaking/params.proto +++ b/proto/lavanet/lava/dualstaking/params.proto @@ -4,7 +4,7 @@ package lavanet.lava.dualstaking; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/lavanet/lava/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v2/x/dualstaking/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/dualstaking/query.proto b/proto/lavanet/lava/dualstaking/query.proto index dd861493b4..d8790ca16f 100644 --- a/proto/lavanet/lava/dualstaking/query.proto +++ b/proto/lavanet/lava/dualstaking/query.proto @@ -8,7 +8,7 @@ import "lavanet/lava/dualstaking/params.proto"; import "lavanet/lava/dualstaking/delegate.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/lavanet/lava/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v2/x/dualstaking/types"; // Query defines the gRPC querier service. service Query { @@ -31,6 +31,11 @@ service Query { rpc DelegatorRewards(QueryDelegatorRewardsRequest) returns (QueryDelegatorRewardsResponse) { option (google.api.http).get = "/lavanet/lava/dualstaking/delegator_rewards/{delegator}/{provider}/{chain_id}"; } + + // Queries a the unclaimed rewards of a delegator. + rpc DelegatorRewardsList(QueryDelegatorRewardsRequest) returns (QueryDelegatorRewardsResponse) { + option (google.api.http).get = "/lavanet/lava/dualstaking/delegator_rewards/{delegator}"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. diff --git a/proto/lavanet/lava/dualstaking/tx.proto b/proto/lavanet/lava/dualstaking/tx.proto index c91357be8f..a2d42beba3 100644 --- a/proto/lavanet/lava/dualstaking/tx.proto +++ b/proto/lavanet/lava/dualstaking/tx.proto @@ -1,21 +1,23 @@ syntax = "proto3"; package lavanet.lava.dualstaking; +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/dualstaking/types"; +option go_package = "github.com/lavanet/lava/v2/x/dualstaking/types"; // Msg defines the Msg service. service Msg { - rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); - rpc Redelegate(MsgRedelegate) returns (MsgRedelegateResponse); - rpc Unbond(MsgUnbond) returns (MsgUnbondResponse); - rpc ClaimRewards(MsgClaimRewards) returns (MsgClaimRewardsResponse); + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + rpc Redelegate(MsgRedelegate) returns (MsgRedelegateResponse); + rpc Unbond(MsgUnbond) returns (MsgUnbondResponse); + rpc ClaimRewards(MsgClaimRewards) returns (MsgClaimRewardsResponse); // this line is used by starport scaffolding # proto/tx/rpc } message MsgDelegate { + option (amino.name) = "dualstaking/Delegate"; string creator = 1; string validator = 5; string provider = 2; @@ -27,6 +29,7 @@ message MsgDelegateResponse { } message MsgRedelegate { + option (amino.name) = "dualstaking/Redelegate"; string creator = 1; string from_provider = 2; string to_provider = 3; @@ -39,6 +42,7 @@ message MsgRedelegateResponse { } message MsgUnbond { + option (amino.name) = "dualstaking/Unbond"; string creator = 1; string validator = 5; string provider = 2; @@ -50,6 +54,7 @@ message MsgUnbondResponse { } message MsgClaimRewards { + option (amino.name) = "dualstaking/MsgClaimRewards"; string creator = 1; // delegator string provider = 2; } diff --git a/proto/lavanet/lava/epochstorage/endpoint.proto b/proto/lavanet/lava/epochstorage/endpoint.proto index 1baf48a955..bd7b0ca433 100644 --- a/proto/lavanet/lava/epochstorage/endpoint.proto +++ b/proto/lavanet/lava/epochstorage/endpoint.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; message Endpoint { string iPPORT = 1; diff --git a/proto/lavanet/lava/epochstorage/epoch_details.proto b/proto/lavanet/lava/epochstorage/epoch_details.proto index cdddc0bc23..001a76e95e 100644 --- a/proto/lavanet/lava/epochstorage/epoch_details.proto +++ b/proto/lavanet/lava/epochstorage/epoch_details.proto @@ -1,11 +1,10 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; message EpochDetails { uint64 startBlock = 1; uint64 earliestStart = 2; - repeated uint64 deletedEpochs =3; - + repeated uint64 deletedEpochs = 3; } diff --git a/proto/lavanet/lava/epochstorage/fixated_params.proto b/proto/lavanet/lava/epochstorage/fixated_params.proto index 486ca81fd0..95272f3540 100644 --- a/proto/lavanet/lava/epochstorage/fixated_params.proto +++ b/proto/lavanet/lava/epochstorage/fixated_params.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; import "gogoproto/gogo.proto"; import "lavanet/lava/epochstorage/params.proto"; diff --git a/proto/lavanet/lava/epochstorage/genesis.proto b/proto/lavanet/lava/epochstorage/genesis.proto index f17397997e..4dd5d97170 100644 --- a/proto/lavanet/lava/epochstorage/genesis.proto +++ b/proto/lavanet/lava/epochstorage/genesis.proto @@ -8,7 +8,7 @@ import "lavanet/lava/epochstorage/epoch_details.proto"; import "lavanet/lava/epochstorage/fixated_params.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; // GenesisState defines the epochstorage module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/epochstorage/params.proto b/proto/lavanet/lava/epochstorage/params.proto index 103fe8badb..2264b24f20 100644 --- a/proto/lavanet/lava/epochstorage/params.proto +++ b/proto/lavanet/lava/epochstorage/params.proto @@ -3,15 +3,14 @@ package lavanet.lava.epochstorage; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - uint64 unstakeHoldBlocks = 1 [(gogoproto.moretags) = "yaml:\"unstake_hold_blocks\""]; + reserved 1, 5; uint64 epochBlocks = 2 [(gogoproto.moretags) = "yaml:\"epoch_blocks\""]; uint64 epochsToSave = 3 [(gogoproto.moretags) = "yaml:\"epochs_to_save\""]; uint64 latestParamChange = 4 [(gogoproto.moretags) = "yaml:\"latest_param_change\""]; - uint64 unstakeHoldBlocksStatic = 5 [(gogoproto.moretags) = "yaml:\"unstake_hold_blocks_static\""]; } \ No newline at end of file diff --git a/proto/lavanet/lava/epochstorage/query.proto b/proto/lavanet/lava/epochstorage/query.proto index 26281d924e..c04fda73fb 100644 --- a/proto/lavanet/lava/epochstorage/query.proto +++ b/proto/lavanet/lava/epochstorage/query.proto @@ -11,7 +11,7 @@ import "lavanet/lava/epochstorage/fixated_params.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/epochstorage/stake_entry.proto b/proto/lavanet/lava/epochstorage/stake_entry.proto index 5a337698ce..b197b20852 100644 --- a/proto/lavanet/lava/epochstorage/stake_entry.proto +++ b/proto/lavanet/lava/epochstorage/stake_entry.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; import "lavanet/lava/epochstorage/endpoint.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/epochstorage/stake_storage.proto b/proto/lavanet/lava/epochstorage/stake_storage.proto index 1f9499b8cf..223df362a0 100644 --- a/proto/lavanet/lava/epochstorage/stake_storage.proto +++ b/proto/lavanet/lava/epochstorage/stake_storage.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.epochstorage; -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; import "lavanet/lava/epochstorage/stake_entry.proto"; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/epochstorage/tx.proto b/proto/lavanet/lava/epochstorage/tx.proto index d57d897932..492336f1d6 100644 --- a/proto/lavanet/lava/epochstorage/tx.proto +++ b/proto/lavanet/lava/epochstorage/tx.proto @@ -3,7 +3,7 @@ package lavanet.lava.epochstorage; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/x/epochstorage/types"; +option go_package = "github.com/lavanet/lava/v2/x/epochstorage/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/fixationstore/fixation.proto b/proto/lavanet/lava/fixationstore/fixation.proto index a40982bb72..d7fdc58841 100644 --- a/proto/lavanet/lava/fixationstore/fixation.proto +++ b/proto/lavanet/lava/fixationstore/fixation.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.fixationstore; -option go_package = "github.com/lavanet/lava/x/fixationstore/types"; +option go_package = "github.com/lavanet/lava/v2/x/fixationstore/types"; import "gogoproto/gogo.proto"; import "lavanet/lava/timerstore/timer.proto"; diff --git a/proto/lavanet/lava/fixationstore/query.proto b/proto/lavanet/lava/fixationstore/query.proto index ab94daae94..3c436e8b7e 100644 --- a/proto/lavanet/lava/fixationstore/query.proto +++ b/proto/lavanet/lava/fixationstore/query.proto @@ -3,7 +3,7 @@ package lavanet.lava.fixationstore; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/lavanet/lava/x/fixationstore/types"; +option go_package = "github.com/lavanet/lava/v2/x/fixationstore/types"; import "lavanet/lava/fixationstore/fixation.proto"; diff --git a/proto/lavanet/lava/pairing/account_info.proto b/proto/lavanet/lava/pairing/account_info.proto index 141ef0bd29..900bf31103 100644 --- a/proto/lavanet/lava/pairing/account_info.proto +++ b/proto/lavanet/lava/pairing/account_info.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; diff --git a/proto/lavanet/lava/pairing/badges.proto b/proto/lavanet/lava/pairing/badges.proto index 64e2ee9422..3be7303182 100644 --- a/proto/lavanet/lava/pairing/badges.proto +++ b/proto/lavanet/lava/pairing/badges.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; import "lavanet/lava/pairing/relay.proto"; import "lavanet/lava/pairing/query.proto"; diff --git a/proto/lavanet/lava/pairing/debug_query.proto b/proto/lavanet/lava/pairing/debug_query.proto index c8acbe60cb..8d5b7f0959 100644 --- a/proto/lavanet/lava/pairing/debug_query.proto +++ b/proto/lavanet/lava/pairing/debug_query.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; diff --git a/proto/lavanet/lava/pairing/epoch_cu.proto b/proto/lavanet/lava/pairing/epoch_cu.proto index 3e981c00f0..a7213d15e8 100644 --- a/proto/lavanet/lava/pairing/epoch_cu.proto +++ b/proto/lavanet/lava/pairing/epoch_cu.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; // UniqueEpochSession is used to detect double spend attacks // It's kept in a epoch-prefixed store with a unique index: provider, project ID, chain ID and session ID diff --git a/proto/lavanet/lava/pairing/genesis.proto b/proto/lavanet/lava/pairing/genesis.proto index 51c94e8f8e..2b6844297a 100644 --- a/proto/lavanet/lava/pairing/genesis.proto +++ b/proto/lavanet/lava/pairing/genesis.proto @@ -9,7 +9,7 @@ import "lavanet/lava/timerstore/timer.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; message BadgeUsedCu { bytes badge_used_cu_key = 1; diff --git a/proto/lavanet/lava/pairing/params.proto b/proto/lavanet/lava/pairing/params.proto index 0f54059d29..248e926ea4 100644 --- a/proto/lavanet/lava/pairing/params.proto +++ b/proto/lavanet/lava/pairing/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.pairing; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/pairing/query.proto b/proto/lavanet/lava/pairing/query.proto index 0359b16328..5e74149ae5 100644 --- a/proto/lavanet/lava/pairing/query.proto +++ b/proto/lavanet/lava/pairing/query.proto @@ -15,7 +15,7 @@ import "lavanet/lava/subscription/subscription.proto"; import "lavanet/lava/projects/project.proto"; import "lavanet/lava/downtime/v1/downtime.proto"; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/pairing/relay.proto b/proto/lavanet/lava/pairing/relay.proto index 6eea45cbfc..1b10b8f5ae 100644 --- a/proto/lavanet/lava/pairing/relay.proto +++ b/proto/lavanet/lava/pairing/relay.proto @@ -1,11 +1,12 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/timestamp.proto"; +import "lavanet/lava/epochstorage/stake_entry.proto"; service Relayer { rpc Relay (RelayRequest) returns (RelayReply) {} @@ -85,12 +86,12 @@ message RelayRequest { message RelayReply { bytes data = 1; - bytes sig = 2; // sign the data hash+query hash+nonce + bytes sig = 2; reserved 3; int64 latest_block = 4; bytes finalized_blocks_hashes = 5; - bytes sig_blocks = 6; //sign latest_block+finalized_blocks_hashes+session_id+block_height+relay_num - repeated Metadata metadata = 7 [(gogoproto.nullable) = false]; + bytes sig_blocks = 6; + repeated Metadata metadata = 7 [(gogoproto.nullable) = false]; } message QualityOfServiceReport{ @@ -110,3 +111,8 @@ message QualityOfServiceReport{ (gogoproto.nullable) = false ]; } + +message PairingRelayCache { + repeated lavanet.lava.epochstorage.StakeEntry entries = 1 [(gogoproto.nullable) = false]; + uint64 allowed_cu = 2; +} \ No newline at end of file diff --git a/proto/lavanet/lava/pairing/relayCache.proto b/proto/lavanet/lava/pairing/relayCache.proto index 28ddd120ee..465f48b5b8 100644 --- a/proto/lavanet/lava/pairing/relayCache.proto +++ b/proto/lavanet/lava/pairing/relayCache.proto @@ -4,7 +4,7 @@ import "gogoproto/gogo.proto"; import "lavanet/lava/pairing/relay.proto"; import "google/protobuf/empty.proto"; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; service RelayerCache { rpc GetRelay (RelayCacheGet) returns (CacheRelayReply) {} @@ -16,6 +16,7 @@ message CacheRelayReply { RelayReply reply = 1; repeated Metadata optional_metadata = 2 [(gogoproto.nullable) = false]; int64 seen_block = 3; + repeated BlockHashToHeight blocks_hashes_to_heights = 4; } message CacheUsage { @@ -37,6 +38,7 @@ message RelayCacheGet { string shared_state_id = 5; // empty id for no shared state string chain_id = 6; // used to set latest block per chain. int64 seen_block = 7; + repeated BlockHashToHeight blocks_hashes_to_heights = 8; } message RelayCacheSet { @@ -51,4 +53,10 @@ message RelayCacheSet { int64 seen_block = 10; int64 average_block_time = 11; bool is_node_error = 12; // node errors wont be cached for long even if they are finalized in cases where it returns a valid response later on + repeated BlockHashToHeight blocks_hashes_to_heights = 13; +} + +message BlockHashToHeight { + string hash = 1; + int64 height = 2; } \ No newline at end of file diff --git a/proto/lavanet/lava/pairing/tx.proto b/proto/lavanet/lava/pairing/tx.proto index b4c92efb5e..7248403495 100644 --- a/proto/lavanet/lava/pairing/tx.proto +++ b/proto/lavanet/lava/pairing/tx.proto @@ -1,6 +1,5 @@ syntax = "proto3"; package lavanet.lava.pairing; - // this line is used by starport scaffolding # proto/tx/import import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; @@ -9,7 +8,7 @@ import "lavanet/lava/pairing/relay.proto"; import "cosmos/staking/v1beta1/staking.proto"; import "amino/amino.proto"; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; // Msg defines the Msg service. service Msg { @@ -22,6 +21,7 @@ service Msg { } message MsgStakeProvider { + option (amino.name) = "pairing/StakeProvider"; string creator = 1; string chainID = 2; cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; @@ -39,6 +39,7 @@ message MsgStakeProviderResponse { } message MsgUnstakeProvider { + option (amino.name) = "pairing/UnstakeProvider"; string creator = 1; string chainID = 2; string validator = 3; @@ -48,6 +49,7 @@ message MsgUnstakeProviderResponse { } message MsgRelayPayment { + option (amino.name) = "pairing/RelayPayment"; reserved 3; string creator = 1; repeated RelaySession relays = 2; @@ -65,6 +67,7 @@ message MsgRelayPaymentResponse { } message MsgFreezeProvider { + option (amino.name) = "pairing/Freeze"; string creator = 1; repeated string chainIds = 2; string reason = 3; @@ -74,6 +77,7 @@ message MsgFreezeProviderResponse { } message MsgUnfreezeProvider { + option (amino.name) = "pairing/Unfreeze"; string creator = 1; repeated string chainIds = 2; } diff --git a/proto/lavanet/lava/pairing/unstake_proposal.proto b/proto/lavanet/lava/pairing/unstake_proposal.proto index 54c5397d32..b16eae731b 100644 --- a/proto/lavanet/lava/pairing/unstake_proposal.proto +++ b/proto/lavanet/lava/pairing/unstake_proposal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.pairing; -option go_package = "github.com/lavanet/lava/x/pairing/types"; +option go_package = "github.com/lavanet/lava/v2/x/pairing/types"; import "gogoproto/gogo.proto"; import "google/protobuf/wrappers.proto"; diff --git a/proto/lavanet/lava/plans/genesis.proto b/proto/lavanet/lava/plans/genesis.proto index e9f2bc60d6..096fe58f7f 100644 --- a/proto/lavanet/lava/plans/genesis.proto +++ b/proto/lavanet/lava/plans/genesis.proto @@ -6,7 +6,7 @@ import "lavanet/lava/plans/params.proto"; import "lavanet/lava/fixationstore/fixation.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/plans/types"; +option go_package = "github.com/lavanet/lava/v2/x/plans/types"; // GenesisState defines the plan module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/plans/params.proto b/proto/lavanet/lava/plans/params.proto index 8697ac4f9b..da825e1236 100644 --- a/proto/lavanet/lava/plans/params.proto +++ b/proto/lavanet/lava/plans/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.plans; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/plans/types"; +option go_package = "github.com/lavanet/lava/v2/x/plans/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/plans/plan.proto b/proto/lavanet/lava/plans/plan.proto index 0d0ecd0ac9..75f89ce31d 100644 --- a/proto/lavanet/lava/plans/plan.proto +++ b/proto/lavanet/lava/plans/plan.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.plans; -option go_package = "github.com/lavanet/lava/x/plans/types"; +option go_package = "github.com/lavanet/lava/v2/x/plans/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/plans/plans_proposal.proto b/proto/lavanet/lava/plans/plans_proposal.proto index 29785d837c..a85c611057 100644 --- a/proto/lavanet/lava/plans/plans_proposal.proto +++ b/proto/lavanet/lava/plans/plans_proposal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.plans; -option go_package = "github.com/lavanet/lava/x/plans/types"; +option go_package = "github.com/lavanet/lava/v2/x/plans/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/plans/policy.proto b/proto/lavanet/lava/plans/policy.proto index c4a7867bee..ad41ba7462 100644 --- a/proto/lavanet/lava/plans/policy.proto +++ b/proto/lavanet/lava/plans/policy.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.plans; -option go_package = "github.com/lavanet/lava/x/plans/types"; +option go_package = "github.com/lavanet/lava/v2/x/plans/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/plans/query.proto b/proto/lavanet/lava/plans/query.proto index 0e4003ef73..9bd771c7cf 100644 --- a/proto/lavanet/lava/plans/query.proto +++ b/proto/lavanet/lava/plans/query.proto @@ -9,7 +9,7 @@ import "lavanet/lava/plans/params.proto"; import "cosmos/base/v1beta1/coin.proto"; import "lavanet/lava/plans/plan.proto"; -option go_package = "github.com/lavanet/lava/x/plans/types"; +option go_package = "github.com/lavanet/lava/v2/x/plans/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/plans/tx.proto b/proto/lavanet/lava/plans/tx.proto index 128ca2d838..be3eac0a8c 100644 --- a/proto/lavanet/lava/plans/tx.proto +++ b/proto/lavanet/lava/plans/tx.proto @@ -3,7 +3,7 @@ package lavanet.lava.plans; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/x/plans/types"; +option go_package = "github.com/lavanet/lava/v2/x/plans/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/projects/genesis.proto b/proto/lavanet/lava/projects/genesis.proto index 2fa879312f..fc4bd42cf7 100644 --- a/proto/lavanet/lava/projects/genesis.proto +++ b/proto/lavanet/lava/projects/genesis.proto @@ -6,7 +6,7 @@ import "lavanet/lava/projects/params.proto"; import "lavanet/lava/fixationstore/fixation.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/projects/types"; +option go_package = "github.com/lavanet/lava/v2/x/projects/types"; // GenesisState defines the projects module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/projects/params.proto b/proto/lavanet/lava/projects/params.proto index 71d479ef14..ebb3062157 100644 --- a/proto/lavanet/lava/projects/params.proto +++ b/proto/lavanet/lava/projects/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.projects; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/projects/types"; +option go_package = "github.com/lavanet/lava/v2/x/projects/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/projects/project.proto b/proto/lavanet/lava/projects/project.proto index 84f61f43b9..f2ee1cba5d 100644 --- a/proto/lavanet/lava/projects/project.proto +++ b/proto/lavanet/lava/projects/project.proto @@ -4,7 +4,7 @@ package lavanet.lava.projects; import "gogoproto/gogo.proto"; import "lavanet/lava/plans/policy.proto"; option (gogoproto.equal_all) = true; -option go_package = "github.com/lavanet/lava/x/projects/types"; +option go_package = "github.com/lavanet/lava/v2/x/projects/types"; message Project { string index = 1; // unique id that will be the combination of subscription address and project name, cannot be changed once created diff --git a/proto/lavanet/lava/projects/query.proto b/proto/lavanet/lava/projects/query.proto index 7c39de9fbf..96187f0383 100644 --- a/proto/lavanet/lava/projects/query.proto +++ b/proto/lavanet/lava/projects/query.proto @@ -7,7 +7,7 @@ import "lavanet/lava/projects/params.proto"; import "lavanet/lava/projects/project.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/x/projects/types"; +option go_package = "github.com/lavanet/lava/v2/x/projects/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/projects/tx.proto b/proto/lavanet/lava/projects/tx.proto index 0807c10289..feef726d1a 100644 --- a/proto/lavanet/lava/projects/tx.proto +++ b/proto/lavanet/lava/projects/tx.proto @@ -1,5 +1,6 @@ syntax = "proto3"; package lavanet.lava.projects; +import "amino/amino.proto"; import "lavanet/lava/projects/project.proto"; import "lavanet/lava/plans/policy.proto"; @@ -7,7 +8,7 @@ import "gogoproto/gogo.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/x/projects/types"; +option go_package = "github.com/lavanet/lava/v2/x/projects/types"; // Msg defines the Msg service. service Msg { @@ -19,6 +20,7 @@ service Msg { } message MsgAddKeys { + option (amino.name) = "projects/AddKeys"; string creator = 1; string project = 2; repeated ProjectKey project_keys = 3 [(gogoproto.nullable) = false]; @@ -28,6 +30,7 @@ message MsgAddKeysResponse { } message MsgDelKeys { + option (amino.name) = "projects/DelKeys"; string creator = 1; string project = 2; repeated ProjectKey project_keys = 3 [(gogoproto.nullable) = false]; @@ -37,6 +40,7 @@ message MsgDelKeysResponse { } message MsgSetPolicy { + option (amino.name) = "projects/SetPolicy"; string creator = 1; string project = 2; lavanet.lava.plans.Policy policy = 3; @@ -46,6 +50,7 @@ message MsgSetPolicyResponse { } message MsgSetSubscriptionPolicy { + option (amino.name) = "projects/SetSubscriptionPolicy"; string creator = 1; repeated string projects = 2; lavanet.lava.plans.Policy policy = 3; diff --git a/proto/lavanet/lava/protocol/genesis.proto b/proto/lavanet/lava/protocol/genesis.proto index 589d0c625d..4fef95193f 100644 --- a/proto/lavanet/lava/protocol/genesis.proto +++ b/proto/lavanet/lava/protocol/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "lavanet/lava/protocol/params.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v2/x/protocol/types"; // GenesisState defines the protocol module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/protocol/params.proto b/proto/lavanet/lava/protocol/params.proto index d6a37aba80..8dd32a0576 100644 --- a/proto/lavanet/lava/protocol/params.proto +++ b/proto/lavanet/lava/protocol/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.protocol; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v2/x/protocol/types"; // Params defines the parameters for the module. message Version { diff --git a/proto/lavanet/lava/protocol/query.proto b/proto/lavanet/lava/protocol/query.proto index 5423633aff..9184a99211 100644 --- a/proto/lavanet/lava/protocol/query.proto +++ b/proto/lavanet/lava/protocol/query.proto @@ -7,7 +7,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "lavanet/lava/protocol/params.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v2/x/protocol/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/protocol/tx.proto b/proto/lavanet/lava/protocol/tx.proto index 08b0625f8b..70db7d8696 100644 --- a/proto/lavanet/lava/protocol/tx.proto +++ b/proto/lavanet/lava/protocol/tx.proto @@ -1,9 +1,10 @@ syntax = "proto3"; package lavanet.lava.protocol; +import "amino/amino.proto"; // this line is used by starport scaffolding # proto/tx/import import "lavanet/lava/protocol/params.proto"; -option go_package = "github.com/lavanet/lava/x/protocol/types"; +option go_package = "github.com/lavanet/lava/v2/x/protocol/types"; // Msg defines the Msg service. service Msg { @@ -13,6 +14,7 @@ service Msg { // this line is used by starport scaffolding # proto/tx/message message MsgSetVersion { + option (amino.name) = "protocol/MsgSetVersion"; string authority = 1; Version version = 2; } diff --git a/proto/lavanet/lava/rewards/base_pay.proto b/proto/lavanet/lava/rewards/base_pay.proto index cff62cd438..fa90e16d46 100644 --- a/proto/lavanet/lava/rewards/base_pay.proto +++ b/proto/lavanet/lava/rewards/base_pay.proto @@ -1,31 +1,32 @@ syntax = "proto3"; package lavanet.lava.rewards; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/rewards/types"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; +option go_package = "github.com/lavanet/lava/v2/x/rewards/types"; // aggregated rewards for the provider through out the month message BasePay { string total = 1 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false ]; string totalAdjusted = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + (gogoproto.nullable) = false + ]; - uint64 iprpc_cu = 3; + uint64 iprpc_cu = 3; } // aggregated rewards for the provider through out the month -message BasePayGenesis { - string index = 1; - BasePay base_pay = 2 [(gogoproto.nullable) = false ]; -} \ No newline at end of file +message BasePayWithIndex { + string provider = 1; + string chain_id = 2; + BasePay base_pay = 3 [(gogoproto.nullable) = false]; +} diff --git a/proto/lavanet/lava/rewards/genesis.proto b/proto/lavanet/lava/rewards/genesis.proto index 90d8e9f533..9b25dd244a 100644 --- a/proto/lavanet/lava/rewards/genesis.proto +++ b/proto/lavanet/lava/rewards/genesis.proto @@ -1,24 +1,24 @@ syntax = "proto3"; package lavanet.lava.rewards; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -import "lavanet/lava/rewards/params.proto"; import "lavanet/lava/rewards/base_pay.proto"; import "lavanet/lava/rewards/iprpc.proto"; +import "lavanet/lava/rewards/params.proto"; import "lavanet/lava/timerstore/timer.proto"; -import "cosmos/base/v1beta1/coin.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v2/x/rewards/types"; // GenesisState defines the rewards module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; lavanet.lava.timerstore.GenesisState refillRewardsTS = 2 [(gogoproto.nullable) = false]; - repeated BasePayGenesis base_pays = 3 [(gogoproto.nullable) = false]; + repeated BasePayWithIndex base_pays = 3 [(gogoproto.nullable) = false]; repeated string iprpc_subscriptions = 4; cosmos.base.v1beta1.Coin min_iprpc_cost = 5 [(gogoproto.nullable) = false]; repeated IprpcReward iprpc_rewards = 6 [(gogoproto.nullable) = false]; uint64 iprpc_rewards_current = 7; // this line is used by starport scaffolding # genesis/proto/state -} \ No newline at end of file +} diff --git a/proto/lavanet/lava/rewards/iprpc.proto b/proto/lavanet/lava/rewards/iprpc.proto index 151ba86bb4..1cd6b4f92d 100644 --- a/proto/lavanet/lava/rewards/iprpc.proto +++ b/proto/lavanet/lava/rewards/iprpc.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.rewards; -option go_package = "github.com/lavanet/lava/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v2/x/rewards/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/lavanet/lava/rewards/params.proto b/proto/lavanet/lava/rewards/params.proto index f2107fc39a..bca431172b 100644 --- a/proto/lavanet/lava/rewards/params.proto +++ b/proto/lavanet/lava/rewards/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.rewards; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v2/x/rewards/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/rewards/query.proto b/proto/lavanet/lava/rewards/query.proto index d8ba5a3c33..681f96e07d 100644 --- a/proto/lavanet/lava/rewards/query.proto +++ b/proto/lavanet/lava/rewards/query.proto @@ -1,15 +1,16 @@ syntax = "proto3"; package lavanet.lava.rewards; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "lavanet/lava/rewards/params.proto"; +import "lavanet/lava/rewards/base_pay.proto"; import "lavanet/lava/rewards/iprpc.proto"; -import "cosmos/base/v1beta1/coin.proto"; +import "lavanet/lava/rewards/params.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v2/x/rewards/types"; // Query defines the gRPC querier service. service Query { @@ -34,8 +35,8 @@ service Query { } // ProviderReward queries for the providers reward for their services - rpc ProviderReward(QueryProviderRewardRequest) returns (QueryProviderRewardResponse) { - option (google.api.http).get = "/lavanet/lava/rewards/provider_reward"; + rpc SpecTrackedInfo(QuerySpecTrackedInfoRequest) returns (QuerySpecTrackedInfoResponse) { + option (google.api.http).get = "/lavanet/lava/rewards/SpecTrackedInfo/{chain_id}/{provider}"; } // IprpcProviderRewardEstimation queries for a provider's current IPRPC reward (relative to its serviced CU) @@ -66,7 +67,7 @@ message PoolInfo { string name = 1; // pool name repeated cosmos.base.v1beta1.Coin balance = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false + (gogoproto.nullable) = false ]; // pool balance (all types of tokens) } @@ -97,20 +98,14 @@ message QueryShowIprpcDataResponse { } // QueryProviderRewardRequest is request type for the Query/ProviderReward RPC method. -message QueryProviderRewardRequest { - string chain_id = 1; - string provider = 2; -} - -message RewardInfo { +message QuerySpecTrackedInfoRequest { string chain_id = 1; string provider = 2; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; } // QueryProviderRewardResponse is response type for the Query/ProviderReward RPC method. -message QueryProviderRewardResponse { - repeated RewardInfo rewards = 1 [(gogoproto.nullable) = false]; +message QuerySpecTrackedInfoResponse { + repeated BasePayWithIndex info = 1 [(gogoproto.nullable) = false]; } // QueryIprpcProviderRewardEstimationRequest is request type for the Query/IprpcProviderRewardEstimation RPC method. @@ -120,7 +115,7 @@ message QueryIprpcProviderRewardEstimationRequest { // QueryIprpcProviderRewardEstimationResponse is response type for the Query/IprpcProviderRewardEstimation RPC method. message QueryIprpcProviderRewardEstimationResponse { - repeated Specfund spec_funds = 1 [(gogoproto.nullable) = false]; + repeated Specfund spec_funds = 1 [(gogoproto.nullable) = false]; } // QueryIprpcSpecRewardRequest is request type for the Query/IprpcSpecReward RPC method. @@ -134,4 +129,4 @@ message QueryIprpcSpecRewardResponse { uint64 current_month_id = 2; } -// this line is used by starport scaffolding # 3 \ No newline at end of file +// this line is used by starport scaffolding # 3 diff --git a/proto/lavanet/lava/rewards/tx.proto b/proto/lavanet/lava/rewards/tx.proto index 1e4c23daee..c8d42a4976 100644 --- a/proto/lavanet/lava/rewards/tx.proto +++ b/proto/lavanet/lava/rewards/tx.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package lavanet.lava.rewards; - +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/x/rewards/types"; +option go_package = "github.com/lavanet/lava/v2/x/rewards/types"; // Msg defines the Msg service. service Msg { @@ -16,6 +16,7 @@ service Msg { } message MsgSetIprpcData { + option (amino.name) = "rewards/MsgSetIprpcData"; string authority = 1; cosmos.base.v1beta1.Coin min_iprpc_cost = 2 [(gogoproto.nullable) = false]; repeated string iprpc_subscriptions = 3; @@ -25,6 +26,7 @@ message MsgSetIprpcDataResponse { } message MsgFundIprpc { + option (amino.name) = "rewards/MsgFundIprpc"; string creator = 1; uint64 duration = 2; // vesting duration in months repeated cosmos.base.v1beta1.Coin amounts = 3 [ diff --git a/proto/lavanet/lava/spec/api_collection.proto b/proto/lavanet/lava/spec/api_collection.proto index f4de8869ba..be7cbbb2fc 100644 --- a/proto/lavanet/lava/spec/api_collection.proto +++ b/proto/lavanet/lava/spec/api_collection.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.spec; -option go_package = "github.com/lavanet/lava/x/spec/types"; +option go_package = "github.com/lavanet/lava/v2/x/spec/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; @@ -96,6 +96,7 @@ message GenericParser { string parse_path = 1; string value = 2; PARSER_TYPE parse_type = 3; + string rule = 4; } enum EXTENSION { @@ -111,6 +112,9 @@ enum FUNCTION_TAG { SET_LATEST_IN_BODY = 4; VERIFICATION = 5; GET_EARLIEST_BLOCK = 6; + SUBSCRIBE = 7; + UNSUBSCRIBE = 8; + UNSUBSCRIBE_ALL = 9; } enum PARSER_TYPE { @@ -121,6 +125,7 @@ enum PARSER_TYPE { EXTENSION_ARG = 4; IDENTIFIER = 5; DEFAULT_VALUE = 6; + BLOCK_HASH = 7; } enum PARSER_FUNC{ diff --git a/proto/lavanet/lava/spec/genesis.proto b/proto/lavanet/lava/spec/genesis.proto index 8d55c792c5..d0dc122572 100644 --- a/proto/lavanet/lava/spec/genesis.proto +++ b/proto/lavanet/lava/spec/genesis.proto @@ -7,7 +7,7 @@ import "lavanet/lava/spec/spec.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/spec/types"; +option go_package = "github.com/lavanet/lava/v2/x/spec/types"; // GenesisState defines the spec module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/spec/params.proto b/proto/lavanet/lava/spec/params.proto index 9950c0d125..05139c4b38 100644 --- a/proto/lavanet/lava/spec/params.proto +++ b/proto/lavanet/lava/spec/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.spec; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/spec/types"; +option go_package = "github.com/lavanet/lava/v2/x/spec/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/spec/query.proto b/proto/lavanet/lava/spec/query.proto index f06668a719..a56d108b51 100644 --- a/proto/lavanet/lava/spec/query.proto +++ b/proto/lavanet/lava/spec/query.proto @@ -8,7 +8,7 @@ import "lavanet/lava/spec/params.proto"; import "lavanet/lava/spec/spec.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/lavanet/lava/x/spec/types"; +option go_package = "github.com/lavanet/lava/v2/x/spec/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/lavanet/lava/spec/spec.proto b/proto/lavanet/lava/spec/spec.proto index 5607691dd0..bed3abdaf6 100644 --- a/proto/lavanet/lava/spec/spec.proto +++ b/proto/lavanet/lava/spec/spec.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.spec; -option go_package = "github.com/lavanet/lava/x/spec/types"; +option go_package = "github.com/lavanet/lava/v2/x/spec/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/spec/spec_add_proposal.proto b/proto/lavanet/lava/spec/spec_add_proposal.proto index 85fe3fb770..628084f32b 100644 --- a/proto/lavanet/lava/spec/spec_add_proposal.proto +++ b/proto/lavanet/lava/spec/spec_add_proposal.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.spec; -option go_package = "github.com/lavanet/lava/x/spec/types"; +option go_package = "github.com/lavanet/lava/v2/x/spec/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; diff --git a/proto/lavanet/lava/spec/tx.proto b/proto/lavanet/lava/spec/tx.proto index 9bc577b5f3..c9d490f4c4 100644 --- a/proto/lavanet/lava/spec/tx.proto +++ b/proto/lavanet/lava/spec/tx.proto @@ -3,7 +3,7 @@ package lavanet.lava.spec; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/lavanet/lava/x/spec/types"; +option go_package = "github.com/lavanet/lava/v2/x/spec/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/lavanet/lava/subscription/adjustment.proto b/proto/lavanet/lava/subscription/adjustment.proto index d3645220b8..9e06f32505 100644 --- a/proto/lavanet/lava/subscription/adjustment.proto +++ b/proto/lavanet/lava/subscription/adjustment.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.subscription; -option go_package = "github.com/lavanet/lava/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v2/x/subscription/types"; message Adjustment { string index = 1; diff --git a/proto/lavanet/lava/subscription/cu_tracker.proto b/proto/lavanet/lava/subscription/cu_tracker.proto index dd99edcfc1..364408ccef 100644 --- a/proto/lavanet/lava/subscription/cu_tracker.proto +++ b/proto/lavanet/lava/subscription/cu_tracker.proto @@ -1,15 +1,23 @@ syntax = "proto3"; package lavanet.lava.subscription; -option go_package = "github.com/lavanet/lava/x/subscription/types"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; +option go_package = "github.com/lavanet/lava/v2/x/subscription/types"; + message TrackedCu { - uint64 cu = 1; // CU counter for CU after QoS consideration + uint64 cu = 1; // CU counter for CU after QoS consideration } message CuTrackerTimerData { - uint64 block = 1; // sub block - cosmos.base.v1beta1.Coin credit = 2 [(gogoproto.nullable) = false]; // credit to be used for rewards -} \ No newline at end of file + uint64 block = 1; // sub block + cosmos.base.v1beta1.Coin credit = 2 [(gogoproto.nullable) = false]; // credit to be used for rewards +} + +message TrackedCuInfo { + string provider = 1; + string chainID = 2; + uint64 trackedCu = 3; + uint64 block = 4; +} diff --git a/proto/lavanet/lava/subscription/genesis.proto b/proto/lavanet/lava/subscription/genesis.proto index 0b04484171..80cc9c6cdc 100644 --- a/proto/lavanet/lava/subscription/genesis.proto +++ b/proto/lavanet/lava/subscription/genesis.proto @@ -8,7 +8,7 @@ import "lavanet/lava/fixationstore/fixation.proto"; import "lavanet/lava/timerstore/timer.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/lavanet/lava/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v2/x/subscription/types"; // GenesisState defines the subscription module's genesis state. message GenesisState { diff --git a/proto/lavanet/lava/subscription/params.proto b/proto/lavanet/lava/subscription/params.proto index b21a6ba2b5..51c04df2ef 100644 --- a/proto/lavanet/lava/subscription/params.proto +++ b/proto/lavanet/lava/subscription/params.proto @@ -3,7 +3,7 @@ package lavanet.lava.subscription; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v2/x/subscription/types"; // Params defines the parameters for the module. message Params { diff --git a/proto/lavanet/lava/subscription/query.proto b/proto/lavanet/lava/subscription/query.proto index 2651bdcdfe..64e0b2ef02 100644 --- a/proto/lavanet/lava/subscription/query.proto +++ b/proto/lavanet/lava/subscription/query.proto @@ -1,16 +1,17 @@ syntax = "proto3"; package lavanet.lava.subscription; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; +import "lavanet/lava/subscription/cu_tracker.proto"; import "lavanet/lava/subscription/params.proto"; -import "cosmos/base/v1beta1/coin.proto"; - // this line is used by starport scaffolding # 1 import "lavanet/lava/subscription/subscription.proto"; +import "amino/amino.proto"; -option go_package = "github.com/lavanet/lava/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v2/x/subscription/types"; // Query defines the gRPC querier service. service Query { @@ -19,25 +20,40 @@ service Query { option (google.api.http).get = "/lavanet/lava/subscription/params"; } // Queries a list of Current items. - rpc Current(QueryCurrentRequest) returns (QueryCurrentResponse) { - option (google.api.http).get = "/lavanet/lava/subscription/current/{consumer}"; - } + rpc Current(QueryCurrentRequest) returns (QueryCurrentResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/current/{consumer}"; + } // Queries a list of ListProjects items. - rpc ListProjects(QueryListProjectsRequest) returns (QueryListProjectsResponse) { - option (google.api.http).get = "/lavanet/lava/subscription/list_projects/{subscription}"; - } + rpc ListProjects(QueryListProjectsRequest) returns (QueryListProjectsResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/list_projects/{subscription}"; + } // Queries a list of List items. - rpc List(QueryListRequest) returns (QueryListResponse) { - option (google.api.http).get = "/lavanet/lava/subscription/list"; - } + rpc List(QueryListRequest) returns (QueryListResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/list"; + } // Queries the subscription with the closest month expiry - rpc NextToMonthExpiry(QueryNextToMonthExpiryRequest) returns (QueryNextToMonthExpiryResponse) { - option (google.api.http).get = "/lavanet/lava/subscription/next_to_month_expiry"; - } -// this line is used by starport scaffolding # 2 + rpc NextToMonthExpiry(QueryNextToMonthExpiryRequest) returns (QueryNextToMonthExpiryResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/next_to_month_expiry"; + } + + // Queries a list of Current items. + rpc TrackedUsage(QuerySubscriptionTrackedUsageRequest) returns (QuerySubscriptionTrackedUsageResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/tracked_usage/{subscription}"; + } + +// Queries a rewards estimation. +rpc EstimatedRewards(QueryEstimatedRewardsRequest) returns (QueryEstimatedRewardsResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/estimated_rewards/{provider}/{chain_id}/{amount_delegator}"; +} + +rpc EstimatedValidatorRewards(QueryEstimatedValidatorRewardsRequest) returns (QueryEstimatedValidatorRewardsResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/estimated_validator_rewards/{validator}/{amount_delegator}"; +} + + // this line is used by starport scaffolding # 2 } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -65,8 +81,7 @@ message QueryListProjectsResponse { repeated string projects = 1; } -message QueryListRequest { -} +message QueryListRequest {} message QueryListResponse { repeated ListInfoStruct subs_info = 1 [(gogoproto.nullable) = false]; @@ -88,8 +103,7 @@ message ListInfoStruct { cosmos.base.v1beta1.Coin credit = 13; } -message QueryNextToMonthExpiryRequest { -} +message QueryNextToMonthExpiryRequest {} message TimerExpiryInfo { string consumer = 1; @@ -100,4 +114,51 @@ message QueryNextToMonthExpiryResponse { repeated TimerExpiryInfo subscriptions = 1 [(gogoproto.nullable) = false]; } +message QuerySubscriptionTrackedUsageRequest { + string subscription = 1; +} + +message QuerySubscriptionTrackedUsageResponse { + Subscription subscription = 1 [(gogoproto.nullable) = true]; + repeated TrackedCuInfo usage = 2; + uint64 total_usage = 3; +} + +message QueryEstimatedRewardsRequest { + string provider = 1; + string chain_id = 2; + string amount_delegator = 3; +} + +message EstimatedRewardInfo { + string source =1; + repeated cosmos.base.v1beta1.DecCoin amount = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +message QueryEstimatedRewardsResponse { + repeated EstimatedRewardInfo info = 1 [(gogoproto.nullable) = true]; + repeated cosmos.base.v1beta1.DecCoin total = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +message QueryEstimatedValidatorRewardsRequest { + string validator = 1; + string amount_delegator = 2; +} + +message QueryEstimatedValidatorRewardsResponse { + repeated EstimatedRewardInfo info = 1 [(gogoproto.nullable) = true]; + repeated cosmos.base.v1beta1.DecCoin total = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} // this line is used by starport scaffolding # 3 diff --git a/proto/lavanet/lava/subscription/subscription.proto b/proto/lavanet/lava/subscription/subscription.proto index db1849db03..c5e17c3b00 100644 --- a/proto/lavanet/lava/subscription/subscription.proto +++ b/proto/lavanet/lava/subscription/subscription.proto @@ -4,7 +4,7 @@ package lavanet.lava.subscription; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v2/x/subscription/types"; message Subscription { string creator = 1; // creator pays for the subscription diff --git a/proto/lavanet/lava/subscription/tx.proto b/proto/lavanet/lava/subscription/tx.proto index 6cdf08ebcd..cd3096b116 100644 --- a/proto/lavanet/lava/subscription/tx.proto +++ b/proto/lavanet/lava/subscription/tx.proto @@ -2,9 +2,10 @@ syntax = "proto3"; package lavanet.lava.subscription; // this line is used by starport scaffolding # proto/tx/import +import "amino/amino.proto"; import "lavanet/lava/projects/project.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/lavanet/lava/x/subscription/types"; +option go_package = "github.com/lavanet/lava/v2/x/subscription/types"; // Msg defines the Msg service. service Msg { @@ -16,6 +17,7 @@ service Msg { } message MsgBuy { + option (amino.name) = "subscription/Buy"; reserved 5; string creator = 1; string consumer = 2; @@ -29,6 +31,7 @@ message MsgBuyResponse { } message MsgAddProject { + option (amino.name) = "subscription/AddProject"; string creator = 1; lavanet.lava.projects.ProjectData project_data = 2 [(gogoproto.nullable) = false]; } @@ -37,6 +40,7 @@ message MsgAddProjectResponse { } message MsgDelProject { + option (amino.name) = "subscription/DelProject"; string creator = 1; string name = 2; } @@ -45,6 +49,7 @@ message MsgDelProjectResponse { } message MsgAutoRenewal { + option (amino.name) = "subscription/AutoRenewal"; string creator = 1; bool enable = 2; string consumer = 3; diff --git a/proto/lavanet/lava/timerstore/query.proto b/proto/lavanet/lava/timerstore/query.proto index 643a62ba5a..2e0a6605e7 100644 --- a/proto/lavanet/lava/timerstore/query.proto +++ b/proto/lavanet/lava/timerstore/query.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.timerstore; -option go_package = "github.com/lavanet/lava/x/timerstore/types"; +option go_package = "github.com/lavanet/lava/v2/x/timerstore/types"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; diff --git a/proto/lavanet/lava/timerstore/timer.proto b/proto/lavanet/lava/timerstore/timer.proto index 4d084cfce8..ce374d01d5 100644 --- a/proto/lavanet/lava/timerstore/timer.proto +++ b/proto/lavanet/lava/timerstore/timer.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lavanet.lava.timerstore; -option go_package = "github.com/lavanet/lava/x/timerstore/types"; +option go_package = "github.com/lavanet/lava/v2/x/timerstore/types"; import "gogoproto/gogo.proto"; message GenesisState { diff --git a/protocol/badgegenerator/badgeserver.go b/protocol/badgegenerator/badgeserver.go index c57aa46053..aab1311ec7 100644 --- a/protocol/badgegenerator/badgeserver.go +++ b/protocol/badgegenerator/badgeserver.go @@ -14,11 +14,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" diff --git a/protocol/badgegenerator/grpc/grpcfetcher.go b/protocol/badgegenerator/grpc/grpcfetcher.go index a2430895dc..1cb7866392 100644 --- a/protocol/badgegenerator/grpc/grpcfetcher.go +++ b/protocol/badgegenerator/grpc/grpcfetcher.go @@ -8,8 +8,8 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/query" retry "github.com/grpc-ecosystem/go-grpc-middleware/retry" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" diff --git a/protocol/badgegenerator/ipservice.go b/protocol/badgegenerator/ipservice.go index 0d5460a998..45149bd914 100644 --- a/protocol/badgegenerator/ipservice.go +++ b/protocol/badgegenerator/ipservice.go @@ -12,7 +12,7 @@ import ( "github.com/praserx/ipconv" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type IpService struct { diff --git a/protocol/badgegenerator/models.go b/protocol/badgegenerator/models.go index e6037f02a7..2296307a5e 100644 --- a/protocol/badgegenerator/models.go +++ b/protocol/badgegenerator/models.go @@ -1,6 +1,6 @@ package badgegenerator -import "github.com/lavanet/lava/x/pairing/types" +import "github.com/lavanet/lava/v2/x/pairing/types" type ProjectConfiguration struct { ProjectPublicKey string `json:"project_public_key"` diff --git a/protocol/badgegenerator/server.go b/protocol/badgegenerator/server.go index c22f7138bc..087d892d73 100644 --- a/protocol/badgegenerator/server.go +++ b/protocol/badgegenerator/server.go @@ -11,13 +11,13 @@ import ( "google.golang.org/grpc/metadata" - btcSecp256k1 "github.com/btcsuite/btcd/btcec" - "github.com/lavanet/lava/protocol/badgegenerator/grpc" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" + "github.com/lavanet/lava/v2/protocol/badgegenerator/grpc" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const dummyApiInterface = "badgeApiInterface" @@ -271,7 +271,7 @@ func (s *Server) addPairingListToResponse(request *pairingtypes.GenerateBadgeReq // note this update the signature of the response func signTheResponse(privateKeyString string, response *pairingtypes.GenerateBadgeResponse) error { privateKeyBytes, _ := hex.DecodeString(privateKeyString) - privateKey, _ := btcSecp256k1.PrivKeyFromBytes(btcSecp256k1.S256(), privateKeyBytes) + privateKey, _ := btcSecp256k1.PrivKeyFromBytes(privateKeyBytes) signature, err := sigs.Sign(privateKey, *response.Badge) if err != nil { return err diff --git a/protocol/badgegenerator/tracker.go b/protocol/badgegenerator/tracker.go index a0dfb3a859..902f117359 100644 --- a/protocol/badgegenerator/tracker.go +++ b/protocol/badgegenerator/tracker.go @@ -6,11 +6,11 @@ import ( cosmosclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/statetracker" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/statetracker" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" ) // adding 3 blocks delay, to update the epoch. diff --git a/protocol/badgeserver/badgeserver.go b/protocol/badgeserver/badgeserver.go index 753d1f3e6a..fe481b3907 100644 --- a/protocol/badgeserver/badgeserver.go +++ b/protocol/badgeserver/badgeserver.go @@ -15,12 +15,12 @@ import ( "github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" @@ -78,6 +78,7 @@ func CreateBadgeServerCobraCommand() *cobra.Command { }, } + flags.AddKeyringFlags(cmd.Flags()) cmd.Flags().Int("epoch-interval", 30, "--epoch-interval=30") cmd.Flags().String("port", "8080", "badge server listening port") cmd.Flags().String("metrics-port", "8081", "badge server metrics port") diff --git a/protocol/badgeserver/ipservice.go b/protocol/badgeserver/ipservice.go index 6767ff2619..619302210b 100644 --- a/protocol/badgeserver/ipservice.go +++ b/protocol/badgeserver/ipservice.go @@ -12,7 +12,7 @@ import ( "github.com/praserx/ipconv" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type IpService struct { diff --git a/protocol/badgeserver/models.go b/protocol/badgeserver/models.go index e23b08696e..5659e00d7e 100644 --- a/protocol/badgeserver/models.go +++ b/protocol/badgeserver/models.go @@ -1,6 +1,6 @@ package badgeserver -import "github.com/lavanet/lava/x/pairing/types" +import "github.com/lavanet/lava/v2/x/pairing/types" type GelocationToProjectsConfiguration map[string]map[string]*ProjectConfiguration diff --git a/protocol/badgeserver/server.go b/protocol/badgeserver/server.go index 544adf0d61..a7bb280226 100644 --- a/protocol/badgeserver/server.go +++ b/protocol/badgeserver/server.go @@ -9,14 +9,14 @@ import ( "google.golang.org/grpc/metadata" - btcSecp256k1 "github.com/btcsuite/btcd/btcec" + btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const dummyApiInterface = "badgeApiInterface" @@ -196,6 +196,7 @@ func (s *Server) validateRequestAndGetProjectData(clientIPAddress string, reques utils.LogAttr("BadgeAddress", request.BadgeAddress), utils.LogAttr("ProjectId", request.ProjectId), utils.LogAttr("geolocation", geolocation), + utils.LogAttr("geolocationData", geolocationData), ) } } diff --git a/protocol/badgeserver/tracker.go b/protocol/badgeserver/tracker.go index 86f9ea40c5..6a62d1ec00 100644 --- a/protocol/badgeserver/tracker.go +++ b/protocol/badgeserver/tracker.go @@ -6,11 +6,11 @@ import ( cosmosclient "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/statetracker" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/statetracker" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" ) // adding 3 blocks delay, to update the epoch. diff --git a/protocol/chainlib/base_chain_parser.go b/protocol/chainlib/base_chain_parser.go index dbaae96a98..f94dfe9b49 100644 --- a/protocol/chainlib/base_chain_parser.go +++ b/protocol/chainlib/base_chain_parser.go @@ -8,12 +8,12 @@ import ( "sync" "time" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" - epochstorage "github.com/lavanet/lava/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" + epochstorage "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type PolicyInf interface { @@ -189,12 +189,14 @@ func (bcp *BaseChainParser) SeparateAddonsExtensions(supported []string) (addons if supportedToCheck == "" { continue } - if bcp.isExtension(supportedToCheck) { + if bcp.isExtension(supportedToCheck) || supportedToCheck == WebSocketExtension { extensions = append(extensions, supportedToCheck) continue } // neither is an error - err = utils.LavaFormatError("invalid supported to check, is neither an addon or an extension", err, utils.Attribute{Key: "spec", Value: bcp.spec.Index}, utils.Attribute{Key: "supported", Value: supportedToCheck}) + err = utils.LavaFormatError("invalid supported to check, is neither an addon or an extension", err, + utils.Attribute{Key: "spec", Value: bcp.spec.Index}, + utils.Attribute{Key: "supported", Value: supportedToCheck}) } } return addons, extensions, err @@ -252,7 +254,7 @@ func (bcp *BaseChainParser) Construct(spec spectypes.Spec, internalPaths map[str bcp.extensionParser.SetConfiguredExtensions(extensionParser.GetConfiguredExtensions()) } -func (bcp *BaseChainParser) GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, collectionData *spectypes.CollectionData, existed bool) { +func (bcp *BaseChainParser) GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, apiCollection *spectypes.ApiCollection, existed bool) { bcp.rwLock.RLock() defer bcp.rwLock.RUnlock() @@ -260,7 +262,7 @@ func (bcp *BaseChainParser) GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing if !ok { return nil, nil, false } - return val.Parsing, &val.ApiCollection.CollectionData, ok + return val.Parsing, val.ApiCollection, ok } func (bcp *BaseChainParser) ExtensionParsing(addon string, parsedMessageArg *baseChainMessageContainer, extensionInfo extensionslib.ExtensionInfo) { @@ -390,7 +392,8 @@ func getServiceApis(spec spectypes.Spec, rpcInterface string) (retInternalPaths re := regexp.MustCompile(`{[^}]+}`) processedName := string(re.ReplaceAll([]byte(api.Name), []byte("replace-me-with-regex"))) processedName = regexp.QuoteMeta(processedName) - processedName = strings.ReplaceAll(processedName, "replace-me-with-regex", `[^\/\s]+`) + processedName = strings.ReplaceAll(processedName, "replace-me-with-regex/", `[^\/\s]+/`) + processedName = strings.ReplaceAll(processedName, "replace-me-with-regex", `[^\/\s]*`) serverApis[ApiKey{ Name: processedName, ConnectionType: collectionKey.ConnectionType, diff --git a/protocol/chainlib/chain_fetcher.go b/protocol/chainlib/chain_fetcher.go index 1fd69a0e8a..e045d264a3 100644 --- a/protocol/chainlib/chain_fetcher.go +++ b/protocol/chainlib/chain_fetcher.go @@ -9,16 +9,16 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/golang/protobuf/proto" - formatter "github.com/lavanet/lava/ecosystem/cache/format" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/protocol/performance" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + formatter "github.com/lavanet/lava/v2/ecosystem/cache/format" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/protocol/performance" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "golang.org/x/exp/slices" ) @@ -126,7 +126,7 @@ func (cf *ChainFetcher) Verify(ctx context.Context, verification VerificationCon collectionType := verification.ConnectionType path := parsing.ApiName - data := []byte(fmt.Sprintf(parsing.FunctionTemplate)) + data := []byte(parsing.FunctionTemplate) if !verification.IsActive() { utils.LavaFormatDebug("skipping disabled verification", []utils.Attribute{ @@ -149,13 +149,20 @@ func (cf *ChainFetcher) Verify(ctx context.Context, verification VerificationCon return utils.LavaFormatWarning("[-] verify failed getting non-earliest block for chainMessage", fmt.Errorf("latestBlock is smaller than latestDistance"), utils.LogAttr("path", path), utils.LogAttr("latest_block", latestBlock), - utils.LogAttr("Latest_distance", verification.LatestDistance), + utils.LogAttr("latest_distance", verification.LatestDistance), ) } + } else if verification.Value != "" { + expectedValue, err := strconv.ParseInt(verification.Value, 10, 64) + if err != nil { + return utils.LavaFormatError("failed converting expected value to number", err, utils.LogAttr("value", verification.Value)) + } + data = []byte(fmt.Sprintf(parsing.FunctionTemplate, expectedValue)) } else { - return utils.LavaFormatWarning("[-] verification misconfiguration", fmt.Errorf("FUNCTION_TAG_GET_BLOCK_BY_NUM defined without LatestDistance or LatestBlock"), + return utils.LavaFormatWarning("[-] verification misconfiguration", fmt.Errorf("FUNCTION_TAG_GET_BLOCK_BY_NUM defined without LatestDistance or LatestBlock or a proper expected value"), utils.LogAttr("latest_block", latestBlock), - utils.LogAttr("Latest_distance", verification.LatestDistance), + utils.LogAttr("latest_distance", verification.LatestDistance), + utils.LogAttr("expected_value", verification.Value), ) } } @@ -222,7 +229,7 @@ func (cf *ChainFetcher) Verify(ctx context.Context, verification VerificationCon } } // some verifications only want the response to be valid, and don't care about the value - if verification.Value != "*" && verification.Value != "" { + if verification.Value != "*" && verification.Value != "" && verification.ParseDirective.FunctionTag != spectypes.FUNCTION_TAG_GET_BLOCK_BY_NUM { if parsedResult != verification.Value { return utils.LavaFormatWarning("[-] verify failed expected and received are different", err, []utils.Attribute{ {Key: "chainId", Value: chainId}, @@ -255,11 +262,12 @@ func (cf *ChainFetcher) ChainFetcherMetadata() []pairingtypes.Metadata { } func (cf *ChainFetcher) FetchLatestBlockNum(ctx context.Context) (int64, error) { - parsing, collectionData, ok := cf.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) + parsing, apiCollection, ok := cf.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) tagName := spectypes.FUNCTION_TAG_GET_BLOCKNUM.String() if !ok { return spectypes.NOT_APPLICABLE, utils.LavaFormatError(tagName+" tag function not found", nil, []utils.Attribute{{Key: "chainID", Value: cf.endpoint.ChainID}, {Key: "APIInterface", Value: cf.endpoint.ApiInterface}}...) } + collectionData := apiCollection.CollectionData var craftData *CraftData if parsing.FunctionTemplate != "" { path := parsing.ApiName @@ -314,11 +322,13 @@ func (cf *ChainFetcher) constructRelayData(conectionType string, path string, da } func (cf *ChainFetcher) FetchBlockHashByNum(ctx context.Context, blockNum int64) (string, error) { - parsing, collectionData, ok := cf.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCK_BY_NUM) + parsing, apiCollection, ok := cf.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCK_BY_NUM) tagName := spectypes.FUNCTION_TAG_GET_BLOCK_BY_NUM.String() if !ok { return "", utils.LavaFormatError(tagName+" tag function not found", nil, []utils.Attribute{{Key: "chainID", Value: cf.endpoint.ChainID}, {Key: "APIInterface", Value: cf.endpoint.ApiInterface}}...) } + collectionData := apiCollection.CollectionData + if parsing.FunctionTemplate == "" { return "", utils.LavaFormatError(tagName+" missing function template", nil, []utils.Attribute{{Key: "chainID", Value: cf.endpoint.ChainID}, {Key: "APIInterface", Value: cf.endpoint.ApiInterface}}...) } @@ -358,8 +368,11 @@ func (cf *ChainFetcher) FetchBlockHashByNum(ctx context.Context, blockNum int64) _, _, blockDistanceToFinalization, _ := cf.chainParser.ChainBlockStats() latestBlock := atomic.LoadInt64(&cf.latestBlock) // assuming FetchLatestBlockNum is called before this one it's always true if latestBlock > 0 { - finalized := spectypes.IsFinalizedBlock(blockNum, latestBlock, blockDistanceToFinalization) - cf.populateCache(cf.constructRelayData(collectionData.Type, path, data, blockNum, "", nil, latestBlock), reply.RelayReply, []byte(res), finalized) + finalized := spectypes.IsFinalizedBlock(blockNum, latestBlock, int64(blockDistanceToFinalization)) + isNodeError, _ := chainMessage.CheckResponseError(reply.RelayReply.Data, reply.StatusCode) + if !isNodeError { // skip cache populate on node errors, this is a protection but should never get here with node error as we parse the result prior. + cf.populateCache(cf.constructRelayData(collectionData.Type, path, data, blockNum, "", nil, latestBlock), reply.RelayReply, []byte(res), finalized) + } } return res, nil } diff --git a/protocol/chainlib/chain_fetcher_mock.go b/protocol/chainlib/chain_fetcher_mock.go index 0de5103435..60844bb8ba 100644 --- a/protocol/chainlib/chain_fetcher_mock.go +++ b/protocol/chainlib/chain_fetcher_mock.go @@ -12,7 +12,7 @@ import ( context "context" reflect "reflect" - lavasession "github.com/lavanet/lava/protocol/lavasession" + lavasession "github.com/lavanet/lava/v2/protocol/lavasession" gomock "go.uber.org/mock/gomock" ) diff --git a/protocol/chainlib/chain_fetcher_test.go b/protocol/chainlib/chain_fetcher_test.go new file mode 100644 index 0000000000..15ebf39a34 --- /dev/null +++ b/protocol/chainlib/chain_fetcher_test.go @@ -0,0 +1,24 @@ +package chainlib + +import ( + "testing" + + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + "github.com/stretchr/testify/require" +) + +// testing hash cache request doesn't change the fields it resets to calculate hash. +func TestHashCacheRequest(t *testing.T) { + var initSeenBlock int64 = 99 + var initRequestBlock int64 = 100 + initData := []byte{1, 2, 3, 4} + initSalt := []byte{1, 3, 4, 5} + + relayRequest := &pairingtypes.RelayPrivateData{Data: initData, Salt: initSalt, RequestBlock: initRequestBlock, SeenBlock: initSeenBlock} + _, _, err := HashCacheRequest(relayRequest, "Best-Chain-AKA-Lava-Network") + require.NoError(t, err) + require.Equal(t, relayRequest.SeenBlock, initSeenBlock) + require.Equal(t, relayRequest.RequestBlock, initRequestBlock) + require.Equal(t, relayRequest.Data, initData) + require.Equal(t, relayRequest.Salt, initSalt) +} diff --git a/protocol/chainlib/chain_message.go b/protocol/chainlib/chain_message.go index dc2418a6fd..9df468f55c 100644 --- a/protocol/chainlib/chain_message.go +++ b/protocol/chainlib/chain_message.go @@ -4,107 +4,136 @@ import ( "math" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type updatableRPCInput interface { rpcInterfaceMessages.GenericMessage UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool) AppendHeader(metadata []pairingtypes.Metadata) + SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string + GetRawRequestHash() ([]byte, error) } type baseChainMessageContainer struct { api *spectypes.Api latestRequestedBlock int64 + requestedBlockHashes []string earliestRequestedBlock int64 msg updatableRPCInput apiCollection *spectypes.ApiCollection extensions []*spectypes.Extension timeoutOverride time.Duration forceCacheRefresh bool + parseDirective *spectypes.ParseDirective // setting the parse directive related to the api, can be nil + + inputHashCache []byte // resultErrorParsingMethod passed by each api interface message to parse the result of the message // and validate it doesn't contain a node error resultErrorParsingMethod func(data []byte, httpStatusCode int) (hasError bool, errorMessage string) } +func (bcnc *baseChainMessageContainer) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + return bcnc.msg.SubscriptionIdExtractor(reply) +} + +// returning parse directive for the api. can be nil. +func (bcnc *baseChainMessageContainer) GetParseDirective() *spectypes.ParseDirective { + return bcnc.parseDirective +} + +func (pm *baseChainMessageContainer) GetRawRequestHash() ([]byte, error) { + if len(pm.inputHashCache) > 0 { + // Get the cached value + return pm.inputHashCache, nil + } + hash, err := pm.msg.GetRawRequestHash() + if err == nil { + // Now we have the hash cached so we call it only once. + pm.inputHashCache = hash + } + return hash, err +} + // not necessary for base chain message. -func (pm *baseChainMessageContainer) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string) { - if pm.resultErrorParsingMethod == nil { +func (bcnc *baseChainMessageContainer) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string) { + if bcnc.resultErrorParsingMethod == nil { utils.LavaFormatError("tried calling resultErrorParsingMethod when it is not set", nil) return false, "" } - return pm.resultErrorParsingMethod(data, httpStatusCode) + return bcnc.resultErrorParsingMethod(data, httpStatusCode) } -func (pm *baseChainMessageContainer) TimeoutOverride(override ...time.Duration) time.Duration { +func (bcnc *baseChainMessageContainer) TimeoutOverride(override ...time.Duration) time.Duration { if len(override) > 0 { - pm.timeoutOverride = override[0] + bcnc.timeoutOverride = override[0] } - return pm.timeoutOverride + return bcnc.timeoutOverride } -func (pm *baseChainMessageContainer) SetForceCacheRefresh(force bool) bool { - pm.forceCacheRefresh = force - return pm.forceCacheRefresh +func (bcnc *baseChainMessageContainer) SetForceCacheRefresh(force bool) bool { + bcnc.forceCacheRefresh = force + return bcnc.forceCacheRefresh } -func (pm *baseChainMessageContainer) GetForceCacheRefresh() bool { - return pm.forceCacheRefresh +func (bcnc *baseChainMessageContainer) GetForceCacheRefresh() bool { + return bcnc.forceCacheRefresh } -func (pm *baseChainMessageContainer) DisableErrorHandling() { - pm.msg.DisableErrorHandling() +func (bcnc *baseChainMessageContainer) DisableErrorHandling() { + bcnc.msg.DisableErrorHandling() } -func (pm baseChainMessageContainer) AppendHeader(metadata []pairingtypes.Metadata) { - pm.msg.AppendHeader(metadata) +func (bcnc baseChainMessageContainer) AppendHeader(metadata []pairingtypes.Metadata) { + bcnc.msg.AppendHeader(metadata) } -func (pm baseChainMessageContainer) GetApi() *spectypes.Api { - return pm.api +func (bcnc baseChainMessageContainer) GetApi() *spectypes.Api { + return bcnc.api } -func (pm baseChainMessageContainer) GetApiCollection() *spectypes.ApiCollection { - return pm.apiCollection +func (bcnc baseChainMessageContainer) GetApiCollection() *spectypes.ApiCollection { + return bcnc.apiCollection } -func (pm baseChainMessageContainer) RequestedBlock() (latest int64, earliest int64) { - if pm.earliestRequestedBlock == 0 { +func (bcnc baseChainMessageContainer) RequestedBlock() (latest int64, earliest int64) { + if bcnc.earliestRequestedBlock == 0 { // earliest is optional and not set here - return pm.latestRequestedBlock, pm.latestRequestedBlock + return bcnc.latestRequestedBlock, bcnc.latestRequestedBlock } - return pm.latestRequestedBlock, pm.earliestRequestedBlock + return bcnc.latestRequestedBlock, bcnc.earliestRequestedBlock } -func (pm baseChainMessageContainer) GetRPCMessage() rpcInterfaceMessages.GenericMessage { - return pm.msg +func (bcnc baseChainMessageContainer) GetRPCMessage() rpcInterfaceMessages.GenericMessage { + return bcnc.msg } -func (pm *baseChainMessageContainer) UpdateLatestBlockInMessage(latestBlock int64, modifyContent bool) (modifiedOnLatestReq bool) { - requestedBlock, _ := pm.RequestedBlock() +func (bcnc *baseChainMessageContainer) UpdateLatestBlockInMessage(latestBlock int64, modifyContent bool) (modifiedOnLatestReq bool) { + requestedBlock, _ := bcnc.RequestedBlock() if latestBlock <= spectypes.NOT_APPLICABLE || requestedBlock != spectypes.LATEST_BLOCK { return false } - success := pm.msg.UpdateLatestBlockInMessage(uint64(latestBlock), modifyContent) + success := bcnc.msg.UpdateLatestBlockInMessage(uint64(latestBlock), modifyContent) if success { - pm.latestRequestedBlock = latestBlock + bcnc.latestRequestedBlock = latestBlock return true } return false } -func (pm *baseChainMessageContainer) GetExtensions() []*spectypes.Extension { - return pm.extensions +func (bcnc *baseChainMessageContainer) GetExtensions() []*spectypes.Extension { + return bcnc.extensions } // adds the following extensions -func (pm *baseChainMessageContainer) OverrideExtensions(extensionNames []string, extensionParser *extensionslib.ExtensionParser) { +func (bcnc *baseChainMessageContainer) OverrideExtensions(extensionNames []string, extensionParser *extensionslib.ExtensionParser) { existingExtensions := map[string]struct{}{} - for _, extension := range pm.extensions { + for _, extension := range bcnc.extensions { existingExtensions[extension.Name] = struct{}{} } for _, extensionName := range extensionNames { @@ -112,38 +141,38 @@ func (pm *baseChainMessageContainer) OverrideExtensions(extensionNames []string, existingExtensions[extensionName] = struct{}{} extensionKey := extensionslib.ExtensionKey{ Extension: extensionName, - ConnectionType: pm.apiCollection.CollectionData.Type, - InternalPath: pm.apiCollection.CollectionData.InternalPath, - Addon: pm.apiCollection.CollectionData.AddOn, + ConnectionType: bcnc.apiCollection.CollectionData.Type, + InternalPath: bcnc.apiCollection.CollectionData.InternalPath, + Addon: bcnc.apiCollection.CollectionData.AddOn, } extension := extensionParser.GetExtension(extensionKey) if extension != nil { - pm.extensions = append(pm.extensions, extension) - pm.updateCUForApi(extension) + bcnc.extensions = append(bcnc.extensions, extension) + bcnc.updateCUForApi(extension) } } } } -func (pm *baseChainMessageContainer) SetExtension(extension *spectypes.Extension) { - if len(pm.extensions) > 0 { - for _, ext := range pm.extensions { +func (bcnc *baseChainMessageContainer) SetExtension(extension *spectypes.Extension) { + if len(bcnc.extensions) > 0 { + for _, ext := range bcnc.extensions { if ext.Name == extension.Name { // already existing, no need to add return } } - pm.extensions = append(pm.extensions, extension) + bcnc.extensions = append(bcnc.extensions, extension) } else { - pm.extensions = []*spectypes.Extension{extension} + bcnc.extensions = []*spectypes.Extension{extension} } - pm.updateCUForApi(extension) + bcnc.updateCUForApi(extension) } -func (pm *baseChainMessageContainer) updateCUForApi(extension *spectypes.Extension) { - copyApi := *pm.api // we can't modify this because it points to an object inside the chainParser +func (bcnc *baseChainMessageContainer) updateCUForApi(extension *spectypes.Extension) { + copyApi := *bcnc.api // we can't modify this because it points to an object inside the chainParser copyApi.ComputeUnits = uint64(math.Floor(float64(extension.GetCuMultiplier()) * float64(copyApi.ComputeUnits))) - pm.api = ©Api + bcnc.api = ©Api } type CraftData struct { diff --git a/protocol/chainlib/chain_message_queries.go b/protocol/chainlib/chain_message_queries.go index a8e453cdf1..479cf259b2 100644 --- a/protocol/chainlib/chain_message_queries.go +++ b/protocol/chainlib/chain_message_queries.go @@ -1,6 +1,9 @@ package chainlib -import "github.com/lavanet/lava/protocol/common" +import ( + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/x/spec/types" +) func ShouldSendToAllProviders(chainMessage ChainMessage) bool { return chainMessage.GetApi().Category.Stateful == common.CONSISTENCY_SELECT_ALL_PROVIDERS @@ -10,10 +13,6 @@ func GetAddon(chainMessage ChainMessageForSend) string { return chainMessage.GetApiCollection().CollectionData.AddOn } -func IsSubscription(chainMessage ChainMessageForSend) bool { - return chainMessage.GetApi().Category.Subscription -} - func IsHangingApi(chainMessage ChainMessageForSend) bool { return chainMessage.GetApi().Category.HangingApi } @@ -25,3 +24,21 @@ func GetComputeUnits(chainMessage ChainMessageForSend) uint64 { func GetStateful(chainMessage ChainMessageForSend) uint32 { return chainMessage.GetApi().Category.Stateful } + +func GetParseDirective(api *types.Api, apiCollection *types.ApiCollection) *types.ParseDirective { + chainMessageApiName := api.Name + for _, parseDirective := range apiCollection.GetParseDirectives() { + if parseDirective.ApiName == chainMessageApiName { + return parseDirective + } + } + return nil +} + +func IsFunctionTagOfType(chainMessage ChainMessageForSend, functionTag types.FUNCTION_TAG) bool { + parseDirective := chainMessage.GetParseDirective() + if parseDirective != nil { + return parseDirective.FunctionTag == functionTag + } + return false +} diff --git a/protocol/chainlib/chain_router.go b/protocol/chainlib/chain_router.go index e0a955b11b..47a56f1032 100644 --- a/protocol/chainlib/chain_router.go +++ b/protocol/chainlib/chain_router.go @@ -2,19 +2,29 @@ package chainlib import ( "context" + "net/url" + "strings" "sync" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) +type MethodRoute struct { + lavasession.RouterKey + method string +} + type chainRouterEntry struct { ChainProxy addonsSupported map[string]struct{} + methodsRouted map[string]struct{} } func (cre *chainRouterEntry) isSupporting(addon string) bool { @@ -32,21 +42,36 @@ type chainRouterImpl struct { chainProxyRouter map[lavasession.RouterKey][]chainRouterEntry } -func (cri *chainRouterImpl) getChainProxySupporting(ctx context.Context, addon string, extensions []string) (ChainProxy, error) { +func (cri *chainRouterImpl) GetChainProxySupporting(ctx context.Context, addon string, extensions []string, method string) (ChainProxy, error) { cri.lock.RLock() defer cri.lock.RUnlock() + + // check if that specific method has a special route, if it does apply it to the router key wantedRouterKey := lavasession.NewRouterKey(extensions) if chainProxyEntries, ok := cri.chainProxyRouter[wantedRouterKey]; ok { for _, chainRouterEntry := range chainProxyEntries { if chainRouterEntry.isSupporting(addon) { + // check if the method is supported + if len(chainRouterEntry.methodsRouted) > 0 { + if _, ok := chainRouterEntry.methodsRouted[method]; !ok { + continue + } + utils.LavaFormatTrace("chainProxy supporting method routing selected", + utils.LogAttr("addon", addon), + utils.LogAttr("wantedRouterKey", wantedRouterKey), + utils.LogAttr("method", method), + ) + } if wantedRouterKey != lavasession.GetEmptyRouterKey() { // add trailer only when router key is not default (||) grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeExtension, string(wantedRouterKey))) } return chainRouterEntry.ChainProxy, nil } - if debug { - utils.LavaFormatDebug("chainProxy supporting extensions but not supporting addon", utils.Attribute{Key: "addon", Value: addon}, utils.Attribute{Key: "wantedRouterKey", Value: wantedRouterKey}) - } + + utils.LavaFormatTrace("chainProxy supporting extensions but not supporting addon", + utils.LogAttr("addon", addon), + utils.LogAttr("wantedRouterKey", wantedRouterKey), + ) } // no support for this addon return nil, utils.LavaFormatError("no chain proxy supporting requested addon", nil, utils.Attribute{Key: "addon", Value: addon}) @@ -64,7 +89,7 @@ func (cri chainRouterImpl) ExtensionsSupported(extensions []string) bool { func (cri chainRouterImpl) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend, extensions []string) (relayReply *RelayReplyWrapper, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, proxyUrl common.NodeUrl, chainId string, err error) { // add the parsed addon from the apiCollection addon := chainMessage.GetApiCollection().CollectionData.AddOn - selectedChainProxy, err := cri.getChainProxySupporting(ctx, addon, extensions) + selectedChainProxy, err := cri.GetChainProxySupporting(ctx, addon, extensions, chainMessage.GetApi().Name) if err != nil { return nil, "", nil, common.NodeUrl{}, "", err } @@ -74,31 +99,83 @@ func (cri chainRouterImpl) SendNodeMsg(ctx context.Context, ch chan interface{}, } // batch nodeUrls with the same addons together in a copy -func batchNodeUrlsByServices(rpcProviderEndpoint lavasession.RPCProviderEndpoint) map[lavasession.RouterKey]lavasession.RPCProviderEndpoint { +func (cri *chainRouterImpl) BatchNodeUrlsByServices(rpcProviderEndpoint lavasession.RPCProviderEndpoint) (map[lavasession.RouterKey]lavasession.RPCProviderEndpoint, error) { returnedBatch := map[lavasession.RouterKey]lavasession.RPCProviderEndpoint{} + routesToCheck := map[lavasession.RouterKey]bool{} + methodRoutes := map[string]int{} for _, nodeUrl := range rpcProviderEndpoint.NodeUrls { - if existingEndpoint, ok := returnedBatch[lavasession.NewRouterKey(nodeUrl.Addons)]; !ok { - returnedBatch[lavasession.NewRouterKey(nodeUrl.Addons)] = lavasession.RPCProviderEndpoint{ + routerKey := lavasession.NewRouterKey(nodeUrl.Addons) + if len(nodeUrl.Methods) > 0 { + // all methods defined here will go to the same batch + methodRoutesUnique := strings.Join(nodeUrl.Methods, ",") + var existing int + var ok bool + if existing, ok = methodRoutes[methodRoutesUnique]; !ok { + methodRoutes[methodRoutesUnique] = len(methodRoutes) + existing = len(methodRoutes) + } + routerKey = routerKey.ApplyMethodsRoute(existing) + } + cri.parseNodeUrl(nodeUrl, returnedBatch, routerKey, rpcProviderEndpoint) + } + if len(returnedBatch) == 0 { + return nil, utils.LavaFormatError("invalid batch, routes are empty", nil, utils.LogAttr("endpoint", rpcProviderEndpoint)) + } + // validate all defined method routes have a regular route + for routerKey, valid := range routesToCheck { + if !valid { + return nil, utils.LavaFormatError("invalid batch, missing regular route for method route", nil, utils.LogAttr("routerKey", routerKey)) + } + } + return returnedBatch, nil +} + +func (*chainRouterImpl) parseNodeUrl(nodeUrl common.NodeUrl, returnedBatch map[lavasession.RouterKey]lavasession.RPCProviderEndpoint, routerKey lavasession.RouterKey, rpcProviderEndpoint lavasession.RPCProviderEndpoint) { + u, err := url.Parse(nodeUrl.Url) + // Some parsing may fail because of gRPC + if err == nil && (u.Scheme == "ws" || u.Scheme == "wss") { + // if websocket, check if we have a router key for http already. if not add a websocket router key + // so in case we didn't get an http endpoint, we can use the ws one. + if _, ok := returnedBatch[routerKey]; !ok { + returnedBatch[routerKey] = lavasession.RPCProviderEndpoint{ NetworkAddress: rpcProviderEndpoint.NetworkAddress, ChainID: rpcProviderEndpoint.ChainID, ApiInterface: rpcProviderEndpoint.ApiInterface, Geolocation: rpcProviderEndpoint.Geolocation, - NodeUrls: []common.NodeUrl{nodeUrl}, // add existing nodeUrl to the batch + NodeUrls: []common.NodeUrl{nodeUrl}, } - } else { - existingEndpoint.NodeUrls = append(existingEndpoint.NodeUrls, nodeUrl) - returnedBatch[lavasession.NewRouterKey(nodeUrl.Addons)] = existingEndpoint } + // now change the router key to fit the websocket extension key. + nodeUrl.Addons = append(nodeUrl.Addons, WebSocketExtension) + routerKey = lavasession.NewRouterKey(nodeUrl.Addons) + } + + if existingEndpoint, ok := returnedBatch[routerKey]; !ok { + returnedBatch[routerKey] = lavasession.RPCProviderEndpoint{ + NetworkAddress: rpcProviderEndpoint.NetworkAddress, + ChainID: rpcProviderEndpoint.ChainID, + ApiInterface: rpcProviderEndpoint.ApiInterface, + Geolocation: rpcProviderEndpoint.Geolocation, + NodeUrls: []common.NodeUrl{nodeUrl}, + } + } else { + // setting the incoming url first as it might be http while existing is websocket. (we prioritize http over ws when possible) + existingEndpoint.NodeUrls = append([]common.NodeUrl{nodeUrl}, existingEndpoint.NodeUrls...) + returnedBatch[routerKey] = existingEndpoint } - return returnedBatch } -func newChainRouter(ctx context.Context, nConns uint, rpcProviderEndpoint lavasession.RPCProviderEndpoint, chainParser ChainParser, proxyConstructor func(context.Context, uint, lavasession.RPCProviderEndpoint, ChainParser) (ChainProxy, error)) (ChainRouter, error) { +func newChainRouter(ctx context.Context, nConns uint, rpcProviderEndpoint lavasession.RPCProviderEndpoint, chainParser ChainParser, proxyConstructor func(context.Context, uint, lavasession.RPCProviderEndpoint, ChainParser) (ChainProxy, error)) (*chainRouterImpl, error) { chainProxyRouter := map[lavasession.RouterKey][]chainRouterEntry{} - + cri := chainRouterImpl{ + lock: &sync.RWMutex{}, + } requiredMap := map[requirementSt]struct{}{} supportedMap := map[requirementSt]struct{}{} - rpcProviderEndpointBatch := batchNodeUrlsByServices(rpcProviderEndpoint) + rpcProviderEndpointBatch, err := cri.BatchNodeUrlsByServices(rpcProviderEndpoint) + if err != nil { + return nil, err + } for _, rpcProviderEndpointEntry := range rpcProviderEndpointBatch { addons, extensions, err := chainParser.SeparateAddonsExtensions(append(rpcProviderEndpointEntry.NodeUrls[0].Addons, "")) if err != nil { @@ -121,6 +198,14 @@ func newChainRouter(ctx context.Context, nConns uint, rpcProviderEndpoint lavase return allExtensionsRouterKey } routerKey := updateRouteCombinations(extensions, addons) + methodsRouted := map[string]struct{}{} + methods := rpcProviderEndpointEntry.NodeUrls[0].Methods + if len(methods) > 0 { + for _, method := range methods { + methodsRouted[method] = struct{}{} + } + } + chainProxy, err := proxyConstructor(ctx, nConns, rpcProviderEndpointEntry, chainParser) if err != nil { // TODO: allow some urls to be down @@ -129,22 +214,54 @@ func newChainRouter(ctx context.Context, nConns uint, rpcProviderEndpoint lavase chainRouterEntryInst := chainRouterEntry{ ChainProxy: chainProxy, addonsSupported: addonsSupportedMap, + methodsRouted: methodsRouted, } if chainRouterEntries, ok := chainProxyRouter[routerKey]; !ok { chainProxyRouter[routerKey] = []chainRouterEntry{chainRouterEntryInst} } else { - chainProxyRouter[routerKey] = append(chainRouterEntries, chainRouterEntryInst) + if len(methodsRouted) > 0 { + // if there are routed methods we want this in the beginning to intercept them + chainProxyRouter[routerKey] = append([]chainRouterEntry{chainRouterEntryInst}, chainRouterEntries...) + } else { + chainProxyRouter[routerKey] = append(chainRouterEntries, chainRouterEntryInst) + } } } if len(requiredMap) > len(supportedMap) { return nil, utils.LavaFormatError("not all requirements supported in chainRouter, missing extensions or addons in definitions", nil, utils.Attribute{Key: "required", Value: requiredMap}, utils.Attribute{Key: "supported", Value: supportedMap}) } - cri := chainRouterImpl{ - lock: &sync.RWMutex{}, - chainProxyRouter: chainProxyRouter, + _, apiCollection, hasSubscriptionInSpec := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_SUBSCRIBE) + // validating we have websocket support for subscription supported specs. + webSocketSupported := false + for key := range supportedMap { + if key.IsRequirementMet(WebSocketExtension) { + webSocketSupported = true + } } - return cri, nil + if hasSubscriptionInSpec && apiCollection.Enabled && !webSocketSupported { + err := utils.LavaFormatError("subscriptions are applicable for this chain, but websocket is not provided in 'supported' map. By not setting ws/wss your provider wont be able to accept ws subscriptions, therefore might receive less rewards and lower QOS score.", nil, + utils.LogAttr("apiInterface", apiCollection.CollectionData.ApiInterface), + utils.LogAttr("supportedMap", supportedMap), + utils.LogAttr("required", WebSocketExtension), + ) + if !IgnoreSubscriptionNotConfiguredError { + return nil, err + } + } + + // make sure all chainProxyRouter entries have one without a method routing + for routerKey, chainRouterEntries := range chainProxyRouter { + // get the last entry, if it has methods routed, we need to error out + lastEntry := chainRouterEntries[len(chainRouterEntries)-1] + if len(lastEntry.methodsRouted) > 0 { + return nil, utils.LavaFormatError("last entry in chainProxyRouter has methods routed, this means no chainProxy supports all methods", nil, utils.LogAttr("routerKey", routerKey)) + } + } + + cri.chainProxyRouter = chainProxyRouter + + return &cri, nil } type requirementSt struct { @@ -152,6 +269,14 @@ type requirementSt struct { addon string } +func (rs *requirementSt) String() string { + return string(rs.extensions) + rs.addon +} + +func (rs *requirementSt) IsRequirementMet(requirement string) bool { + return strings.Contains(string(rs.extensions), requirement) || strings.Contains(rs.addon, requirement) +} + func populateRequiredForAddon(addon string, extensions []string, required map[requirementSt]struct{}) { if len(extensions) == 0 { required[requirementSt{ diff --git a/protocol/chainlib/chain_router_test.go b/protocol/chainlib/chain_router_test.go index 92f81f0e24..c16c7e6c25 100644 --- a/protocol/chainlib/chain_router_test.go +++ b/protocol/chainlib/chain_router_test.go @@ -2,26 +2,436 @@ package chainlib import ( "context" + "log" + "net" + "os" + "strings" "testing" + "time" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - testcommon "github.com/lavanet/lava/testutil/common" - spectypes "github.com/lavanet/lava/x/spec/types" + gojson "github.com/goccy/go-json" + "github.com/gofiber/fiber/v2" + "github.com/gofiber/fiber/v2/middleware/compress" + "github.com/gofiber/fiber/v2/middleware/favicon" + "github.com/gofiber/websocket/v2" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + testcommon "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) -func TestChainRouter(t *testing.T) { +var ( + listenerAddressTcp = "localhost:0" + listenerAddressHttp = "" + listenerAddressWs = "" +) + +type TimeServer int64 + +func TestChainRouterWithDisabledWebSocketInSpec(t *testing.T) { + ctx := context.Background() + apiInterface := spectypes.APIInterfaceJsonRPC + chainParser, err := NewChainParser(apiInterface) + require.NoError(t, err) + + IgnoreSubscriptionNotConfiguredError = false + + addonsOptions := []string{"-addon-", "-addon2-"} + extensionsOptions := []string{"-test-", "-test2-", "-test3-"} + + spec := testcommon.CreateMockSpec() + spec.ApiCollections = []*spectypes.ApiCollection{ + { + Enabled: false, + CollectionData: spectypes.CollectionData{ + ApiInterface: apiInterface, + InternalPath: "", + Type: "", + AddOn: "", + }, + Extensions: []*spectypes.Extension{ + { + Name: extensionsOptions[0], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[1], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[2], + CuMultiplier: 1, + }, + }, + ParseDirectives: []*spectypes.ParseDirective{{ + FunctionTag: spectypes.FUNCTION_TAG_SUBSCRIBE, + }}, + }, + { + Enabled: true, + CollectionData: spectypes.CollectionData{ + ApiInterface: apiInterface, + InternalPath: "", + Type: "", + AddOn: "", + }, + Extensions: []*spectypes.Extension{ + { + Name: extensionsOptions[0], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[1], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[2], + CuMultiplier: 1, + }, + }, + }, + { + Enabled: true, + CollectionData: spectypes.CollectionData{ + ApiInterface: apiInterface, + InternalPath: "", + Type: "", + AddOn: addonsOptions[0], + }, + Extensions: []*spectypes.Extension{ + { + Name: extensionsOptions[0], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[1], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[2], + CuMultiplier: 1, + }, + }, + }, + { + Enabled: true, + CollectionData: spectypes.CollectionData{ + ApiInterface: apiInterface, + InternalPath: "", + Type: "", + AddOn: addonsOptions[1], + }, + Extensions: []*spectypes.Extension{ + { + Name: extensionsOptions[0], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[1], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[2], + CuMultiplier: 1, + }, + }, + }, + } + chainParser.SetSpec(spec) + endpoint := &lavasession.RPCProviderEndpoint{ + NetworkAddress: lavasession.NetworkAddressData{}, + ChainID: spec.Index, + ApiInterface: apiInterface, + Geolocation: 1, + NodeUrls: []common.NodeUrl{}, + } + + type servicesStruct struct { + services []string + } + + playBook := []struct { + name string + services []servicesStruct + success bool + }{ + { + name: "empty services", + services: []servicesStruct{{ + services: []string{}, + }}, + success: true, + }, + { + name: "one-addon", + services: []servicesStruct{{ + services: []string{addonsOptions[0]}, + }}, + success: true, + }, + { + name: "one-extension", + services: []servicesStruct{{ + services: []string{extensionsOptions[0]}, + }}, + success: false, + }, + { + name: "one-extension with empty services", + services: []servicesStruct{ + { + services: []string{extensionsOptions[0]}, + }, + { + services: []string{}, + }, + }, + success: true, + }, + { + name: "two-addons together", + services: []servicesStruct{{ + services: addonsOptions, + }}, + success: true, + }, + { + name: "two-addons, separated", + services: []servicesStruct{{ + services: []string{addonsOptions[0]}, + }, { + services: []string{addonsOptions[1]}, + }}, + success: true, + }, + { + name: "addon + extension only", + services: []servicesStruct{{ + services: []string{addonsOptions[0], extensionsOptions[0]}, + }}, + success: false, + }, + { + name: "addon + extension, addon", + services: []servicesStruct{{ + services: []string{addonsOptions[0], extensionsOptions[0]}, + }, { + services: []string{addonsOptions[0]}, + }}, + success: true, + }, + { + name: "two addons + extension, addon", + services: []servicesStruct{{ + services: []string{addonsOptions[0], addonsOptions[1], extensionsOptions[0]}, + }, { + services: []string{addonsOptions[0]}, + }}, + success: false, + }, + { + name: "addons + extension, two addons", + services: []servicesStruct{{ + services: []string{addonsOptions[0], extensionsOptions[0]}, + }, { + services: []string{addonsOptions[0], addonsOptions[1]}, + }}, + success: true, + }, + { + name: "addons + two extensions, addon extension", + services: []servicesStruct{{ + services: []string{addonsOptions[0], extensionsOptions[0], extensionsOptions[1]}, + }, { + services: []string{addonsOptions[0], extensionsOptions[1]}, + }}, + success: false, + }, + { + name: "addons + two extensions, addon", + services: []servicesStruct{{ + services: []string{addonsOptions[0], extensionsOptions[0], extensionsOptions[1]}, + }, { + services: []string{addonsOptions[0]}, + }}, + success: false, + }, + { + name: "addons + two extensions, other addon", + services: []servicesStruct{ + { + services: []string{addonsOptions[0], extensionsOptions[0], extensionsOptions[1]}, + }, + { + services: []string{addonsOptions[1], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[0], extensionsOptions[1]}, + }, + }, + success: false, + }, + { + name: "addons + two extensions, addon ext1, addon ext2", + services: []servicesStruct{ + { + services: []string{addonsOptions[0], extensionsOptions[0], extensionsOptions[1]}, + }, + { + services: []string{addonsOptions[0], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[0], extensionsOptions[1]}, + }, + }, + success: false, + }, + { + name: "addons + two extensions, works", + services: []servicesStruct{ + { + services: []string{addonsOptions[0], extensionsOptions[0], extensionsOptions[1]}, + }, + { + services: []string{addonsOptions[0], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[0], extensionsOptions[1]}, + }, + { + services: []string{addonsOptions[0]}, + }, + }, + success: true, + }, + { + name: "addons + two extensions, works, addon2", + services: []servicesStruct{ + { + services: []string{addonsOptions[0], extensionsOptions[0], extensionsOptions[1]}, + }, + { + services: []string{addonsOptions[0], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[0], extensionsOptions[1]}, + }, + { + services: []string{addonsOptions[0], addonsOptions[1]}, + }, + }, + success: true, + }, + { + name: "addon1 + ext, addon 2 + ext, addon 1", + services: []servicesStruct{ + { + services: []string{addonsOptions[0], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[1], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[0]}, + }, + }, + success: false, + }, + { + name: "addon1 + ext, addon 2 + ext, addon 1,addon2", + services: []servicesStruct{ + { + services: []string{addonsOptions[0], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[1], extensionsOptions[0]}, + }, + { + services: []string{addonsOptions[0]}, + }, + { + services: []string{addonsOptions[1]}, + }, + }, + success: true, + }, + { + name: "addon, ext", + services: []servicesStruct{ + { + services: []string{addonsOptions[0]}, + }, + { + services: []string{extensionsOptions[0]}, + }, + }, + success: true, + }, + } + for _, play := range playBook { + t.Run(play.name, func(t *testing.T) { + nodeUrls := []common.NodeUrl{} + for _, service := range play.services { + nodeUrl := common.NodeUrl{Url: listenerAddressHttp} + nodeUrl.Addons = service.services + nodeUrls = append(nodeUrls, nodeUrl) + } + + endpoint.NodeUrls = nodeUrls + _, err := GetChainRouter(ctx, 1, endpoint, chainParser) + if play.success { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} + +func TestChainRouterWithEnabledWebSocketInSpec(t *testing.T) { ctx := context.Background() apiInterface := spectypes.APIInterfaceJsonRPC chainParser, err := NewChainParser(apiInterface) require.NoError(t, err) + IgnoreSubscriptionNotConfiguredError = false + addonsOptions := []string{"-addon-", "-addon2-"} extensionsOptions := []string{"-test-", "-test2-", "-test3-"} spec := testcommon.CreateMockSpec() spec.ApiCollections = []*spectypes.ApiCollection{ + { + Enabled: true, + CollectionData: spectypes.CollectionData{ + ApiInterface: apiInterface, + InternalPath: "", + Type: "", + AddOn: "", + }, + Extensions: []*spectypes.Extension{ + { + Name: extensionsOptions[0], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[1], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[2], + CuMultiplier: 1, + }, + }, + ParseDirectives: []*spectypes.ParseDirective{{ + FunctionTag: spectypes.FUNCTION_TAG_SUBSCRIBE, + }}, + }, { Enabled: true, CollectionData: spectypes.CollectionData{ @@ -132,7 +542,7 @@ func TestChainRouter(t *testing.T) { success: false, }, { - name: "one-extension works", + name: "one-extension with empty services", services: []servicesStruct{ { services: []string{extensionsOptions[0]}, @@ -327,9 +737,11 @@ func TestChainRouter(t *testing.T) { t.Run(play.name, func(t *testing.T) { nodeUrls := []common.NodeUrl{} for _, service := range play.services { - nodeUrl := common.NodeUrl{Url: "http://127.0.0.1:0"} + nodeUrl := common.NodeUrl{Url: listenerAddressHttp} nodeUrl.Addons = service.services nodeUrls = append(nodeUrls, nodeUrl) + nodeUrl.Url = listenerAddressWs + nodeUrls = append(nodeUrls, nodeUrl) } endpoint.NodeUrls = nodeUrls _, err := GetChainRouter(ctx, 1, endpoint, chainParser) @@ -341,3 +753,452 @@ func TestChainRouter(t *testing.T) { }) } } + +type chainProxyMock struct { + endpoint lavasession.RPCProviderEndpoint +} + +func (m *chainProxyMock) GetChainProxyInformation() (common.NodeUrl, string) { + urlStr := "" + if len(m.endpoint.NodeUrls) > 0 { + urlStr = m.endpoint.NodeUrls[0].UrlStr() + } + return common.NodeUrl{}, urlStr +} + +func (m *chainProxyMock) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend) (relayReply *RelayReplyWrapper, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error) { + return nil, "", nil, nil +} + +type PolicySt struct { + addons []string + extensions []string + apiInterface string +} + +func (a PolicySt) GetSupportedAddons(string) ([]string, error) { + return a.addons, nil +} + +func (a PolicySt) GetSupportedExtensions(string) ([]epochstoragetypes.EndpointService, error) { + ret := []epochstoragetypes.EndpointService{} + for _, ext := range a.extensions { + ret = append(ret, epochstoragetypes.EndpointService{Extension: ext, ApiInterface: a.apiInterface}) + } + return ret, nil +} + +func TestChainRouterWithMethodRoutes(t *testing.T) { + ctx := context.Background() + apiInterface := spectypes.APIInterfaceRest + chainParser, err := NewChainParser(apiInterface) + require.NoError(t, err) + + IgnoreSubscriptionNotConfiguredError = false + + addonsOptions := []string{"-addon-", "-addon2-"} + extensionsOptions := []string{"-test-", "-test2-", "-test3-"} + + spec := testcommon.CreateMockSpec() + spec.ApiCollections = []*spectypes.ApiCollection{ + { + Enabled: true, + CollectionData: spectypes.CollectionData{ + ApiInterface: apiInterface, + InternalPath: "", + Type: "", + AddOn: "", + }, + Extensions: []*spectypes.Extension{ + { + Name: extensionsOptions[0], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[1], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[2], + CuMultiplier: 1, + }, + }, + ParseDirectives: []*spectypes.ParseDirective{{ + FunctionTag: spectypes.FUNCTION_TAG_SUBSCRIBE, + }}, + Apis: []*spectypes.Api{ + { + Enabled: true, + Name: "api-1", + }, + { + Enabled: true, + Name: "api-2", + }, + { + Enabled: true, + Name: "api-8", + }, + }, + }, + { + Enabled: true, + CollectionData: spectypes.CollectionData{ + ApiInterface: apiInterface, + InternalPath: "", + Type: "", + AddOn: addonsOptions[0], + }, + Extensions: []*spectypes.Extension{ + { + Name: extensionsOptions[0], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[1], + CuMultiplier: 1, + }, + { + Name: extensionsOptions[2], + CuMultiplier: 1, + }, + }, + ParseDirectives: []*spectypes.ParseDirective{{ + FunctionTag: spectypes.FUNCTION_TAG_SUBSCRIBE, + }}, + Apis: []*spectypes.Api{ + { + Enabled: true, + Name: "api-3", + }, + { + Enabled: true, + Name: "api-4", + }, + }, + }, + } + chainParser.SetSpec(spec) + endpoint := &lavasession.RPCProviderEndpoint{ + NetworkAddress: lavasession.NetworkAddressData{}, + ChainID: spec.Index, + ApiInterface: apiInterface, + Geolocation: 1, + NodeUrls: []common.NodeUrl{}, + } + const extMarker = "::ext::" + playBook := []struct { + name string + nodeUrls []common.NodeUrl + success bool + apiToUrlMapping map[string]string + }{ + { + name: "addon routing", + nodeUrls: []common.NodeUrl{ + { + Url: "-0-", + Methods: []string{}, + Addons: []string{addonsOptions[0]}, + }, + { + Url: "ws:-0-", + Addons: []string{addonsOptions[0]}, + }, + { + Url: "-1-", + Methods: []string{"api-2"}, + }, + }, + success: true, + apiToUrlMapping: map[string]string{ + "api-1": "-0-", + "api-2": "-1-", + "api-3": "-0-", + }, + }, + { + name: "basic method routing", + nodeUrls: []common.NodeUrl{ + { + Url: "-0-", + Methods: []string{}, + }, + { + Url: "ws:-0-", + Methods: []string{}, + }, + { + Url: "-1-", + Methods: []string{"api-2"}, + }, + { + Url: "ws:-1-", + Methods: []string{}, + }, + }, + success: true, + apiToUrlMapping: map[string]string{ + "api-1": "-0-", + "api-2": "-1-", + }, + }, + { + name: "method routing with extension", + nodeUrls: []common.NodeUrl{ + { + Url: "-0-", + Methods: []string{}, + }, + { + Url: "ws:-0-", + Methods: []string{}, + }, + { + Url: "-1-", + Addons: []string{extensionsOptions[0]}, + }, + { + Url: "-2-", + Methods: []string{"api-2"}, + Addons: []string{extensionsOptions[0]}, + }, + }, + success: true, + apiToUrlMapping: map[string]string{ + "api-1": "-0-", + "api-2": "-0-", + "api-1" + extMarker + extensionsOptions[0]: "-1-", + "api-2" + extMarker + extensionsOptions[0]: "-2-", + }, + }, + { + name: "method routing with two extensions", + nodeUrls: []common.NodeUrl{ + { + Url: "-0-", + Methods: []string{}, + }, + { + Url: "ws:-0-", + Methods: []string{}, + }, + { + Url: "-1-", + Addons: []string{extensionsOptions[0]}, + }, + { + Url: "-2-", + Methods: []string{"api-2"}, + Addons: []string{extensionsOptions[0]}, + }, + { + Url: "-3-", + Addons: []string{extensionsOptions[1]}, + }, + { + Url: "-4-", + Methods: []string{"api-8"}, + Addons: []string{extensionsOptions[1]}, + }, + }, + success: true, + apiToUrlMapping: map[string]string{ + "api-1": "-0-", + "api-2": "-0-", + "api-1" + extMarker + extensionsOptions[0]: "-1-", + "api-2" + extMarker + extensionsOptions[0]: "-2-", + "api-1" + extMarker + extensionsOptions[1]: "-3-", + "api-8" + extMarker + extensionsOptions[1]: "-4-", + }, + }, + { + name: "two method routings with extension", + nodeUrls: []common.NodeUrl{ + { + Url: "-0-", + Methods: []string{}, + }, + { + Url: "ws:-0-", + Methods: []string{}, + }, + { + Url: "-1-", + Addons: []string{extensionsOptions[0]}, + }, + { + Url: "-2-", + Methods: []string{"api-2"}, + Addons: []string{extensionsOptions[0]}, + }, + { + Url: "-3-", + Methods: []string{"api-8"}, + Addons: []string{extensionsOptions[0]}, + }, + { + Url: "ws:-1-", + Methods: []string{}, + }, + }, + success: true, + apiToUrlMapping: map[string]string{ + "api-1": "-0-", + "api-2": "-0-", + "api-1" + extMarker + extensionsOptions[0]: "-1-", + "api-2" + extMarker + extensionsOptions[0]: "-2-", + "api-8" + extMarker + extensionsOptions[0]: "-3-", + }, + }, + { + name: "method routing without base", + nodeUrls: []common.NodeUrl{ + { + Url: "-0-", + Methods: []string{"api-1"}, + }, + { + Url: "ws:-0-", + Methods: []string{"api-1"}, + }, + }, + success: false, + }, + { + name: "method routing without base with extension", + nodeUrls: []common.NodeUrl{ + { + Url: "-0-", + Methods: []string{}, + }, + { + Url: "ws:-0-", + Methods: []string{}, + }, + { + Url: "-1-", + Addons: []string{extensionsOptions[0]}, + Methods: []string{"api-1"}, + }, + }, + success: false, + }, + } + mockProxyConstructor := func(_ context.Context, _ uint, endp lavasession.RPCProviderEndpoint, _ ChainParser) (ChainProxy, error) { + mockChainProxy := &chainProxyMock{endpoint: endp} + return mockChainProxy, nil + } + for _, play := range playBook { + t.Run(play.name, func(t *testing.T) { + endpoint.NodeUrls = play.nodeUrls + policy := PolicySt{ + addons: addonsOptions, + extensions: extensionsOptions, + apiInterface: apiInterface, + } + chainParser.SetPolicy(policy, spec.Index, apiInterface) + chainRouter, err := newChainRouter(ctx, 1, *endpoint, chainParser, mockProxyConstructor) + if play.success { + require.NoError(t, err) + for api, url := range play.apiToUrlMapping { + extension := extensionslib.ExtensionInfo{} + if strings.Contains(api, extMarker) { + splitted := strings.Split(api, extMarker) + api = splitted[0] + extension.ExtensionOverride = []string{splitted[1]} + } + chainMsg, err := chainParser.ParseMsg(api, nil, "", nil, extension) + require.NoError(t, err) + chainProxy, err := chainRouter.GetChainProxySupporting(ctx, chainMsg.GetApiCollection().CollectionData.AddOn, common.GetExtensionNames(chainMsg.GetExtensions()), api) + require.NoError(t, err) + _, urlFromProxy := chainProxy.GetChainProxyInformation() + require.Equal(t, url, urlFromProxy, "chainMsg: %+v, ---chainRouter: %+v", chainMsg, chainRouter) + } + } else { + require.Error(t, err) + } + }) + } +} + +func createRPCServer() net.Listener { + listener, err := net.Listen("tcp", listenerAddressTcp) + if err != nil { + log.Fatal("Listener error: ", err) + } + + app := fiber.New(fiber.Config{ + JSONEncoder: gojson.Marshal, + JSONDecoder: gojson.Unmarshal, + }) + app.Use(favicon.New()) + app.Use(compress.New(compress.Config{Level: compress.LevelBestSpeed})) + app.Use("/ws", func(c *fiber.Ctx) error { + // IsWebSocketUpgrade returns true if the client + // requested upgrade to the WebSocket protocol. + if websocket.IsWebSocketUpgrade(c) { + c.Locals("allowed", true) + return c.Next() + } + return fiber.ErrUpgradeRequired + }) + + app.Get("/ws", websocket.New(func(c *websocket.Conn) { + defer c.Close() + for { + // Read message from WebSocket + mt, message, err := c.ReadMessage() + if err != nil { + log.Println("Read error:", err) + break + } + + // Print the message to the console + log.Printf("Received: %s", message) + + // Echo the message back + err = c.WriteMessage(mt, message) + if err != nil { + log.Println("Write error:", err) + break + } + } + })) + + listenerAddressTcp = listener.Addr().String() + listenerAddressHttp = "http://" + listenerAddressTcp + listenerAddressWs = "ws://" + listenerAddressTcp + "/ws" + // Serve accepts incoming HTTP connections on the listener l, creating + // a new service goroutine for each. The service goroutines read requests + // and then call handler to reply to them + go app.Listener(listener) + + return listener +} + +func TestMain(m *testing.M) { + listener := createRPCServer() + for { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + _, err := rpcclient.DialContext(ctx, listenerAddressHttp) + _, err2 := rpcclient.DialContext(ctx, listenerAddressWs) + if err2 != nil { + utils.LavaFormatDebug("waiting for grpc server to launch") + continue + } + if err != nil { + utils.LavaFormatDebug("waiting for grpc server to launch") + continue + } + cancel() + break + } + + utils.LavaFormatDebug("listening on", utils.LogAttr("address", listenerAddressHttp)) + + // Start running tests. + code := m.Run() + listener.Close() + os.Exit(code) +} diff --git a/protocol/chainlib/chainlib.go b/protocol/chainlib/chainlib.go index 597b82e44f..8ed037669d 100644 --- a/protocol/chainlib/chainlib.go +++ b/protocol/chainlib/chainlib.go @@ -5,14 +5,19 @@ import ( "fmt" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" +) + +var ( + IgnoreSubscriptionNotConfiguredError = true + IgnoreSubscriptionNotConfiguredErrorFlag = "ignore-subscription-not-configured-error" ) func NewChainParser(apiInterface string) (chainParser ChainParser, err error) { @@ -37,12 +42,13 @@ func NewChainListener( rpcConsumerLogs *metrics.RPCConsumerLogs, chainParser ChainParser, refererData *RefererData, + consumerWsSubscriptionManager *ConsumerWSSubscriptionManager, ) (ChainListener, error) { switch listenEndpoint.ApiInterface { case spectypes.APIInterfaceJsonRPC: - return NewJrpcChainListener(ctx, listenEndpoint, relaySender, healthReporter, rpcConsumerLogs, refererData), nil + return NewJrpcChainListener(ctx, listenEndpoint, relaySender, healthReporter, rpcConsumerLogs, refererData, consumerWsSubscriptionManager), nil case spectypes.APIInterfaceTendermintRPC: - return NewTendermintRpcChainListener(ctx, listenEndpoint, relaySender, healthReporter, rpcConsumerLogs, refererData), nil + return NewTendermintRpcChainListener(ctx, listenEndpoint, relaySender, healthReporter, rpcConsumerLogs, refererData, consumerWsSubscriptionManager), nil case spectypes.APIInterfaceRest: return NewRestChainListener(ctx, listenEndpoint, relaySender, healthReporter, rpcConsumerLogs, refererData), nil case spectypes.APIInterfaceGrpc: @@ -56,7 +62,7 @@ type ChainParser interface { SetSpec(spec spectypes.Spec) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, blockDistanceForFinalizedData, blocksInFinalizationProof uint32) - GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, collectionData *spectypes.CollectionData, existed bool) + GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, apiCollection *spectypes.ApiCollection, existed bool) CraftMessage(parser *spectypes.ParseDirective, connectionType string, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error) HandleHeaders(metadata []pairingtypes.Metadata, apiCollection *spectypes.ApiCollection, headersDirection spectypes.Header_HeaderType) (filtered []pairingtypes.Metadata, overwriteReqBlock string, ignoredMetadata []pairingtypes.Metadata) GetVerifications(supported []string) ([]VerificationContainer, error) @@ -70,6 +76,7 @@ type ChainParser interface { } type ChainMessage interface { + SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string RequestedBlock() (latest int64, earliest int64) UpdateLatestBlockInMessage(latestBlock int64, modifyContent bool) (modified bool) AppendHeader(metadata []pairingtypes.Metadata) @@ -80,6 +87,7 @@ type ChainMessage interface { GetForceCacheRefresh() bool SetForceCacheRefresh(force bool) bool CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string) + GetRawRequestHash() ([]byte, error) ChainMessageForSend } @@ -89,6 +97,8 @@ type ChainMessageForSend interface { GetApi() *spectypes.Api GetRPCMessage() rpcInterfaceMessages.GenericMessage GetApiCollection() *spectypes.ApiCollection + GetParseDirective() *spectypes.ParseDirective + CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string) } type HealthReporter interface { @@ -106,10 +116,31 @@ type RelaySender interface { analytics *metrics.RelayMetrics, metadataValues []pairingtypes.Metadata, ) (*common.RelayResult, error) + ParseRelay( + ctx context.Context, + url string, + req string, + connectionType string, + dappID string, + consumerIp string, + analytics *metrics.RelayMetrics, + metadata []pairingtypes.Metadata, + ) (ProtocolMessage, error) + SendParsedRelay( + ctx context.Context, + dappID string, + consumerIp string, + analytics *metrics.RelayMetrics, + protocolMessage ProtocolMessage, + ) (relayResult *common.RelayResult, errRet error) + CreateDappKey(dappID, consumerIp string) string + CancelSubscriptionContext(subscriptionKey string) + SetConsistencySeenBlock(blockSeen int64, key string) } type ChainListener interface { Serve(ctx context.Context, cmdFlags common.ConsumerCmdFlags) + GetListeningAddress() string } type ChainRouter interface { diff --git a/protocol/chainlib/chainlib_mock.go b/protocol/chainlib/chainlib_mock.go new file mode 100644 index 0000000000..757c2cd9e0 --- /dev/null +++ b/protocol/chainlib/chainlib_mock.go @@ -0,0 +1,923 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: protocol/chainlib/chainlib.go + +// Package chainlib is a generated GoMock package. +package chainlib + +import ( + context "context" + reflect "reflect" + time "time" + + gomock "github.com/golang/mock/gomock" + rpcInterfaceMessages "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + rpcclient "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + extensionslib "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + common "github.com/lavanet/lava/v2/protocol/common" + metrics "github.com/lavanet/lava/v2/protocol/metrics" + types "github.com/lavanet/lava/v2/x/pairing/types" + types0 "github.com/lavanet/lava/v2/x/spec/types" +) + +// MockChainParser is a mock of ChainParser interface. +type MockChainParser struct { + ctrl *gomock.Controller + recorder *MockChainParserMockRecorder +} + +// MockChainParserMockRecorder is the mock recorder for MockChainParser. +type MockChainParserMockRecorder struct { + mock *MockChainParser +} + +// NewMockChainParser creates a new mock instance. +func NewMockChainParser(ctrl *gomock.Controller) *MockChainParser { + mock := &MockChainParser{ctrl: ctrl} + mock.recorder = &MockChainParserMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChainParser) EXPECT() *MockChainParserMockRecorder { + return m.recorder +} + +// Activate mocks base method. +func (m *MockChainParser) Activate() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Activate") +} + +// Activate indicates an expected call of Activate. +func (mr *MockChainParserMockRecorder) Activate() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Activate", reflect.TypeOf((*MockChainParser)(nil).Activate)) +} + +// Active mocks base method. +func (m *MockChainParser) Active() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Active") + ret0, _ := ret[0].(bool) + return ret0 +} + +// Active indicates an expected call of Active. +func (mr *MockChainParserMockRecorder) Active() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Active", reflect.TypeOf((*MockChainParser)(nil).Active)) +} + +// ChainBlockStats mocks base method. +func (m *MockChainParser) ChainBlockStats() (int64, time.Duration, uint32, uint32) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ChainBlockStats") + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(time.Duration) + ret2, _ := ret[2].(uint32) + ret3, _ := ret[3].(uint32) + return ret0, ret1, ret2, ret3 +} + +// ChainBlockStats indicates an expected call of ChainBlockStats. +func (mr *MockChainParserMockRecorder) ChainBlockStats() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainBlockStats", reflect.TypeOf((*MockChainParser)(nil).ChainBlockStats)) +} + +// CraftMessage mocks base method. +func (m *MockChainParser) CraftMessage(parser *types0.ParseDirective, connectionType string, craftData *CraftData, metadata []types.Metadata) (ChainMessageForSend, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CraftMessage", parser, connectionType, craftData, metadata) + ret0, _ := ret[0].(ChainMessageForSend) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CraftMessage indicates an expected call of CraftMessage. +func (mr *MockChainParserMockRecorder) CraftMessage(parser, connectionType, craftData, metadata interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CraftMessage", reflect.TypeOf((*MockChainParser)(nil).CraftMessage), parser, connectionType, craftData, metadata) +} + +// DataReliabilityParams mocks base method. +func (m *MockChainParser) DataReliabilityParams() (bool, uint32) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DataReliabilityParams") + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(uint32) + return ret0, ret1 +} + +// DataReliabilityParams indicates an expected call of DataReliabilityParams. +func (mr *MockChainParserMockRecorder) DataReliabilityParams() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DataReliabilityParams", reflect.TypeOf((*MockChainParser)(nil).DataReliabilityParams)) +} + +// ExtensionsParser mocks base method. +func (m *MockChainParser) ExtensionsParser() *extensionslib.ExtensionParser { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExtensionsParser") + ret0, _ := ret[0].(*extensionslib.ExtensionParser) + return ret0 +} + +// ExtensionsParser indicates an expected call of ExtensionsParser. +func (mr *MockChainParserMockRecorder) ExtensionsParser() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExtensionsParser", reflect.TypeOf((*MockChainParser)(nil).ExtensionsParser)) +} + +// GetParsingByTag mocks base method. +func (m *MockChainParser) GetParsingByTag(tag types0.FUNCTION_TAG) (*types0.ParseDirective, *types0.ApiCollection, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParsingByTag", tag) + ret0, _ := ret[0].(*types0.ParseDirective) + ret1, _ := ret[1].(*types0.ApiCollection) + ret2, _ := ret[2].(bool) + return ret0, ret1, ret2 +} + +// GetParsingByTag indicates an expected call of GetParsingByTag. +func (mr *MockChainParserMockRecorder) GetParsingByTag(tag interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParsingByTag", reflect.TypeOf((*MockChainParser)(nil).GetParsingByTag), tag) +} + +// GetUniqueName mocks base method. +func (m *MockChainParser) GetUniqueName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUniqueName") + ret0, _ := ret[0].(string) + return ret0 +} + +// GetUniqueName indicates an expected call of GetUniqueName. +func (mr *MockChainParserMockRecorder) GetUniqueName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUniqueName", reflect.TypeOf((*MockChainParser)(nil).GetUniqueName)) +} + +// GetVerifications mocks base method. +func (m *MockChainParser) GetVerifications(supported []string) ([]VerificationContainer, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVerifications", supported) + ret0, _ := ret[0].([]VerificationContainer) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVerifications indicates an expected call of GetVerifications. +func (mr *MockChainParserMockRecorder) GetVerifications(supported interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVerifications", reflect.TypeOf((*MockChainParser)(nil).GetVerifications), supported) +} + +// HandleHeaders mocks base method. +func (m *MockChainParser) HandleHeaders(metadata []types.Metadata, apiCollection *types0.ApiCollection, headersDirection types0.Header_HeaderType) ([]types.Metadata, string, []types.Metadata) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HandleHeaders", metadata, apiCollection, headersDirection) + ret0, _ := ret[0].([]types.Metadata) + ret1, _ := ret[1].(string) + ret2, _ := ret[2].([]types.Metadata) + return ret0, ret1, ret2 +} + +// HandleHeaders indicates an expected call of HandleHeaders. +func (mr *MockChainParserMockRecorder) HandleHeaders(metadata, apiCollection, headersDirection interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleHeaders", reflect.TypeOf((*MockChainParser)(nil).HandleHeaders), metadata, apiCollection, headersDirection) +} + +// ParseMsg mocks base method. +func (m *MockChainParser) ParseMsg(url string, data []byte, connectionType string, metadata []types.Metadata, extensionInfo extensionslib.ExtensionInfo) (ChainMessage, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ParseMsg", url, data, connectionType, metadata, extensionInfo) + ret0, _ := ret[0].(ChainMessage) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ParseMsg indicates an expected call of ParseMsg. +func (mr *MockChainParserMockRecorder) ParseMsg(url, data, connectionType, metadata, extensionInfo interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParseMsg", reflect.TypeOf((*MockChainParser)(nil).ParseMsg), url, data, connectionType, metadata, extensionInfo) +} + +// SeparateAddonsExtensions mocks base method. +func (m *MockChainParser) SeparateAddonsExtensions(supported []string) ([]string, []string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SeparateAddonsExtensions", supported) + ret0, _ := ret[0].([]string) + ret1, _ := ret[1].([]string) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// SeparateAddonsExtensions indicates an expected call of SeparateAddonsExtensions. +func (mr *MockChainParserMockRecorder) SeparateAddonsExtensions(supported interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SeparateAddonsExtensions", reflect.TypeOf((*MockChainParser)(nil).SeparateAddonsExtensions), supported) +} + +// SetPolicy mocks base method. +func (m *MockChainParser) SetPolicy(policy PolicyInf, chainId, apiInterface string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetPolicy", policy, chainId, apiInterface) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetPolicy indicates an expected call of SetPolicy. +func (mr *MockChainParserMockRecorder) SetPolicy(policy, chainId, apiInterface interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPolicy", reflect.TypeOf((*MockChainParser)(nil).SetPolicy), policy, chainId, apiInterface) +} + +// SetSpec mocks base method. +func (m *MockChainParser) SetSpec(spec types0.Spec) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetSpec", spec) +} + +// SetSpec indicates an expected call of SetSpec. +func (mr *MockChainParserMockRecorder) SetSpec(spec interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSpec", reflect.TypeOf((*MockChainParser)(nil).SetSpec), spec) +} + +// UpdateBlockTime mocks base method. +func (m *MockChainParser) UpdateBlockTime(newBlockTime time.Duration) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UpdateBlockTime", newBlockTime) +} + +// UpdateBlockTime indicates an expected call of UpdateBlockTime. +func (mr *MockChainParserMockRecorder) UpdateBlockTime(newBlockTime interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBlockTime", reflect.TypeOf((*MockChainParser)(nil).UpdateBlockTime), newBlockTime) +} + +// MockChainMessage is a mock of ChainMessage interface. +type MockChainMessage struct { + ctrl *gomock.Controller + recorder *MockChainMessageMockRecorder +} + +// MockChainMessageMockRecorder is the mock recorder for MockChainMessage. +type MockChainMessageMockRecorder struct { + mock *MockChainMessage +} + +// NewMockChainMessage creates a new mock instance. +func NewMockChainMessage(ctrl *gomock.Controller) *MockChainMessage { + mock := &MockChainMessage{ctrl: ctrl} + mock.recorder = &MockChainMessageMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChainMessage) EXPECT() *MockChainMessageMockRecorder { + return m.recorder +} + +// AppendHeader mocks base method. +func (m *MockChainMessage) AppendHeader(metadata []types.Metadata) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "AppendHeader", metadata) +} + +// AppendHeader indicates an expected call of AppendHeader. +func (mr *MockChainMessageMockRecorder) AppendHeader(metadata interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppendHeader", reflect.TypeOf((*MockChainMessage)(nil).AppendHeader), metadata) +} + +// CheckResponseError mocks base method. +func (m *MockChainMessage) CheckResponseError(data []byte, httpStatusCode int) (bool, string) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CheckResponseError", data, httpStatusCode) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(string) + return ret0, ret1 +} + +// CheckResponseError indicates an expected call of CheckResponseError. +func (mr *MockChainMessageMockRecorder) CheckResponseError(data, httpStatusCode interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckResponseError", reflect.TypeOf((*MockChainMessage)(nil).CheckResponseError), data, httpStatusCode) +} + +// DisableErrorHandling mocks base method. +func (m *MockChainMessage) DisableErrorHandling() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "DisableErrorHandling") +} + +// DisableErrorHandling indicates an expected call of DisableErrorHandling. +func (mr *MockChainMessageMockRecorder) DisableErrorHandling() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DisableErrorHandling", reflect.TypeOf((*MockChainMessage)(nil).DisableErrorHandling)) +} + +// GetApi mocks base method. +func (m *MockChainMessage) GetApi() *types0.Api { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetApi") + ret0, _ := ret[0].(*types0.Api) + return ret0 +} + +// GetApi indicates an expected call of GetApi. +func (mr *MockChainMessageMockRecorder) GetApi() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApi", reflect.TypeOf((*MockChainMessage)(nil).GetApi)) +} + +// GetApiCollection mocks base method. +func (m *MockChainMessage) GetApiCollection() *types0.ApiCollection { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetApiCollection") + ret0, _ := ret[0].(*types0.ApiCollection) + return ret0 +} + +// GetApiCollection indicates an expected call of GetApiCollection. +func (mr *MockChainMessageMockRecorder) GetApiCollection() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApiCollection", reflect.TypeOf((*MockChainMessage)(nil).GetApiCollection)) +} + +// GetExtensions mocks base method. +func (m *MockChainMessage) GetExtensions() []*types0.Extension { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetExtensions") + ret0, _ := ret[0].([]*types0.Extension) + return ret0 +} + +// GetExtensions indicates an expected call of GetExtensions. +func (mr *MockChainMessageMockRecorder) GetExtensions() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExtensions", reflect.TypeOf((*MockChainMessage)(nil).GetExtensions)) +} + +// GetForceCacheRefresh mocks base method. +func (m *MockChainMessage) GetForceCacheRefresh() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetForceCacheRefresh") + ret0, _ := ret[0].(bool) + return ret0 +} + +// GetForceCacheRefresh indicates an expected call of GetForceCacheRefresh. +func (mr *MockChainMessageMockRecorder) GetForceCacheRefresh() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetForceCacheRefresh", reflect.TypeOf((*MockChainMessage)(nil).GetForceCacheRefresh)) +} + +// GetParseDirective mocks base method. +func (m *MockChainMessage) GetParseDirective() *types0.ParseDirective { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParseDirective") + ret0, _ := ret[0].(*types0.ParseDirective) + return ret0 +} + +// GetParseDirective indicates an expected call of GetParseDirective. +func (mr *MockChainMessageMockRecorder) GetParseDirective() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParseDirective", reflect.TypeOf((*MockChainMessage)(nil).GetParseDirective)) +} + +// GetRPCMessage mocks base method. +func (m *MockChainMessage) GetRPCMessage() rpcInterfaceMessages.GenericMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRPCMessage") + ret0, _ := ret[0].(rpcInterfaceMessages.GenericMessage) + return ret0 +} + +// GetRPCMessage indicates an expected call of GetRPCMessage. +func (mr *MockChainMessageMockRecorder) GetRPCMessage() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRPCMessage", reflect.TypeOf((*MockChainMessage)(nil).GetRPCMessage)) +} + +// GetRawRequestHash mocks base method. +func (m *MockChainMessage) GetRawRequestHash() ([]byte, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRawRequestHash") + ret0, _ := ret[0].([]byte) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRawRequestHash indicates an expected call of GetRawRequestHash. +func (mr *MockChainMessageMockRecorder) GetRawRequestHash() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRawRequestHash", reflect.TypeOf((*MockChainMessage)(nil).GetRawRequestHash)) +} + +// OverrideExtensions mocks base method. +func (m *MockChainMessage) OverrideExtensions(extensionNames []string, extensionParser *extensionslib.ExtensionParser) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "OverrideExtensions", extensionNames, extensionParser) +} + +// OverrideExtensions indicates an expected call of OverrideExtensions. +func (mr *MockChainMessageMockRecorder) OverrideExtensions(extensionNames, extensionParser interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OverrideExtensions", reflect.TypeOf((*MockChainMessage)(nil).OverrideExtensions), extensionNames, extensionParser) +} + +// RequestedBlock mocks base method. +func (m *MockChainMessage) RequestedBlock() (int64, int64) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RequestedBlock") + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(int64) + return ret0, ret1 +} + +// RequestedBlock indicates an expected call of RequestedBlock. +func (mr *MockChainMessageMockRecorder) RequestedBlock() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestedBlock", reflect.TypeOf((*MockChainMessage)(nil).RequestedBlock)) +} + +// SetForceCacheRefresh mocks base method. +func (m *MockChainMessage) SetForceCacheRefresh(force bool) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetForceCacheRefresh", force) + ret0, _ := ret[0].(bool) + return ret0 +} + +// SetForceCacheRefresh indicates an expected call of SetForceCacheRefresh. +func (mr *MockChainMessageMockRecorder) SetForceCacheRefresh(force interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetForceCacheRefresh", reflect.TypeOf((*MockChainMessage)(nil).SetForceCacheRefresh), force) +} + +// SubscriptionIdExtractor mocks base method. +func (m *MockChainMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SubscriptionIdExtractor", reply) + ret0, _ := ret[0].(string) + return ret0 +} + +// SubscriptionIdExtractor indicates an expected call of SubscriptionIdExtractor. +func (mr *MockChainMessageMockRecorder) SubscriptionIdExtractor(reply interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscriptionIdExtractor", reflect.TypeOf((*MockChainMessage)(nil).SubscriptionIdExtractor), reply) +} + +// TimeoutOverride mocks base method. +func (m *MockChainMessage) TimeoutOverride(arg0 ...time.Duration) time.Duration { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range arg0 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "TimeoutOverride", varargs...) + ret0, _ := ret[0].(time.Duration) + return ret0 +} + +// TimeoutOverride indicates an expected call of TimeoutOverride. +func (mr *MockChainMessageMockRecorder) TimeoutOverride(arg0 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TimeoutOverride", reflect.TypeOf((*MockChainMessage)(nil).TimeoutOverride), arg0...) +} + +// UpdateLatestBlockInMessage mocks base method. +func (m *MockChainMessage) UpdateLatestBlockInMessage(latestBlock int64, modifyContent bool) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateLatestBlockInMessage", latestBlock, modifyContent) + ret0, _ := ret[0].(bool) + return ret0 +} + +// UpdateLatestBlockInMessage indicates an expected call of UpdateLatestBlockInMessage. +func (mr *MockChainMessageMockRecorder) UpdateLatestBlockInMessage(latestBlock, modifyContent interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLatestBlockInMessage", reflect.TypeOf((*MockChainMessage)(nil).UpdateLatestBlockInMessage), latestBlock, modifyContent) +} + +// MockChainMessageForSend is a mock of ChainMessageForSend interface. +type MockChainMessageForSend struct { + ctrl *gomock.Controller + recorder *MockChainMessageForSendMockRecorder +} + +// MockChainMessageForSendMockRecorder is the mock recorder for MockChainMessageForSend. +type MockChainMessageForSendMockRecorder struct { + mock *MockChainMessageForSend +} + +// NewMockChainMessageForSend creates a new mock instance. +func NewMockChainMessageForSend(ctrl *gomock.Controller) *MockChainMessageForSend { + mock := &MockChainMessageForSend{ctrl: ctrl} + mock.recorder = &MockChainMessageForSendMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChainMessageForSend) EXPECT() *MockChainMessageForSendMockRecorder { + return m.recorder +} + +// CheckResponseError mocks base method. +func (m *MockChainMessageForSend) CheckResponseError(data []byte, httpStatusCode int) (bool, string) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CheckResponseError", data, httpStatusCode) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(string) + return ret0, ret1 +} + +// CheckResponseError indicates an expected call of CheckResponseError. +func (mr *MockChainMessageForSendMockRecorder) CheckResponseError(data, httpStatusCode interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckResponseError", reflect.TypeOf((*MockChainMessageForSend)(nil).CheckResponseError), data, httpStatusCode) +} + +// GetApi mocks base method. +func (m *MockChainMessageForSend) GetApi() *types0.Api { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetApi") + ret0, _ := ret[0].(*types0.Api) + return ret0 +} + +// GetApi indicates an expected call of GetApi. +func (mr *MockChainMessageForSendMockRecorder) GetApi() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApi", reflect.TypeOf((*MockChainMessageForSend)(nil).GetApi)) +} + +// GetApiCollection mocks base method. +func (m *MockChainMessageForSend) GetApiCollection() *types0.ApiCollection { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetApiCollection") + ret0, _ := ret[0].(*types0.ApiCollection) + return ret0 +} + +// GetApiCollection indicates an expected call of GetApiCollection. +func (mr *MockChainMessageForSendMockRecorder) GetApiCollection() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApiCollection", reflect.TypeOf((*MockChainMessageForSend)(nil).GetApiCollection)) +} + +// GetParseDirective mocks base method. +func (m *MockChainMessageForSend) GetParseDirective() *types0.ParseDirective { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetParseDirective") + ret0, _ := ret[0].(*types0.ParseDirective) + return ret0 +} + +// GetParseDirective indicates an expected call of GetParseDirective. +func (mr *MockChainMessageForSendMockRecorder) GetParseDirective() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParseDirective", reflect.TypeOf((*MockChainMessageForSend)(nil).GetParseDirective)) +} + +// GetRPCMessage mocks base method. +func (m *MockChainMessageForSend) GetRPCMessage() rpcInterfaceMessages.GenericMessage { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRPCMessage") + ret0, _ := ret[0].(rpcInterfaceMessages.GenericMessage) + return ret0 +} + +// GetRPCMessage indicates an expected call of GetRPCMessage. +func (mr *MockChainMessageForSendMockRecorder) GetRPCMessage() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRPCMessage", reflect.TypeOf((*MockChainMessageForSend)(nil).GetRPCMessage)) +} + +// TimeoutOverride mocks base method. +func (m *MockChainMessageForSend) TimeoutOverride(arg0 ...time.Duration) time.Duration { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range arg0 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "TimeoutOverride", varargs...) + ret0, _ := ret[0].(time.Duration) + return ret0 +} + +// TimeoutOverride indicates an expected call of TimeoutOverride. +func (mr *MockChainMessageForSendMockRecorder) TimeoutOverride(arg0 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TimeoutOverride", reflect.TypeOf((*MockChainMessageForSend)(nil).TimeoutOverride), arg0...) +} + +// MockHealthReporter is a mock of HealthReporter interface. +type MockHealthReporter struct { + ctrl *gomock.Controller + recorder *MockHealthReporterMockRecorder +} + +// MockHealthReporterMockRecorder is the mock recorder for MockHealthReporter. +type MockHealthReporterMockRecorder struct { + mock *MockHealthReporter +} + +// NewMockHealthReporter creates a new mock instance. +func NewMockHealthReporter(ctrl *gomock.Controller) *MockHealthReporter { + mock := &MockHealthReporter{ctrl: ctrl} + mock.recorder = &MockHealthReporterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockHealthReporter) EXPECT() *MockHealthReporterMockRecorder { + return m.recorder +} + +// IsHealthy mocks base method. +func (m *MockHealthReporter) IsHealthy() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsHealthy") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsHealthy indicates an expected call of IsHealthy. +func (mr *MockHealthReporterMockRecorder) IsHealthy() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsHealthy", reflect.TypeOf((*MockHealthReporter)(nil).IsHealthy)) +} + +// MockRelaySender is a mock of RelaySender interface. +type MockRelaySender struct { + ctrl *gomock.Controller + recorder *MockRelaySenderMockRecorder +} + +// MockRelaySenderMockRecorder is the mock recorder for MockRelaySender. +type MockRelaySenderMockRecorder struct { + mock *MockRelaySender +} + +// NewMockRelaySender creates a new mock instance. +func NewMockRelaySender(ctrl *gomock.Controller) *MockRelaySender { + mock := &MockRelaySender{ctrl: ctrl} + mock.recorder = &MockRelaySenderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelaySender) EXPECT() *MockRelaySenderMockRecorder { + return m.recorder +} + +// CancelSubscriptionContext mocks base method. +func (m *MockRelaySender) CancelSubscriptionContext(subscriptionKey string) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "CancelSubscriptionContext", subscriptionKey) +} + +// CancelSubscriptionContext indicates an expected call of CancelSubscriptionContext. +func (mr *MockRelaySenderMockRecorder) CancelSubscriptionContext(subscriptionKey interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelSubscriptionContext", reflect.TypeOf((*MockRelaySender)(nil).CancelSubscriptionContext), subscriptionKey) +} + +// CreateDappKey mocks base method. +func (m *MockRelaySender) CreateDappKey(dappID, consumerIp string) string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateDappKey", dappID, consumerIp) + ret0, _ := ret[0].(string) + return ret0 +} + +// CreateDappKey indicates an expected call of CreateDappKey. +func (mr *MockRelaySenderMockRecorder) CreateDappKey(dappID, consumerIp interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDappKey", reflect.TypeOf((*MockRelaySender)(nil).CreateDappKey), dappID, consumerIp) +} + +// ParseRelay mocks base method. +func (m *MockRelaySender) ParseRelay(ctx context.Context, url, req, connectionType, dappID, consumerIp string, analytics *metrics.RelayMetrics, metadata []types.Metadata) (ProtocolMessage, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ParseRelay", ctx, url, req, connectionType, dappID, consumerIp, analytics, metadata) + ret0, _ := ret[0].(ProtocolMessage) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ParseRelay indicates an expected call of ParseRelay. +func (mr *MockRelaySenderMockRecorder) ParseRelay(ctx, url, req, connectionType, dappID, consumerIp, analytics, metadata interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParseRelay", reflect.TypeOf((*MockRelaySender)(nil).ParseRelay), ctx, url, req, connectionType, dappID, consumerIp, analytics, metadata) +} + +// SendParsedRelay mocks base method. +func (m *MockRelaySender) SendParsedRelay(ctx context.Context, dappID, consumerIp string, analytics *metrics.RelayMetrics, protocolMessage ProtocolMessage) (*common.RelayResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendParsedRelay", ctx, dappID, consumerIp, analytics, protocolMessage) + ret0, _ := ret[0].(*common.RelayResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendParsedRelay indicates an expected call of SendParsedRelay. +func (mr *MockRelaySenderMockRecorder) SendParsedRelay(ctx, dappID, consumerIp, analytics, protocolMessage interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendParsedRelay", reflect.TypeOf((*MockRelaySender)(nil).SendParsedRelay), ctx, dappID, consumerIp, analytics, protocolMessage) +} + +// SendRelay mocks base method. +func (m *MockRelaySender) SendRelay(ctx context.Context, url, req, connectionType, dappID, consumerIp string, analytics *metrics.RelayMetrics, metadataValues []types.Metadata) (*common.RelayResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendRelay", ctx, url, req, connectionType, dappID, consumerIp, analytics, metadataValues) + ret0, _ := ret[0].(*common.RelayResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendRelay indicates an expected call of SendRelay. +func (mr *MockRelaySenderMockRecorder) SendRelay(ctx, url, req, connectionType, dappID, consumerIp, analytics, metadataValues interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendRelay", reflect.TypeOf((*MockRelaySender)(nil).SendRelay), ctx, url, req, connectionType, dappID, consumerIp, analytics, metadataValues) +} + +// SetConsistencySeenBlock mocks base method. +func (m *MockRelaySender) SetConsistencySeenBlock(blockSeen int64, key string) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetConsistencySeenBlock", blockSeen, key) +} + +// SetConsistencySeenBlock indicates an expected call of SetConsistencySeenBlock. +func (mr *MockRelaySenderMockRecorder) SetConsistencySeenBlock(blockSeen, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetConsistencySeenBlock", reflect.TypeOf((*MockRelaySender)(nil).SetConsistencySeenBlock), blockSeen, key) +} + +// MockChainListener is a mock of ChainListener interface. +type MockChainListener struct { + ctrl *gomock.Controller + recorder *MockChainListenerMockRecorder +} + +// MockChainListenerMockRecorder is the mock recorder for MockChainListener. +type MockChainListenerMockRecorder struct { + mock *MockChainListener +} + +// NewMockChainListener creates a new mock instance. +func NewMockChainListener(ctrl *gomock.Controller) *MockChainListener { + mock := &MockChainListener{ctrl: ctrl} + mock.recorder = &MockChainListenerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChainListener) EXPECT() *MockChainListenerMockRecorder { + return m.recorder +} + +// GetListeningAddress mocks base method. +func (m *MockChainListener) GetListeningAddress() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListeningAddress") + ret0, _ := ret[0].(string) + return ret0 +} + +// GetListeningAddress indicates an expected call of GetListeningAddress. +func (mr *MockChainListenerMockRecorder) GetListeningAddress() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListeningAddress", reflect.TypeOf((*MockChainListener)(nil).GetListeningAddress)) +} + +// Serve mocks base method. +func (m *MockChainListener) Serve(ctx context.Context, cmdFlags common.ConsumerCmdFlags) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Serve", ctx, cmdFlags) +} + +// Serve indicates an expected call of Serve. +func (mr *MockChainListenerMockRecorder) Serve(ctx, cmdFlags interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Serve", reflect.TypeOf((*MockChainListener)(nil).Serve), ctx, cmdFlags) +} + +// MockChainRouter is a mock of ChainRouter interface. +type MockChainRouter struct { + ctrl *gomock.Controller + recorder *MockChainRouterMockRecorder +} + +// MockChainRouterMockRecorder is the mock recorder for MockChainRouter. +type MockChainRouterMockRecorder struct { + mock *MockChainRouter +} + +// NewMockChainRouter creates a new mock instance. +func NewMockChainRouter(ctrl *gomock.Controller) *MockChainRouter { + mock := &MockChainRouter{ctrl: ctrl} + mock.recorder = &MockChainRouterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChainRouter) EXPECT() *MockChainRouterMockRecorder { + return m.recorder +} + +// ExtensionsSupported mocks base method. +func (m *MockChainRouter) ExtensionsSupported(arg0 []string) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExtensionsSupported", arg0) + ret0, _ := ret[0].(bool) + return ret0 +} + +// ExtensionsSupported indicates an expected call of ExtensionsSupported. +func (mr *MockChainRouterMockRecorder) ExtensionsSupported(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExtensionsSupported", reflect.TypeOf((*MockChainRouter)(nil).ExtensionsSupported), arg0) +} + +// SendNodeMsg mocks base method. +func (m *MockChainRouter) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend, extensions []string) (*RelayReplyWrapper, string, *rpcclient.ClientSubscription, common.NodeUrl, string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendNodeMsg", ctx, ch, chainMessage, extensions) + ret0, _ := ret[0].(*RelayReplyWrapper) + ret1, _ := ret[1].(string) + ret2, _ := ret[2].(*rpcclient.ClientSubscription) + ret3, _ := ret[3].(common.NodeUrl) + ret4, _ := ret[4].(string) + ret5, _ := ret[5].(error) + return ret0, ret1, ret2, ret3, ret4, ret5 +} + +// SendNodeMsg indicates an expected call of SendNodeMsg. +func (mr *MockChainRouterMockRecorder) SendNodeMsg(ctx, ch, chainMessage, extensions interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendNodeMsg", reflect.TypeOf((*MockChainRouter)(nil).SendNodeMsg), ctx, ch, chainMessage, extensions) +} + +// MockChainProxy is a mock of ChainProxy interface. +type MockChainProxy struct { + ctrl *gomock.Controller + recorder *MockChainProxyMockRecorder +} + +// MockChainProxyMockRecorder is the mock recorder for MockChainProxy. +type MockChainProxyMockRecorder struct { + mock *MockChainProxy +} + +// NewMockChainProxy creates a new mock instance. +func NewMockChainProxy(ctrl *gomock.Controller) *MockChainProxy { + mock := &MockChainProxy{ctrl: ctrl} + mock.recorder = &MockChainProxyMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChainProxy) EXPECT() *MockChainProxyMockRecorder { + return m.recorder +} + +// GetChainProxyInformation mocks base method. +func (m *MockChainProxy) GetChainProxyInformation() (common.NodeUrl, string) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChainProxyInformation") + ret0, _ := ret[0].(common.NodeUrl) + ret1, _ := ret[1].(string) + return ret0, ret1 +} + +// GetChainProxyInformation indicates an expected call of GetChainProxyInformation. +func (mr *MockChainProxyMockRecorder) GetChainProxyInformation() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainProxyInformation", reflect.TypeOf((*MockChainProxy)(nil).GetChainProxyInformation)) +} + +// SendNodeMsg mocks base method. +func (m *MockChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend) (*RelayReplyWrapper, string, *rpcclient.ClientSubscription, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendNodeMsg", ctx, ch, chainMessage) + ret0, _ := ret[0].(*RelayReplyWrapper) + ret1, _ := ret[1].(string) + ret2, _ := ret[2].(*rpcclient.ClientSubscription) + ret3, _ := ret[3].(error) + return ret0, ret1, ret2, ret3 +} + +// SendNodeMsg indicates an expected call of SendNodeMsg. +func (mr *MockChainProxyMockRecorder) SendNodeMsg(ctx, ch, chainMessage interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendNodeMsg", reflect.TypeOf((*MockChainProxy)(nil).SendNodeMsg), ctx, ch, chainMessage) +} diff --git a/protocol/chainlib/chainproxy/common.go b/protocol/chainlib/chainproxy/common.go index 4f28de309a..b09f6caa70 100644 --- a/protocol/chainlib/chainproxy/common.go +++ b/protocol/chainlib/chainproxy/common.go @@ -5,9 +5,9 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/protocol/parser" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/parser" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( @@ -89,6 +89,10 @@ func (dri DefaultRPCInput) GetResult() json.RawMessage { return dri.Result } +func (dri DefaultRPCInput) GetID() json.RawMessage { + return nil +} + func (dri DefaultRPCInput) ParseBlock(inp string) (int64, error) { return parser.ParseDefaultBlockParameter(inp) } diff --git a/protocol/chainlib/chainproxy/connector.go b/protocol/chainlib/chainproxy/connector.go index d8be6de67a..3c56f398ba 100644 --- a/protocol/chainlib/chainproxy/connector.go +++ b/protocol/chainlib/chainproxy/connector.go @@ -18,10 +18,10 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" @@ -124,11 +124,12 @@ func (connector *Connector) createConnection(ctx context.Context, nodeUrl common timeout := common.AverageWorldLatency * (1 + time.Duration(numberOfConnectionAttempts)) nctx, cancel := nodeUrl.LowerContextTimeoutWithDuration(ctx, timeout) // add auth path - rpcClient, err = rpcclient.DialContext(nctx, nodeUrl.AuthConfig.AddAuthPath(nodeUrl.Url)) + authPathNodeUrl := nodeUrl.AuthConfig.AddAuthPath(nodeUrl.Url) + rpcClient, err = rpcclient.DialContext(nctx, authPathNodeUrl) if err != nil { utils.LavaFormatWarning("Could not connect to the node, retrying", err, []utils.Attribute{ {Key: "Current Number Of Connections", Value: currentNumberOfConnections}, - {Key: "Network Address", Value: nodeUrl.UrlStr()}, + {Key: "Network Address", Value: authPathNodeUrl}, {Key: "Number Of Attempts", Value: numberOfConnectionAttempts}, {Key: "timeout", Value: timeout}, }...) diff --git a/protocol/chainlib/chainproxy/connector_test.go b/protocol/chainlib/chainproxy/connector_test.go index 36d60c36eb..7b052295e0 100644 --- a/protocol/chainlib/chainproxy/connector_test.go +++ b/protocol/chainlib/chainproxy/connector_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" - pb_pkg "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" + pb_pkg "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/metadata" @@ -70,28 +70,6 @@ func createGRPCServerWithRegisteredProto(t *testing.T) *grpc.Server { return s } -func createRPCServer() net.Listener { - timeserver := new(TimeServer) - // Register the timeserver object upon which the GiveServerTime - // function will be called from the RPC server (from the client) - rpc.Register(timeserver) - // Registers an HTTP handler for RPC messages - rpc.HandleHTTP() - // Start listening for the requests on port 1234 - listener, err := net.Listen("tcp", listenerAddress) - if err != nil { - log.Fatal("Listener error: ", err) - } - listenerAddress = listener.Addr().String() - listenerAddressTcp = "http://" + listenerAddress - // Serve accepts incoming HTTP connections on the listener l, creating - // a new service goroutine for each. The service goroutines read requests - // and then call handler to reply to them - go http.Serve(listener, nil) - - return listener -} - func TestConnector(t *testing.T) { ctx := context.Background() conn, err := NewConnector(ctx, numberOfClients, common.NodeUrl{Url: listenerAddressTcp}) @@ -181,6 +159,28 @@ func TestHashing(t *testing.T) { require.Equal(t, conn.hashedNodeUrl, HashURL(listenerAddressTcp)) } +func createRPCServer() net.Listener { + timeserver := new(TimeServer) + // Register the timeserver object upon which the GiveServerTime + // function will be called from the RPC server (from the client) + rpc.Register(timeserver) + // Registers an HTTP handler for RPC messages + rpc.HandleHTTP() + // Start listening for the requests on port 1234 + listener, err := net.Listen("tcp", listenerAddress) + if err != nil { + log.Fatal("Listener error: ", err) + } + listenerAddress = listener.Addr().String() + listenerAddressTcp = "http://" + listenerAddress + // Serve accepts incoming HTTP connections on the listener l, creating + // a new service goroutine for each. The service goroutines read requests + // and then call handler to reply to them + go http.Serve(listener, nil) + + return listener +} + func TestMain(m *testing.M) { listener := createRPCServer() for { diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go index e20ff49c49..58a6041be1 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/common.go @@ -1,13 +1,16 @@ package rpcInterfaceMessages import ( + sdkerrors "cosmossdk.io/errors" "github.com/goccy/go-json" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/parser" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/parser" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) +var WontCalculateBatchHash = sdkerrors.New("Wont calculate batch hash", 892, "wont calculate batch message hash") // on batches we just wont calculate hashes, meaning we wont retry. + type ParsableRPCInput struct { Result json.RawMessage chainproxy.BaseMessage @@ -29,7 +32,12 @@ func (pri ParsableRPCInput) GetResult() json.RawMessage { return pri.Result } +func (pri ParsableRPCInput) GetID() json.RawMessage { + return nil +} + type GenericMessage interface { GetHeaders() []pairingtypes.Metadata DisableErrorHandling() + GetParams() interface{} } diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go index 00bb6dc664..403f5303f4 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage.go @@ -13,10 +13,13 @@ import ( "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" "github.com/jhump/protoreflect/grpcreflect" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - dyncodec "github.com/lavanet/lava/protocol/chainlib/grpcproxy/dyncodec" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + dyncodec "github.com/lavanet/lava/v2/protocol/chainlib/grpcproxy/dyncodec" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + "google.golang.org/grpc/codes" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/dynamicpb" @@ -33,6 +36,22 @@ type GrpcMessage struct { chainproxy.BaseMessage } +func (gm *GrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + return "" +} + +// get msg hash byte array containing all the relevant information for a unique request. (headers / api / params) +func (gm *GrpcMessage) GetRawRequestHash() ([]byte, error) { + headers := gm.GetHeaders() + headersByteArray, err := json.Marshal(headers) + if err != nil { + utils.LavaFormatError("Failed marshalling headers on jsonRpc message", err, utils.LogAttr("headers", headers)) + return []byte{}, err + } + pathByteArray := []byte(gm.Path) + return sigs.HashMsg(append(append(pathByteArray, gm.Msg...), headersByteArray...)), nil +} + func (jm GrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string) { // grpc status code different than OK or 0 is a node error. if httpStatusCode != 0 && httpStatusCode != http.StatusOK { @@ -103,6 +122,10 @@ func (gm GrpcMessage) GetMethod() string { return gm.Path } +func (gm GrpcMessage) GetID() json.RawMessage { + return nil +} + func (gm GrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error) { msgFactory := dynamic.NewMessageFactoryWithDefaults() if gm.methodDesc == nil { diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go index 6ff7bc9085..bf617df3bd 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/grpcMessage_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go index 8ae01e3dad..416aa7b2eb 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go @@ -6,10 +6,11 @@ import ( "github.com/goccy/go-json" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" ) var ErrFailedToConvertMessage = sdkerrors.New("RPC error", 1000, "failed to convert a message") @@ -24,6 +25,29 @@ type JsonrpcMessage struct { chainproxy.BaseMessage `json:"-"` } +func (jm *JsonrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + return string(reply.Result) +} + +// get msg hash byte array containing all the relevant information for a unique request. (headers / api / params) +func (jm *JsonrpcMessage) GetRawRequestHash() ([]byte, error) { + headers := jm.GetHeaders() + headersByteArray, err := json.Marshal(headers) + if err != nil { + utils.LavaFormatError("Failed marshalling headers on jsonRpc message", err, utils.LogAttr("headers", headers)) + return []byte{}, err + } + + methodByteArray := []byte(jm.Method) + + paramsByteArray, err := json.Marshal(jm.Params) + if err != nil { + utils.LavaFormatError("Failed marshalling params on jsonRpc message", err, utils.LogAttr("headers", jm.Params)) + return []byte{}, err + } + return sigs.HashMsg(append(append(methodByteArray, paramsByteArray...), headersByteArray...)), nil +} + // returns if error exists and func (jm JsonrpcMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string) { result := &JsonrpcMessage{} @@ -86,11 +110,11 @@ func ConvertBatchElement(batchElement rpcclient.BatchElemWithId) (JsonrpcMessage return msg, nil } -func (gm *JsonrpcMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool) { +func (jm *JsonrpcMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool) { return false } -func (gm JsonrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error) { +func (jm JsonrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCInput, error) { msg := &JsonrpcMessage{} err := json.Unmarshal(input, msg) if err != nil { @@ -104,22 +128,26 @@ func (gm JsonrpcMessage) NewParsableRPCInput(input json.RawMessage) (parser.RPCI return ParsableRPCInput{Result: msg.Result}, nil } -func (cp JsonrpcMessage) GetParams() interface{} { - return cp.Params +func (jm JsonrpcMessage) GetParams() interface{} { + return jm.Params } -func (cp JsonrpcMessage) GetMethod() string { - return cp.Method +func (jm JsonrpcMessage) GetMethod() string { + return jm.Method } -func (cp JsonrpcMessage) GetResult() json.RawMessage { - if cp.Error != nil { - utils.LavaFormatWarning("GetResult() Request got an error from the node", nil, utils.Attribute{Key: "error", Value: cp.Error}) +func (jm JsonrpcMessage) GetResult() json.RawMessage { + if jm.Error != nil { + utils.LavaFormatWarning("GetResult() Request got an error from the node", nil, utils.Attribute{Key: "error", Value: jm.Error}) } - return cp.Result + return jm.Result } -func (cp JsonrpcMessage) ParseBlock(inp string) (int64, error) { +func (jm JsonrpcMessage) GetID() json.RawMessage { + return jm.ID +} + +func (jm JsonrpcMessage) ParseBlock(inp string) (int64, error) { return parser.ParseDefaultBlockParameter(inp) } @@ -134,7 +162,7 @@ func ParseJsonRPCMsg(data []byte) (msgRet []JsonrpcMessage, err error) { var batch []JsonrpcMessage errBatch := json.Unmarshal(data, &batch) if errBatch != nil { - // failed parsing both as batch and jsonrpc return the first unmarshal error, unless the first charqacter is "[" + // failed parsing both as batch and jsonrpc return the first unmarshal error, unless the first character is "[" if len(data) > 0 && data[0] == '[' { return nil, errBatch } @@ -142,6 +170,9 @@ func ParseJsonRPCMsg(data []byte) (msgRet []JsonrpcMessage, err error) { } return batch, nil } + if msg.ID == nil { + msg.ID = []byte("null") + } return []JsonrpcMessage{msg}, nil } @@ -150,6 +181,16 @@ type JsonrpcBatchMessage struct { chainproxy.BaseMessage } +func (jbm *JsonrpcBatchMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + return "" +} + +// on batches we don't want to calculate the batch hash as its impossible to get the args +// we will just return false so retry wont trigger. +func (jbm JsonrpcBatchMessage) GetRawRequestHash() ([]byte, error) { + return nil, WontCalculateBatchHash +} + func (jbm *JsonrpcBatchMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool) { return false } @@ -158,6 +199,10 @@ func (jbm *JsonrpcBatchMessage) GetBatch() []rpcclient.BatchElemWithId { return jbm.batch } +func (jbm JsonrpcBatchMessage) GetParams() interface{} { + return [][]byte{} +} + func NewBatchMessage(msgs []JsonrpcMessage) (JsonrpcBatchMessage, error) { batch := make([]rpcclient.BatchElemWithId, len(msgs)) for idx, msg := range msgs { diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go index 43bd7a8260..5adc144b12 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -119,6 +119,18 @@ func TestParseJsonRPCMsg(t *testing.T) { } } +func TestParseJsonRPCMissingId(t *testing.T) { + // Test Case 1: Valid JSON input + data := []byte(`{"jsonrpc": "2.0", "id": nil, "method": "getblock", "params": []}`) + _, err := ParseJsonRPCMsg(data) + require.Error(t, err, err) + + data = []byte(`{"jsonrpc": "2.0", "method": "getblock", "params": []}`) + msg, err := ParseJsonRPCMsg(data) + require.NoError(t, err) + require.Equal(t, json.RawMessage([]byte("null")), msg[0].ID) +} + func TestParseJsonRPCBatch(t *testing.T) { // Test Case 1: Valid JSON input data := []byte(`[{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"},{"method":"eth_accounts","params":[],"id":2,"jsonrpc":"2.0"},{"method":"eth_blockNumber","params":[],"id":3,"jsonrpc":"2.0"}]`) diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go index 1aebe4f073..eda3b0435c 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/restMessage.go @@ -6,9 +6,11 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" ) type RestMessage struct { @@ -18,6 +20,22 @@ type RestMessage struct { chainproxy.BaseMessage } +func (rm *RestMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + return "" +} + +// get msg hash byte array containing all the relevant information for a unique request. (headers / api / params) +func (rm *RestMessage) GetRawRequestHash() ([]byte, error) { + headers := rm.GetHeaders() + headersByteArray, err := json.Marshal(headers) + if err != nil { + utils.LavaFormatError("Failed marshalling headers on jsonRpc message", err, utils.LogAttr("headers", headers)) + return []byte{}, err + } + pathByteArray := []byte(rm.Path) + return sigs.HashMsg(append(append(pathByteArray, rm.Msg...), headersByteArray...)), nil +} + func (jm RestMessage) CheckResponseError(data []byte, httpStatusCode int) (hasError bool, errorMessage string) { if httpStatusCode >= 200 && httpStatusCode <= 300 { // valid code return false, "" @@ -40,13 +58,13 @@ func (jm RestMessage) CheckResponseError(data []byte, httpStatusCode int) (hasEr // GetParams will be deprecated after we remove old client // Currently needed because of parser.RPCInput interface -func (cp RestMessage) GetParams() interface{} { - urlObj, err := url.Parse(cp.Path) +func (rm RestMessage) GetParams() interface{} { + urlObj, err := url.Parse(rm.Path) if err != nil { return nil } parsedMethod := urlObj.Path - objectSpec := strings.Split(cp.SpecPath, "/") + objectSpec := strings.Split(rm.SpecPath, "/") objectPath := strings.Split(parsedMethod, "/") parameters := map[string]interface{}{} @@ -68,22 +86,26 @@ func (cp RestMessage) GetParams() interface{} { func (rm *RestMessage) UpdateLatestBlockInMessage(latestBlock uint64, modifyContent bool) (success bool) { // return rm.SetLatestBlockWithHeader(latestBlock, modifyContent) - // removed until behaviour inconsistency with the cosmos sdk header is solved + // removed until behavior inconsistency with the cosmos sdk header is solved return false // if !done else we need a different setter } // GetResult will be deprecated after we remove old client // Currently needed because of parser.RPCInput interface -func (cp RestMessage) GetResult() json.RawMessage { +func (rm RestMessage) GetResult() json.RawMessage { return nil } -func (cp RestMessage) GetMethod() string { - return cp.Path +func (rm RestMessage) GetMethod() string { + return rm.Path +} + +func (rm RestMessage) GetID() json.RawMessage { + return nil } // ParseBlock parses default block number from string to int -func (cp RestMessage) ParseBlock(inp string) (int64, error) { +func (rm RestMessage) ParseBlock(inp string) (int64, error) { return parser.ParseDefaultBlockParameter(inp) } diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go index efa93c30bf..5a81767acf 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage.go @@ -4,13 +4,14 @@ import ( "fmt" "reflect" + tenderminttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" "github.com/goccy/go-json" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" - tenderminttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils/sigs" ) type TendermintrpcMessage struct { @@ -18,18 +19,45 @@ type TendermintrpcMessage struct { Path string } +func (tm TendermintrpcMessage) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + params, err := json.Marshal(tm.GetParams()) + if err != nil { + utils.LavaFormatWarning("failed marshaling params", err, utils.LogAttr("request", tm)) + return "" + } + return string(params) +} + +// get msg hash byte array containing all the relevant information for a unique request. (headers / api / params) +func (tm *TendermintrpcMessage) GetRawRequestHash() ([]byte, error) { + headers := tm.GetHeaders() + headersByteArray, err := json.Marshal(headers) + if err != nil { + utils.LavaFormatError("Failed marshalling headers on jsonRpc message", err, utils.LogAttr("headers", headers)) + return []byte{}, err + } + methodByteArray := []byte(tm.Method + tm.Path) + + paramsByteArray, err := json.Marshal(tm.Params) + if err != nil { + utils.LavaFormatError("Failed marshalling params on jsonRpc message", err, utils.LogAttr("headers", tm.Params)) + return []byte{}, err + } + return sigs.HashMsg(append(append(methodByteArray, paramsByteArray...), headersByteArray...)), nil +} + func (cp TendermintrpcMessage) GetParams() interface{} { return cp.Params } -func (cp TendermintrpcMessage) GetResult() json.RawMessage { - if cp.Error != nil { - utils.LavaFormatWarning("GetResult() Request got an error from the node", nil, utils.Attribute{Key: "error", Value: cp.Error}) +func (tm TendermintrpcMessage) GetResult() json.RawMessage { + if tm.Error != nil { + utils.LavaFormatWarning("GetResult() Request got an error from the node", nil, utils.Attribute{Key: "error", Value: tm.Error}) } - return cp.Result + return tm.Result } -func (cp TendermintrpcMessage) ParseBlock(inp string) (int64, error) { +func (tm TendermintrpcMessage) ParseBlock(inp string) (int64, error) { return parser.ParseDefaultBlockParameter(inp) } diff --git a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go index 98808d7ba8..df39432718 100644 --- a/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go +++ b/protocol/chainlib/chainproxy/rpcInterfaceMessages/tendermintRPCMessage_test.go @@ -7,7 +7,7 @@ import ( "testing" tenderminttypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/chainproxy/rpcclient/client.go b/protocol/chainlib/chainproxy/rpcclient/client.go index 885e2a6da5..6e4e4c00cd 100644 --- a/protocol/chainlib/chainproxy/rpcclient/client.go +++ b/protocol/chainlib/chainproxy/rpcclient/client.go @@ -29,7 +29,7 @@ import ( "github.com/goccy/go-json" "github.com/ethereum/go-ethereum/log" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) var ( @@ -514,6 +514,11 @@ func (c *Client) Subscribe(ctx context.Context, id json.RawMessage, method strin return nil, nil, err } resp, err := op.wait(ctx, c) + // In the case of response containing the error message, we want to return it to the user as-is + if err != nil && resp != nil && resp.Error != nil { + return nil, resp, nil + } + if err != nil { return nil, nil, err } diff --git a/protocol/chainlib/chainproxy/rpcclient/handler.go b/protocol/chainlib/chainproxy/rpcclient/handler.go index 08ecd0ecac..60f628b5bc 100755 --- a/protocol/chainlib/chainproxy/rpcclient/handler.go +++ b/protocol/chainlib/chainproxy/rpcclient/handler.go @@ -27,7 +27,7 @@ import ( "github.com/goccy/go-json" "github.com/ethereum/go-ethereum/log" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) // handler handles JSON-RPC messages. There is one handler per connection. Note that diff --git a/protocol/chainlib/chainproxy/rpcclient/http.go b/protocol/chainlib/chainproxy/rpcclient/http.go index f340d33a12..b4cf981f55 100755 --- a/protocol/chainlib/chainproxy/rpcclient/http.go +++ b/protocol/chainlib/chainproxy/rpcclient/http.go @@ -31,8 +31,8 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -147,7 +147,7 @@ func DialHTTP(endpoint string) (*Client, error) { func (c *Client) sendHTTP(ctx context.Context, op *requestOp, msg interface{}, isJsonRPC bool, strict bool) error { hc, ok := c.writeConn.(*httpConn) if !ok { - return fmt.Errorf("sendHTTP - c.writeConn.(*httpConn) - type assertion failed" + fmt.Sprintf("%s", c.writeConn)) + return fmt.Errorf("sendHTTP - c.writeConn.(*httpConn) - type assertion failed %s", c.writeConn) } respBody, err := hc.doRequest(ctx, msg, isJsonRPC, strict) if err != nil { @@ -166,7 +166,7 @@ func (c *Client) sendHTTP(ctx context.Context, op *requestOp, msg interface{}, i func (c *Client) sendBatchHTTP(ctx context.Context, op *requestOp, msgs []*JsonrpcMessage, strict bool) error { hc, ok := c.writeConn.(*httpConn) if !ok { - return fmt.Errorf("sendBatchHTTP - c.writeConn.(*httpConn) - type assertion failed, type:" + fmt.Sprintf("%s", c.writeConn)) + return fmt.Errorf("sendBatchHTTP - c.writeConn.(*httpConn) - type assertion failed, type: %s", c.writeConn) } respBody, err := hc.doRequest(ctx, msgs, true, strict) if err != nil { diff --git a/protocol/chainlib/chainproxy/rpcclient/json.go b/protocol/chainlib/chainproxy/rpcclient/json.go index 3a752daad6..9292df8dec 100755 --- a/protocol/chainlib/chainproxy/rpcclient/json.go +++ b/protocol/chainlib/chainproxy/rpcclient/json.go @@ -29,7 +29,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) const ( @@ -146,6 +146,8 @@ type JsonError struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` + Name interface{} `json:"name,omitempty"` + Cause interface{} `json:"cause,omitempty"` } func (err *JsonError) Error() string { diff --git a/protocol/chainlib/chainproxy/rpcclient/service.go b/protocol/chainlib/chainproxy/rpcclient/service.go index 198d944226..78754feb64 100755 --- a/protocol/chainlib/chainproxy/rpcclient/service.go +++ b/protocol/chainlib/chainproxy/rpcclient/service.go @@ -26,7 +26,7 @@ import ( "unicode" "github.com/ethereum/go-ethereum/log" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) var ( @@ -214,7 +214,7 @@ func (c *callback) call(ctx context.Context, method string, args []reflect.Value var ok bool errRet, ok := err.(error) if !ok { - return reflect.Value{}, fmt.Errorf("(c *callback) call - errRet, ok := err.(error) - type assertion failed" + fmt.Sprintf("%s", err)) + return reflect.Value{}, fmt.Errorf("(c *callback) call - errRet, ok := err.(error) - type assertion failed %s", err) } return reflect.Value{}, errRet } diff --git a/protocol/chainlib/chainproxy/rpcclient/subscription.go b/protocol/chainlib/chainproxy/rpcclient/subscription.go index 5ee2d64deb..af9beb8236 100755 --- a/protocol/chainlib/chainproxy/rpcclient/subscription.go +++ b/protocol/chainlib/chainproxy/rpcclient/subscription.go @@ -32,7 +32,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) var ( @@ -340,7 +340,7 @@ func (sub *ClientSubscription) forward() (unsubscribeServer bool, err error) { var ok bool err, ok = recv.Interface().(error) if !ok { - return false, fmt.Errorf("(sub *ClientSubscription) forward() - recv.Interface().(error) - type assertion failed" + fmt.Sprintf("%s", recv.Interface())) + return false, fmt.Errorf("(sub *ClientSubscription) forward() - recv.Interface().(error) - type assertion failed %s", recv.Interface()) } } if err == errUnsubscribed { @@ -352,7 +352,7 @@ func (sub *ClientSubscription) forward() (unsubscribeServer bool, err error) { case 1: // <-sub.in msg, ok := recv.Interface().(*JsonrpcMessage) if !ok { - return false, fmt.Errorf("(sub *ClientSubscription) forward() - recv.Interface().(*JsonrpcMessage) - type assertion failed" + fmt.Sprintf("%s", recv.Interface())) + return false, fmt.Errorf("(sub *ClientSubscription) forward() - recv.Interface().(*JsonrpcMessage) - type assertion failed %s", recv.Interface()) } if msg.Error != nil { return true, err diff --git a/protocol/chainlib/chainproxy/rpcclient/types.go b/protocol/chainlib/chainproxy/rpcclient/types.go index 590e2e83c4..a79a846b26 100755 --- a/protocol/chainlib/chainproxy/rpcclient/types.go +++ b/protocol/chainlib/chainproxy/rpcclient/types.go @@ -27,7 +27,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) // API describes the set of methods offered over the RPC interface diff --git a/protocol/chainlib/chainproxy/rpcclient/utils.go b/protocol/chainlib/chainproxy/rpcclient/utils.go new file mode 100644 index 0000000000..4c7d7abd8c --- /dev/null +++ b/protocol/chainlib/chainproxy/rpcclient/utils.go @@ -0,0 +1,9 @@ +package rpcclient + +import ( + "github.com/lavanet/lava/v2/utils/sigs" +) + +func CreateHashFromParams(params []byte) string { + return string(sigs.HashMsg(params)) +} diff --git a/protocol/chainlib/common.go b/protocol/chainlib/common.go index f60ae4158f..3deaae94bb 100644 --- a/protocol/chainlib/common.go +++ b/protocol/chainlib/common.go @@ -5,20 +5,20 @@ import ( "fmt" "net" "net/http" - "net/url" "strings" "time" + sdkerrors "cosmossdk.io/errors" gojson "github.com/goccy/go-json" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/compress" "github.com/gofiber/fiber/v2/middleware/favicon" "github.com/gofiber/websocket/v2" - common "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + common "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/metadata" ) @@ -30,9 +30,15 @@ const ( relayMsgLogMaxChars = 200 RPCProviderNodeAddressHash = "Lava-Provider-Node-Address-Hash" RPCProviderNodeExtension = "Lava-Provider-Node-Extension" + RpcProviderUniqueIdHeader = "Lava-Provider-Unique-Id" + WebSocketExtension = "websocket" ) -var InvalidResponses = []string{"null", "", "nil", "undefined"} +var ( + InvalidResponses = []string{"null", "", "nil", "undefined"} + FailedSendingSubscriptionToClients = sdkerrors.New("failed Sending Subscription To Clients", 1015, "Failed Sending Subscription To Clients connection might have been closed by the user") + NoActiveSubscriptionFound = sdkerrors.New("failed finding an active subscription on provider side", 1016, "no active subscriptions for hashed params.") +) type RelayReplyWrapper struct { StatusCode int @@ -181,54 +187,24 @@ func addAttributeToError(key, value, errorMessage string) string { return errorMessage + fmt.Sprintf(`, "%v": "%v"`, key, value) } -// rpc default endpoint should be websocket. otherwise return an error -func verifyRPCEndpoint(endpoint string) { - u, err := url.Parse(endpoint) - if err != nil { - utils.LavaFormatFatal("unparsable url", err, utils.Attribute{Key: "url", Value: endpoint}) - } - switch u.Scheme { - case "ws", "wss": - return - default: - utils.LavaFormatWarning("URL scheme should be websocket (ws/wss), got: "+u.Scheme+", By not setting ws/wss your provider wont be able to accept ws subscriptions, therefore might receive less rewards and lower QOS score. if subscriptions are not applicable for this chain you can ignore this warning", nil) - } -} - -// rpc default endpoint should be websocket. otherwise return an error -func verifyTendermintEndpoint(endpoints []common.NodeUrl) (websocketEndpoint, httpEndpoint common.NodeUrl) { +func validateEndpoints(endpoints []common.NodeUrl, apiInterface string) { for _, endpoint := range endpoints { - u, err := url.Parse(endpoint.Url) - if err != nil { - utils.LavaFormatFatal("unparsable url", err, utils.Attribute{Key: "url", Value: endpoint.UrlStr()}) - } - switch u.Scheme { - case "http", "https": - httpEndpoint = endpoint - case "ws", "wss": - websocketEndpoint = endpoint - default: - utils.LavaFormatFatal("URL scheme should be websocket (ws/wss) or (http/https), got: "+u.Scheme, nil) - } - } - - if websocketEndpoint.String() == "" || httpEndpoint.String() == "" { - utils.LavaFormatError("Tendermint Provider was not provided with both http and websocket urls. please provide both", nil, - utils.Attribute{Key: "websocket", Value: websocketEndpoint.String()}, utils.Attribute{Key: "http", Value: httpEndpoint.String()}) - if httpEndpoint.String() != "" { - return httpEndpoint, httpEndpoint - } else { - utils.LavaFormatFatal("Tendermint Provider was not provided with http url. please provide a url that starts with http/https", nil) - } + common.ValidateEndpoint(endpoint.Url, apiInterface) } - return websocketEndpoint, httpEndpoint } -func ListenWithRetry(app *fiber.App, address string) { +func ListenWithRetry(app *fiber.App, address string, chosenAddrCh *common.SafeChannelSender[string]) { for { - err := app.Listen(address) + ln, err := net.Listen("tcp", address) if err != nil { - utils.LavaFormatError("app.Listen(listenAddr)", err) + utils.LavaFormatError("net.Listen(tcp, address)", err, utils.LogAttr("address", address)) + } else { + chosenAddrCh.Send(ln.Addr().String()) + + err = app.Listener(ln) + if err != nil { + utils.LavaFormatError("app.Listen(listenAddr)", err) + } } time.Sleep(RetryListeningInterval * time.Second) } @@ -285,35 +261,48 @@ func convertRelayMetaDataToMDMetaData(md []pairingtypes.Metadata) metadata.MD { // FINALIZED // numeric value (descending) // EARLIEST -func CompareRequestedBlockInBatch(firstRequestedBlock int64, second int64) (latestCombinedBlock int64, earliestCombinedBlock int64) { - if firstRequestedBlock == spectypes.EARLIEST_BLOCK { - return second, firstRequestedBlock - } - if second == spectypes.EARLIEST_BLOCK { - return firstRequestedBlock, second - } +func CompareRequestedBlockInBatch(currentLatestRequestedBlock, currentEarliestRequestedBlock, parsedBlock int64) (latestCombinedBlock int64, earliestCombinedBlock int64) { + latestCallback := func(currentLatest int64, parsedBlock int64) int64 { + if currentLatest < 0 && parsedBlock < 0 { + return utils.Max(currentLatest, parsedBlock) + } - returnBigger := func(in_first int64, in_second int64) (int64, int64) { - if in_first > in_second { - return in_first, in_second + if currentLatest > 0 && parsedBlock < 0 && parsedBlock != spectypes.EARLIEST_BLOCK { + return parsedBlock } - return in_second, in_first - } - if firstRequestedBlock < 0 { - if second < 0 { - // both are negative - return returnBigger(firstRequestedBlock, second) + if currentLatest < 0 && parsedBlock > 0 && currentLatest != spectypes.EARLIEST_BLOCK { + return currentLatest } - // first is negative non earliest second is positive - return firstRequestedBlock, second + + return utils.Max(currentLatest, parsedBlock) } - if second < 0 { - // second is negative non earliest first is positive - return second, firstRequestedBlock + + earliestCallback := func(currentEarliest int64, parsedBlock int64) int64 { + if currentEarliest == spectypes.EARLIEST_BLOCK || parsedBlock == spectypes.EARLIEST_BLOCK { + return spectypes.EARLIEST_BLOCK + } + + if currentEarliest == spectypes.NOT_APPLICABLE || parsedBlock == spectypes.NOT_APPLICABLE { + return spectypes.NOT_APPLICABLE + } + + if currentEarliest < 0 && parsedBlock < 0 { + return utils.Min(currentEarliest, parsedBlock) + } + + if currentEarliest > 0 && parsedBlock < 0 { + return currentEarliest + } + + if currentEarliest < 0 && parsedBlock > 0 { + return parsedBlock + } + + return utils.Min(currentEarliest, parsedBlock) } - // both are positive - return returnBigger(firstRequestedBlock, second) + + return latestCallback(currentLatestRequestedBlock, parsedBlock), earliestCallback(currentEarliestRequestedBlock, parsedBlock) } func GetRelayTimeout(chainMessage ChainMessageForSend, averageBlockTime time.Duration) time.Duration { diff --git a/protocol/chainlib/common_test.go b/protocol/chainlib/common_test.go index 9f8c6680dc..1ac2ab5ff1 100644 --- a/protocol/chainlib/common_test.go +++ b/protocol/chainlib/common_test.go @@ -2,6 +2,7 @@ package chainlib import ( "encoding/json" + "fmt" "io" "net/http/httptest" "testing" @@ -10,9 +11,11 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" websocket2 "github.com/gorilla/websocket" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestMatchSpecApiByName(t *testing.T) { @@ -312,6 +315,14 @@ type mockRPCInput struct { chainproxy.BaseMessage } +func (m *mockRPCInput) SubscriptionIdExtractor(reply *rpcclient.JsonrpcMessage) string { + return "" +} + +func (m *mockRPCInput) GetRawRequestHash() ([]byte, error) { + return nil, fmt.Errorf("test") +} + func (m *mockRPCInput) GetParams() interface{} { return nil } @@ -391,3 +402,121 @@ func TestGetServiceApis(t *testing.T) { t.Errorf("Expected serverApis length to be 3, but got %d", len(serverApis)) } } + +func TestCompareRequestedBlockInBatch(t *testing.T) { + playbook := []struct { + latest int64 + earliest int64 + parsed int64 + expectedLatest int64 + expectedEarliest int64 + }{ + { + latest: spectypes.LATEST_BLOCK, + earliest: spectypes.LATEST_BLOCK, + parsed: spectypes.LATEST_BLOCK, + expectedLatest: spectypes.LATEST_BLOCK, + expectedEarliest: spectypes.LATEST_BLOCK, + }, + { + latest: 10, + earliest: 5, + parsed: 7, + expectedLatest: 10, + expectedEarliest: 5, + }, + { + latest: 10, + earliest: 5, + parsed: 2, + expectedLatest: 10, + expectedEarliest: 2, + }, + { + latest: 10, + earliest: 5, + parsed: 12, + expectedLatest: 12, + expectedEarliest: 5, + }, + { + latest: spectypes.LATEST_BLOCK, + earliest: 5, + parsed: 10, + expectedLatest: spectypes.LATEST_BLOCK, + expectedEarliest: 5, + }, + { + latest: 10, + earliest: 5, + parsed: spectypes.LATEST_BLOCK, + expectedLatest: spectypes.LATEST_BLOCK, + expectedEarliest: 5, + }, + { + latest: 10, + earliest: 5, + parsed: spectypes.LATEST_BLOCK, + expectedLatest: spectypes.LATEST_BLOCK, + expectedEarliest: 5, + }, + { + latest: 10, + earliest: spectypes.EARLIEST_BLOCK, + parsed: 2, + expectedLatest: 10, + expectedEarliest: spectypes.EARLIEST_BLOCK, + }, + { + latest: 10, + earliest: 5, + parsed: spectypes.EARLIEST_BLOCK, + expectedLatest: 10, + expectedEarliest: spectypes.EARLIEST_BLOCK, + }, + { + latest: spectypes.LATEST_BLOCK, + earliest: spectypes.EARLIEST_BLOCK, + parsed: 5, + expectedLatest: spectypes.LATEST_BLOCK, + expectedEarliest: spectypes.EARLIEST_BLOCK, + }, + { + latest: spectypes.EARLIEST_BLOCK, + earliest: spectypes.LATEST_BLOCK, + parsed: 5, + expectedLatest: 5, + expectedEarliest: 5, + }, + { + latest: spectypes.LATEST_BLOCK, + earliest: spectypes.EARLIEST_BLOCK, + parsed: spectypes.NOT_APPLICABLE, + expectedLatest: spectypes.NOT_APPLICABLE, + expectedEarliest: spectypes.EARLIEST_BLOCK, + }, + { + latest: 4, + earliest: spectypes.EARLIEST_BLOCK, + parsed: spectypes.NOT_APPLICABLE, + expectedLatest: spectypes.NOT_APPLICABLE, + expectedEarliest: spectypes.EARLIEST_BLOCK, + }, + { + latest: 4, + earliest: 2, + parsed: spectypes.NOT_APPLICABLE, + expectedLatest: spectypes.NOT_APPLICABLE, + expectedEarliest: spectypes.NOT_APPLICABLE, + }, + } + + for _, test := range playbook { + testName := fmt.Sprintf("latest=%d_earliest=%d_parsed=%d", test.latest, test.earliest, test.parsed) + t.Run(testName, func(t *testing.T) { + latest, earliest := CompareRequestedBlockInBatch(test.latest, test.earliest, test.parsed) + require.Equal(t, test.expectedLatest, latest, "latest") + require.Equal(t, test.expectedEarliest, earliest, "earliest") + }) + } +} diff --git a/protocol/chainlib/common_test_utils.go b/protocol/chainlib/common_test_utils.go index d18e81d49e..1e4db5dc47 100644 --- a/protocol/chainlib/common_test_utils.go +++ b/protocol/chainlib/common_test_utils.go @@ -2,28 +2,33 @@ package chainlib import ( "context" + "fmt" "net" "net/http" "net/http/httptest" "strconv" + "strings" "testing" "time" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" + "github.com/gorilla/websocket" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - testcommon "github.com/lavanet/lava/testutil/common" - keepertest "github.com/lavanet/lava/testutil/keeper" - plantypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + testcommon "github.com/lavanet/lava/v2/testutil/common" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + specutils "github.com/lavanet/lava/v2/utils/keeper" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/metadata" @@ -84,11 +89,45 @@ func generateCombinations(arr []string) [][]string { return append(combinationsWithoutFirst, combinationsWithFirst...) } +func genericWebSocketHandler() http.HandlerFunc { + upGrader := websocket.Upgrader{} + + // Create a simple websocket server that mocks the node + return func(w http.ResponseWriter, r *http.Request) { + conn, err := upGrader.Upgrade(w, r, nil) + if err != nil { + fmt.Println(err) + panic("got error in upgrader") + } + defer conn.Close() + + for { + // Read the request + messageType, message, err := conn.ReadMessage() + if err != nil { + panic("got error in ReadMessage") + } + fmt.Println("got ws message", string(message), messageType) + conn.WriteMessage(messageType, message) + fmt.Println("writing ws message", string(message), messageType) + } + } +} + // generates a chain parser, a chain fetcher messages based on it // apiInterface can either be an ApiInterface string as in spectypes.ApiInterfaceXXX or a number for an index in the apiCollections -func CreateChainLibMocks(ctx context.Context, specIndex string, apiInterface string, serverCallback http.HandlerFunc, getToTopMostPath string, services []string) (cpar ChainParser, crout ChainRouter, cfetc chaintracker.ChainFetcher, closeServer func(), endpointRet *lavasession.RPCProviderEndpoint, errRet error) { +func CreateChainLibMocks( + ctx context.Context, + specIndex string, + apiInterface string, + httpServerCallback http.HandlerFunc, + wsServerCallback http.HandlerFunc, + getToTopMostPath string, + services []string, +) (cpar ChainParser, crout ChainRouter, cfetc chaintracker.ChainFetcher, closeServer func(), endpointRet *lavasession.RPCProviderEndpoint, errRet error) { + utils.SetGlobalLoggingLevel("debug") closeServer = nil - spec, err := keepertest.GetASpec(specIndex, getToTopMostPath, nil, nil) + spec, err := specutils.GetASpec(specIndex, getToTopMostPath, nil, nil) if err != nil { return nil, nil, nil, nil, nil, err } @@ -114,6 +153,14 @@ func CreateChainLibMocks(ctx context.Context, specIndex string, apiInterface str return nil, nil, nil, nil, nil, err } + if httpServerCallback == nil { + httpServerCallback = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) }) + } + + if wsServerCallback == nil { + wsServerCallback = genericWebSocketHandler() + } + if apiInterface == spectypes.APIInterfaceGrpc { // Start a new gRPC server using the buffered connection grpcServer := grpc.NewServer() @@ -127,7 +174,7 @@ func CreateChainLibMocks(ctx context.Context, specIndex string, apiInterface str endpoint.NodeUrls = append(endpoint.NodeUrls, common.NodeUrl{Url: lis.Addr().String(), Addons: append(addons, extensionsList...)}) } go func() { - service := myServiceImplementation{serverCallback: serverCallback} + service := myServiceImplementation{serverCallback: httpServerCallback} tmservice.RegisterServiceServer(grpcServer, service) gogoreflection.Register(grpcServer) // Serve requests on the buffered connection @@ -141,9 +188,17 @@ func CreateChainLibMocks(ctx context.Context, specIndex string, apiInterface str return nil, nil, nil, closeServer, nil, err } } else { - mockServer := httptest.NewServer(serverCallback) - closeServer = mockServer.Close - endpoint.NodeUrls = append(endpoint.NodeUrls, common.NodeUrl{Url: mockServer.URL, Addons: addons}) + var mockWebSocketServer *httptest.Server + var wsUrl string + mockWebSocketServer = httptest.NewServer(wsServerCallback) + wsUrl = "ws" + strings.TrimPrefix(mockWebSocketServer.URL, "http") + mockHttpServer := httptest.NewServer(httpServerCallback) + closeServer = func() { + mockHttpServer.Close() + mockWebSocketServer.Close() + } + endpoint.NodeUrls = append(endpoint.NodeUrls, common.NodeUrl{Url: mockHttpServer.URL, Addons: addons}) + endpoint.NodeUrls = append(endpoint.NodeUrls, common.NodeUrl{Url: wsUrl, Addons: nil}) chainRouter, err = GetChainRouter(ctx, 1, endpoint, chainParser) if err != nil { return nil, nil, nil, closeServer, nil, err @@ -196,7 +251,7 @@ func SetupForTests(t *testing.T, numOfProviders int, specID string, getToTopMost ts.Providers = append(ts.Providers, testcommon.CreateNewAccount(ts.Ctx, *ts.Keepers, balance)) } sdkContext := sdk.UnwrapSDKContext(ts.Ctx) - spec, err := keepertest.GetASpec(specID, getToTopMostPath, &sdkContext, &ts.Keepers.Spec) + spec, err := specutils.GetASpec(specID, getToTopMostPath, &sdkContext, &ts.Keepers.Spec) if err != nil { require.NoError(t, err) } diff --git a/protocol/chainlib/consumer_websocket_manager.go b/protocol/chainlib/consumer_websocket_manager.go new file mode 100644 index 0000000000..75dd3ca1ba --- /dev/null +++ b/protocol/chainlib/consumer_websocket_manager.go @@ -0,0 +1,273 @@ +package chainlib + +import ( + "context" + "strconv" + "time" + + gojson "github.com/goccy/go-json" + "github.com/gofiber/websocket/v2" + formatter "github.com/lavanet/lava/v2/ecosystem/cache/format" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" +) + +type ConsumerWebsocketManager struct { + websocketConn *websocket.Conn + rpcConsumerLogs *metrics.RPCConsumerLogs + cmdFlags common.ConsumerCmdFlags + refererMatchString string + relayMsgLogMaxChars int + chainId string + apiInterface string + connectionType string + refererData *RefererData + relaySender RelaySender + consumerWsSubscriptionManager *ConsumerWSSubscriptionManager + WebsocketConnectionUID string +} + +type ConsumerWebsocketManagerOptions struct { + WebsocketConn *websocket.Conn + RpcConsumerLogs *metrics.RPCConsumerLogs + RefererMatchString string + CmdFlags common.ConsumerCmdFlags + RelayMsgLogMaxChars int + ChainID string + ApiInterface string + ConnectionType string + RefererData *RefererData + RelaySender RelaySender + ConsumerWsSubscriptionManager *ConsumerWSSubscriptionManager + WebsocketConnectionUID string +} + +func NewConsumerWebsocketManager(options ConsumerWebsocketManagerOptions) *ConsumerWebsocketManager { + cwm := &ConsumerWebsocketManager{ + websocketConn: options.WebsocketConn, + relaySender: options.RelaySender, + rpcConsumerLogs: options.RpcConsumerLogs, + cmdFlags: options.CmdFlags, + refererMatchString: options.RefererMatchString, + relayMsgLogMaxChars: options.RelayMsgLogMaxChars, + chainId: options.ChainID, + apiInterface: options.ApiInterface, + connectionType: options.ConnectionType, + refererData: options.RefererData, + consumerWsSubscriptionManager: options.ConsumerWsSubscriptionManager, + WebsocketConnectionUID: options.WebsocketConnectionUID, + } + return cwm +} + +func (cwm *ConsumerWebsocketManager) GetWebSocketConnectionUniqueId(dappId, userIp string) string { + return dappId + "__" + userIp + "__" + cwm.WebsocketConnectionUID +} + +func (cwm *ConsumerWebsocketManager) ListenToMessages() { + var ( + messageType int + msg []byte + err error + ) + + type webSocketMsgWithType struct { + messageType int + msg []byte + } + + websocketConnWriteChan := make(chan webSocketMsgWithType) + + websocketConn := cwm.websocketConn + logger := cwm.rpcConsumerLogs + + webSocketCtx, cancelWebSocketCtx := context.WithCancel(context.Background()) + guid := utils.GenerateUniqueIdentifier() + webSocketCtx = utils.WithUniqueIdentifier(webSocketCtx, guid) + utils.LavaFormatDebug("consumer websocket manager started", utils.LogAttr("GUID", webSocketCtx)) + defer func() { + cancelWebSocketCtx() // In case there's a problem make sure to cancel the connection + utils.LavaFormatDebug("consumer websocket manager stopped", utils.LogAttr("GUID", webSocketCtx)) + }() + + go func() { + for msg := range websocketConnWriteChan { + select { + case <-webSocketCtx.Done(): + utils.LavaFormatTrace("websocket's context cancelled", utils.LogAttr("GUID", webSocketCtx)) + return + default: + err := cwm.websocketConn.WriteMessage(msg.messageType, msg.msg) + if err != nil { + utils.LavaFormatTrace("error writing msg to the websocket") + return + } + } + } + }() + + for { + startTime := time.Now() + msgSeed := logger.GetMessageSeed() + + utils.LavaFormatTrace("listening for new message from the websocket") + + if messageType, msg, err = websocketConn.ReadMessage(); err != nil { + utils.LavaFormatTrace("error reading msg from the websocket, probably websocket was closed by the user", utils.LogAttr("err", err)) + formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), err, msgSeed, msg, cwm.apiInterface, time.Since(startTime)) + if formatterMsg != nil { + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: formatterMsg} + } + break + } + + dappID, ok := websocketConn.Locals("dapp-id").(string) + if !ok { + // Log and remove the analyze + formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), nil, msgSeed, []byte("Unable to extract dappID"), cwm.apiInterface, time.Since(startTime)) + if formatterMsg != nil { + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: formatterMsg} + } + } + + msgSeed = strconv.FormatUint(guid, 10) + userIp := websocketConn.RemoteAddr().String() + + logFormattedMsg := string(msg) + if !cwm.cmdFlags.DebugRelays { + logFormattedMsg = utils.FormatLongString(logFormattedMsg, cwm.relayMsgLogMaxChars) + } + + utils.LavaFormatDebug("ws in <<<", + utils.LogAttr("seed", msgSeed), + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("msg", logFormattedMsg), + utils.LogAttr("dappID", dappID), + ) + + metricsData := metrics.NewRelayAnalytics(dappID, cwm.chainId, cwm.apiInterface) + + protocolMessage, err := cwm.relaySender.ParseRelay(webSocketCtx, "", string(msg), cwm.connectionType, dappID, userIp, metricsData, nil) + if err != nil { + formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), utils.LavaFormatError("could not parse message", err), msgSeed, msg, cwm.apiInterface, time.Since(startTime)) + if formatterMsg != nil { + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: formatterMsg} + } + continue + } + + // check whether its a normal relay / unsubscribe / unsubscribe_all otherwise its a subscription flow. + if !IsFunctionTagOfType(protocolMessage, spectypes.FUNCTION_TAG_SUBSCRIBE) { + if IsFunctionTagOfType(protocolMessage, spectypes.FUNCTION_TAG_UNSUBSCRIBE) { + err := cwm.consumerWsSubscriptionManager.Unsubscribe(webSocketCtx, protocolMessage, dappID, userIp, cwm.WebsocketConnectionUID, metricsData) + if err != nil { + utils.LavaFormatWarning("error unsubscribing from subscription", err, utils.LogAttr("GUID", webSocketCtx)) + if err == common.SubscriptionNotFoundError { + msgData, err := gojson.Marshal(common.JsonRpcSubscriptionNotFoundError) + if err != nil { + continue + } + + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: msgData} + } + } + continue + } else if IsFunctionTagOfType(protocolMessage, spectypes.FUNCTION_TAG_UNSUBSCRIBE_ALL) { + err := cwm.consumerWsSubscriptionManager.UnsubscribeAll(webSocketCtx, dappID, userIp, cwm.WebsocketConnectionUID, metricsData) + if err != nil { + utils.LavaFormatWarning("error unsubscribing from all subscription", err, utils.LogAttr("GUID", webSocketCtx)) + } + continue + } else { + // Normal relay over websocket. (not subscription related) + relayResult, err := cwm.relaySender.SendParsedRelay(webSocketCtx, dappID, userIp, metricsData, protocolMessage) + if err != nil { + formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), utils.LavaFormatError("could not send parsed relay", err), msgSeed, msg, cwm.apiInterface, time.Since(startTime)) + if formatterMsg != nil { + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: formatterMsg} + continue + } + } + + relayResultReply := relayResult.GetReply() + if relayResultReply != nil { + // No need to verify signature since this is already happening inside the SendParsedRelay flow + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: relayResult.GetReply().Data} + continue + } + utils.LavaFormatError("Relay result is nil over websocket normal request flow, should not happen", err, utils.LogAttr("messageType", messageType)) + } + } + + // Subscription flow + inputFormatter, outputFormatter := formatter.FormatterForRelayRequestAndResponse(protocolMessage.GetApiCollection().CollectionData.ApiInterface) // we use this to preserve the original jsonrpc id + inputFormatter(protocolMessage.RelayPrivateData().Data) // set the extracted jsonrpc id + + reply, subscriptionMsgsChan, err := cwm.consumerWsSubscriptionManager.StartSubscription(webSocketCtx, protocolMessage, dappID, userIp, cwm.WebsocketConnectionUID, metricsData) + if err != nil { + utils.LavaFormatWarning("StartSubscription returned an error", err, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("userIp", userIp), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + ) + + formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), utils.LavaFormatError("could not start subscription", err), msgSeed, msg, cwm.apiInterface, time.Since(startTime)) + if formatterMsg != nil { + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: formatterMsg} // No need to use outputFormatter here since we are sending an error + continue + } + + // Handle the case when the error is a method not found error + if common.APINotSupportedError.Is(err) { + msgData, err := gojson.Marshal(common.JsonRpcMethodNotFoundError) + if err != nil { + continue + } + + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: outputFormatter(msgData)} + continue + } + continue + } + + if subscriptionMsgsChan != nil { // if == nil, it means that we already have an active subscription running on this query + go func() { + utils.LavaFormatTrace("created go routine for new websocketSubMsgsChan", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("userIp", userIp), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + ) + + for subscriptionMsgReply := range subscriptionMsgsChan { + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: outputFormatter(subscriptionMsgReply.Data)} + } + + utils.LavaFormatTrace("subscriptionMsgsChan was closed", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("userIp", userIp), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + ) + }() + } + + refererMatch, referrerMatchCastedSuccessfully := websocketConn.Locals(cwm.refererMatchString).(string) + if referrerMatchCastedSuccessfully && refererMatch != "" && cwm.refererData != nil { + go cwm.refererData.SendReferer(refererMatch, cwm.chainId, string(msg), websocketConn.RemoteAddr().String(), nil, websocketConn) + } + + go logger.AddMetricForWebSocket(metricsData, err, websocketConn) + + if reply != nil { + reply.Data = outputFormatter(reply.Data) // use that id for the reply + + websocketConnWriteChan <- webSocketMsgWithType{messageType: messageType, msg: reply.Data} + + logger.LogRequestAndResponse("jsonrpc ws msg", false, "ws", websocketConn.LocalAddr().String(), string(msg), string(reply.Data), msgSeed, time.Since(startTime), nil) + } + } +} diff --git a/protocol/chainlib/consumer_ws_subscription_manager.go b/protocol/chainlib/consumer_ws_subscription_manager.go new file mode 100644 index 0000000000..dda1405573 --- /dev/null +++ b/protocol/chainlib/consumer_ws_subscription_manager.go @@ -0,0 +1,922 @@ +package chainlib + +import ( + "context" + "fmt" + "strconv" + "sync" + + gojson "github.com/goccy/go-json" + rpcclient "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/protocopy" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" +) + +type unsubscribeRelayData struct { + protocolMessage ProtocolMessage +} + +type activeSubscriptionHolder struct { + firstSubscriptionReply *pairingtypes.RelayReply + subscriptionOriginalRequest *pairingtypes.RelayRequest + subscriptionOriginalRequestChainMessage ChainMessage + firstSubscriptionReplyAsJsonrpcMessage *rpcclient.JsonrpcMessage + replyServer pairingtypes.Relayer_RelaySubscribeClient + closeSubscriptionChan chan *unsubscribeRelayData + connectedDappKeys map[string]struct{} // key is dapp key + subscriptionId string +} + +// by using the broadcast manager, we make sure we don't have a race between read and writes and make sure we don't hang for ever +type pendingSubscriptionsBroadcastManager struct { + broadcastChannelList []chan bool +} + +func (psbm *pendingSubscriptionsBroadcastManager) broadcastToChannelList(value bool) { + for _, ch := range psbm.broadcastChannelList { + utils.LavaFormatTrace("broadcastToChannelList Notified pending subscriptions", utils.LogAttr("success", value)) + ch <- value + } +} + +type ConsumerWSSubscriptionManager struct { + connectedDapps map[string]map[string]*common.SafeChannelSender[*pairingtypes.RelayReply] // first key is dapp key, second key is hashed params + activeSubscriptions map[string]*activeSubscriptionHolder // key is params hash + relaySender RelaySender + consumerSessionManager *lavasession.ConsumerSessionManager + chainParser ChainParser + refererData *RefererData + connectionType string + activeSubscriptionProvidersStorage *lavasession.ActiveSubscriptionProvidersStorage + currentlyPendingSubscriptions map[string]*pendingSubscriptionsBroadcastManager + lock sync.RWMutex +} + +func NewConsumerWSSubscriptionManager( + consumerSessionManager *lavasession.ConsumerSessionManager, + relaySender RelaySender, + refererData *RefererData, + connectionType string, + chainParser ChainParser, + activeSubscriptionProvidersStorage *lavasession.ActiveSubscriptionProvidersStorage, +) *ConsumerWSSubscriptionManager { + return &ConsumerWSSubscriptionManager{ + connectedDapps: make(map[string]map[string]*common.SafeChannelSender[*pairingtypes.RelayReply]), + activeSubscriptions: make(map[string]*activeSubscriptionHolder), + currentlyPendingSubscriptions: make(map[string]*pendingSubscriptionsBroadcastManager), + consumerSessionManager: consumerSessionManager, + chainParser: chainParser, + refererData: refererData, + relaySender: relaySender, + connectionType: connectionType, + activeSubscriptionProvidersStorage: activeSubscriptionProvidersStorage, + } +} + +// must be called while locked! +// checking whether hashed params exist in storage, if it does return the subscription stream and indicate it was found. +// otherwise return false +func (cwsm *ConsumerWSSubscriptionManager) checkForActiveSubscriptionAndConnect(webSocketCtx context.Context, hashedParams string, chainMessage ChainMessage, dappKey string, websocketRepliesSafeChannelSender *common.SafeChannelSender[*pairingtypes.RelayReply]) (*pairingtypes.RelayReply, bool) { + activeSubscription, found := cwsm.activeSubscriptions[hashedParams] + if found { + utils.LavaFormatTrace("found active subscription for given params", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", chainMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + + if _, ok := activeSubscription.connectedDappKeys[dappKey]; ok { + utils.LavaFormatTrace("found active subscription for given params and dappKey", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", chainMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + + return activeSubscription.firstSubscriptionReply, true // found and already active + } + + // Add to existing subscription + cwsm.connectDappWithSubscription(dappKey, websocketRepliesSafeChannelSender, hashedParams) + + return activeSubscription.firstSubscriptionReply, false // found and not active, register new. + } + // not found, need to apply new message + return nil, false +} + +func (cwsm *ConsumerWSSubscriptionManager) failedPendingSubscription(hashedParams string) { + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + pendingSubscriptionChannel, ok := cwsm.currentlyPendingSubscriptions[hashedParams] + if !ok { + utils.LavaFormatError("failed fetching hashed params in failedPendingSubscriptions", nil, utils.LogAttr("hash", hashedParams), utils.LogAttr("cwsm.currentlyPendingSubscriptions", cwsm.currentlyPendingSubscriptions)) + } else { + pendingSubscriptionChannel.broadcastToChannelList(false) + delete(cwsm.currentlyPendingSubscriptions, hashedParams) // removed pending + } +} + +// must be called under a lock. +func (cwsm *ConsumerWSSubscriptionManager) successfulPendingSubscription(hashedParams string) { + pendingSubscriptionChannel, ok := cwsm.currentlyPendingSubscriptions[hashedParams] + if !ok { + utils.LavaFormatError("failed fetching hashed params in successfulPendingSubscription", nil, utils.LogAttr("hash", hashedParams), utils.LogAttr("cwsm.currentlyPendingSubscriptions", cwsm.currentlyPendingSubscriptions)) + } else { + pendingSubscriptionChannel.broadcastToChannelList(true) + delete(cwsm.currentlyPendingSubscriptions, hashedParams) // removed pending + } +} + +func (cwsm *ConsumerWSSubscriptionManager) checkAndAddPendingSubscriptionsWithLock(hashedParams string) (chan bool, bool) { + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + pendingSubscriptionBroadcastManager, ok := cwsm.currentlyPendingSubscriptions[hashedParams] + if !ok { + // we didn't find hashed params for pending subscriptions, we can create a new subscription + utils.LavaFormatTrace("No pending subscription for incoming hashed params found", utils.LogAttr("params", hashedParams)) + // create pending subscription broadcast manager for other users to sync on the same relay. + cwsm.currentlyPendingSubscriptions[hashedParams] = &pendingSubscriptionsBroadcastManager{} + return nil, ok + } + utils.LavaFormatTrace("found subscription for incoming hashed params, registering our channel", utils.LogAttr("params", hashedParams)) + // by creating a buffered channel we make sure that we wont miss out on the update between the time we register and listen to the channel + listenChan := make(chan bool, 1) + pendingSubscriptionBroadcastManager.broadcastChannelList = append(pendingSubscriptionBroadcastManager.broadcastChannelList, listenChan) + return listenChan, ok +} + +func (cwsm *ConsumerWSSubscriptionManager) checkForActiveSubscriptionWithLock( + webSocketCtx context.Context, + hashedParams string, + chainMessage ChainMessage, + dappKey string, + websocketRepliesSafeChannelSender *common.SafeChannelSender[*pairingtypes.RelayReply], + closeWebsocketRepliesChannel func(), +) (*pairingtypes.RelayReply, bool) { + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + + firstSubscriptionReply, alreadyActiveSubscription := cwsm.checkForActiveSubscriptionAndConnect( + webSocketCtx, hashedParams, chainMessage, dappKey, websocketRepliesSafeChannelSender, + ) + + if firstSubscriptionReply != nil { + if alreadyActiveSubscription { // same dapp Id, no need for new channel + closeWebsocketRepliesChannel() + return firstSubscriptionReply, false + } + // Added to existing subscriptions with a new dappId. + return firstSubscriptionReply, true + } + + // if we reached here, the subscription is currently not registered, we will need to check again later when we apply the subscription, and + // handle the case where two identical subscriptions were launched at the same time. + return nil, false +} + +func (cwsm *ConsumerWSSubscriptionManager) StartSubscription( + webSocketCtx context.Context, + protocolMessage ProtocolMessage, + dappID string, + consumerIp string, + webSocketConnectionUniqueId string, + metricsData *metrics.RelayMetrics, +) (firstReply *pairingtypes.RelayReply, repliesChan <-chan *pairingtypes.RelayReply, err error) { + hashedParams, _, err := cwsm.getHashedParams(protocolMessage) + if err != nil { + return nil, nil, utils.LavaFormatError("could not marshal params", err) + } + + dappKey := cwsm.CreateWebSocketConnectionUniqueKey(dappID, consumerIp, webSocketConnectionUniqueId) + + utils.LavaFormatTrace("request to start subscription", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("connectedDapps", cwsm.connectedDapps), + ) + + websocketRepliesChan := make(chan *pairingtypes.RelayReply) + websocketRepliesSafeChannelSender := common.NewSafeChannelSender(webSocketCtx, websocketRepliesChan) + + closeWebsocketRepliesChan := make(chan struct{}) + closeWebsocketRepliesChannel := func() { + select { + case closeWebsocketRepliesChan <- struct{}{}: + default: + } + } + + // called after send relay failure or parsing failure afterwards + onSubscriptionFailure := func() { + cwsm.failedPendingSubscription(hashedParams) + closeWebsocketRepliesChannel() + } + + go func() { + <-closeWebsocketRepliesChan + utils.LavaFormatTrace("requested to close websocketRepliesChan", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + + websocketRepliesSafeChannelSender.Close() + }() + + // Remove the websocket from the active subscriptions, when the websocket is closed + go func() { + <-webSocketCtx.Done() + utils.LavaFormatTrace("websocket context is done, removing websocket from active subscriptions", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + + if _, ok := cwsm.connectedDapps[dappKey]; ok { + // The websocket can be closed before the first reply is received, so we need to check if the dapp was even added to the connectedDapps map + cwsm.verifyAndDisconnectDappFromSubscription(webSocketCtx, dappKey, hashedParams, nil) + } + closeWebsocketRepliesChannel() + }() + + // Validated there are no active subscriptions that we can use. + firstSubscriptionReply, returnWebsocketRepliesChan := cwsm.checkForActiveSubscriptionWithLock(webSocketCtx, hashedParams, protocolMessage, dappKey, websocketRepliesSafeChannelSender, closeWebsocketRepliesChannel) + if firstSubscriptionReply != nil { + if returnWebsocketRepliesChan { + return firstSubscriptionReply, websocketRepliesChan, nil + } + return firstSubscriptionReply, nil, nil + } + + // This for loop will break when there is a successful queue lock, allowing us to avoid racing new subscription creation when + // there is a failed subscription. the loop will break for the first routine the manages to lock and create the pendingSubscriptionsBroadcastManager + for { + // Incase there are no active subscriptions, check for pending subscriptions with the same hashed params. + // avoiding having the same subscription twice. + pendingSubscriptionChannel, foundPendingSubscription := cwsm.checkAndAddPendingSubscriptionsWithLock(hashedParams) + if foundPendingSubscription { + utils.LavaFormatTrace("Found pending subscription, waiting for it to complete") + // this is a buffered channel, it wont get stuck even if it is written to before the time we listen + res := <-pendingSubscriptionChannel + utils.LavaFormatTrace("Finished pending for subscription, have results", utils.LogAttr("success", res)) + // Check res is valid, if not fall through logs and try again with a new client. + if res { + firstSubscriptionReply, returnWebsocketRepliesChan := cwsm.checkForActiveSubscriptionWithLock(webSocketCtx, hashedParams, protocolMessage, dappKey, websocketRepliesSafeChannelSender, closeWebsocketRepliesChannel) + if firstSubscriptionReply != nil { + if returnWebsocketRepliesChan { + return firstSubscriptionReply, websocketRepliesChan, nil + } + return firstSubscriptionReply, nil, nil + } + // In case we expected a subscription to return as res != nil we should find an active subscription. + // If we fail to find it, it might have suddenly stopped. we will log a warning and try with a new client. + utils.LavaFormatWarning("failed getting a result when channel indicated we got a successful relay", nil) + } + // Failed the subscription attempt, will retry using current relay. + utils.LavaFormatDebug("Failed the subscription attempt, retrying with the incoming message", utils.LogAttr("hash", hashedParams)) + } else { + utils.LavaFormatDebug("No Pending subscriptions, creating a new one", utils.LogAttr("hash", hashedParams)) + break + } + } + + utils.LavaFormatTrace("could not find active subscription for given params, creating new one", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + + relayResult, err := cwsm.relaySender.SendParsedRelay(webSocketCtx, dappID, consumerIp, metricsData, protocolMessage) + if err != nil { + onSubscriptionFailure() + return nil, nil, utils.LavaFormatError("could not send subscription relay", err) + } + + utils.LavaFormatTrace("got relay result from SendParsedRelay", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("relayResult", relayResult), + ) + + replyServer := relayResult.GetReplyServer() + if replyServer == nil { + // This code should never be reached, but just in case + onSubscriptionFailure() + return nil, nil, utils.LavaFormatError("reply server is nil, probably an error with the subscription initiation", nil, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + } + + reply := *relayResult.Reply + if reply.Data == nil { + onSubscriptionFailure() + return nil, nil, utils.LavaFormatError("Reply data is nil", nil, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + } + + copiedRequest := &pairingtypes.RelayRequest{} + err = protocopy.DeepCopyProtoObject(relayResult.Request, copiedRequest) + if err != nil { + onSubscriptionFailure() + return nil, nil, utils.LavaFormatError("could not copy relay request", err, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + ) + } + + err = cwsm.verifySubscriptionMessage(hashedParams, protocolMessage, relayResult.Request, &reply, relayResult.ProviderInfo.ProviderAddress) + if err != nil { + onSubscriptionFailure() + return nil, nil, utils.LavaFormatError("Failed VerifyRelayReply on subscription message", err, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("reply", string(reply.Data)), + ) + } + + // Parse the reply + var replyJsonrpcMessage rpcclient.JsonrpcMessage + err = gojson.Unmarshal(reply.Data, &replyJsonrpcMessage) + if err != nil { + onSubscriptionFailure() + return nil, nil, utils.LavaFormatError("could not parse reply into json", err, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("reply", reply.Data), + ) + } + + utils.LavaFormatTrace("Adding new subscription", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("dappID", dappID), + utils.LogAttr("consumerIp", consumerIp), + ) + + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + + subscriptionId := protocolMessage.SubscriptionIdExtractor(&replyJsonrpcMessage) + subscriptionId = common.UnSquareBracket(subscriptionId) + if common.IsQuoted(subscriptionId) { + subscriptionId, _ = strconv.Unquote(subscriptionId) + } + + // we don't have a subscription of this hashedParams stored, create a new one. + closeSubscriptionChan := make(chan *unsubscribeRelayData) + cwsm.activeSubscriptions[hashedParams] = &activeSubscriptionHolder{ + firstSubscriptionReply: &reply, + firstSubscriptionReplyAsJsonrpcMessage: &replyJsonrpcMessage, + replyServer: replyServer, + subscriptionOriginalRequest: copiedRequest, + subscriptionOriginalRequestChainMessage: protocolMessage, + closeSubscriptionChan: closeSubscriptionChan, + connectedDappKeys: map[string]struct{}{dappKey: {}}, + subscriptionId: subscriptionId, + } + + providerAddr := relayResult.ProviderInfo.ProviderAddress + cwsm.activeSubscriptionProvidersStorage.AddProvider(providerAddr) + cwsm.connectDappWithSubscription(dappKey, websocketRepliesSafeChannelSender, hashedParams) + // trigger success for other pending subscriptions + cwsm.successfulPendingSubscription(hashedParams) + // Need to be run once for subscription + go cwsm.listenForSubscriptionMessages(webSocketCtx, dappID, consumerIp, replyServer, hashedParams, providerAddr, metricsData, closeSubscriptionChan) + + return &reply, websocketRepliesChan, nil +} + +func (cwsm *ConsumerWSSubscriptionManager) listenForSubscriptionMessages( + webSocketCtx context.Context, + dappID string, + userIp string, + replyServer pairingtypes.Relayer_RelaySubscribeClient, + hashedParams string, + providerAddr string, + metricsData *metrics.RelayMetrics, + closeSubscriptionChan chan *unsubscribeRelayData, +) { + var unsubscribeData *unsubscribeRelayData + + defer func() { + // Only gets here when there is an issue with the connection to the provider or the connection's context is canceled + // Then, we close all active connections with dapps + + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + + utils.LavaFormatTrace("closing all connected dapps for closed subscription connection", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + cwsm.activeSubscriptions[hashedParams].connectedDappKeys = make(map[string]struct{}) // disconnect all dapps at once from active subscription + + // Close all remaining active connections + for _, connectedDapp := range cwsm.connectedDapps { + if _, ok := connectedDapp[hashedParams]; ok { + connectedDapp[hashedParams].Close() + delete(connectedDapp, hashedParams) + } + } + + // we run the unsubscribe flow in an inner function so it wont prevent us from removing the activeSubscriptions at the end. + func() { + var err error + var protocolMessage ProtocolMessage + if unsubscribeData != nil { + // This unsubscribe request was initiated by the user + utils.LavaFormatTrace("unsubscribe request was made by the user", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + protocolMessage = unsubscribeData.protocolMessage + } else { + // This unsubscribe request was initiated by us + utils.LavaFormatTrace("unsubscribe request was made automatically", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + protocolMessage, err = cwsm.craftUnsubscribeMessage(hashedParams, dappID, userIp, metricsData) + if err != nil { + utils.LavaFormatError("could not craft unsubscribe message", err, utils.LogAttr("GUID", webSocketCtx)) + return + } + + stringJson, err := gojson.Marshal(protocolMessage.GetRPCMessage()) + if err != nil { + utils.LavaFormatError("could not marshal chain message", err, utils.LogAttr("GUID", webSocketCtx)) + return + } + + utils.LavaFormatTrace("crafted unsubscribe message to send to the provider", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("chainMessage", string(stringJson)), + ) + } + + unsubscribeRelayCtx := utils.WithUniqueIdentifier(context.Background(), utils.GenerateUniqueIdentifier()) + err = cwsm.sendUnsubscribeMessage(unsubscribeRelayCtx, dappID, userIp, protocolMessage, metricsData) + if err != nil { + utils.LavaFormatError("could not send unsubscribe message due to a relay error", + err, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("relayRequestData", protocolMessage.RelayPrivateData()), + utils.LogAttr("dappID", dappID), + utils.LogAttr("userIp", userIp), + utils.LogAttr("api", protocolMessage.GetApi().Name), + utils.LogAttr("params", protocolMessage.GetRPCMessage().GetParams()), + ) + } else { + utils.LavaFormatTrace("success sending unsubscribe message, deleting hashed params from activeSubscriptions", + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("chainMessage", cwsm.activeSubscriptions), + ) + } + }() + + delete(cwsm.activeSubscriptions, hashedParams) + utils.LavaFormatTrace("after delete") + + cwsm.activeSubscriptionProvidersStorage.RemoveProvider(providerAddr) + utils.LavaFormatTrace("after remove") + cwsm.relaySender.CancelSubscriptionContext(hashedParams) + utils.LavaFormatTrace("after cancel") + }() + + for { + select { + case unsubscribeData = <-closeSubscriptionChan: + utils.LavaFormatTrace("requested to close subscription connection", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + return + case <-replyServer.Context().Done(): + utils.LavaFormatTrace("reply server context canceled", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + return + default: + var reply pairingtypes.RelayReply + err := replyServer.RecvMsg(&reply) + if err != nil { + // The connection was closed by the provider + utils.LavaFormatTrace("error reading from subscription stream", utils.LogAttr("original error", err.Error())) + return + } + err = cwsm.handleIncomingSubscriptionNodeMessage(hashedParams, &reply, providerAddr) + if err != nil { + utils.LavaFormatError("failed handling subscription message", err, + utils.LogAttr("hashedParams", hashedParams), + utils.LogAttr("reply", reply), + ) + return + } + } + } +} + +func (cwsm *ConsumerWSSubscriptionManager) verifySubscriptionMessage(hashedParams string, chainMessage ChainMessage, request *pairingtypes.RelayRequest, reply *pairingtypes.RelayReply, providerAddr string) error { + lavaprotocol.UpdateRequestedBlock(request.RelayData, reply) // update relay request requestedBlock to the provided one in case it was arbitrary + filteredHeaders, _, ignoredHeaders := cwsm.chainParser.HandleHeaders(reply.Metadata, chainMessage.GetApiCollection(), spectypes.Header_pass_reply) + reply.Metadata = filteredHeaders + err := lavaprotocol.VerifyRelayReply(context.Background(), reply, request, providerAddr) + if err != nil { + return utils.LavaFormatError("Failed VerifyRelayReply on subscription message", err, + utils.LogAttr("subscriptionMsg", reply.Data), + utils.LogAttr("hashedParams", hashedParams), + utils.LogAttr("originalRequest", request), + ) + } + + reply.Metadata = append(reply.Metadata, ignoredHeaders...) + return nil +} + +func (cwsm *ConsumerWSSubscriptionManager) handleIncomingSubscriptionNodeMessage(hashedParams string, subscriptionRelayReplyMsg *pairingtypes.RelayReply, providerAddr string) error { + cwsm.lock.RLock() + defer cwsm.lock.RUnlock() + + activeSubscription := cwsm.activeSubscriptions[hashedParams] + // we need to copy the original message because the verify changes the requested block every time. + copiedRequest := &pairingtypes.RelayRequest{} + err := protocopy.DeepCopyProtoObject(activeSubscription.subscriptionOriginalRequest, copiedRequest) + if err != nil { + return utils.LavaFormatError("could not copy relay request", err, + utils.LogAttr("hashedParams", hashedParams), + utils.LogAttr("subscriptionMsg", subscriptionRelayReplyMsg.Data), + utils.LogAttr("providerAddr", providerAddr), + ) + } + + chainMessage := activeSubscription.subscriptionOriginalRequestChainMessage + err = cwsm.verifySubscriptionMessage(hashedParams, chainMessage, copiedRequest, subscriptionRelayReplyMsg, providerAddr) + if err != nil { + // Critical error, we need to close the connection + return utils.LavaFormatError("Failed VerifyRelayReply on subscription message", err, + utils.LogAttr("hashedParams", hashedParams), + utils.LogAttr("subscriptionMsg", subscriptionRelayReplyMsg.Data), + utils.LogAttr("providerAddr", providerAddr), + ) + } + + // message is valid, we can now distribute the message to all active listening users. + for connectedDappKey := range activeSubscription.connectedDappKeys { + if _, ok := cwsm.connectedDapps[connectedDappKey]; !ok { + utils.LavaFormatError("connected dapp not found", nil, + utils.LogAttr("connectedDappKey", connectedDappKey), + utils.LogAttr("hashedParams", hashedParams), + utils.LogAttr("activeSubscriptions[hashedParams].connectedDapps", activeSubscription.connectedDappKeys), + utils.LogAttr("connectedDapps", cwsm.connectedDapps), + ) + continue + } + + if _, ok := cwsm.connectedDapps[connectedDappKey][hashedParams]; !ok { + utils.LavaFormatError("dapp is not connected to subscription", nil, + utils.LogAttr("connectedDappKey", connectedDappKey), + utils.LogAttr("hashedParams", hashedParams), + utils.LogAttr("activeSubscriptions[hashedParams].connectedDapps", activeSubscription.connectedDappKeys), + utils.LogAttr("connectedDapps[connectedDappKey]", cwsm.connectedDapps[connectedDappKey]), + ) + continue + } + // set consistency seen block + cwsm.relaySender.SetConsistencySeenBlock(subscriptionRelayReplyMsg.LatestBlock, connectedDappKey) + // send the reply to the user + cwsm.connectedDapps[connectedDappKey][hashedParams].Send(subscriptionRelayReplyMsg) + } + + return nil +} + +func (cwsm *ConsumerWSSubscriptionManager) getHashedParams(chainMessage ChainMessageForSend) (hashedParams string, params []byte, err error) { + params, err = gojson.Marshal(chainMessage.GetRPCMessage().GetParams()) + if err != nil { + return "", nil, utils.LavaFormatError("could not marshal params", err) + } + + hashedParams = rpcclient.CreateHashFromParams(params) + + return hashedParams, params, nil +} + +func (cwsm *ConsumerWSSubscriptionManager) Unsubscribe(webSocketCtx context.Context, protocolMessage ProtocolMessage, dappID, consumerIp string, webSocketConnectionUniqueId string, metricsData *metrics.RelayMetrics) error { + utils.LavaFormatTrace("want to unsubscribe", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("consumerIp", consumerIp), + utils.LogAttr("webSocketConnectionUniqueId", webSocketConnectionUniqueId), + ) + + dappKey := cwsm.CreateWebSocketConnectionUniqueKey(dappID, consumerIp, webSocketConnectionUniqueId) + + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + hashedParams, err := cwsm.findActiveSubscriptionHashedParamsFromChainMessage(protocolMessage) + if err != nil { + return err + } + return cwsm.verifyAndDisconnectDappFromSubscription(webSocketCtx, dappKey, hashedParams, func() (*unsubscribeRelayData, error) { + return &unsubscribeRelayData{protocolMessage}, nil + }) +} + +func (cwsm *ConsumerWSSubscriptionManager) craftUnsubscribeMessage(hashedParams, dappID, consumerIp string, metricsData *metrics.RelayMetrics) (ProtocolMessage, error) { + request := cwsm.activeSubscriptions[hashedParams].subscriptionOriginalRequestChainMessage + subscriptionId := cwsm.activeSubscriptions[hashedParams].subscriptionId + + // Craft the message data from function template + var unsubscribeRequestData string + var found bool + for _, currParseDirective := range request.GetApiCollection().ParseDirectives { + if currParseDirective.FunctionTag == spectypes.FUNCTION_TAG_UNSUBSCRIBE { + unsubscribeRequestData = fmt.Sprintf(currParseDirective.FunctionTemplate, subscriptionId) + found = true + break + } + } + + if !found { + return nil, utils.LavaFormatError("could not find unsubscribe parse directive for given chain message", nil, + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("subscriptionId", subscriptionId), + ) + } + + if unsubscribeRequestData == "" { + return nil, utils.LavaFormatError("unsubscribe request data is empty", nil, + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("subscriptionId", subscriptionId), + ) + } + + // Craft the unsubscribe chain message + ctx := context.Background() + protocolMessage, err := cwsm.relaySender.ParseRelay(ctx, "", unsubscribeRequestData, cwsm.connectionType, dappID, consumerIp, metricsData, nil) + if err != nil { + return nil, utils.LavaFormatError("could not craft unsubscribe chain message", err, + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("subscriptionId", subscriptionId), + utils.LogAttr("unsubscribeRequestData", unsubscribeRequestData), + utils.LogAttr("cwsm.connectionType", cwsm.connectionType), + ) + } + + return protocolMessage, nil +} + +func (cwsm *ConsumerWSSubscriptionManager) sendUnsubscribeMessage(ctx context.Context, dappID, consumerIp string, protocolMessage ProtocolMessage, metricsData *metrics.RelayMetrics) error { + // Send the crafted unsubscribe relay + utils.LavaFormatTrace("sending unsubscribe relay", + utils.LogAttr("GUID", ctx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("consumerIp", consumerIp), + ) + + _, err := cwsm.relaySender.SendParsedRelay(ctx, dappID, consumerIp, metricsData, protocolMessage) + if err != nil { + return utils.LavaFormatError("could not send unsubscribe relay", err) + } + + return nil +} + +func (cwsm *ConsumerWSSubscriptionManager) connectDappWithSubscription(dappKey string, webSocketChan *common.SafeChannelSender[*pairingtypes.RelayReply], hashedParams string) { + // Must be called under a lock + + // Validate hashedParams is in active subscriptions. + if _, ok := cwsm.activeSubscriptions[hashedParams]; !ok { + utils.LavaFormatError("Failed finding hashed params in connectDappWithSubscription, should never happen", nil, utils.LogAttr("hashedParams", hashedParams), utils.LogAttr("cwsm.activeSubscriptions", cwsm.activeSubscriptions)) + return + } + cwsm.activeSubscriptions[hashedParams].connectedDappKeys[dappKey] = struct{}{} + if _, ok := cwsm.connectedDapps[dappKey]; !ok { + cwsm.connectedDapps[dappKey] = make(map[string]*common.SafeChannelSender[*pairingtypes.RelayReply]) + } + cwsm.connectedDapps[dappKey][hashedParams] = webSocketChan +} + +func (cwsm *ConsumerWSSubscriptionManager) CreateWebSocketConnectionUniqueKey(dappID, consumerIp, webSocketConnectionUniqueId string) string { + return cwsm.relaySender.CreateDappKey(dappID, consumerIp) + "__" + webSocketConnectionUniqueId +} + +func (cwsm *ConsumerWSSubscriptionManager) UnsubscribeAll(webSocketCtx context.Context, dappID, consumerIp string, webSocketConnectionUniqueId string, metricsData *metrics.RelayMetrics) error { + utils.LavaFormatTrace("want to unsubscribe all", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("consumerIp", consumerIp), + ) + + dappKey := cwsm.CreateWebSocketConnectionUniqueKey(dappID, consumerIp, webSocketConnectionUniqueId) + + cwsm.lock.Lock() + defer cwsm.lock.Unlock() + + // Look for active connection + if _, ok := cwsm.connectedDapps[dappKey]; !ok { + return utils.LavaFormatDebug("webSocket has no active subscriptions", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("consumerIp", consumerIp), + ) + } + + for hashedParams := range cwsm.connectedDapps[dappKey] { + utils.LavaFormatTrace("disconnecting dapp from subscription", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappID", dappID), + utils.LogAttr("consumerIp", consumerIp), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + unsubscribeRelayGetter := func() (*unsubscribeRelayData, error) { + protocolMessage, err := cwsm.craftUnsubscribeMessage(hashedParams, dappID, consumerIp, metricsData) + if err != nil { + return nil, err + } + + return &unsubscribeRelayData{protocolMessage}, nil + } + + cwsm.verifyAndDisconnectDappFromSubscription(webSocketCtx, dappKey, hashedParams, unsubscribeRelayGetter) + } + + return nil +} + +func (cwsm *ConsumerWSSubscriptionManager) findActiveSubscriptionHashedParamsFromChainMessage(chainMessage ChainMessage) (string, error) { + // Must be called under lock + + // Extract the subscription id from the chain message + unsubscribeRequestParams, err := gojson.Marshal(chainMessage.GetRPCMessage().GetParams()) + if err != nil { + return "", utils.LavaFormatError("could not marshal params", err, utils.LogAttr("params", chainMessage.GetRPCMessage().GetParams())) + } + + unsubscribeRequestParamsString := string(unsubscribeRequestParams) + + // In JsonRPC, the subscription id is a string, but it is sent in an array + // In Tendermint, the subscription id is the query params, and sent as an object, so skipped + unsubscribeRequestParamsString = common.UnSquareBracket(unsubscribeRequestParamsString) + + if common.IsQuoted(unsubscribeRequestParamsString) { + unsubscribeRequestParamsString, err = strconv.Unquote(unsubscribeRequestParamsString) + if err != nil { + return "", utils.LavaFormatError("could not unquote params", err) + } + } + + for hashesParams, activeSubscription := range cwsm.activeSubscriptions { + if activeSubscription.subscriptionId == unsubscribeRequestParamsString { + return hashesParams, nil + } + } + + utils.LavaFormatDebug("could not find active subscription for given params", utils.LogAttr("params", chainMessage.GetRPCMessage().GetParams())) + + return "", common.SubscriptionNotFoundError +} + +func (cwsm *ConsumerWSSubscriptionManager) verifyAndDisconnectDappFromSubscription( + webSocketCtx context.Context, + dappKey string, + hashedParams string, + unsubscribeRelayDataGetter func() (*unsubscribeRelayData, error), +) error { + // Must be called under lock + if _, ok := cwsm.connectedDapps[dappKey]; !ok { + utils.LavaFormatDebug("webSocket has no active subscriptions", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + return nil + } + + if _, ok := cwsm.connectedDapps[dappKey][hashedParams]; !ok { + utils.LavaFormatDebug("no active subscription found for given dapp", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("cwsm.connectedDapps", cwsm.connectedDapps), + ) + + return nil + } + + if _, ok := cwsm.activeSubscriptions[hashedParams]; !ok { + utils.LavaFormatError("no active subscription found, but the subscription is found in connectedDapps, this should never happen", nil, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + return common.SubscriptionNotFoundError + } + + if _, ok := cwsm.activeSubscriptions[hashedParams].connectedDappKeys[dappKey]; !ok { + utils.LavaFormatError("active subscription found, but the dappKey is not found in it's connectedDapps, this should never happen", nil, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + return common.SubscriptionNotFoundError + } + + cwsm.connectedDapps[dappKey][hashedParams].Close() // close the subscription msgs channel + + delete(cwsm.connectedDapps[dappKey], hashedParams) + utils.LavaFormatTrace("deleted hashedParams from connected dapp's active subscriptions", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("connectedDappActiveSubs", cwsm.connectedDapps[dappKey]), + ) + + if len(cwsm.connectedDapps[dappKey]) == 0 { + delete(cwsm.connectedDapps, dappKey) + utils.LavaFormatTrace("deleted dappKey from connected dapps", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + ) + } + + delete(cwsm.activeSubscriptions[hashedParams].connectedDappKeys, dappKey) + utils.LavaFormatTrace("deleted dappKey from active subscriptions", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("activeSubConnectedDapps", cwsm.activeSubscriptions[hashedParams].connectedDappKeys), + ) + + if len(cwsm.activeSubscriptions[hashedParams].connectedDappKeys) == 0 { + // No more dapps are connected, close the subscription with provider + utils.LavaFormatTrace("no more dapps are connected to subscription, closing subscription", + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + var unsubscribeData *unsubscribeRelayData + + if unsubscribeRelayDataGetter != nil { + var err error + unsubscribeData, err = unsubscribeRelayDataGetter() + if err != nil { + return utils.LavaFormatError("got error from getUnsubscribeRelay function", err, + utils.LogAttr("GUID", webSocketCtx), + utils.LogAttr("dappKey", dappKey), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + } + } + + // Close subscription with provider + go func() { + // In a go routine because the reading routine is also locking on new messages from the node + // So we need to release the lock here, and let the last message be sent, and then the channel will be released + cwsm.activeSubscriptions[hashedParams].closeSubscriptionChan <- unsubscribeData + }() + } + + return nil +} diff --git a/protocol/chainlib/consumer_ws_subscription_manager_test.go b/protocol/chainlib/consumer_ws_subscription_manager_test.go new file mode 100644 index 0000000000..81a59fea87 --- /dev/null +++ b/protocol/chainlib/consumer_ws_subscription_manager_test.go @@ -0,0 +1,721 @@ +package chainlib + +import ( + "context" + "strconv" + "strings" + "sync" + "testing" + "time" + + gomock "github.com/golang/mock/gomock" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + gomockuber "go.uber.org/mock/gomock" +) + +const ( + numberOfParallelSubscriptions = 10 + uniqueId = "1234" +) + +func TestConsumerWSSubscriptionManagerParallelSubscriptionsOnSameDappIdIp(t *testing.T) { + playbook := []struct { + name string + specId string + apiInterface string + connectionType string + subscriptionRequestData1 []byte + subscriptionFirstReply1 []byte + subscriptionRequestData2 []byte + subscriptionFirstReply2 []byte + }{ + { + name: "TendermintRPC", + specId: "LAV1", + apiInterface: spectypes.APIInterfaceTendermintRPC, + connectionType: "", + subscriptionRequestData1: []byte(`{"jsonrpc":"2.0","id":3,"method":"subscribe","params":{"query":"tm.event='NewBlock'"}}`), + subscriptionFirstReply1: []byte(`{"jsonrpc":"2.0","id":3,"result":{}}`), + subscriptionRequestData2: []byte(`{"jsonrpc":"2.0","id":4,"method":"subscribe","params":{"query":"tm.event= 'NewBlock'"}}`), + subscriptionFirstReply2: []byte(`{"jsonrpc":"2.0","id":4,"result":{}}`), + }, + } + + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + ts := SetupForTests(t, 1, play.specId, "../../") + + dapp := "dapp" + ip := "127.0.0.1" + + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + chainParser, _, _, _, _, err := CreateChainLibMocks(ts.Ctx, play.specId, play.apiInterface, nil, nil, "../../", nil) + require.NoError(t, err) + + chainMessage1, err := chainParser.ParseMsg("", play.subscriptionRequestData1, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + protocolMessage1 := NewProtocolMessage(chainMessage1, nil, nil) + relaySender := NewMockRelaySender(ctrl) + relaySender. + EXPECT(). + CreateDappKey(gomock.Any(), gomock.Any()). + DoAndReturn(func(dappID, consumerIp string) string { + return dappID + consumerIp + }). + AnyTimes() + relaySender. + EXPECT(). + SetConsistencySeenBlock(gomock.Any(), gomock.Any()). + AnyTimes() + + relaySender. + EXPECT(). + ParseRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(protocolMessage1, nil). + AnyTimes() + + mockRelayerClient1 := pairingtypes.NewMockRelayer_RelaySubscribeClient(ctrl) + + relayResult1 := &common.RelayResult{ + ReplyServer: mockRelayerClient1, + ProviderInfo: common.ProviderInfo{ + ProviderAddress: ts.Providers[0].Addr.String(), + }, + Reply: &pairingtypes.RelayReply{ + Data: play.subscriptionFirstReply1, + LatestBlock: 1, + }, + Request: &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{ + Data: play.subscriptionRequestData1, + }, + RelaySession: &pairingtypes.RelaySession{}, + }, + } + + relayResult1.Reply, err = lavaprotocol.SignRelayResponse(ts.Consumer.Addr, *relayResult1.Request, ts.Providers[0].SK, relayResult1.Reply, true) + require.NoError(t, err) + + mockRelayerClient1. + EXPECT(). + Context(). + Return(context.Background()). + AnyTimes() + + mockRelayerClient1. + EXPECT(). + RecvMsg(gomock.Any()). + DoAndReturn(func(msg interface{}) error { + relayReply, ok := msg.(*pairingtypes.RelayReply) + require.True(t, ok) + + *relayReply = *relayResult1.Reply + return nil + }). + AnyTimes() + + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(relayResult1, nil). + Times(1) // Should call SendParsedRelay, because it is the first time we subscribe + + consumerSessionManager := CreateConsumerSessionManager(play.specId, play.apiInterface, ts.Consumer.Addr.String()) + + // Create a new ConsumerWSSubscriptionManager + manager := NewConsumerWSSubscriptionManager(consumerSessionManager, relaySender, nil, play.connectionType, chainParser, lavasession.NewActiveSubscriptionProvidersStorage()) + uniqueIdentifiers := make([]string, numberOfParallelSubscriptions) + wg := sync.WaitGroup{} + wg.Add(numberOfParallelSubscriptions) + + // Start a new subscription for the first time, called SendParsedRelay once while in parallel calling 10 times subscribe with the same message + // expected result is to have SendParsedRelay only once and 9 other messages waiting the broadcast. + for i := 0; i < numberOfParallelSubscriptions; i++ { + uniqueIdentifiers[i] = strconv.FormatUint(utils.GenerateUniqueIdentifier(), 10) + // sending + go func(index int) { + ctx := utils.WithUniqueIdentifier(ts.Ctx, utils.GenerateUniqueIdentifier()) + var repliesChan <-chan *pairingtypes.RelayReply + var firstReply *pairingtypes.RelayReply + + firstReply, repliesChan, err = manager.StartSubscription(ctx, protocolMessage1, dapp, ip, uniqueIdentifiers[index], nil) + go func() { + for subMsg := range repliesChan { + // utils.LavaFormatInfo("got reply for index", utils.LogAttr("index", index)) + require.Equal(t, string(play.subscriptionFirstReply1), string(subMsg.Data)) + } + }() + assert.NoError(t, err) + assert.Equal(t, string(play.subscriptionFirstReply1), string(firstReply.Data)) + assert.NotNil(t, repliesChan) + wg.Done() + }(i) + } + wg.Wait() + + // now we have numberOfParallelSubscriptions subscriptions currently running + require.Len(t, manager.connectedDapps, numberOfParallelSubscriptions) + // remove one + err = manager.Unsubscribe(ts.Ctx, protocolMessage1, dapp, ip, uniqueIdentifiers[0], nil) + require.NoError(t, err) + // now we have numberOfParallelSubscriptions - 1 + require.Len(t, manager.connectedDapps, numberOfParallelSubscriptions-1) + // check we still have an active subscription. + require.Len(t, manager.activeSubscriptions, 1) + + // same flow for unsubscribe all + err = manager.UnsubscribeAll(ts.Ctx, dapp, ip, uniqueIdentifiers[1], nil) + require.NoError(t, err) + // now we have numberOfParallelSubscriptions - 2 + require.Len(t, manager.connectedDapps, numberOfParallelSubscriptions-2) + // check we still have an active subscription. + require.Len(t, manager.activeSubscriptions, 1) + }) + } +} + +func TestConsumerWSSubscriptionManagerParallelSubscriptions(t *testing.T) { + playbook := []struct { + name string + specId string + apiInterface string + connectionType string + subscriptionRequestData1 []byte + subscriptionFirstReply1 []byte + subscriptionRequestData2 []byte + subscriptionFirstReply2 []byte + }{ + { + name: "TendermintRPC", + specId: "LAV1", + apiInterface: spectypes.APIInterfaceTendermintRPC, + connectionType: "", + subscriptionRequestData1: []byte(`{"jsonrpc":"2.0","id":3,"method":"subscribe","params":{"query":"tm.event='NewBlock'"}}`), + subscriptionFirstReply1: []byte(`{"jsonrpc":"2.0","id":3,"result":{}}`), + subscriptionRequestData2: []byte(`{"jsonrpc":"2.0","id":4,"method":"subscribe","params":{"query":"tm.event= 'NewBlock'"}}`), + subscriptionFirstReply2: []byte(`{"jsonrpc":"2.0","id":4,"result":{}}`), + }, + } + + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + ts := SetupForTests(t, 1, play.specId, "../../") + + dapp := "dapp" + + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + chainParser, _, _, _, _, err := CreateChainLibMocks(ts.Ctx, play.specId, play.apiInterface, nil, nil, "../../", nil) + require.NoError(t, err) + + chainMessage1, err := chainParser.ParseMsg("", play.subscriptionRequestData1, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + protocolMessage1 := NewProtocolMessage(chainMessage1, nil, nil) + relaySender := NewMockRelaySender(ctrl) + relaySender. + EXPECT(). + CreateDappKey(gomock.Any(), gomock.Any()). + DoAndReturn(func(dappID, consumerIp string) string { + return dappID + consumerIp + }). + AnyTimes() + relaySender. + EXPECT(). + SetConsistencySeenBlock(gomock.Any(), gomock.Any()). + AnyTimes() + + relaySender. + EXPECT(). + ParseRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(protocolMessage1, nil). + AnyTimes() + + mockRelayerClient1 := pairingtypes.NewMockRelayer_RelaySubscribeClient(ctrl) + + relayResult1 := &common.RelayResult{ + ReplyServer: mockRelayerClient1, + ProviderInfo: common.ProviderInfo{ + ProviderAddress: ts.Providers[0].Addr.String(), + }, + Reply: &pairingtypes.RelayReply{ + Data: play.subscriptionFirstReply1, + LatestBlock: 1, + }, + Request: &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{ + Data: play.subscriptionRequestData1, + }, + RelaySession: &pairingtypes.RelaySession{}, + }, + } + + relayResult1.Reply, err = lavaprotocol.SignRelayResponse(ts.Consumer.Addr, *relayResult1.Request, ts.Providers[0].SK, relayResult1.Reply, true) + require.NoError(t, err) + + mockRelayerClient1. + EXPECT(). + Context(). + Return(context.Background()). + AnyTimes() + + mockRelayerClient1. + EXPECT(). + RecvMsg(gomock.Any()). + DoAndReturn(func(msg interface{}) error { + relayReply, ok := msg.(*pairingtypes.RelayReply) + require.True(t, ok) + + *relayReply = *relayResult1.Reply + return nil + }). + AnyTimes() + + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(relayResult1, nil). + Times(1) // Should call SendParsedRelay, because it is the first time we subscribe + + consumerSessionManager := CreateConsumerSessionManager(play.specId, play.apiInterface, ts.Consumer.Addr.String()) + + // Create a new ConsumerWSSubscriptionManager + manager := NewConsumerWSSubscriptionManager(consumerSessionManager, relaySender, nil, play.connectionType, chainParser, lavasession.NewActiveSubscriptionProvidersStorage()) + + wg := sync.WaitGroup{} + wg.Add(10) + // Start a new subscription for the first time, called SendParsedRelay once while in parallel calling 10 times subscribe with the same message + // expected result is to have SendParsedRelay only once and 9 other messages waiting the broadcast. + for i := 0; i < 10; i++ { + // sending + go func(index int) { + ctx := utils.WithUniqueIdentifier(ts.Ctx, utils.GenerateUniqueIdentifier()) + var repliesChan <-chan *pairingtypes.RelayReply + var firstReply *pairingtypes.RelayReply + firstReply, repliesChan, err = manager.StartSubscription(ctx, protocolMessage1, dapp+strconv.Itoa(index), ts.Consumer.Addr.String(), uniqueId, nil) + go func() { + for subMsg := range repliesChan { + require.Equal(t, string(play.subscriptionFirstReply1), string(subMsg.Data)) + } + }() + assert.NoError(t, err) + assert.Equal(t, string(play.subscriptionFirstReply1), string(firstReply.Data)) + assert.NotNil(t, repliesChan) + wg.Done() + }(i) + } + wg.Wait() + }) + } +} + +func TestConsumerWSSubscriptionManager(t *testing.T) { + // This test does the following: + // 1. Create a new ConsumerWSSubscriptionManager + // 2. Start a new subscription for the first time -> should call SendParsedRelay once + // 3. Start a subscription again, same params, same dappKey -> should not call SendParsedRelay + // 4. Start a subscription again, same params, different dappKey -> should not call SendParsedRelay + // 5. Start a new subscription, different params, same dappKey -> should call SendParsedRelay + // 6. Start a subscription again, different params, different dappKey -> should call SendParsedRelay + // 7. Unsubscribe from the first subscription -> should call CancelSubscriptionContext and SendParsedRelay + // 8. Unsubscribe from the second subscription -> should call CancelSubscriptionContext and SendParsedRelay + playbook := []struct { + name string + specId string + apiInterface string + connectionType string + subscriptionRequestData1 []byte + subscriptionId1 string + subscriptionFirstReply1 []byte + unsubscribeMessage1 []byte + subscriptionRequestData2 []byte + subscriptionId2 string + subscriptionFirstReply2 []byte + unsubscribeMessage2 []byte + }{ + { + name: "Lava_TendermintRPC", + specId: "LAV1", + apiInterface: spectypes.APIInterfaceTendermintRPC, + connectionType: "", + + subscriptionRequestData1: []byte(`{"jsonrpc":"2.0","id":3,"method":"subscribe","params":{"query":"tm.event='NewBlock'"}}`), + subscriptionId1: `{"query":"tm.event='NewBlock'"}`, + subscriptionFirstReply1: []byte(`{"jsonrpc":"2.0","id":3,"result":{}}`), + unsubscribeMessage1: []byte(`{"jsonrpc":"2.0","method":"unsubscribe","params":{"query":"tm.event='NewBlock'"},"id":1}`), + + subscriptionRequestData2: []byte(`{"jsonrpc":"2.0","id":4,"method":"subscribe","params":{"query":"tm.event= 'NewBlock'"}}`), + subscriptionId2: `{"query":"tm.event= 'NewBlock'"}`, + subscriptionFirstReply2: []byte(`{"jsonrpc":"2.0","id":4,"result":{}}`), + unsubscribeMessage2: []byte(`{"jsonrpc":"2.0","method":"unsubscribe","params":{"query":"tm.event= 'NewBlock'"},"id":1}`), + }, + { + name: "Ethereum_JsonRPC", + specId: "ETH1", + apiInterface: spectypes.APIInterfaceJsonRPC, + connectionType: "POST", + + subscriptionRequestData1: []byte(`{"jsonrpc":"2.0","id":5,"method":"eth_subscribe","params":["newHeads"]}`), + subscriptionId1: "0x1234567890", + subscriptionFirstReply1: []byte(`{"jsonrpc":"2.0","id":5,"result":["0x1234567890"]}`), + unsubscribeMessage1: []byte(`{"jsonrpc":"2.0","method":"eth_unsubscribe","params":["0x1234567890"],"id":1}`), + + subscriptionRequestData2: []byte(`{"jsonrpc":"2.0","id":6,"method":"eth_subscribe","params":["logs"]}`), + subscriptionId2: "0x2134567890", + subscriptionFirstReply2: []byte(`{"jsonrpc":"2.0","id":6,"result":["0x2134567890"]}`), + unsubscribeMessage2: []byte(`{"jsonrpc":"2.0","method":"eth_unsubscribe","params":["0x2134567890"],"id":1}`), + }, + } + + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + ts := SetupForTests(t, 1, play.specId, "../../") + unsubscribeMessageWg := sync.WaitGroup{} + ctx, cancel := context.WithCancel(ts.Ctx) + defer func() { + cancel() + unsubscribeMessageWg.Wait() + }() + + listenForExpectedMessages := func(ctx context.Context, repliesChan <-chan *pairingtypes.RelayReply, expectedMsg string) { + select { + case <-time.After(5 * time.Second): + require.Fail(t, "Timeout waiting for messages", "Expected message: %s", expectedMsg) + return + case subMsg := <-repliesChan: + require.Equal(t, expectedMsg, string(subMsg.Data)) + case <-ctx.Done(): + return + } + } + + expectNoMoreMessages := func(ctx context.Context, repliesChan <-chan *pairingtypes.RelayReply) { + msgCounter := 0 + select { + case <-ctx.Done(): + return + case <-repliesChan: + msgCounter++ + if msgCounter > 2 { + require.Fail(t, "Unexpected message received") + } + } + } + + dapp1 := "dapp1" + dapp2 := "dapp2" + + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + chainParser, _, _, _, _, err := CreateChainLibMocks(ts.Ctx, play.specId, play.apiInterface, nil, nil, "../../", nil) + require.NoError(t, err) + + unsubscribeChainMessage1, err := chainParser.ParseMsg("", play.unsubscribeMessage1, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + + subscribeChainMessage1, err := chainParser.ParseMsg("", play.subscriptionRequestData1, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + + subscribeProtocolMessage1 := NewProtocolMessage(subscribeChainMessage1, nil, nil) + unsubscribeProtocolMessage1 := NewProtocolMessage(unsubscribeChainMessage1, nil, &pairingtypes.RelayPrivateData{ + Data: play.unsubscribeMessage1, + }) + relaySender := NewMockRelaySender(ctrl) + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomockuber.Cond(func(x any) bool { + protocolMsg, ok := x.(ProtocolMessage) + require.True(t, ok) + require.NotNil(t, protocolMsg) + if protocolMsg.RelayPrivateData() == nil { + return false + } + if strings.Contains(string(protocolMsg.RelayPrivateData().Data), "unsubscribe") { + unsubscribeMessageWg.Done() + } + + // Always return false, because we don't to use this mock's default return for the calls + return false + })). + AnyTimes() + + relaySender. + EXPECT(). + CreateDappKey(gomock.Any(), gomock.Any()). + DoAndReturn(func(dappID, consumerIp string) string { + return dappID + consumerIp + }). + AnyTimes() + + relaySender. + EXPECT(). + SetConsistencySeenBlock(gomock.Any(), gomock.Any()). + AnyTimes() + + relaySender. + EXPECT(). + ParseRelay(gomock.Any(), gomock.Any(), gomockuber.Cond(func(x any) bool { + reqData, ok := x.(string) + require.True(t, ok) + areEqual := reqData == string(play.unsubscribeMessage1) + return areEqual + }), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(unsubscribeProtocolMessage1, nil). + AnyTimes() + + relaySender. + EXPECT(). + ParseRelay(gomock.Any(), gomock.Any(), gomockuber.Cond(func(x any) bool { + reqData, ok := x.(string) + require.True(t, ok) + areEqual := reqData == string(play.subscriptionRequestData1) + return areEqual + }), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(subscribeProtocolMessage1, nil). + AnyTimes() + + mockRelayerClient1 := pairingtypes.NewMockRelayer_RelaySubscribeClient(ctrl) + + relayResult1 := &common.RelayResult{ + ReplyServer: mockRelayerClient1, + ProviderInfo: common.ProviderInfo{ + ProviderAddress: ts.Providers[0].Addr.String(), + }, + Reply: &pairingtypes.RelayReply{ + Data: play.subscriptionFirstReply1, + LatestBlock: 1, + }, + Request: &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{ + Data: play.subscriptionRequestData1, + }, + RelaySession: &pairingtypes.RelaySession{}, + }, + } + + relayResult1.Reply, err = lavaprotocol.SignRelayResponse(ts.Consumer.Addr, *relayResult1.Request, ts.Providers[0].SK, relayResult1.Reply, true) + require.NoError(t, err) + + mockRelayerClient1. + EXPECT(). + Context(). + Return(context.Background()). + AnyTimes() + + mockRelayerClient1. + EXPECT(). + RecvMsg(gomock.Any()). + DoAndReturn(func(msg interface{}) error { + relayReply, ok := msg.(*pairingtypes.RelayReply) + require.True(t, ok) + + *relayReply = *relayResult1.Reply + return nil + }). + AnyTimes() + + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(relayResult1, nil). + Times(1) // Should call SendParsedRelay, because it is the first time we subscribe + + consumerSessionManager := CreateConsumerSessionManager(play.specId, play.apiInterface, ts.Consumer.Addr.String()) + + // Create a new ConsumerWSSubscriptionManager + manager := NewConsumerWSSubscriptionManager(consumerSessionManager, relaySender, nil, play.connectionType, chainParser, lavasession.NewActiveSubscriptionProvidersStorage()) + + // Start a new subscription for the first time, called SendParsedRelay once + ctx = utils.WithUniqueIdentifier(ctx, utils.GenerateUniqueIdentifier()) + + firstReply, repliesChan1, err := manager.StartSubscription(ctx, subscribeProtocolMessage1, dapp1, ts.Consumer.Addr.String(), uniqueId, nil) + assert.NoError(t, err) + unsubscribeMessageWg.Add(1) + assert.Equal(t, string(play.subscriptionFirstReply1), string(firstReply.Data)) + assert.NotNil(t, repliesChan1) + + listenForExpectedMessages(ctx, repliesChan1, string(play.subscriptionFirstReply1)) + + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(relayResult1, nil). + Times(0) // Should not call SendParsedRelay, because it is already subscribed + + // Start a subscription again, same params, same dappKey, should not call SendParsedRelay + ctx = utils.WithUniqueIdentifier(ctx, utils.GenerateUniqueIdentifier()) + firstReply, repliesChan2, err := manager.StartSubscription(ctx, subscribeProtocolMessage1, dapp1, ts.Consumer.Addr.String(), uniqueId, nil) + assert.NoError(t, err) + assert.Equal(t, string(play.subscriptionFirstReply1), string(firstReply.Data)) + assert.Nil(t, repliesChan2) // Same subscription, same dappKey, no need for a new channel + + listenForExpectedMessages(ctx, repliesChan1, string(play.subscriptionFirstReply1)) + + // Start a subscription again, same params, different dappKey, should not call SendParsedRelay + ctx = utils.WithUniqueIdentifier(ctx, utils.GenerateUniqueIdentifier()) + firstReply, repliesChan3, err := manager.StartSubscription(ctx, subscribeProtocolMessage1, dapp2, ts.Consumer.Addr.String(), uniqueId, nil) + assert.NoError(t, err) + assert.Equal(t, string(play.subscriptionFirstReply1), string(firstReply.Data)) + assert.NotNil(t, repliesChan3) // Same subscription, but different dappKey, so will create new channel + + listenForExpectedMessages(ctx, repliesChan1, string(play.subscriptionFirstReply1)) + listenForExpectedMessages(ctx, repliesChan3, string(play.subscriptionFirstReply1)) + + // Prepare for the next subscription + unsubscribeChainMessage2, err := chainParser.ParseMsg("", play.unsubscribeMessage2, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + unsubscribeProtocolMessage2 := NewProtocolMessage(unsubscribeChainMessage2, nil, &pairingtypes.RelayPrivateData{Data: play.unsubscribeMessage2}) + subscribeChainMessage2, err := chainParser.ParseMsg("", play.subscriptionRequestData2, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + subscribeProtocolMessage2 := NewProtocolMessage(subscribeChainMessage2, nil, nil) + relaySender. + EXPECT(). + ParseRelay(gomock.Any(), gomock.Any(), gomockuber.Cond(func(x any) bool { + reqData, ok := x.(string) + require.True(t, ok) + areEqual := reqData == string(play.unsubscribeMessage2) + return areEqual + }), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(unsubscribeProtocolMessage2, nil). + AnyTimes() + + relaySender. + EXPECT(). + ParseRelay(gomock.Any(), gomock.Any(), gomockuber.Cond(func(x any) bool { + reqData, ok := x.(string) + require.True(t, ok) + areEqual := reqData == string(play.subscriptionRequestData2) + return areEqual + }), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(subscribeProtocolMessage2, nil). + AnyTimes() + + mockRelayerClient2 := pairingtypes.NewMockRelayer_RelaySubscribeClient(ctrl) + mockRelayerClient2. + EXPECT(). + Context(). + Return(context.Background()). + AnyTimes() + + relayResult2 := &common.RelayResult{ + ReplyServer: mockRelayerClient2, + ProviderInfo: common.ProviderInfo{ + ProviderAddress: ts.Providers[0].Addr.String(), + }, + Reply: &pairingtypes.RelayReply{ + Data: play.subscriptionFirstReply2, + }, + Request: &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{ + Data: play.subscriptionRequestData2, + }, + RelaySession: &pairingtypes.RelaySession{}, + }, + } + + relayResult2.Reply, err = lavaprotocol.SignRelayResponse(ts.Consumer.Addr, *relayResult2.Request, ts.Providers[0].SK, relayResult2.Reply, true) + require.NoError(t, err) + + mockRelayerClient2. + EXPECT(). + RecvMsg(gomock.Any()). + DoAndReturn(func(msg interface{}) error { + relayReply, ok := msg.(*pairingtypes.RelayReply) + require.True(t, ok) + + *relayReply = *relayResult2.Reply + return nil + }). + AnyTimes() + + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(relayResult2, nil). + Times(1) // Should call SendParsedRelay, because it is the first time we subscribe + + // Start a subscription again, different params, same dappKey, should call SendParsedRelay + ctx = utils.WithUniqueIdentifier(ctx, utils.GenerateUniqueIdentifier()) + + firstReply, repliesChan4, err := manager.StartSubscription(ctx, subscribeProtocolMessage2, dapp1, ts.Consumer.Addr.String(), uniqueId, nil) + assert.NoError(t, err) + unsubscribeMessageWg.Add(1) + assert.Equal(t, string(play.subscriptionFirstReply2), string(firstReply.Data)) + assert.NotNil(t, repliesChan4) // New subscription, new channel + + listenForExpectedMessages(ctx, repliesChan1, string(play.subscriptionFirstReply1)) + listenForExpectedMessages(ctx, repliesChan3, string(play.subscriptionFirstReply1)) + listenForExpectedMessages(ctx, repliesChan4, string(play.subscriptionFirstReply2)) + + // Prepare for unsubscribe from the first subscription + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + Return(relayResult1, nil). + Times(0) // Should call SendParsedRelay, because it unsubscribed + + ctx = utils.WithUniqueIdentifier(ctx, utils.GenerateUniqueIdentifier()) + unsubProtocolMessage := NewProtocolMessage(unsubscribeChainMessage1, nil, relayResult1.Request.RelayData) + err = manager.Unsubscribe(ctx, unsubProtocolMessage, dapp2, ts.Consumer.Addr.String(), uniqueId, nil) + require.NoError(t, err) + + listenForExpectedMessages(ctx, repliesChan1, string(play.subscriptionFirstReply1)) + expectNoMoreMessages(ctx, repliesChan3) + listenForExpectedMessages(ctx, repliesChan4, string(play.subscriptionFirstReply2)) + + wg := sync.WaitGroup{} + wg.Add(2) + + relaySender. + EXPECT(). + CancelSubscriptionContext(gomock.Any()). + AnyTimes() + + // Prepare for unsubscribe from the second subscription + relaySender. + EXPECT(). + SendParsedRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()). + DoAndReturn(func(ctx context.Context, dappID string, consumerIp string, analytics *metrics.RelayMetrics, protocolMessage ProtocolMessage) (relayResult *common.RelayResult, errRet error) { + wg.Done() + return relayResult2, nil + }). + Times(2) // Should call SendParsedRelay, because it unsubscribed + + ctx = utils.WithUniqueIdentifier(ctx, utils.GenerateUniqueIdentifier()) + err = manager.UnsubscribeAll(ctx, dapp1, ts.Consumer.Addr.String(), uniqueId, nil) + require.NoError(t, err) + + expectNoMoreMessages(ctx, repliesChan1) + expectNoMoreMessages(ctx, repliesChan3) + expectNoMoreMessages(ctx, repliesChan4) + + // Because the SendParsedRelay is called in a goroutine, we need to wait for it to finish + wg.Wait() + }) + } +} + +func CreateConsumerSessionManager(chainID, apiInterface, consumerPublicAddress string) *lavasession.ConsumerSessionManager { + rand.InitRandomSeed() + baseLatency := common.AverageWorldLatency / 2 // we want performance to be half our timeout or better + return lavasession.NewConsumerSessionManager( + &lavasession.RPCEndpoint{NetworkAddress: "stub", ChainID: chainID, ApiInterface: apiInterface, TLSEnabled: false, HealthCheckPath: "/", Geolocation: 0}, + provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, 0, baseLatency, 1), + nil, nil, consumerPublicAddress, + lavasession.NewActiveSubscriptionProvidersStorage(), + ) +} diff --git a/protocol/chainlib/extensionslib/archive_parser_rule.go b/protocol/chainlib/extensionslib/archive_parser_rule.go index 624ea99c15..e937d9067a 100644 --- a/protocol/chainlib/extensionslib/archive_parser_rule.go +++ b/protocol/chainlib/extensionslib/archive_parser_rule.go @@ -1,7 +1,7 @@ package extensionslib import ( - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type ArchiveParserRule struct { diff --git a/protocol/chainlib/extensionslib/extension_parser.go b/protocol/chainlib/extensionslib/extension_parser.go index 843c5599a9..91af83f95d 100644 --- a/protocol/chainlib/extensionslib/extension_parser.go +++ b/protocol/chainlib/extensionslib/extension_parser.go @@ -1,7 +1,7 @@ package extensionslib import ( - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type ExtensionInfo struct { @@ -69,7 +69,7 @@ func (ep *ExtensionParser) ExtensionParsing(addon string, extensionsChainMessage continue } extensionParserRule := NewExtensionParserRule(extension) - if extensionParserRule.isPassingRule(extensionsChainMessage, latestBlock) { + if extensionParserRule != nil && extensionParserRule.isPassingRule(extensionsChainMessage, latestBlock) { extensionsChainMessage.SetExtension(extension) } } diff --git a/protocol/chainlib/grpc.go b/protocol/chainlib/grpc.go index 62bf6f3b8c..40aa78178f 100644 --- a/protocol/chainlib/grpc.go +++ b/protocol/chainlib/grpc.go @@ -15,11 +15,11 @@ import ( "github.com/goccy/go-json" "github.com/gogo/protobuf/jsonpb" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/chainlib/grpcproxy" - dyncodec "github.com/lavanet/lava/protocol/chainlib/grpcproxy/dyncodec" - "github.com/lavanet/lava/protocol/parser" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/chainlib/grpcproxy" + dyncodec "github.com/lavanet/lava/v2/protocol/chainlib/grpcproxy/dyncodec" + "github.com/lavanet/lava/v2/protocol/parser" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -30,15 +30,15 @@ import ( "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" "github.com/jhump/protoreflect/grpcreflect" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" reflectionpbo "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" "google.golang.org/grpc/status" ) @@ -135,7 +135,7 @@ func (apip *GrpcChainParser) CraftMessage(parsing *spectypes.ParseDirective, con if err != nil { return nil, err } - return apip.newChainMessage(apiCont.api, spectypes.NOT_APPLICABLE, grpcMessage, apiCollection), nil + return apip.newChainMessage(apiCont.api, spectypes.NOT_APPLICABLE, nil, grpcMessage, apiCollection), nil } // ParseMsg parses message data into chain message object @@ -172,39 +172,39 @@ func (apip *GrpcChainParser) ParseMsg(url string, data []byte, connectionType st // // Fetch requested block, it is used for data reliability // // Extract default block parser - blockParser := apiCont.api.BlockParsing - var requestedBlock int64 + api := apiCont.api + parsedInput := parser.NewParsedInput() if overwriteReqBlock == "" { - requestedBlock, err = parser.ParseBlockFromParams(grpcMessage, blockParser) + parsedInput = parser.ParseBlockFromParams(grpcMessage, api.BlockParsing, api.Parsers) + } else { + parsedBlock, err := grpcMessage.ParseBlock(overwriteReqBlock) + parsedInput.SetBlock(parsedBlock) if err != nil { - utils.LavaFormatError("ParseBlockFromParams failed parsing block", err, + utils.LavaFormatError("failed parsing block from an overwrite header", err, utils.LogAttr("chain", apip.spec.Name), - utils.LogAttr("blockParsing", apiCont.api.BlockParsing), - utils.LogAttr("apiName", apiCont.api.Name), - utils.LogAttr("connectionType", "grpc"), + utils.LogAttr("overwriteRequestedBlock", overwriteReqBlock), ) - requestedBlock = spectypes.NOT_APPLICABLE - } - } else { - requestedBlock, err = grpcMessage.ParseBlock(overwriteReqBlock) - if err != nil { - utils.LavaFormatError("failed parsing block from an overwrite header", err, utils.Attribute{Key: "chain", Value: apip.spec.Name}, utils.Attribute{Key: "overwriteRequestedBlock", Value: overwriteReqBlock}) - requestedBlock = spectypes.NOT_APPLICABLE + parsedInput.SetBlock(spectypes.NOT_APPLICABLE) } } - nodeMsg := apip.newChainMessage(apiCont.api, requestedBlock, &grpcMessage, apiCollection) + parsedBlock := parsedInput.GetBlock() + blockHashes, _ := parsedInput.GetBlockHashes() + + nodeMsg := apip.newChainMessage(apiCont.api, parsedBlock, blockHashes, &grpcMessage, apiCollection) apip.BaseChainParser.ExtensionParsing(apiCollection.CollectionData.AddOn, nodeMsg, extensionInfo) return nodeMsg, apip.BaseChainParser.Validate(nodeMsg) } -func (*GrpcChainParser) newChainMessage(api *spectypes.Api, requestedBlock int64, grpcMessage *rpcInterfaceMessages.GrpcMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { +func (*GrpcChainParser) newChainMessage(api *spectypes.Api, requestedBlock int64, requestedHashes []string, grpcMessage *rpcInterfaceMessages.GrpcMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { nodeMsg := &baseChainMessageContainer{ api: api, msg: grpcMessage, // setting the grpc message as a pointer so we can set descriptors for parsing latestRequestedBlock: requestedBlock, + requestedBlockHashes: requestedHashes, apiCollection: apiCollection, resultErrorParsingMethod: grpcMessage.CheckResponseError, + parseDirective: GetParseDirective(api, apiCollection), } return nodeMsg } @@ -260,12 +260,13 @@ func (apip *GrpcChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, } type GrpcChainListener struct { - endpoint *lavasession.RPCEndpoint - relaySender RelaySender - logger *metrics.RPCConsumerLogs - chainParser *GrpcChainParser - healthReporter HealthReporter - refererData *RefererData + endpoint *lavasession.RPCEndpoint + relaySender RelaySender + logger *metrics.RPCConsumerLogs + chainParser *GrpcChainParser + healthReporter HealthReporter + refererData *RefererData + listeningAddress string } func NewGrpcChainListener( @@ -279,12 +280,12 @@ func NewGrpcChainListener( ) (chainListener *GrpcChainListener) { // Create a new instance of GrpcChainListener chainListener = &GrpcChainListener{ - listenEndpoint, - relaySender, - rpcConsumerLogs, - chainParser.(*GrpcChainParser), - healthReporter, - refererData, + endpoint: listenEndpoint, + relaySender: relaySender, + logger: rpcConsumerLogs, + chainParser: chainParser.(*GrpcChainParser), + healthReporter: healthReporter, + refererData: refererData, } return chainListener } @@ -297,6 +298,7 @@ func (apil *GrpcChainListener) Serve(ctx context.Context, cmdFlags common.Consum } lis := GetListenerWithRetryGrpc("tcp", apil.endpoint.NetworkAddress) + apil.listeningAddress = lis.Addr().String() apiInterface := apil.endpoint.ApiInterface sendRelayCallback := func(ctx context.Context, method string, reqBody []byte) ([]byte, metadata.MD, error) { if method == "grpc.reflection.v1.ServerReflection/ServerReflectionInfo" { @@ -318,6 +320,7 @@ func (apil *GrpcChainListener) Serve(ctx context.Context, cmdFlags common.Consum utils.LogAttr("headers", grpcHeaders), ) metricsData := metrics.NewRelayAnalytics(dappID, apil.endpoint.ChainID, apiInterface) + metricsData.SetProcessingTimestampBeforeRelay(startTime) consumerIp := common.GetIpFromGrpcContext(ctx) relayResult, err := apil.relaySender.SendRelay(ctx, method, string(reqBody), "", dappID, consumerIp, metricsData, grpcHeaders) relayReply := relayResult.GetReply() @@ -326,9 +329,10 @@ func (apil *GrpcChainListener) Serve(ctx context.Context, cmdFlags common.Consum if err != nil { errMasking := apil.logger.GetUniqueGuidResponseForError(err, msgSeed) apil.logger.LogRequestAndResponse("grpc in/out", true, method, string(reqBody), "", errMasking, msgSeed, time.Since(startTime), err) - return nil, nil, utils.LavaFormatError("Failed to SendRelay", fmt.Errorf(errMasking)) + return nil, nil, utils.LavaFormatError("Failed to SendRelay", fmt.Errorf("%s", errMasking)) } apil.logger.LogRequestAndResponse("grpc in/out", false, method, string(reqBody), "", "", msgSeed, time.Since(startTime), nil) + apil.logger.AddMetricForProcessingLatencyAfterProvider(metricsData, apil.endpoint.ChainID, apiInterface) // try checking for node errors. nodeError := &GrpcNodeErrorResponse{} @@ -377,6 +381,10 @@ func (apil *GrpcChainListener) Serve(ctx context.Context, cmdFlags common.Consum } } +func (apil *GrpcChainListener) GetListeningAddress() string { + return apil.listeningAddress +} + type GrpcChainProxy struct { BaseChainProxy conn grpcConnectorInterface @@ -525,13 +533,13 @@ func (cp *GrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, return nil, "", nil, utils.LavaFormatError("rp.Next(msg) Failed", err, utils.Attribute{Key: "GUID", Value: ctx}) } } - if debug { - utils.LavaFormatDebug("provider sending node message", - utils.Attribute{Key: "_method", Value: nodeMessage.Path}, - utils.Attribute{Key: "headers", Value: metadataMap}, - utils.Attribute{Key: "apiInterface", Value: "grpc"}, - ) - } + + utils.LavaFormatTrace("provider sending node message", + utils.LogAttr("_method", nodeMessage.Path), + utils.LogAttr("headers", metadataMap), + utils.LogAttr("apiInterface", "grpc"), + ) + var respHeaders metadata.MD response := msgFactory.NewMessage(methodDescriptor.GetOutputType()) connectCtx, cancel := cp.CapTimeoutForSend(ctx, chainMessage) diff --git a/protocol/chainlib/grpc_test.go b/protocol/chainlib/grpc_test.go index 23f770c1fe..934cf82809 100644 --- a/protocol/chainlib/grpc_test.go +++ b/protocol/chainlib/grpc_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/parser" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/parser" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -142,7 +142,7 @@ func TestGrpcChainProxy(t *testing.T) { // Handle the incoming request and provide the desired response wasCalled = true }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceGrpc, serverHandle, "../../", nil) + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceGrpc, serverHandle, nil, "../../", nil) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -169,15 +169,16 @@ func TestParsingRequestedBlocksHeadersGrpc(t *testing.T) { w.WriteHeader(244591) } }) - chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceGrpc, serverHandler, "../../", nil) + chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceGrpc, serverHandler, nil, "../../", nil) require.NoError(t, err) defer func() { if closeServer != nil { closeServer() } }() - parsingForCrafting, collectionData, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) + parsingForCrafting, apiCollection, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) require.True(t, ok) + collectionData := apiCollection.CollectionData headerParsingDirective, _, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_SET_LATEST_IN_METADATA) callbackHeaderNameToCheck = headerParsingDirective.GetApiName() // this causes the callback to modify the response to simulate a real behavior require.True(t, ok) @@ -237,15 +238,16 @@ func TestSettingBlocksHeadersGrpc(t *testing.T) { w.WriteHeader(244591) } }) - chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceGrpc, serverHandler, "../../", nil) + chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceGrpc, serverHandler, nil, "../../", nil) require.NoError(t, err) defer func() { if closeServer != nil { closeServer() } }() - parsingForCrafting, collectionData, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) + parsingForCrafting, apiCollection, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) require.True(t, ok) + collectionData := apiCollection.CollectionData headerParsingDirective, _, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_SET_LATEST_IN_METADATA) callbackHeaderNameToCheck = headerParsingDirective.GetApiName() // this causes the callback to modify the response to simulate a real behavior require.True(t, ok) diff --git a/protocol/chainlib/grpcproxy/dyncodec/registry.go b/protocol/chainlib/grpcproxy/dyncodec/registry.go index 187a4dad79..30c6a4435a 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/registry.go +++ b/protocol/chainlib/grpcproxy/dyncodec/registry.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" diff --git a/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go b/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go index e817ae75b2..03273e1944 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go +++ b/protocol/chainlib/grpcproxy/dyncodec/remote_grpc_reflection.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "google.golang.org/grpc" "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" "google.golang.org/protobuf/proto" diff --git a/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go b/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go index 8d6993ae98..ceb8ded940 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go +++ b/protocol/chainlib/grpcproxy/dyncodec/remote_relayer.go @@ -3,7 +3,7 @@ package dyncodec import ( "context" - "github.com/lavanet/lava/protocol/chainlib/grpcproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/grpcproxy" "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go b/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go index 2f963d28bd..f9e215d097 100644 --- a/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go +++ b/protocol/chainlib/grpcproxy/dyncodec/remotes_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/lavanet/lava/protocol/chainlib/grpcproxy" - "github.com/lavanet/lava/protocol/chainlib/grpcproxy/testproto" + "github.com/lavanet/lava/v2/protocol/chainlib/grpcproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/grpcproxy/testproto" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/protocol/chainlib/grpcproxy/grpcproxy.go b/protocol/chainlib/grpcproxy/grpcproxy.go index ee53c3348e..f507a4375a 100644 --- a/protocol/chainlib/grpcproxy/grpcproxy.go +++ b/protocol/chainlib/grpcproxy/grpcproxy.go @@ -7,8 +7,8 @@ import ( "github.com/gofiber/fiber/v2" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "google.golang.org/grpc" diff --git a/protocol/chainlib/grpcproxy/grpcproxy_test.go b/protocol/chainlib/grpcproxy/grpcproxy_test.go index 36495d0233..07c8b9e4ef 100644 --- a/protocol/chainlib/grpcproxy/grpcproxy_test.go +++ b/protocol/chainlib/grpcproxy/grpcproxy_test.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/lavanet/lava/protocol/chainlib/grpcproxy/testproto" - "github.com/lavanet/lava/protocol/common" + "github.com/lavanet/lava/v2/protocol/chainlib/grpcproxy/testproto" + "github.com/lavanet/lava/v2/protocol/common" "github.com/stretchr/testify/require" "google.golang.org/grpc/metadata" ) diff --git a/protocol/chainlib/jsonRPC.go b/protocol/chainlib/jsonRPC.go index e89324397d..bedcd154c5 100644 --- a/protocol/chainlib/jsonRPC.go +++ b/protocol/chainlib/jsonRPC.go @@ -14,18 +14,18 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/parser" - - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/parser" + + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const SEP = "&" @@ -83,7 +83,7 @@ func (apip *JsonRPCChainParser) CraftMessage(parsing *spectypes.ParseDirective, if err != nil { return nil, err } - return apip.newChainMessage(apiCont.api, spectypes.NOT_APPLICABLE, msg, apiCollection), nil + return apip.newChainMessage(apiCont.api, spectypes.NOT_APPLICABLE, nil, msg, apiCollection), nil } // this func parses message data into chain message object @@ -105,8 +105,9 @@ func (apip *JsonRPCChainParser) ParseMsg(url string, data []byte, connectionType var api *spectypes.Api var apiCollection *spectypes.ApiCollection var latestRequestedBlock, earliestRequestedBlock int64 = 0, 0 + blockHashes := []string{} for idx, msg := range msgs { - var requestedBlockForMessage int64 + parsedInput := parser.NewParsedInput() internalPath := "" if apip.isValidInternalPath(url) { internalPath = url @@ -114,7 +115,13 @@ func (apip *JsonRPCChainParser) ParseMsg(url string, data []byte, connectionType // Check api is supported and save it in nodeMsg apiCont, err := apip.getSupportedApi(msg.Method, connectionType, internalPath) if err != nil { - utils.LavaFormatDebug("getSupportedApi jsonrpc failed", utils.LogAttr("method", msg.Method), utils.LogAttr("error", err)) + utils.LavaFormatDebug("getSupportedApi jsonrpc failed", + utils.LogAttr("method", msg.Method), + utils.LogAttr("connectionType", connectionType), + utils.LogAttr("internalPath", internalPath), + utils.LogAttr("error", err), + ) + return nil, err } @@ -129,28 +136,29 @@ func (apip *JsonRPCChainParser) ParseMsg(url string, data []byte, connectionType if overwriteReqBlock == "" { // Fetch requested block, it is used for data reliability - requestedBlockForMessage, err = parser.ParseBlockFromParams(msg, apiCont.api.BlockParsing) - if err != nil { - utils.LavaFormatError("ParseBlockFromParams failed parsing block", err, - utils.LogAttr("chain", apip.spec.Name), - utils.LogAttr("blockParsing", apiCont.api.BlockParsing), - utils.LogAttr("apiName", apiCont.api.Name), - utils.LogAttr("connectionType", "jsonrpc"), - ) - requestedBlockForMessage = spectypes.NOT_APPLICABLE + parsedInput = parser.ParseBlockFromParams(msg, apiCont.api.BlockParsing, apiCont.api.Parsers) + if hashes, err := parsedInput.GetBlockHashes(); err == nil { + blockHashes = append(blockHashes, hashes...) } } else { - requestedBlockForMessage, err = msg.ParseBlock(overwriteReqBlock) + parsedBlock, err := msg.ParseBlock(overwriteReqBlock) + parsedInput.SetBlock(parsedBlock) if err != nil { - utils.LavaFormatError("failed parsing block from an overwrite header", err, utils.Attribute{Key: "chain", Value: apip.spec.Name}, utils.Attribute{Key: "overwriteReqBlock", Value: overwriteReqBlock}) - requestedBlockForMessage = spectypes.NOT_APPLICABLE + utils.LavaFormatError("failed parsing block from an overwrite header", err, + utils.LogAttr("chain", apip.spec.Name), + utils.LogAttr("overwriteReqBlock", overwriteReqBlock), + ) + parsedInput.SetBlock(spectypes.NOT_APPLICABLE) } } + + parsedBlock := parsedInput.GetBlock() + if idx == 0 { // on the first entry store them api = apiCont.api apiCollection = apiCollectionForMessage - latestRequestedBlock = requestedBlockForMessage + latestRequestedBlock = parsedBlock } else { // on next entries we need to compare to existing data if api == nil { @@ -185,14 +193,16 @@ func (apip *JsonRPCChainParser) ParseMsg(url string, data []byte, connectionType Encoding: "", }, } - latestRequestedBlock, earliestRequestedBlock = CompareRequestedBlockInBatch(latestRequestedBlock, requestedBlockForMessage) + + latestRequestedBlock, earliestRequestedBlock = CompareRequestedBlockInBatch(latestRequestedBlock, earliestRequestedBlock, parsedBlock) } } + var nodeMsg *baseChainMessageContainer if len(msgs) == 1 { - nodeMsg = apip.newChainMessage(api, latestRequestedBlock, &msgs[0], apiCollection) + nodeMsg = apip.newChainMessage(api, latestRequestedBlock, blockHashes, &msgs[0], apiCollection) } else { - nodeMsg, err = apip.newBatchChainMessage(api, latestRequestedBlock, earliestRequestedBlock, msgs, apiCollection) + nodeMsg, err = apip.newBatchChainMessage(api, latestRequestedBlock, earliestRequestedBlock, blockHashes, msgs, apiCollection) if err != nil { return nil, err } @@ -201,7 +211,7 @@ func (apip *JsonRPCChainParser) ParseMsg(url string, data []byte, connectionType return nodeMsg, apip.BaseChainParser.Validate(nodeMsg) } -func (*JsonRPCChainParser) newBatchChainMessage(serviceApi *spectypes.Api, requestedBlock int64, earliestRequestedBlock int64, msgs []rpcInterfaceMessages.JsonrpcMessage, apiCollection *spectypes.ApiCollection) (*baseChainMessageContainer, error) { +func (*JsonRPCChainParser) newBatchChainMessage(serviceApi *spectypes.Api, requestedBlock int64, earliestRequestedBlock int64, requestedBlockHashes []string, msgs []rpcInterfaceMessages.JsonrpcMessage, apiCollection *spectypes.ApiCollection) (*baseChainMessageContainer, error) { batchMessage, err := rpcInterfaceMessages.NewBatchMessage(msgs) if err != nil { return nil, err @@ -210,20 +220,24 @@ func (*JsonRPCChainParser) newBatchChainMessage(serviceApi *spectypes.Api, reque api: serviceApi, apiCollection: apiCollection, latestRequestedBlock: requestedBlock, + requestedBlockHashes: requestedBlockHashes, msg: &batchMessage, earliestRequestedBlock: earliestRequestedBlock, resultErrorParsingMethod: rpcInterfaceMessages.CheckResponseErrorForJsonRpcBatch, + parseDirective: nil, } return nodeMsg, err } -func (*JsonRPCChainParser) newChainMessage(serviceApi *spectypes.Api, requestedBlock int64, msg *rpcInterfaceMessages.JsonrpcMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { +func (*JsonRPCChainParser) newChainMessage(serviceApi *spectypes.Api, requestedBlock int64, requestedBlockHashes []string, msg *rpcInterfaceMessages.JsonrpcMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { nodeMsg := &baseChainMessageContainer{ api: serviceApi, apiCollection: apiCollection, latestRequestedBlock: requestedBlock, + requestedBlockHashes: requestedBlockHashes, msg: msg, resultErrorParsingMethod: msg.CheckResponseError, + parseDirective: GetParseDirective(serviceApi, apiCollection), } return nodeMsg } @@ -287,11 +301,13 @@ func (apip *JsonRPCChainParser) ChainBlockStats() (allowedBlockLagForQosSync int } type JsonRPCChainListener struct { - endpoint *lavasession.RPCEndpoint - relaySender RelaySender - healthReporter HealthReporter - logger *metrics.RPCConsumerLogs - refererData *RefererData + endpoint *lavasession.RPCEndpoint + relaySender RelaySender + healthReporter HealthReporter + logger *metrics.RPCConsumerLogs + refererData *RefererData + consumerWsSubscriptionManager *ConsumerWSSubscriptionManager + listeningAddress string } // NewJrpcChainListener creates a new instance of JsonRPCChainListener @@ -299,14 +315,16 @@ func NewJrpcChainListener(ctx context.Context, listenEndpoint *lavasession.RPCEn relaySender RelaySender, healthReporter HealthReporter, rpcConsumerLogs *metrics.RPCConsumerLogs, refererData *RefererData, + consumerWsSubscriptionManager *ConsumerWSSubscriptionManager, ) (chainListener *JsonRPCChainListener) { // Create a new instance of JsonRPCChainListener chainListener = &JsonRPCChainListener{ - listenEndpoint, - relaySender, - healthReporter, - rpcConsumerLogs, - refererData, + endpoint: listenEndpoint, + relaySender: relaySender, + healthReporter: healthReporter, + logger: rpcConsumerLogs, + refererData: refererData, + consumerWsSubscriptionManager: consumerWsSubscriptionManager, } return chainListener @@ -335,91 +353,26 @@ func (apil *JsonRPCChainListener) Serve(ctx context.Context, cmdFlags common.Con chainID := apil.endpoint.ChainID apiInterface := apil.endpoint.ApiInterface - webSocketCallback := websocket.New(func(websockConn *websocket.Conn) { - var ( - messageType int - msg []byte - err error - ) - startTime := time.Now() - msgSeed := apil.logger.GetMessageSeed() - for { - if messageType, msg, err = websockConn.ReadMessage(); err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, err, msgSeed, msg, spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - break - } - dappID, ok := websockConn.Locals("dapp-id").(string) - if !ok { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, nil, msgSeed, []byte("Unable to extract dappID"), spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - } - refererMatch, ok := websockConn.Locals(refererMatchString).(string) - ctx, cancel := context.WithCancel(context.Background()) - guid := utils.GenerateUniqueIdentifier() - ctx = utils.WithUniqueIdentifier(ctx, guid) - msgSeed = strconv.FormatUint(guid, 10) - defer cancel() // incase there's a problem make sure to cancel the connection - - logFormattedMsg := string(msg) - if !cmdFlags.DebugRelays { - logFormattedMsg = utils.FormatLongString(logFormattedMsg, relayMsgLogMaxChars) - } - - utils.LavaFormatDebug("ws in <<<", - utils.LogAttr("seed", msgSeed), - utils.LogAttr("GUID", ctx), - utils.LogAttr("msg", logFormattedMsg), - utils.LogAttr("dappID", dappID), - ) - metricsData := metrics.NewRelayAnalytics(dappID, chainID, apiInterface) - relayResult, err := apil.relaySender.SendRelay(ctx, "", string(msg), http.MethodPost, dappID, websockConn.RemoteAddr().String(), metricsData, nil) - if ok && refererMatch != "" && apil.refererData != nil && err == nil { - go apil.refererData.SendReferer(refererMatch, chainID, string(msg), websockConn.RemoteAddr().String(), nil, websockConn) - } - reply := relayResult.GetReply() - replyServer := relayResult.GetReplyServer() - go apil.logger.AddMetricForWebSocket(metricsData, err, websockConn) - if err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, err, msgSeed, msg, spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - continue - } - // If subscribe the first reply would contain the RPC ID that can be used for disconnect. - if replyServer != nil { - var reply pairingtypes.RelayReply - err = (*replyServer).RecvMsg(&reply) // this reply contains the RPC ID - if err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, err, msgSeed, msg, spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - continue - } + webSocketCallback := websocket.New(func(websocketConn *websocket.Conn) { + utils.LavaFormatDebug("jsonrpc websocket opened", utils.LogAttr("consumerIp", websocketConn.LocalAddr().String())) + defer utils.LavaFormatDebug("jsonrpc websocket closed", utils.LogAttr("consumerIp", websocketConn.LocalAddr().String())) + + consumerWebsocketManager := NewConsumerWebsocketManager(ConsumerWebsocketManagerOptions{ + WebsocketConn: websocketConn, + RpcConsumerLogs: apil.logger, + RefererMatchString: refererMatchString, + CmdFlags: cmdFlags, + RelayMsgLogMaxChars: relayMsgLogMaxChars, + ChainID: chainID, + ApiInterface: apiInterface, + ConnectionType: fiber.MethodPost, // We use it for the ParseMsg method, which needs to know the connection type to find the method in the spec + RefererData: apil.refererData, + RelaySender: apil.relaySender, + ConsumerWsSubscriptionManager: apil.consumerWsSubscriptionManager, + WebsocketConnectionUID: strconv.FormatUint(utils.GenerateUniqueIdentifier(), 10), + }) - if err = websockConn.WriteMessage(messageType, reply.Data); err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, err, msgSeed, msg, spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - continue - } - apil.logger.LogRequestAndResponse("jsonrpc ws msg", false, "ws", websockConn.LocalAddr().String(), string(msg), string(reply.Data), msgSeed, time.Since(startTime), nil) - for { - err = (*replyServer).RecvMsg(&reply) - if err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, err, msgSeed, msg, spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - break - } - - // If portal cant write to the client - if err = websockConn.WriteMessage(messageType, reply.Data); err != nil { - cancel() - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, err, msgSeed, msg, spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - // break - } - - apil.logger.LogRequestAndResponse("jsonrpc ws msg", false, "ws", websockConn.LocalAddr().String(), string(msg), string(reply.Data), msgSeed, time.Since(startTime), nil) - } - } else { - if err = websockConn.WriteMessage(messageType, reply.Data); err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websockConn, messageType, err, msgSeed, msg, spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - continue - } - apil.logger.LogRequestAndResponse("jsonrpc ws msg", false, "ws", websockConn.LocalAddr().String(), string(msg), string(reply.Data), msgSeed, time.Since(startTime), nil) - } - } + consumerWebsocketManager.ListenToMessages() }) websocketCallbackWithDappID := constructFiberCallbackWithHeaderAndParameterExtraction(webSocketCallback, apil.logger.StoreMetricData) app.Get("/ws", websocketCallbackWithDappID) @@ -433,6 +386,7 @@ func (apil *JsonRPCChainListener) Serve(ctx context.Context, cmdFlags common.Con defer endTx() dappID := extractDappIDFromFiberContext(fiberCtx) metricsData := metrics.NewRelayAnalytics(dappID, chainID, apiInterface) + metricsData.SetProcessingTimestampBeforeRelay(startTime) ctx, cancel := context.WithCancel(context.Background()) defer cancel() guid := utils.GenerateUniqueIdentifier() @@ -506,8 +460,10 @@ func (apil *JsonRPCChainListener) Serve(ctx context.Context, cmdFlags common.Con if relayResult.GetStatusCode() != 0 { fiberCtx.Status(relayResult.StatusCode) } - // Return json response - return addHeadersAndSendString(fiberCtx, reply.GetMetadata(), response) + // Return json response and add metric for after provider processing + err = addHeadersAndSendString(fiberCtx, reply.GetMetadata(), response) + apil.logger.AddMetricForProcessingLatencyAfterProvider(metricsData, chainID, apiInterface) + return err } if apil.refererData != nil && apil.refererData.Marker != "" { app.Use("/"+apil.refererData.Marker+":"+refererMatchString+"/ws", func(c *fiber.Ctx) error { @@ -524,7 +480,18 @@ func (apil *JsonRPCChainListener) Serve(ctx context.Context, cmdFlags common.Con } app.Post("/*", handlerPost) // Go - ListenWithRetry(app, apil.endpoint.NetworkAddress) + addrChannel := make(chan string) + addrChannelSafe := common.NewSafeChannelSender(ctx, addrChannel) + go func() { + addr := <-addrChannel + apil.listeningAddress = addr + }() + + ListenWithRetry(app, apil.endpoint.NetworkAddress, addrChannelSafe) +} + +func (apil *JsonRPCChainListener) GetListeningAddress() string { + return apil.listeningAddress } type JrpcChainProxy struct { @@ -539,10 +506,17 @@ func NewJrpcChainProxy(ctx context.Context, nConns uint, rpcProviderEndpoint lav _, averageBlockTime, _, _ := chainParser.ChainBlockStats() nodeUrl := rpcProviderEndpoint.NodeUrls[0] cp := &JrpcChainProxy{ - BaseChainProxy: BaseChainProxy{averageBlockTime: averageBlockTime, NodeUrl: nodeUrl, ErrorHandler: &JsonRPCErrorHandler{}, ChainID: rpcProviderEndpoint.ChainID}, - conn: map[string]*chainproxy.Connector{}, + BaseChainProxy: BaseChainProxy{ + averageBlockTime: averageBlockTime, + NodeUrl: nodeUrl, + ErrorHandler: &JsonRPCErrorHandler{}, + ChainID: rpcProviderEndpoint.ChainID, + }, + conn: map[string]*chainproxy.Connector{}, } - verifyRPCEndpoint(nodeUrl.Url) + + validateEndpoints(rpcProviderEndpoint.NodeUrls, spectypes.APIInterfaceJsonRPC) + internalPaths := map[string]struct{}{} jsonRPCChainParser, ok := chainParser.(*JsonRPCChainParser) if ok { @@ -588,6 +562,7 @@ func (cp *JrpcChainProxy) start(ctx context.Context, nConns uint, nodeUrl common if err != nil { return err } + cp.conn[path] = conn if cp.conn == nil { return errors.New("g_conn == nil") @@ -663,14 +638,15 @@ func (cp *JrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, return reply, "", nil, err } internalPath := chainMessage.GetApiCollection().CollectionData.InternalPath - rpc, err := cp.conn[internalPath].GetRpc(ctx, true) + connector := cp.conn[internalPath] + rpc, err := connector.GetRpc(ctx, true) if err != nil { return nil, "", nil, err } - defer cp.conn[internalPath].ReturnRpc(rpc) + defer connector.ReturnRpc(rpc) // appending hashed url - grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeAddressHash, cp.conn[internalPath].GetUrlHash())) + grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeAddressHash, connector.GetUrlHash())) // Call our node var rpcMessage *rpcclient.JsonrpcMessage @@ -684,8 +660,9 @@ func (cp *JrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, defer rpc.SetHeader(metadata.Name, "") } } + var nodeErr error if ch != nil { - sub, rpcMessage, err = rpc.Subscribe(context.Background(), nodeMessage.ID, nodeMessage.Method, ch, nodeMessage.Params) + sub, rpcMessage, nodeErr = rpc.Subscribe(context.Background(), nodeMessage.ID, nodeMessage.Method, ch, nodeMessage.Params) } else { // we use the minimum timeout between the two, spec or context. to prevent the provider from hanging // we don't use the context alone so the provider won't be hanging forever by an attack @@ -693,7 +670,7 @@ func (cp *JrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, defer cancel() cp.NodeUrl.SetIpForwardingIfNecessary(ctx, rpc.SetHeader) - rpcMessage, err = rpc.CallContext(connectCtx, nodeMessage.ID, nodeMessage.Method, nodeMessage.Params, true, nodeMessage.GetDisableErrorHandling()) + rpcMessage, nodeErr = rpc.CallContext(connectCtx, nodeMessage.ID, nodeMessage.Method, nodeMessage.Params, true, nodeMessage.GetDisableErrorHandling()) if err != nil { // here we are getting an error for every code that is not 200-300 if common.StatusCodeError504.Is(err) || common.StatusCodeError429.Is(err) || common.StatusCodeErrorStrict.Is(err) { @@ -709,31 +686,32 @@ func (cp *JrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, var replyMsg rpcInterfaceMessages.JsonrpcMessage // the error check here would only wrap errors not from the rpc + + if nodeErr != nil { + utils.LavaFormatDebug("got error from node", utils.LogAttr("GUID", ctx), utils.LogAttr("nodeErr", nodeErr)) + return nil, "", nil, nodeErr + } + + replyMessage, err = rpcInterfaceMessages.ConvertJsonRPCMsg(rpcMessage) if err != nil { - utils.LavaFormatDebug("received an error from SendNodeMsg", utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "error", Value: err}) - return nil, "", nil, err - } else { - replyMessage, err = rpcInterfaceMessages.ConvertJsonRPCMsg(rpcMessage) - if err != nil { - return nil, "", nil, utils.LavaFormatError("jsonRPC error", err, utils.Attribute{Key: "GUID", Value: ctx}) - } - // validate result is valid - if replyMessage.Error == nil { - responseIsNilValidationError := ValidateNilResponse(string(replyMessage.Result)) - if responseIsNilValidationError != nil { - return nil, "", nil, responseIsNilValidationError - } + return nil, "", nil, utils.LavaFormatError("jsonRPC error", err, utils.Attribute{Key: "GUID", Value: ctx}) + } + // validate result is valid + if replyMessage.Error == nil { + responseIsNilValidationError := ValidateNilResponse(string(replyMessage.Result)) + if responseIsNilValidationError != nil { + return nil, "", nil, responseIsNilValidationError } + } - replyMsg = *replyMessage - err := cp.ValidateRequestAndResponseIds(nodeMessage.ID, replyMessage.ID) - if err != nil { - return nil, "", nil, utils.LavaFormatError("jsonRPC ID mismatch error", err, - utils.Attribute{Key: "GUID", Value: ctx}, - utils.Attribute{Key: "requestId", Value: nodeMessage.ID}, - utils.Attribute{Key: "responseId", Value: rpcMessage.ID}, - ) - } + replyMsg = *replyMessage + err = cp.ValidateRequestAndResponseIds(nodeMessage.ID, replyMessage.ID) + if err != nil { + return nil, "", nil, utils.LavaFormatError("jsonRPC ID mismatch error", err, + utils.Attribute{Key: "GUID", Value: ctx}, + utils.Attribute{Key: "requestId", Value: nodeMessage.ID}, + utils.Attribute{Key: "responseId", Value: rpcMessage.ID}, + ) } retData, err := json.Marshal(replyMsg) @@ -750,9 +728,17 @@ func (cp *JrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, } if ch != nil { - subscriptionID, err = strconv.Unquote(string(replyMsg.Result)) - if err != nil { - return nil, "", nil, utils.LavaFormatError("Subscription failed", err, utils.Attribute{Key: "GUID", Value: ctx}) + if replyMsg.Error != nil { + return reply, "", nil, nil + } + + if common.IsQuoted(string(replyMsg.Result)) { + subscriptionID, err = strconv.Unquote(string(replyMsg.Result)) + if err != nil { + return nil, "", nil, utils.LavaFormatError("Subscription failed", err, utils.Attribute{Key: "GUID", Value: ctx}) + } + } else { + subscriptionID = string(replyMsg.Result) } } diff --git a/protocol/chainlib/jsonRPC_test.go b/protocol/chainlib/jsonRPC_test.go index 850aa78b08..15f9db0dc2 100644 --- a/protocol/chainlib/jsonRPC_test.go +++ b/protocol/chainlib/jsonRPC_test.go @@ -9,15 +9,43 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - keepertest "github.com/lavanet/lava/testutil/keeper" - plantypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/gorilla/websocket" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + specutils "github.com/lavanet/lava/v2/utils/keeper" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) +func createWebSocketHandler(handler func(string) string) http.HandlerFunc { + upGrader := websocket.Upgrader{} + + // Create a simple websocket server that mocks the node + return func(w http.ResponseWriter, r *http.Request) { + conn, err := upGrader.Upgrade(w, r, nil) + if err != nil { + fmt.Println(err) + panic("got error in upgrader") + } + defer conn.Close() + + for { + // Read the request + messageType, message, err := conn.ReadMessage() + if err != nil { + panic("got error in ReadMessage") + } + fmt.Println("got ws message", string(message), messageType) + retMsg := handler(string(message)) + conn.WriteMessage(messageType, []byte(retMsg)) + fmt.Println("writing ws message", string(message), messageType) + } + } +} + func TestJSONChainParser_Spec(t *testing.T) { // create a new instance of RestChainParser apip, err := NewJrpcChainParser() @@ -134,26 +162,33 @@ func TestJSONParseMessage(t *testing.T) { func TestJsonRpcChainProxy(t *testing.T) { ctx := context.Background() - serverHandle := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + serverHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Handle the incoming request and provide the desired response w.WriteHeader(http.StatusOK) fmt.Fprint(w, `{"jsonrpc":"2.0","id":1,"result":"0x10a7a08"}`) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandle, "../../", nil) + wsServerHandler := func(message string) string { + return `{"jsonrpc":"2.0","id":1,"result":"0x10a7a08"}` + } + + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandler, createWebSocketHandler(wsServerHandler), "../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) require.NotNil(t, chainFetcher) + block, err := chainFetcher.FetchLatestBlockNum(ctx) require.Greater(t, block, int64(0)) require.NoError(t, err) + _, err = chainFetcher.FetchBlockHashByNum(ctx, block) errMsg := "GET_BLOCK_BY_NUM Failed ParseMessageResponse {error:invalid parser input format" require.True(t, err.Error()[:len(errMsg)] == errMsg, err.Error()) - if closeServer != nil { - closeServer() - } } func TestAddonAndVerifications(t *testing.T) { @@ -164,7 +199,15 @@ func TestAddonAndVerifications(t *testing.T) { fmt.Fprint(w, `{"jsonrpc":"2.0","id":1,"result":"0xf9ccdff90234a064"}`) }) - chainParser, chainRouter, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandle, "../../", []string{"debug"}) + wsServerHandler := func(message string) string { + return `{"jsonrpc":"2.0","id":1,"result":"0xf9ccdff90234a064"}` + } + + chainParser, chainRouter, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandle, createWebSocketHandler(wsServerHandler), "../../", []string{"debug"}) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainRouter) @@ -183,9 +226,6 @@ func TestAddonAndVerifications(t *testing.T) { _, err = FormatResponseForParsing(reply.RelayReply, chainMessage) require.NoError(t, err) } - if closeServer != nil { - closeServer() - } } func TestExtensions(t *testing.T) { @@ -196,8 +236,16 @@ func TestExtensions(t *testing.T) { fmt.Fprint(w, `{"jsonrpc":"2.0","id":1,"result":"0xf9ccdff90234a064"}`) }) + wsServerHandler := func(message string) string { + return `{"jsonrpc":"2.0","id":1,"result":"0xf9ccdff90234a064"}` + } + specname := "ETH1" - chainParser, chainRouter, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, specname, spectypes.APIInterfaceJsonRPC, serverHandle, "../../", []string{"archive"}) + chainParser, chainRouter, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, specname, spectypes.APIInterfaceJsonRPC, serverHandle, createWebSocketHandler(wsServerHandler), "../../", []string{"archive"}) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainRouter) @@ -205,12 +253,13 @@ func TestExtensions(t *testing.T) { configuredExtensions := map[string]struct{}{ "archive": {}, } - spec, err := keepertest.GetASpec(specname, "../../", nil, nil) + spec, err := specutils.GetASpec(specname, "../../", nil, nil) require.NoError(t, err) chainParser.SetPolicy(&plantypes.Policy{ChainPolicies: []plantypes.ChainPolicy{{ChainId: specname, Requirements: []plantypes.ChainRequirement{{Collection: spectypes.CollectionData{ApiInterface: "jsonrpc"}, Extensions: []string{"archive"}}}}}}, specname, "jsonrpc") - parsingForCrafting, collectionData, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCK_BY_NUM) + parsingForCrafting, apiCollection, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCK_BY_NUM) require.True(t, ok) + collectionData := apiCollection.CollectionData cuCost := uint64(0) for _, api := range spec.ApiCollections[0].Apis { if api.Name == parsingForCrafting.ApiName { @@ -258,9 +307,6 @@ func TestExtensions(t *testing.T) { require.Len(t, chainMessage.GetExtensions(), 1) require.Equal(t, "archive", chainMessage.GetExtensions()[0].Name) require.Equal(t, cuCostExt, chainMessage.GetApi().ComputeUnits) - if closeServer != nil { - closeServer() - } } func TestJsonRpcBatchCall(t *testing.T) { @@ -279,7 +325,16 @@ func TestJsonRpcBatchCall(t *testing.T) { fmt.Fprint(w, response) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandle, "../../", nil) + wsServerHandler := func(message string) string { + require.Equal(t, batchCallData, message) + return response + } + + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandle, createWebSocketHandler(wsServerHandler), "../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -287,18 +342,15 @@ func TestJsonRpcBatchCall(t *testing.T) { chainMessage, err := chainParser.ParseMsg("", []byte(batchCallData), http.MethodPost, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) + requestedBlock, _ := chainMessage.RequestedBlock() require.Equal(t, spectypes.LATEST_BLOCK, requestedBlock) + relayReply, _, _, _, _, err := chainProxy.SendNodeMsg(ctx, nil, chainMessage, nil) require.True(t, gotCalled) require.NoError(t, err) require.NotNil(t, relayReply) require.Equal(t, response, string(relayReply.RelayReply.Data)) - defer func() { - if closeServer != nil { - closeServer() - } - }() } func TestJsonRpcBatchCallSameID(t *testing.T) { @@ -320,7 +372,16 @@ func TestJsonRpcBatchCallSameID(t *testing.T) { fmt.Fprint(w, response) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandle, "../../", nil) + wsServerHandler := func(message string) string { + require.Equal(t, sentBatchCallData, message) + return response + } + + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "ETH1", spectypes.APIInterfaceJsonRPC, serverHandle, createWebSocketHandler(wsServerHandler), "../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -335,21 +396,21 @@ func TestJsonRpcBatchCallSameID(t *testing.T) { require.NoError(t, err) require.NotNil(t, relayReply) require.Equal(t, responseExpected, string(relayReply.RelayReply.Data)) - defer func() { - if closeServer != nil { - closeServer() - } - }() } -func TestJsonRpcInternalPathsMultipleVersions(t *testing.T) { +func TestJsonRpcInternalPathsMultipleVersionsStarkNet(t *testing.T) { ctx := context.Background() serverHandle := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Handle the incoming request and provide the desired response w.WriteHeader(http.StatusOK) fmt.Fprintf(w, `{"jsonrpc":"2.0","id":1,"result":"%s"}`, r.RequestURI) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "STRK", spectypes.APIInterfaceJsonRPC, serverHandle, "../../", nil) + + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "STRK", spectypes.APIInterfaceJsonRPC, serverHandle, nil, "../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -377,7 +438,71 @@ func TestJsonRpcInternalPathsMultipleVersions(t *testing.T) { collection = chainMessage.GetApiCollection() require.Equal(t, "starknet_specVersion", api.Name) require.Equal(t, v6_path, collection.CollectionData.InternalPath) +} + +func TestJsonRpcInternalPathsMultipleVersionsAvalanche(t *testing.T) { + type reqWithApiName struct { + apiName string + reqData []byte + } + + // TODO: Add the empty path back in once the ETH spec will be fixed + // allPaths := []string{"", "/C/rpc", "/C/avax", "/P", "/X"} + allPaths := []string{"/C/rpc", "/C/avax", "/P", "/X"} + pathToReqData := map[string]reqWithApiName{ + "/C/rpc": { // Eth jsonrpc path + apiName: "eth_blockNumber", + reqData: []byte(`{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}`), + }, + "/C/avax": { // Avalanche jsonrpc path + apiName: "avax.export", + reqData: []byte(`{"jsonrpc": "2.0", "id": 1, "method": "avax.export", "params": []}`), + }, + "/P": { // Platform jsonrpc path + apiName: "platform.addDelegator", + reqData: []byte(`{"jsonrpc": "2.0", "id": 1, "method": "platform.addDelegator", "params": []}`), + }, + "/X": { // Avm jsonrpc path + apiName: "avm.getAssetDescription", + reqData: []byte(`{"jsonrpc": "2.0", "id": 1, "method": "avm.getAssetDescription", "params": []}`), + }, + } + + ctx := context.Background() + serverHandle := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Handle the incoming request and provide the desired response + w.WriteHeader(http.StatusOK) + fmt.Fprintf(w, `{"jsonrpc":"2.0","id":1,"result":"%s"}`, r.RequestURI) + }) + + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "AVAX", spectypes.APIInterfaceJsonRPC, serverHandle, nil, "../../", nil) if closeServer != nil { - closeServer() + defer closeServer() + } + + require.NoError(t, err) + require.NotNil(t, chainParser) + require.NotNil(t, chainProxy) + require.NotNil(t, chainFetcher) + + for correctPath, reqDataWithApiName := range pathToReqData { + for _, path := range allPaths { + shouldErr := path != correctPath + t.Run(fmt.Sprintf("ApiName:%s,CorrectPath:%s,Path:%s,ShouldError:%v", reqDataWithApiName.apiName, correctPath, path, shouldErr), func(t *testing.T) { + chainMessage, err := chainParser.ParseMsg(path, reqDataWithApiName.reqData, http.MethodPost, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + + if !shouldErr { + require.NoError(t, err) + api := chainMessage.GetApi() + collection := chainMessage.GetApiCollection() + require.Equal(t, reqDataWithApiName.apiName, api.Name) + require.Equal(t, correctPath, collection.CollectionData.InternalPath) + } else { + require.Error(t, err) + require.ErrorIs(t, err, common.APINotSupportedError) + require.Nil(t, chainMessage) + } + }) + } } } diff --git a/protocol/chainlib/node_error_handler.go b/protocol/chainlib/node_error_handler.go index 079b58b231..683839b8d3 100644 --- a/protocol/chainlib/node_error_handler.go +++ b/protocol/chainlib/node_error_handler.go @@ -11,13 +11,13 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/common" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/common" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type genericErrorHandler struct{} @@ -87,11 +87,11 @@ func (geh *genericErrorHandler) HandleJSONFormatError(replyData []byte) error { func (geh *genericErrorHandler) ValidateRequestAndResponseIds(nodeMessageID json.RawMessage, replyMsgID json.RawMessage) error { reqId, idErr := rpcInterfaceMessages.IdFromRawMessage(nodeMessageID) if idErr != nil { - return fmt.Errorf("Failed parsing ID " + idErr.Error()) + return fmt.Errorf("failed parsing ID %s", idErr.Error()) } respId, idErr := rpcInterfaceMessages.IdFromRawMessage(replyMsgID) if idErr != nil { - return fmt.Errorf("Failed parsing ID " + idErr.Error()) + return fmt.Errorf("failed parsing ID %s", idErr.Error()) } if reqId != respId { return fmt.Errorf("ID mismatch error") diff --git a/protocol/chainlib/node_error_handler_test.go b/protocol/chainlib/node_error_handler_test.go index 216444b0fc..c78fc24472 100644 --- a/protocol/chainlib/node_error_handler_test.go +++ b/protocol/chainlib/node_error_handler_test.go @@ -9,7 +9,7 @@ import ( "syscall" "testing" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/stretchr/testify/require" ) diff --git a/protocol/chainlib/protocol_message.go b/protocol/chainlib/protocol_message.go new file mode 100644 index 0000000000..c9ed2ea01d --- /dev/null +++ b/protocol/chainlib/protocol_message.go @@ -0,0 +1,53 @@ +package chainlib + +import ( + "strings" + + "github.com/lavanet/lava/v2/protocol/common" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" +) + +type BaseProtocolMessage struct { + ChainMessage + directiveHeaders map[string]string + relayRequestData *pairingtypes.RelayPrivateData +} + +func (bpm *BaseProtocolMessage) GetDirectiveHeaders() map[string]string { + return bpm.directiveHeaders +} + +func (bpm *BaseProtocolMessage) RelayPrivateData() *pairingtypes.RelayPrivateData { + return bpm.relayRequestData +} + +func (bpm *BaseProtocolMessage) HashCacheRequest(chainId string) ([]byte, func([]byte) []byte, error) { + return HashCacheRequest(bpm.relayRequestData, chainId) +} + +func (bpm *BaseProtocolMessage) GetBlockedProviders() []string { + if bpm.directiveHeaders == nil { + return nil + } + blockedProviders, ok := bpm.directiveHeaders[common.BLOCK_PROVIDERS_ADDRESSES_HEADER_NAME] + if ok { + return strings.Split(blockedProviders, ",") + } + return nil +} + +func NewProtocolMessage(chainMessage ChainMessage, directiveHeaders map[string]string, relayRequestData *pairingtypes.RelayPrivateData) ProtocolMessage { + return &BaseProtocolMessage{ + ChainMessage: chainMessage, + directiveHeaders: directiveHeaders, + relayRequestData: relayRequestData, + } +} + +type ProtocolMessage interface { + ChainMessage + GetDirectiveHeaders() map[string]string + RelayPrivateData() *pairingtypes.RelayPrivateData + HashCacheRequest(chainId string) ([]byte, func([]byte) []byte, error) + GetBlockedProviders() []string +} diff --git a/protocol/chainlib/provider_node_subscription_manager.go b/protocol/chainlib/provider_node_subscription_manager.go new file mode 100644 index 0000000000..3766a063cc --- /dev/null +++ b/protocol/chainlib/provider_node_subscription_manager.go @@ -0,0 +1,650 @@ +package chainlib + +import ( + "context" + "fmt" + "sync" + "time" + + "github.com/btcsuite/btcd/btcec/v2" + sdk "github.com/cosmos/cosmos-sdk/types" + gojson "github.com/goccy/go-json" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/protocopy" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" +) + +const SubscriptionTimeoutDuration = 15 * time.Minute + +type relayFinalizationBlocksHandler interface { + GetParametersForRelayDataReliability( + ctx context.Context, + request *pairingtypes.RelayRequest, + chainMsg ChainMessage, + relayTimeout time.Duration, + blockLagForQosSync int64, + averageBlockTime time.Duration, + blockDistanceToFinalization, + blocksInFinalizationData uint32, + ) (latestBlock int64, requestedBlockHash []byte, requestedHashes []*chaintracker.BlockStore, modifiedReqBlock int64, finalized, updatedChainMessage bool, err error) + + BuildRelayFinalizedBlockHashes( + ctx context.Context, + request *pairingtypes.RelayRequest, + reply *pairingtypes.RelayReply, + latestBlock int64, + requestedHashes []*chaintracker.BlockStore, + updatedChainMessage bool, + relayTimeout time.Duration, + averageBlockTime time.Duration, + blockDistanceToFinalization uint32, + blocksInFinalizationData uint32, + modifiedReqBlock int64, + ) (err error) +} + +type connectedConsumerContainer struct { + consumerChannel *common.SafeChannelSender[*pairingtypes.RelayReply] + firstSetupRequest *pairingtypes.RelayRequest + consumerSDKAddress sdk.AccAddress +} + +type activeSubscription struct { + cancellableContext context.Context + cancellableContextCancelFunc context.CancelFunc + messagesChannel chan interface{} + nodeSubscription *rpcclient.ClientSubscription + subscriptionID string + firstSetupReply *pairingtypes.RelayReply + apiCollection *spectypes.ApiCollection + connectedConsumers map[string]map[string]*connectedConsumerContainer // first key is consumer address, 2nd key is consumer guid +} + +type ProviderNodeSubscriptionManager struct { + chainRouter ChainRouter + chainParser ChainParser + relayFinalizationBlocksHandler relayFinalizationBlocksHandler + activeSubscriptions map[string]*activeSubscription // key is request params hash + currentlyPendingSubscriptions map[string]*pendingSubscriptionsBroadcastManager // pending subscriptions waiting for node message to return. + privKey *btcec.PrivateKey + lock sync.RWMutex +} + +func NewProviderNodeSubscriptionManager(chainRouter ChainRouter, chainParser ChainParser, relayFinalizationBlocksHandler relayFinalizationBlocksHandler, privKey *btcec.PrivateKey) *ProviderNodeSubscriptionManager { + return &ProviderNodeSubscriptionManager{ + chainRouter: chainRouter, + chainParser: chainParser, + relayFinalizationBlocksHandler: relayFinalizationBlocksHandler, + activeSubscriptions: make(map[string]*activeSubscription), + currentlyPendingSubscriptions: make(map[string]*pendingSubscriptionsBroadcastManager), + privKey: privKey, + } +} + +func (pnsm *ProviderNodeSubscriptionManager) failedPendingSubscription(hashedParams string) { + pnsm.lock.Lock() + defer pnsm.lock.Unlock() + pendingSubscriptionChannel, ok := pnsm.currentlyPendingSubscriptions[hashedParams] + if !ok { + utils.LavaFormatError("failed fetching hashed params in failedPendingSubscriptions", nil, utils.LogAttr("hash", hashedParams), utils.LogAttr("cwsm.currentlyPendingSubscriptions", pnsm.currentlyPendingSubscriptions)) + } else { + pendingSubscriptionChannel.broadcastToChannelList(false) + delete(pnsm.currentlyPendingSubscriptions, hashedParams) // removed pending + } +} + +// must be called under a lock. +func (pnsm *ProviderNodeSubscriptionManager) successfulPendingSubscription(hashedParams string) { + pendingSubscriptionChannel, ok := pnsm.currentlyPendingSubscriptions[hashedParams] + if !ok { + utils.LavaFormatError("failed fetching hashed params in successfulPendingSubscription", nil, utils.LogAttr("hash", hashedParams), utils.LogAttr("cwsm.currentlyPendingSubscriptions", pnsm.currentlyPendingSubscriptions)) + } else { + pendingSubscriptionChannel.broadcastToChannelList(true) + delete(pnsm.currentlyPendingSubscriptions, hashedParams) // removed pending + } +} + +func (pnsm *ProviderNodeSubscriptionManager) checkAndAddPendingSubscriptionsWithLock(hashedParams string) (chan bool, bool) { + pnsm.lock.Lock() + defer pnsm.lock.Unlock() + pendingSubscriptionBroadcastManager, ok := pnsm.currentlyPendingSubscriptions[hashedParams] + if !ok { + // we didn't find hashed params for pending subscriptions, we can create a new subscription + utils.LavaFormatTrace("No pending subscription for incoming hashed params found", utils.LogAttr("params", hashedParams)) + // create pending subscription broadcast manager for other users to sync on the same relay. + pnsm.currentlyPendingSubscriptions[hashedParams] = &pendingSubscriptionsBroadcastManager{} + return nil, ok + } + utils.LavaFormatTrace("found subscription for incoming hashed params, registering our channel", utils.LogAttr("params", hashedParams)) + // by creating a buffered channel we make sure that we wont miss out on the update between the time we register and listen to the channel + listenChan := make(chan bool, 1) + pendingSubscriptionBroadcastManager.broadcastChannelList = append(pendingSubscriptionBroadcastManager.broadcastChannelList, listenChan) + return listenChan, ok +} + +func (pnsm *ProviderNodeSubscriptionManager) checkForActiveSubscriptionsWithLock(ctx context.Context, hashedParams string, consumerAddr sdk.AccAddress, consumerProcessGuid string, params []byte, chainMessage ChainMessage, consumerChannel chan<- *pairingtypes.RelayReply, request *pairingtypes.RelayRequest) (subscriptionId string, err error) { + pnsm.lock.Lock() + defer pnsm.lock.Unlock() + paramsChannelToConnectedConsumers, foundSubscriptionHash := pnsm.activeSubscriptions[hashedParams] + if foundSubscriptionHash { + consumerAddrString := consumerAddr.String() + utils.LavaFormatTrace("[AddConsumer] found existing subscription", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("consumerProcessGuid", consumerProcessGuid), + utils.LogAttr("params", string(params)), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + if _, foundConsumer := paramsChannelToConnectedConsumers.connectedConsumers[consumerAddrString]; foundConsumer { // Consumer is already connected to this subscription, dismiss + // check consumer guid. + if consumerGuidContainer, foundGuid := paramsChannelToConnectedConsumers.connectedConsumers[consumerAddrString][consumerProcessGuid]; foundGuid { + // if the consumer exists and channel is already active, and the consumer tried to resubscribe, we assume the connection was interrupted, we disconnect the previous channel and reconnect the incoming channel. + utils.LavaFormatWarning("consumer tried to subscribe twice to the same subscription hash, disconnecting the previous one and attaching incoming channel", nil, + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("hashedParams", hashedParams), + utils.LogAttr("params_provided", chainMessage.GetRPCMessage().GetParams()), + ) + // disconnecting the previous channel, attaching new channel, and returning subscription Id. + consumerGuidContainer.consumerChannel.ReplaceChannel(consumerChannel) + return paramsChannelToConnectedConsumers.subscriptionID, nil + } + // else we have this consumer but two different processes try to subscribe + utils.LavaFormatTrace("[AddConsumer] consumer address exists but consumer GUID does not exist in the subscription map, adding", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("params", string(params)), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("consumerProcessGuid", consumerProcessGuid), + ) + } + + // Create a new map for this consumer address if it doesn't exist + if paramsChannelToConnectedConsumers.connectedConsumers[consumerAddrString] == nil { + utils.LavaFormatError("missing map object from paramsChannelToConnectedConsumers.connectedConsumers[consumerAddrString], creating to avoid nil deref", nil) + paramsChannelToConnectedConsumers.connectedConsumers[consumerAddrString] = make(map[string]*connectedConsumerContainer) + } + + utils.LavaFormatTrace("[AddConsumer] consumer GUID does not exist in the subscription, adding", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("params", string(params)), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("consumerProcessGuid", consumerProcessGuid), + ) + + // Add the new entry for the consumer + paramsChannelToConnectedConsumers.connectedConsumers[consumerAddrString][consumerProcessGuid] = &connectedConsumerContainer{ + consumerChannel: common.NewSafeChannelSender(ctx, consumerChannel), + firstSetupRequest: &pairingtypes.RelayRequest{}, // Deep copy later firstSetupChainMessage: chainMessage, + consumerSDKAddress: consumerAddr, + } + + copyRequestErr := protocopy.DeepCopyProtoObject(request, paramsChannelToConnectedConsumers.connectedConsumers[consumerAddrString][consumerProcessGuid].firstSetupRequest) + if copyRequestErr != nil { + return "", utils.LavaFormatError("failed to copy subscription request", copyRequestErr) + } + + firstSetupReply := paramsChannelToConnectedConsumers.firstSetupReply + // Making sure to sign the reply before returning it to the consumer. This will replace the sig field with the correct value + // (and not the signature for another consumer) + signingError := pnsm.signReply(ctx, firstSetupReply, consumerAddr, chainMessage, request) + if signingError != nil { + return "", utils.LavaFormatError("AddConsumer failed signing reply", signingError) + } + + subscriptionId = paramsChannelToConnectedConsumers.subscriptionID + // Send the first reply to the consumer asynchronously, allowing the lock to be released while waiting for the consumer to receive the response. + pnsm.activeSubscriptions[hashedParams].connectedConsumers[consumerAddrString][consumerProcessGuid].consumerChannel.LockAndSendAsynchronously(firstSetupReply) + return subscriptionId, nil + } + return "", NoActiveSubscriptionFound +} + +func (pnsm *ProviderNodeSubscriptionManager) AddConsumer(ctx context.Context, request *pairingtypes.RelayRequest, chainMessage ChainMessage, consumerAddr sdk.AccAddress, consumerChannel chan<- *pairingtypes.RelayReply, consumerProcessGuid string) (subscriptionId string, err error) { + utils.LavaFormatTrace("[AddConsumer] called", utils.LogAttr("consumerAddr", consumerAddr)) + + if pnsm == nil { + return "", fmt.Errorf("ProviderNodeSubscriptionManager is nil") + } + + hashedParams, params, err := pnsm.getHashedParams(chainMessage) + if err != nil { + return "", err + } + + utils.LavaFormatTrace("[AddConsumer] hashed params", + utils.LogAttr("params", string(params)), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + subscriptionId, err = pnsm.checkForActiveSubscriptionsWithLock(ctx, hashedParams, consumerAddr, consumerProcessGuid, params, chainMessage, consumerChannel, request) + if NoActiveSubscriptionFound.Is(err) { + // This for loop will break when there is a successful queue lock, allowing us to avoid racing new subscription creation when + // there is a failed subscription. the loop will break for the first routine the manages to lock and create the pendingSubscriptionsBroadcastManager + for { + pendingSubscriptionChannel, foundPendingSubscription := pnsm.checkAndAddPendingSubscriptionsWithLock(hashedParams) + if foundPendingSubscription { + utils.LavaFormatTrace("Found pending subscription, waiting for it to complete") + pendingResult := <-pendingSubscriptionChannel + utils.LavaFormatTrace("Finished pending for subscription, have results", utils.LogAttr("success", pendingResult)) + // Check result is valid, if not fall through logs and try again with a new message. + if pendingResult { + subscriptionId, err = pnsm.checkForActiveSubscriptionsWithLock(ctx, hashedParams, consumerAddr, consumerProcessGuid, params, chainMessage, consumerChannel, request) + if err == nil { + // found new the subscription after waiting for a pending subscription + return subscriptionId, err + } + // In case we expected a subscription to return as res != nil we should find an active subscription. + // If we fail to find it, it might have suddenly stopped. we will log a warning and try with a new client. + utils.LavaFormatWarning("failed getting a result when channel indicated we got a successful relay", nil) + } else { + utils.LavaFormatWarning("Failed the subscription attempt, retrying with the incoming message", nil, utils.LogAttr("hash", hashedParams)) + } + } else { + utils.LavaFormatDebug("No Pending subscriptions, creating a new one", utils.LogAttr("hash", hashedParams)) + break + } + } + + // did not find active or pending subscriptions, will try to create a new subscription. + consumerAddrString := consumerAddr.String() + utils.LavaFormatTrace("[AddConsumer] did not found existing subscription for hashed params, creating new one", utils.LogAttr("hash", hashedParams)) + nodeChan := make(chan interface{}) + var replyWrapper *RelayReplyWrapper + var clientSubscription *rpcclient.ClientSubscription + replyWrapper, subscriptionId, clientSubscription, _, _, err = pnsm.chainRouter.SendNodeMsg(ctx, nodeChan, chainMessage, append(request.RelayData.Extensions, WebSocketExtension)) + utils.LavaFormatTrace("[AddConsumer] subscription reply received", + utils.LogAttr("replyWrapper", replyWrapper), + utils.LogAttr("subscriptionId", subscriptionId), + utils.LogAttr("clientSubscription", clientSubscription), + utils.LogAttr("err", err), + ) + + if err != nil { + pnsm.failedPendingSubscription(hashedParams) + return "", utils.LavaFormatError("ProviderNodeSubscriptionManager: Subscription failed", err, utils.LogAttr("GUID", ctx), utils.LogAttr("params", params)) + } + + if replyWrapper == nil || replyWrapper.RelayReply == nil { + pnsm.failedPendingSubscription(hashedParams) + return "", utils.LavaFormatError("ProviderNodeSubscriptionManager: Subscription failed, relayWrapper or RelayReply are nil", nil, utils.LogAttr("GUID", ctx)) + } + + reply := replyWrapper.RelayReply + + copiedRequest := &pairingtypes.RelayRequest{} + copyRequestErr := protocopy.DeepCopyProtoObject(request, copiedRequest) + if copyRequestErr != nil { + pnsm.failedPendingSubscription(hashedParams) + return "", utils.LavaFormatError("failed to copy subscription request", copyRequestErr) + } + + err = pnsm.signReply(ctx, reply, consumerAddr, chainMessage, request) + if err != nil { + pnsm.failedPendingSubscription(hashedParams) + return "", utils.LavaFormatError("failed signing subscription Reply", err) + } + + if clientSubscription == nil { + // failed subscription, but not an error. (probably a node error) + SafeChannelSender := common.NewSafeChannelSender(ctx, consumerChannel) + // Send the first message to the consumer, so it can handle the error in a routine. + go SafeChannelSender.Send(reply) + pnsm.failedPendingSubscription(hashedParams) + return "", utils.LavaFormatWarning("ProviderNodeSubscriptionManager: Subscription failed, node error", nil, utils.LogAttr("GUID", ctx), utils.LogAttr("reply", reply)) + } + + utils.LavaFormatTrace("[AddConsumer] subscription successful", + utils.LogAttr("subscriptionId", subscriptionId), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("firstSetupReplyData", reply.Data), + ) + + // Initialize the map for connected consumers + connectedConsumers := map[string]map[string]*connectedConsumerContainer{ + consumerAddrString: { + consumerProcessGuid: { + consumerChannel: common.NewSafeChannelSender(ctx, consumerChannel), + firstSetupRequest: copiedRequest, + consumerSDKAddress: consumerAddr, + }, + }, + } + + // Create the activeSubscription instance + cancellableCtx, cancel := context.WithCancel(context.Background()) + channelToConnectedConsumers := &activeSubscription{ + cancellableContext: cancellableCtx, + cancellableContextCancelFunc: cancel, + messagesChannel: nodeChan, + nodeSubscription: clientSubscription, + subscriptionID: subscriptionId, + firstSetupReply: reply, + apiCollection: chainMessage.GetApiCollection(), + connectedConsumers: connectedConsumers, + } + + // now we can lock after we have a successful subscription. + pnsm.lock.Lock() + defer pnsm.lock.Unlock() + + pnsm.activeSubscriptions[hashedParams] = channelToConnectedConsumers + firstSetupReply := reply + + // let other channels waiting the new subscription know we have a channel ready. + pnsm.successfulPendingSubscription(hashedParams) + + // send the first reply to the consumer, reply needs to be signed. + pnsm.activeSubscriptions[hashedParams].connectedConsumers[consumerAddrString][consumerProcessGuid].consumerChannel.LockAndSendAsynchronously(firstSetupReply) + // now when all channels are set, start listening to incoming data. + go pnsm.listenForSubscriptionMessages(cancellableCtx, nodeChan, clientSubscription.Err(), hashedParams) + } + + return subscriptionId, err +} + +func (pnsm *ProviderNodeSubscriptionManager) listenForSubscriptionMessages(ctx context.Context, nodeChan chan interface{}, nodeErrChan <-chan error, hashedParams string) { + utils.LavaFormatTrace("Inside ProviderNodeSubscriptionManager:startListeningForSubscription()", utils.LogAttr("hashedParams", utils.ToHexString(hashedParams))) + defer utils.LavaFormatTrace("Leaving ProviderNodeSubscriptionManager:startListeningForSubscription()", utils.LogAttr("hashedParams", utils.ToHexString(hashedParams))) + + subscriptionTimeoutTicker := time.NewTicker(SubscriptionTimeoutDuration) // Set a time limit of 15 minutes for the subscription + defer subscriptionTimeoutTicker.Stop() + + closeNodeSubscriptionCallback := func() { + pnsm.lock.Lock() + defer pnsm.lock.Unlock() + pnsm.closeNodeSubscription(hashedParams) + } + + for { + select { + case <-ctx.Done(): + // If this context is done, it means that the subscription was already closed + utils.LavaFormatTrace("ProviderNodeSubscriptionManager:startListeningForSubscription() subscription context is done, ending subscription", + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + return + case <-subscriptionTimeoutTicker.C: + utils.LavaFormatTrace("ProviderNodeSubscriptionManager:startListeningForSubscription() timeout reached, ending subscription", + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + closeNodeSubscriptionCallback() + return + case nodeErr := <-nodeErrChan: + utils.LavaFormatWarning("ProviderNodeSubscriptionManager:startListeningForSubscription() got error from node, ending subscription", nodeErr, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + closeNodeSubscriptionCallback() + return + case nodeMsg := <-nodeChan: + utils.LavaFormatTrace("ProviderNodeSubscriptionManager:startListeningForSubscription() got new message from node", + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("nodeMsg", nodeMsg), + ) + err := pnsm.handleNewNodeMessage(ctx, hashedParams, nodeMsg) + if err != nil { + closeNodeSubscriptionCallback() + } + } + } +} + +func (pnsm *ProviderNodeSubscriptionManager) getHashedParams(chainMessage ChainMessageForSend) (hashedParams string, params []byte, err error) { + rpcInputMessage := chainMessage.GetRPCMessage() + params, err = gojson.Marshal(rpcInputMessage.GetParams()) + if err != nil { + return "", nil, utils.LavaFormatError("could not marshal params", err) + } + + hashedParams = rpcclient.CreateHashFromParams(params) + return hashedParams, params, nil +} + +func (pnsm *ProviderNodeSubscriptionManager) convertNodeMsgToMarshalledJsonRpcResponse(data interface{}, apiCollection *spectypes.ApiCollection) ([]byte, error) { + msg, ok := data.(*rpcclient.JsonrpcMessage) + if !ok { + return nil, fmt.Errorf("data is not a *rpcclient.JsonrpcMessage, but: %T", data) + } + + var convertedMsg any + var err error + + switch apiCollection.GetCollectionData().ApiInterface { + case spectypes.APIInterfaceJsonRPC: + convertedMsg, err = rpcInterfaceMessages.ConvertJsonRPCMsg(msg) + if err != nil { + return nil, err + } + case spectypes.APIInterfaceTendermintRPC: + convertedMsg, err = rpcInterfaceMessages.ConvertTendermintMsg(msg) + if err != nil { + return nil, err + } + default: + return nil, fmt.Errorf("unsupported API interface: %s", apiCollection.GetCollectionData().ApiInterface) + } + + marshalledMsg, err := gojson.Marshal(convertedMsg) + if err != nil { + return nil, err + } + + return marshalledMsg, nil +} + +func (pnsm *ProviderNodeSubscriptionManager) signReply(ctx context.Context, reply *pairingtypes.RelayReply, consumerAddr sdk.AccAddress, chainMessage ChainMessage, request *pairingtypes.RelayRequest) error { + // Send the first setup message to the consumer in a go routine because the blocking listening for this channel happens after this function + dataReliabilityEnabled, _ := pnsm.chainParser.DataReliabilityParams() + blockLagForQosSync, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData := pnsm.chainParser.ChainBlockStats() + relayTimeout := GetRelayTimeout(chainMessage, averageBlockTime) + + if dataReliabilityEnabled { + var err error + latestBlock, _, requestedHashes, modifiedReqBlock, _, updatedChainMessage, err := pnsm.relayFinalizationBlocksHandler.GetParametersForRelayDataReliability(ctx, request, chainMessage, relayTimeout, blockLagForQosSync, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData) + if err != nil { + return err + } + + err = pnsm.relayFinalizationBlocksHandler.BuildRelayFinalizedBlockHashes(ctx, request, reply, latestBlock, requestedHashes, updatedChainMessage, relayTimeout, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData, modifiedReqBlock) + if err != nil { + return err + } + } + + var ignoredMetadata []pairingtypes.Metadata + reply.Metadata, _, ignoredMetadata = pnsm.chainParser.HandleHeaders(reply.Metadata, chainMessage.GetApiCollection(), spectypes.Header_pass_reply) + reply, err := lavaprotocol.SignRelayResponse(consumerAddr, *request, pnsm.privKey, reply, dataReliabilityEnabled) + if err != nil { + return err + } + reply.Metadata = append(reply.Metadata, ignoredMetadata...) // appended here only after signing + return nil +} + +func (pnsm *ProviderNodeSubscriptionManager) handleNewNodeMessage(ctx context.Context, hashedParams string, nodeMsg interface{}) error { + pnsm.lock.RLock() + defer pnsm.lock.RUnlock() + activeSub, foundActiveSubscription := pnsm.activeSubscriptions[hashedParams] + if !foundActiveSubscription { + return utils.LavaFormatWarning("No hashed params in handleNewNodeMessage, connection might have been closed", FailedSendingSubscriptionToClients, utils.LogAttr("hash", hashedParams)) + } + // Sending message to all connected consumers + for consumerAddrString, connectedConsumerAddress := range activeSub.connectedConsumers { + for consumerProcessGuid, connectedConsumerContainer := range connectedConsumerAddress { + utils.LavaFormatTrace("ProviderNodeSubscriptionManager:startListeningForSubscription() sending to consumer", + utils.LogAttr("consumerAddr", consumerAddrString), + utils.LogAttr("consumerProcessGuid", consumerProcessGuid), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + copiedRequest := &pairingtypes.RelayRequest{} + // TODO: Optimization, a better way is to avoid ParseMsg multiple times by creating a deep copy for chain message. + // this way we can parse msg only once and use the copy method to save resources. + copyRequestErr := protocopy.DeepCopyProtoObject(connectedConsumerContainer.firstSetupRequest, copiedRequest) + if copyRequestErr != nil { + return utils.LavaFormatError("failed to copy subscription request", copyRequestErr) + } + + extensionInfo := extensionslib.ExtensionInfo{LatestBlock: 0, ExtensionOverride: copiedRequest.RelayData.Extensions} + if extensionInfo.ExtensionOverride == nil { // in case consumer did not set an extension, we skip the extension parsing and we are sending it to the regular url + extensionInfo.ExtensionOverride = []string{} + } + + chainMessage, err := pnsm.chainParser.ParseMsg(copiedRequest.RelayData.ApiUrl, copiedRequest.RelayData.Data, copiedRequest.RelayData.ConnectionType, copiedRequest.RelayData.GetMetadata(), extensionInfo) + if err != nil { + return utils.LavaFormatError("failed to parse message", err) + } + + apiCollection := pnsm.activeSubscriptions[hashedParams].apiCollection + + marshalledNodeMsg, err := pnsm.convertNodeMsgToMarshalledJsonRpcResponse(nodeMsg, apiCollection) + if err != nil { + return utils.LavaFormatError("error converting node message", err) + } + + relayMessageFromNode := &pairingtypes.RelayReply{ + Data: marshalledNodeMsg, + Metadata: []pairingtypes.Metadata{}, + } + + err = pnsm.signReply(ctx, relayMessageFromNode, connectedConsumerContainer.consumerSDKAddress, chainMessage, copiedRequest) + if err != nil { + return utils.LavaFormatError("error signing reply", err) + } + + utils.LavaFormatDebug("Sending relay to consumer", + utils.LogAttr("requestRelayData", copiedRequest.RelayData), + utils.LogAttr("reply", marshalledNodeMsg), + utils.LogAttr("replyLatestBlock", relayMessageFromNode.LatestBlock), + utils.LogAttr("consumerAddr", connectedConsumerContainer.consumerSDKAddress), + ) + + go connectedConsumerContainer.consumerChannel.Send(relayMessageFromNode) + } + } + return nil +} + +func (pnsm *ProviderNodeSubscriptionManager) RemoveConsumer(ctx context.Context, chainMessage ChainMessageForSend, consumerAddr sdk.AccAddress, closeConsumerChannel bool, consumerProcessGuid string) error { + if pnsm == nil { + return nil + } + + hashedParams, params, err := pnsm.getHashedParams(chainMessage) + if err != nil { + return err + } + + utils.LavaFormatTrace("[RemoveConsumer] requested to remove consumer from subscription", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("params", params), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + consumerAddrString := consumerAddr.String() + + pnsm.lock.Lock() + defer pnsm.lock.Unlock() + + openSubscriptions, ok := pnsm.activeSubscriptions[hashedParams] + if !ok { + utils.LavaFormatTrace("[RemoveConsumer] no subscription found for params, subscription is already closed", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("params", params), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + return nil + } + + // Remove consumer from connected consumers + if _, ok := openSubscriptions.connectedConsumers[consumerAddrString]; ok { + if _, foundGuid := openSubscriptions.connectedConsumers[consumerAddrString][consumerProcessGuid]; foundGuid { + utils.LavaFormatTrace("[RemoveConsumer] found consumer connected consumers", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddrString), + utils.LogAttr("params", params), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("consumerProcessGuid", consumerProcessGuid), + utils.LogAttr("connectedConsumers", openSubscriptions.connectedConsumers), + ) + if closeConsumerChannel { + utils.LavaFormatTrace("[RemoveConsumer] closing consumer channel", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddrString), + utils.LogAttr("params", params), + utils.LogAttr("consumerProcessGuid", consumerProcessGuid), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + openSubscriptions.connectedConsumers[consumerAddrString][consumerProcessGuid].consumerChannel.Close() + } + + // delete guid + delete(pnsm.activeSubscriptions[hashedParams].connectedConsumers[consumerAddrString], consumerProcessGuid) + // check if this was our only subscription for this consumer. + if len(pnsm.activeSubscriptions[hashedParams].connectedConsumers[consumerAddrString]) == 0 { + // delete consumer as well. + delete(pnsm.activeSubscriptions[hashedParams].connectedConsumers, consumerAddrString) + } + if len(pnsm.activeSubscriptions[hashedParams].connectedConsumers) == 0 { + utils.LavaFormatTrace("[RemoveConsumer] no more connected consumers", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("params", params), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + // Cancel the subscription's context and close the subscription + pnsm.activeSubscriptions[hashedParams].cancellableContextCancelFunc() + pnsm.closeNodeSubscription(hashedParams) + } + } + utils.LavaFormatTrace("[RemoveConsumer] removed consumer", utils.LogAttr("consumerAddr", consumerAddr), utils.LogAttr("params", params)) + } else { + utils.LavaFormatTrace("[RemoveConsumer] consumer not found in connected consumers", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("params", params), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("consumerProcessGuid", consumerProcessGuid), + utils.LogAttr("connectedConsumers", openSubscriptions.connectedConsumers), + ) + } + return nil +} + +func (pnsm *ProviderNodeSubscriptionManager) closeNodeSubscription(hashedParams string) error { + activeSub, foundActiveSubscription := pnsm.activeSubscriptions[hashedParams] + if !foundActiveSubscription { + return utils.LavaFormatError("closeNodeSubscription called with hashedParams that does not exist", nil, utils.LogAttr("hashedParams", utils.ToHexString(hashedParams))) + } + + // Disconnect all connected consumers + for consumerAddrString, consumerChannels := range activeSub.connectedConsumers { + for consumerGuid, consumerChannel := range consumerChannels { + utils.LavaFormatTrace("ProviderNodeSubscriptionManager:closeNodeSubscription() closing consumer channel", + utils.LogAttr("consumerAddr", consumerAddrString), + utils.LogAttr("consumerGuid", consumerGuid), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + consumerChannel.consumerChannel.Close() + } + } + + pnsm.activeSubscriptions[hashedParams].nodeSubscription.Unsubscribe() + close(pnsm.activeSubscriptions[hashedParams].messagesChannel) + delete(pnsm.activeSubscriptions, hashedParams) + return nil +} diff --git a/protocol/chainlib/provider_node_subscription_manager_test.go b/protocol/chainlib/provider_node_subscription_manager_test.go new file mode 100644 index 0000000000..2104adc994 --- /dev/null +++ b/protocol/chainlib/provider_node_subscription_manager_test.go @@ -0,0 +1,441 @@ +package chainlib + +import ( + "context" + "net/http" + "strconv" + "sync" + "testing" + "time" + + "github.com/gorilla/websocket" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + "github.com/stretchr/testify/require" +) + +const testGuid = "testGuid" + +type RelayFinalizationBlocksHandlerMock struct{} + +func (rf *RelayFinalizationBlocksHandlerMock) GetParametersForRelayDataReliability( + ctx context.Context, + request *pairingtypes.RelayRequest, + chainMsg ChainMessage, + relayTimeout time.Duration, + blockLagForQosSync int64, + averageBlockTime time.Duration, + blockDistanceToFinalization, + blocksInFinalizationData uint32, +) (latestBlock int64, requestedBlockHash []byte, requestedHashes []*chaintracker.BlockStore, modifiedReqBlock int64, finalized, updatedChainMessage bool, err error) { + return 0, []byte{}, []*chaintracker.BlockStore{}, 0, true, true, nil +} + +func (rf *RelayFinalizationBlocksHandlerMock) BuildRelayFinalizedBlockHashes( + ctx context.Context, + request *pairingtypes.RelayRequest, + reply *pairingtypes.RelayReply, + latestBlock int64, + requestedHashes []*chaintracker.BlockStore, + updatedChainMessage bool, + relayTimeout time.Duration, + averageBlockTime time.Duration, + blockDistanceToFinalization uint32, + blocksInFinalizationData uint32, + modifiedReqBlock int64, +) (err error) { + return nil +} + +func TestSubscriptionManager_HappyFlow(t *testing.T) { + playbook := []struct { + name string + specId string + apiInterface string + connectionType string + subscriptionRequestData []byte + subscriptionFirstReply []byte + }{ + { + name: "TendermintRPC", + specId: "LAV1", + apiInterface: spectypes.APIInterfaceTendermintRPC, + connectionType: "", + subscriptionRequestData: []byte(`{"jsonrpc":"2.0","id":3,"method":"subscribe","params":{"query":"tm.event='NewBlock'"}}`), + subscriptionFirstReply: []byte(`{"jsonrpc":"2.0","id":3,"result":{}}`), + }, + { + name: "JsonRPC", + specId: "ETH1", + apiInterface: spectypes.APIInterfaceJsonRPC, + connectionType: "POST", + subscriptionRequestData: []byte(`{"jsonrpc":"2.0","id":5,"method":"eth_subscribe","params":["newHeads"]}`), + subscriptionFirstReply: []byte(`{"jsonrpc":"2.0","id":5,"result":"0x1234567890"}`), + }, + } + + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + ts := SetupForTests(t, 1, play.specId, "../../") + + wg := sync.WaitGroup{} + wg.Add(1) + // msgCount := 0 + upgrader := websocket.Upgrader{} + + // Create a simple websocket server that mocks the node + handleWebSocket := func(w http.ResponseWriter, r *http.Request) { + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + require.NoError(t, err) + return + } + defer conn.Close() + + for { + // Read the request + messageType, message, err := conn.ReadMessage() + if err != nil { + require.NoError(t, err) + return + } + + wg.Done() + + require.Equal(t, string(play.subscriptionRequestData)+"\n", string(message)) + + // Write the first reply + err = conn.WriteMessage(messageType, play.subscriptionFirstReply) + if err != nil { + require.NoError(t, err) + return + } + } + } + + chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(context.Background(), play.specId, play.apiInterface, nil, handleWebSocket, "../../", nil) + require.NoError(t, err) + if closeServer != nil { + defer closeServer() + } + + // Create the relay request and chain message + relayRequest := &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{ + Data: play.subscriptionRequestData, + }, + RelaySession: &pairingtypes.RelaySession{}, + } + + chainMessage, err := chainParser.ParseMsg("", play.subscriptionRequestData, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + + // Create the provider node subscription manager + mockRpcProvider := &RelayFinalizationBlocksHandlerMock{} + pnsm := NewProviderNodeSubscriptionManager(chainRouter, chainParser, mockRpcProvider, ts.Providers[0].SK) + + consumerChannel := make(chan *pairingtypes.RelayReply) + + // Read the consumer channel that simulates consumer + go func() { + reply := <-consumerChannel + require.NotNil(t, reply) + require.Equal(t, string(play.subscriptionFirstReply), string(reply.Data)) + }() + + // Subscribe to the chain + subscriptionId, err := pnsm.AddConsumer(ts.Ctx, relayRequest, chainMessage, ts.Consumer.Addr, consumerChannel, testGuid) + require.NoError(t, err) + require.NotEmpty(t, subscriptionId) + + wg.Wait() // Make sure the subscription manager sent a message to the node + + // Subscribe to the same subscription again, should return the same subscription id + subscriptionIdNew, err := pnsm.AddConsumer(ts.Ctx, relayRequest, chainMessage, ts.Consumer.Addr, consumerChannel, testGuid) + require.NoError(t, err) + require.NotEmpty(t, subscriptionId) + require.Equal(t, subscriptionId, subscriptionIdNew) + + // Cut the subscription, and re-subscribe, should send another message to node + err = pnsm.RemoveConsumer(ts.Ctx, chainMessage, ts.Consumer.Addr, true, testGuid) + require.NoError(t, err) + + // Make sure both the consumer channels are closed + _, ok := <-consumerChannel + require.False(t, ok) + + consumerChannel = make(chan *pairingtypes.RelayReply) + waitTestToEnd := make(chan bool) + // Read the consumer channel that simulates consumer + go func() { + defer func() { waitTestToEnd <- true }() + reply := <-consumerChannel + require.NotNil(t, reply) + require.Equal(t, string(play.subscriptionFirstReply), string(reply.Data)) + }() + + wg.Add(1) // Should send another message to the node + + subscriptionId, err = pnsm.AddConsumer(ts.Ctx, relayRequest, chainMessage, ts.Consumer.Addr, consumerChannel, "testGuid") + require.NoError(t, err) + require.NotEmpty(t, subscriptionId) + + wg.Wait() // Make sure the subscription manager sent another message to the node + + // making sure our routine ended, otherwise the routine can read the wrong play.subscriptionFirstReply + <-waitTestToEnd + }) + } +} + +func TestSubscriptionManager_MultipleParallelSubscriptionsWithTheSameParams(t *testing.T) { + playbook := []struct { + name string + specId string + apiInterface string + connectionType string + subscriptionRequestData []byte + subscriptionFirstReply []byte + }{ + { + name: "TendermintRPC", + specId: "LAV1", + apiInterface: spectypes.APIInterfaceTendermintRPC, + connectionType: "", + subscriptionRequestData: []byte(`{"jsonrpc":"2.0","id":3,"method":"subscribe","params":{"query":"tm.event='NewBlock'"}}`), + subscriptionFirstReply: []byte(`{"jsonrpc":"2.0","id":3,"result":{}}`), + }, + { + name: "JsonRPC", + specId: "ETH1", + apiInterface: spectypes.APIInterfaceJsonRPC, + connectionType: "POST", + subscriptionRequestData: []byte(`{"jsonrpc":"2.0","id":5,"method":"eth_subscribe","params":["newHeads"]}`), + subscriptionFirstReply: []byte(`{"jsonrpc":"2.0","id":5,"result":"0x1234567890"}`), + }, + } + + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + ts := SetupForTests(t, 1, play.specId, "../../") + + wg := sync.WaitGroup{} + // msgCount := 0 + upgrader := websocket.Upgrader{} + + // Create a simple websocket server that mocks the node + handleWebSocket := func(w http.ResponseWriter, r *http.Request) { + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + require.NoError(t, err) + return + } + defer conn.Close() + first := true + for { + // Read the request + messageType, message, err := conn.ReadMessage() + if err != nil { + require.NoError(t, err) + return + } + + require.Equal(t, string(play.subscriptionRequestData)+"\n", string(message)) + + if first { // on first reply we want some delay, so we can make sure the pending is working properly + time.Sleep(time.Second * 2) + first = false + } + utils.LavaFormatDebug("write message") + wg.Done() + + // Write the first reply + err = conn.WriteMessage(messageType, play.subscriptionFirstReply) + if err != nil { + require.NoError(t, err) + return + } + } + } + + chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(context.Background(), play.specId, play.apiInterface, nil, handleWebSocket, "../../", nil) + require.NoError(t, err) + if closeServer != nil { + defer closeServer() + } + + // Create the relay request and chain message + relayRequest := &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{ + Data: play.subscriptionRequestData, + }, + RelaySession: &pairingtypes.RelaySession{}, + } + + chainMessage, err := chainParser.ParseMsg("", play.subscriptionRequestData, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + + // Create the provider node subscription manager + mockRpcProvider := &RelayFinalizationBlocksHandlerMock{} + pnsm := NewProviderNodeSubscriptionManager(chainRouter, chainParser, mockRpcProvider, ts.Providers[0].SK) + + wg.Add(1) + wgAllIds := sync.WaitGroup{} + wgAllIds.Add(10) + for i := 0; i < 10; i++ { + consumerChannel := make(chan *pairingtypes.RelayReply) + // Read the consumer channel that simulates consumer + go func() { + reply := <-consumerChannel + require.NotNil(t, reply) + require.Equal(t, string(play.subscriptionFirstReply), string(reply.Data)) + wgAllIds.Done() + }() + // Subscribe to the chain + go func(index int) { + subscriptionId, err := pnsm.AddConsumer(ts.Ctx, relayRequest, chainMessage, ts.Consumer.Addr, consumerChannel, testGuid+strconv.Itoa(index)) + require.NoError(t, err) + require.NotEmpty(t, subscriptionId) + }(i) + } + + utils.LavaFormatDebug("Waiting wait group") + wgAllIds.Wait() + wg.Wait() // Make sure the subscription manager sent a message to the node + + // Cut the subscription, and re-subscribe, should send another message to node + err = pnsm.RemoveConsumer(ts.Ctx, chainMessage, ts.Consumer.Addr, true, testGuid) + require.NoError(t, err) + }) + } +} + +func TestSubscriptionManager_MultipleParallelSubscriptionsWithTheSameParamsAndNodeMessageFailure(t *testing.T) { + playbook := []struct { + name string + specId string + apiInterface string + connectionType string + subscriptionRequestData []byte + subscriptionFirstReply []byte + }{ + { + name: "TendermintRPC", + specId: "LAV1", + apiInterface: spectypes.APIInterfaceTendermintRPC, + connectionType: "", + subscriptionRequestData: []byte(`{"jsonrpc":"2.0","id":3,"method":"subscribe","params":{"query":"tm.event='NewBlock'"}}`), + subscriptionFirstReply: []byte(`{"jsonrpc":"2.0","id":3,"result":{}}`), + }, + { + name: "JsonRPC", + specId: "ETH1", + apiInterface: spectypes.APIInterfaceJsonRPC, + connectionType: "POST", + subscriptionRequestData: []byte(`{"jsonrpc":"2.0","id":5,"method":"eth_subscribe","params":["newHeads"]}`), + subscriptionFirstReply: []byte(`{"jsonrpc":"2.0","id":5,"result":"0x1234567890"}`), + }, + } + + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + ts := SetupForTests(t, 1, play.specId, "../../") + + wg := sync.WaitGroup{} + // msgCount := 0 + upgrader := websocket.Upgrader{} + first := true + // Create a simple websocket server that mocks the node + handleWebSocket := func(w http.ResponseWriter, r *http.Request) { + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + require.NoError(t, err) + return + } + defer conn.Close() + for { + // Read the request + messageType, message, err := conn.ReadMessage() + if err != nil { + require.NoError(t, err) + return + } + + require.Equal(t, string(play.subscriptionRequestData)+"\n", string(message)) + + if first { // on first reply we want some delay, so we can make sure the pending is working properly + time.Sleep(time.Second * 2) + first = false + conn.Close() // first connection should fail. + return + } + utils.LavaFormatDebug("write message") + wg.Done() + + // Write the first reply + err = conn.WriteMessage(messageType, play.subscriptionFirstReply) + if err != nil { + require.NoError(t, err) + return + } + } + } + + chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(context.Background(), play.specId, play.apiInterface, nil, handleWebSocket, "../../", nil) + require.NoError(t, err) + if closeServer != nil { + defer closeServer() + } + + // Create the relay request and chain message + relayRequest := &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{ + Data: play.subscriptionRequestData, + }, + RelaySession: &pairingtypes.RelaySession{}, + } + + chainMessage, err := chainParser.ParseMsg("", play.subscriptionRequestData, play.connectionType, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + + // Create the provider node subscription manager + mockRpcProvider := &RelayFinalizationBlocksHandlerMock{} + pnsm := NewProviderNodeSubscriptionManager(chainRouter, chainParser, mockRpcProvider, ts.Providers[0].SK) + + wg.Add(1) + wgAllIds := sync.WaitGroup{} + wgAllIds.Add(9) + errors := []error{} + for i := 0; i < 10; i++ { + consumerChannel := make(chan *pairingtypes.RelayReply) + // Read the consumer channel that simulates consumer + go func() { + reply := <-consumerChannel + require.NotNil(t, reply) + require.Equal(t, string(play.subscriptionFirstReply), string(reply.Data)) + wgAllIds.Done() + }() + // Subscribe to the chain + go func(index int) { + _, err := pnsm.AddConsumer(ts.Ctx, relayRequest, chainMessage, ts.Consumer.Addr, consumerChannel, testGuid+strconv.Itoa(index)) + if err != nil { + errors = append(errors, err) + } + }(i) + } + + utils.LavaFormatDebug("Waiting wait group") + wgAllIds.Wait() + wg.Wait() // Make sure the subscription manager sent a message to the node + // make sure we had only one error, on the first subscription attempt + require.Len(t, errors, 1) + + // Cut the subscription, and re-subscribe, should send another message to node + err = pnsm.RemoveConsumer(ts.Ctx, chainMessage, ts.Consumer.Addr, true, testGuid) + require.NoError(t, err) + }) + } +} diff --git a/protocol/chainlib/rest.go b/protocol/chainlib/rest.go index c275825635..33e727ff6b 100644 --- a/protocol/chainlib/rest.go +++ b/protocol/chainlib/rest.go @@ -11,22 +11,22 @@ import ( "strings" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" "google.golang.org/grpc" "google.golang.org/grpc/metadata" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/gofiber/fiber/v2" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/metrics" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/metrics" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type RestChainParser struct { @@ -74,7 +74,7 @@ func (apip *RestChainParser) CraftMessage(parsing *spectypes.ParseDirective, con if err != nil { return nil, err } - return apip.newChainMessage(api, spectypes.NOT_APPLICABLE, restMessage, apiCollection), nil + return apip.newChainMessage(api, spectypes.NOT_APPLICABLE, nil, restMessage, apiCollection), nil } // ParseMsg parses message data into chain message object @@ -96,7 +96,7 @@ func (apip *RestChainParser) ParseMsg(urlPath string, data []byte, connectionTyp } // Extract default block parser - blockParser := apiCont.api.BlockParsing + api := apiCont.api apiCollection, err := apip.getApiCollection(connectionType, apiCont.collectionKey.InternalPath, apiCont.collectionKey.Addon) if err != nil { @@ -113,39 +113,39 @@ func (apip *RestChainParser) ParseMsg(urlPath string, data []byte, connectionTyp } // add spec path to rest message so we can extract the requested block. restMessage.SpecPath = apiCont.api.Name - var requestedBlock int64 + parsedInput := parser.NewParsedInput() if overwriteReqBlock == "" { // Fetch requested block, it is used for data reliability - requestedBlock, err = parser.ParseBlockFromParams(restMessage, blockParser) + parsedInput = parser.ParseBlockFromParams(restMessage, api.BlockParsing, api.Parsers) + } else { + parsedBlock, err := restMessage.ParseBlock(overwriteReqBlock) + parsedInput.SetBlock(parsedBlock) if err != nil { - utils.LavaFormatError("ParseBlockFromParams failed parsing block", err, + utils.LavaFormatError("failed parsing block from an overwrite header", err, utils.LogAttr("chain", apip.spec.Name), - utils.LogAttr("blockParsing", apiCont.api.BlockParsing), - utils.LogAttr("apiName", apiCont.api.Name), - utils.LogAttr("connectionType", "rest"), + utils.LogAttr("overwriteRequestedBlock", overwriteReqBlock), ) - requestedBlock = spectypes.NOT_APPLICABLE - } - } else { - requestedBlock, err = restMessage.ParseBlock(overwriteReqBlock) - if err != nil { - utils.LavaFormatError("failed parsing block from an overwrite header", err, utils.Attribute{Key: "chain", Value: apip.spec.Name}, utils.Attribute{Key: "overwriteReqBlock", Value: overwriteReqBlock}) - requestedBlock = spectypes.NOT_APPLICABLE + parsedInput.SetBlock(spectypes.NOT_APPLICABLE) } } - nodeMsg := apip.newChainMessage(apiCont.api, requestedBlock, &restMessage, apiCollection) + parsedBlock := parsedInput.GetBlock() + blockHashes, _ := parsedInput.GetBlockHashes() + + nodeMsg := apip.newChainMessage(apiCont.api, parsedBlock, blockHashes, &restMessage, apiCollection) apip.BaseChainParser.ExtensionParsing(apiCollection.CollectionData.AddOn, nodeMsg, extensionInfo) return nodeMsg, apip.BaseChainParser.Validate(nodeMsg) } -func (*RestChainParser) newChainMessage(serviceApi *spectypes.Api, requestBlock int64, restMessage *rpcInterfaceMessages.RestMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { +func (*RestChainParser) newChainMessage(serviceApi *spectypes.Api, requestBlock int64, requestedHashes []string, restMessage *rpcInterfaceMessages.RestMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { nodeMsg := &baseChainMessageContainer{ api: serviceApi, apiCollection: apiCollection, msg: restMessage, latestRequestedBlock: requestBlock, + requestedBlockHashes: requestedHashes, resultErrorParsingMethod: restMessage.CheckResponseError, + parseDirective: GetParseDirective(serviceApi, apiCollection), } return nodeMsg } @@ -239,11 +239,12 @@ func (apip *RestChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, } type RestChainListener struct { - endpoint *lavasession.RPCEndpoint - relaySender RelaySender - healthReporter HealthReporter - logger *metrics.RPCConsumerLogs - refererData *RefererData + endpoint *lavasession.RPCEndpoint + relaySender RelaySender + healthReporter HealthReporter + logger *metrics.RPCConsumerLogs + refererData *RefererData + listeningAddress string } // NewRestChainListener creates a new instance of RestChainListener @@ -254,11 +255,11 @@ func NewRestChainListener(ctx context.Context, listenEndpoint *lavasession.RPCEn ) (chainListener *RestChainListener) { // Create a new instance of JsonRPCChainListener chainListener = &RestChainListener{ - listenEndpoint, - relaySender, - healthReporter, - rpcConsumerLogs, - refererData, + endpoint: listenEndpoint, + relaySender: relaySender, + healthReporter: healthReporter, + logger: rpcConsumerLogs, + refererData: refererData, } return chainListener @@ -308,6 +309,7 @@ func (apil *RestChainListener) Serve(ctx context.Context, cmdFlags common.Consum utils.LogAttr("msgSeed", msgSeed), utils.LogAttr("headers", restHeaders), ) + analytics.SetProcessingTimestampBeforeRelay(startTime) userIp := fiberCtx.Get(common.IP_FORWARDING_HEADER_NAME, fiberCtx.IP()) refererMatch := fiberCtx.Params(refererMatchString, "") requestBody := string(fiberCtx.Body()) @@ -342,8 +344,10 @@ func (apil *RestChainListener) Serve(ctx context.Context, cmdFlags common.Consum if relayResult.GetStatusCode() != 0 { fiberCtx.Status(relayResult.StatusCode) } - // Return json response - return addHeadersAndSendString(fiberCtx, reply.GetMetadata(), string(reply.Data)) + // Return json response and add metric for after provider processing + err = addHeadersAndSendString(fiberCtx, reply.GetMetadata(), string(reply.Data)) + apil.logger.AddMetricForProcessingLatencyAfterProvider(analytics, chainID, apiInterface) + return err } handlerUse := func(fiberCtx *fiber.Ctx) error { @@ -358,6 +362,7 @@ func (apil *RestChainListener) Serve(ctx context.Context, cmdFlags common.Consum path := "/" + fiberCtx.Params("*") dappID := extractDappIDFromFiberContext(fiberCtx) analytics := metrics.NewRelayAnalytics(dappID, chainID, apiInterface) + analytics.SetProcessingTimestampBeforeRelay(startTime) metadataValues := fiberCtx.GetReqHeaders() restHeaders := convertToMetadataMap(metadataValues) @@ -414,7 +419,9 @@ func (apil *RestChainListener) Serve(ctx context.Context, cmdFlags common.Consum apil.logger.LogRequestAndResponse("http in/out", false, http.MethodGet, path, "", string(reply.Data), msgSeed, time.Since(startTime), nil) // Return json response - return addHeadersAndSendString(fiberCtx, reply.GetMetadata(), string(reply.Data)) + err = addHeadersAndSendString(fiberCtx, reply.GetMetadata(), string(reply.Data)) + apil.logger.AddMetricForProcessingLatencyAfterProvider(analytics, chainID, apiInterface) + return err } if apil.refererData != nil && apil.refererData.Marker != "" { @@ -427,7 +434,18 @@ func (apil *RestChainListener) Serve(ctx context.Context, cmdFlags common.Consum app.Use("/*", handlerUse) // Go - ListenWithRetry(app, apil.endpoint.NetworkAddress) + addrChannel := make(chan string) + addrChannelSafe := common.NewSafeChannelSender(ctx, addrChannel) + go func() { + addr := <-addrChannel + apil.listeningAddress = addr + }() + + ListenWithRetry(app, apil.endpoint.NetworkAddress, addrChannelSafe) +} + +func (apil *RestChainListener) GetListeningAddress() string { + return apil.listeningAddress } func addHeadersAndSendString(c *fiber.Ctx, metaData []pairingtypes.Metadata, data string) error { @@ -447,6 +465,9 @@ func NewRestChainProxy(ctx context.Context, nConns uint, rpcProviderEndpoint lav if len(rpcProviderEndpoint.NodeUrls) == 0 { return nil, utils.LavaFormatError("rpcProviderEndpoint.NodeUrl list is empty missing node url", nil, utils.Attribute{Key: "chainID", Value: rpcProviderEndpoint.ChainID}, utils.Attribute{Key: "ApiInterface", Value: rpcProviderEndpoint.ApiInterface}) } + + validateEndpoints(rpcProviderEndpoint.NodeUrls, spectypes.APIInterfaceRest) + _, averageBlockTime, _, _ := chainParser.ChainBlockStats() nodeUrl := rpcProviderEndpoint.NodeUrls[0] nodeUrl.Url = strings.TrimSuffix(rpcProviderEndpoint.NodeUrls[0].Url, "/") @@ -506,13 +527,12 @@ func (rcp *RestChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, rcp.NodeUrl.SetAuthHeaders(ctx, req.Header.Set) rcp.NodeUrl.SetIpForwardingIfNecessary(ctx, req.Header.Set) - if debug { - utils.LavaFormatDebug("provider sending node message", - utils.Attribute{Key: "_method", Value: nodeMessage.Path}, - utils.Attribute{Key: "headers", Value: req.Header}, - utils.Attribute{Key: "apiInterface", Value: "rest"}, - ) - } + utils.LavaFormatTrace("provider sending node message", + utils.LogAttr("_method", nodeMessage.Path), + utils.LogAttr("headers", req.Header), + utils.LogAttr("apiInterface", "rest"), + ) + res, err := httpClient.Do(req) if res != nil { // resp can be non nil on error diff --git a/protocol/chainlib/rest_test.go b/protocol/chainlib/rest_test.go index e3d435af70..7db8ff2125 100644 --- a/protocol/chainlib/rest_test.go +++ b/protocol/chainlib/rest_test.go @@ -8,13 +8,13 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/parser" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/parser" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -137,7 +137,7 @@ func TestRestChainProxy(t *testing.T) { w.WriteHeader(http.StatusOK) fmt.Fprint(w, `{"block": { "header": {"height": "244591"}}}`) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -168,15 +168,16 @@ func TestParsingRequestedBlocksHeadersRest(t *testing.T) { fmt.Fprint(w, `{"block": { "header": {"height": "244591"}}}`) } }) - chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) require.NoError(t, err) defer func() { if closeServer != nil { closeServer() } }() - parsingForCrafting, collectionData, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) + parsingForCrafting, apiCollection, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) require.True(t, ok) + collectionData := apiCollection.CollectionData headerParsingDirective, _, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_SET_LATEST_IN_METADATA) callbackHeaderNameToCheck = headerParsingDirective.GetApiName() // this causes the callback to modify the response to simulate a real behavior require.True(t, ok) @@ -238,15 +239,16 @@ func TestSettingRequestedBlocksHeadersRest(t *testing.T) { } fmt.Fprint(w, `{"block": { "header": {"height": "244591"}}}`) }) - chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, chainRouter, _, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) require.NoError(t, err) defer func() { if closeServer != nil { closeServer() } }() - parsingForCrafting, collectionData, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) + parsingForCrafting, apiCollection, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) require.True(t, ok) + collectionData := apiCollection.CollectionData headerParsingDirective, _, ok := chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_SET_LATEST_IN_METADATA) callbackHeaderNameToCheck = headerParsingDirective.GetApiName() // this causes the callback to modify the response to simulate a real behavior require.True(t, ok) @@ -294,3 +296,27 @@ func TestSettingRequestedBlocksHeadersRest(t *testing.T) { }) } } + +func TestRegexParsing(t *testing.T) { + chainParser, _, _, closeServer, _, err := CreateChainLibMocks(context.Background(), "LAV1", spectypes.APIInterfaceRest, nil, nil, "../../", nil) + require.NoError(t, err) + defer func() { + if closeServer != nil { + closeServer() + } + }() + for _, api := range []string{ + "/cosmos/staking/v1beta1/delegations/", + "/lavanet/lava/pairing/provider/lava@1e9ma89h83azrfnqqy0u255zqxq0xluza6ydf9n/", + "/lavanet/lava/pairing/provider/lava@1e9ma89h83azrfnqqy0u255zqxq0xluza6ydf9n/ETH1", + } { + _, err := chainParser.ParseMsg(api, nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + } + for _, api := range []string{ + "/cosmos/staking/v1beta1/delegations/lava@17ym998u666u8w2qgjd5m7w7ydjqmu3mlgl7ua2/", + } { + _, err := chainParser.ParseMsg(api, nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.Error(t, err) + } +} diff --git a/protocol/chainlib/tendermintRPC.go b/protocol/chainlib/tendermintRPC.go index 4cc9ef8395..3f52e70659 100644 --- a/protocol/chainlib/tendermintRPC.go +++ b/protocol/chainlib/tendermintRPC.go @@ -15,17 +15,17 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -85,7 +85,7 @@ func (apip *TendermintChainParser) CraftMessage(parsing *spectypes.ParseDirectiv return nil, err } tenderMsg := rpcInterfaceMessages.TendermintrpcMessage{JsonrpcMessage: msg, Path: parsing.ApiName} - return apip.newChainMessage(apiCont.api, spectypes.NOT_APPLICABLE, &tenderMsg, apiCollection), nil + return apip.newChainMessage(apiCont.api, spectypes.NOT_APPLICABLE, nil, &tenderMsg, apiCollection), nil } // ParseMsg parses message data into chain message object @@ -127,19 +127,27 @@ func (apip *TendermintChainParser) ParseMsg(urlPath string, data []byte, connect msg.Params = params msgs = []rpcInterfaceMessages.JsonrpcMessage{msg} } - if len(msgs) == 0 { + + msgsLength := len(msgs) + + if msgsLength == 0 { return nil, errors.New("empty unmarshaled json") } var api *spectypes.Api var apiCollection *spectypes.ApiCollection - var latestRequestedBlock, earliestRequestedBlock int64 = 0, 0 + var latestRequestedBlock, earliestRequestedBlock int64 = 0, spectypes.LATEST_BLOCK + blockHashes := []string{} for idx, msg := range msgs { - var requestedBlockForMessage int64 + parsedInput := parser.NewParsedInput() // Check api is supported and save it in nodeMsg apiCont, err := apip.getSupportedApi(msg.Method, connectionType) if err != nil { - utils.LavaFormatDebug("getSupportedApi jsonrpc failed", utils.LogAttr("method", msg.Method), utils.LogAttr("error", err)) + utils.LavaFormatDebug("getSupportedApi tendermintrpc failed", + utils.LogAttr("method", msg.Method), + utils.LogAttr("connectionType", connectionType), + utils.LogAttr("error", err), + ) return nil, err } @@ -154,28 +162,29 @@ func (apip *TendermintChainParser) ParseMsg(urlPath string, data []byte, connect if overwriteReqBlock == "" { // Fetch requested block, it is used for data reliability - requestedBlockForMessage, err = parser.ParseBlockFromParams(msg, apiCont.api.BlockParsing) - if err != nil { - utils.LavaFormatError("ParseBlockFromParams failed parsing block", err, - utils.LogAttr("chain", apip.spec.Name), - utils.LogAttr("blockParsing", apiCont.api.BlockParsing), - utils.LogAttr("apiName", apiCont.api.Name), - utils.LogAttr("connectionType", "tendermintRPC"), - ) - requestedBlockForMessage = spectypes.NOT_APPLICABLE + parsedInput = parser.ParseBlockFromParams(msg, apiCont.api.BlockParsing, apiCont.api.Parsers) + if hashes, err := parsedInput.GetBlockHashes(); err == nil { + blockHashes = append(blockHashes, hashes...) } } else { - requestedBlockForMessage, err = msg.ParseBlock(overwriteReqBlock) + parsedBlock, err := msg.ParseBlock(overwriteReqBlock) + parsedInput.SetBlock(parsedBlock) if err != nil { - utils.LavaFormatError("failed parsing block from an overwrite header", err, utils.Attribute{Key: "chain", Value: apip.spec.Name}, utils.Attribute{Key: "overwriteReqBlock", Value: overwriteReqBlock}) - requestedBlockForMessage = spectypes.NOT_APPLICABLE + utils.LavaFormatError("failed parsing block from an overwrite header", err, + utils.LogAttr("chain", apip.spec.Name), + utils.LogAttr("overwriteReqBlock", overwriteReqBlock), + ) + parsedInput.SetBlock(spectypes.NOT_APPLICABLE) } } + + parsedBlock := parsedInput.GetBlock() + if idx == 0 { // on the first entry store them api = apiCont.api apiCollection = apiCollectionForMessage - latestRequestedBlock = requestedBlockForMessage + latestRequestedBlock = parsedBlock } else { // on next entries we need to compare to existing data if api == nil { @@ -210,20 +219,23 @@ func (apip *TendermintChainParser) ParseMsg(urlPath string, data []byte, connect Encoding: "", }, } - latestRequestedBlock, earliestRequestedBlock = CompareRequestedBlockInBatch(latestRequestedBlock, requestedBlockForMessage) + } + + if msgsLength > 1 { + latestRequestedBlock, earliestRequestedBlock = CompareRequestedBlockInBatch(latestRequestedBlock, earliestRequestedBlock, parsedBlock) } } var nodeMsg *baseChainMessageContainer - if len(msgs) == 1 { + if msgsLength == 1 { tenderMsg := rpcInterfaceMessages.TendermintrpcMessage{JsonrpcMessage: msgs[0], Path: ""} if !isJsonrpc { tenderMsg.Path = urlPath // add path } - nodeMsg = apip.newChainMessage(api, latestRequestedBlock, &tenderMsg, apiCollection) + nodeMsg = apip.newChainMessage(api, latestRequestedBlock, blockHashes, &tenderMsg, apiCollection) } else { var err error - nodeMsg, err = apip.newBatchChainMessage(api, latestRequestedBlock, earliestRequestedBlock, msgs, apiCollection) + nodeMsg, err = apip.newBatchChainMessage(api, latestRequestedBlock, earliestRequestedBlock, blockHashes, msgs, apiCollection) if err != nil { return nil, err } @@ -233,7 +245,7 @@ func (apip *TendermintChainParser) ParseMsg(urlPath string, data []byte, connect return nodeMsg, apip.BaseChainParser.Validate(nodeMsg) } -func (*TendermintChainParser) newBatchChainMessage(serviceApi *spectypes.Api, requestedBlock int64, earliestRequestedBlock int64, msgs []rpcInterfaceMessages.JsonrpcMessage, apiCollection *spectypes.ApiCollection) (*baseChainMessageContainer, error) { +func (*TendermintChainParser) newBatchChainMessage(serviceApi *spectypes.Api, requestedBlock int64, earliestRequestedBlock int64, requestedHashes []string, msgs []rpcInterfaceMessages.JsonrpcMessage, apiCollection *spectypes.ApiCollection) (*baseChainMessageContainer, error) { batchMessage, err := rpcInterfaceMessages.NewBatchMessage(msgs) if err != nil { return nil, err @@ -242,20 +254,24 @@ func (*TendermintChainParser) newBatchChainMessage(serviceApi *spectypes.Api, re api: serviceApi, apiCollection: apiCollection, latestRequestedBlock: requestedBlock, + requestedBlockHashes: requestedHashes, msg: &batchMessage, earliestRequestedBlock: earliestRequestedBlock, resultErrorParsingMethod: rpcInterfaceMessages.CheckResponseErrorForJsonRpcBatch, + parseDirective: GetParseDirective(serviceApi, apiCollection), } return nodeMsg, err } -func (*TendermintChainParser) newChainMessage(serviceApi *spectypes.Api, requestedBlock int64, msg *rpcInterfaceMessages.TendermintrpcMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { +func (*TendermintChainParser) newChainMessage(serviceApi *spectypes.Api, requestedBlock int64, requestedHashes []string, msg *rpcInterfaceMessages.TendermintrpcMessage, apiCollection *spectypes.ApiCollection) *baseChainMessageContainer { nodeMsg := &baseChainMessageContainer{ api: serviceApi, apiCollection: apiCollection, latestRequestedBlock: requestedBlock, + requestedBlockHashes: requestedHashes, msg: msg, resultErrorParsingMethod: msg.CheckResponseError, + parseDirective: GetParseDirective(serviceApi, apiCollection), } return nodeMsg } @@ -311,11 +327,13 @@ func (apip *TendermintChainParser) ChainBlockStats() (allowedBlockLagForQosSync } type TendermintRpcChainListener struct { - endpoint *lavasession.RPCEndpoint - relaySender RelaySender - healthReporter HealthReporter - logger *metrics.RPCConsumerLogs - refererData *RefererData + endpoint *lavasession.RPCEndpoint + relaySender RelaySender + healthReporter HealthReporter + logger *metrics.RPCConsumerLogs + refererData *RefererData + consumerWsSubscriptionManager *ConsumerWSSubscriptionManager + listeningAddress string } // NewTendermintRpcChainListener creates a new instance of TendermintRpcChainListener @@ -323,14 +341,16 @@ func NewTendermintRpcChainListener(ctx context.Context, listenEndpoint *lavasess relaySender RelaySender, healthReporter HealthReporter, rpcConsumerLogs *metrics.RPCConsumerLogs, refererData *RefererData, + consumerWsSubscriptionManager *ConsumerWSSubscriptionManager, ) (chainListener *TendermintRpcChainListener) { // Create a new instance of JsonRPCChainListener chainListener = &TendermintRpcChainListener{ - listenEndpoint, - relaySender, - healthReporter, - rpcConsumerLogs, - refererData, + endpoint: listenEndpoint, + relaySender: relaySender, + healthReporter: healthReporter, + logger: rpcConsumerLogs, + refererData: refererData, + consumerWsSubscriptionManager: consumerWsSubscriptionManager, } return chainListener @@ -358,90 +378,25 @@ func (apil *TendermintRpcChainListener) Serve(ctx context.Context, cmdFlags comm return fiber.ErrUpgradeRequired }) webSocketCallback := websocket.New(func(websocketConn *websocket.Conn) { - var ( - mt int - msg []byte - err error - ) - msgSeed := apil.logger.GetMessageSeed() - startTime := time.Now() - for { - if mt, msg, err = websocketConn.ReadMessage(); err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, err, msgSeed, msg, "tendermint", time.Since(startTime)) - break - } - dappID, ok := websocketConn.Locals("dappId").(string) - if !ok { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, nil, msgSeed, []byte("Unable to extract dappID"), spectypes.APIInterfaceJsonRPC, time.Since(startTime)) - } - - ctx, cancel := context.WithCancel(context.Background()) - guid := utils.GenerateUniqueIdentifier() - ctx = utils.WithUniqueIdentifier(ctx, guid) - defer cancel() // incase there's a problem make sure to cancel the connection - - logFormattedMsg := string(msg) - if !cmdFlags.DebugRelays { - logFormattedMsg = utils.FormatLongString(logFormattedMsg, relayMsgLogMaxChars) - } - - utils.LavaFormatDebug("ws in <<<", - utils.LogAttr("GUID", ctx), - utils.LogAttr("seed", msgSeed), - utils.LogAttr("msg", logFormattedMsg), - utils.LogAttr("dappID", dappID), - ) - msgSeed = strconv.FormatUint(guid, 10) - refererMatch, ok := websocketConn.Locals(refererMatchString).(string) - metricsData := metrics.NewRelayAnalytics(dappID, chainID, apiInterface) - relayResult, err := apil.relaySender.SendRelay(ctx, "", string(msg), "", dappID, websocketConn.RemoteAddr().String(), metricsData, nil) - if ok && refererMatch != "" && apil.refererData != nil && err == nil { - go apil.refererData.SendReferer(refererMatch, chainID, string(msg), websocketConn.RemoteAddr().String(), nil, websocketConn) - } - reply := relayResult.GetReply() - replyServer := relayResult.GetReplyServer() - go apil.logger.AddMetricForWebSocket(metricsData, err, websocketConn) - if err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, err, msgSeed, msg, "tendermint", time.Since(startTime)) - continue - } - // If subscribe the first reply would contain the RPC ID that can be used for disconnect. - if replyServer != nil { - var reply pairingtypes.RelayReply - err = (*replyServer).RecvMsg(&reply) // this reply contains the RPC ID - if err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, err, msgSeed, msg, "tendermint", time.Since(startTime)) - continue - } + utils.LavaFormatDebug("tendermintrpc websocket opened", utils.LogAttr("consumerIp", websocketConn.LocalAddr().String())) + defer utils.LavaFormatDebug("tendermintrpc websocket closed", utils.LogAttr("consumerIp", websocketConn.LocalAddr().String())) + + consumerWebsocketManager := NewConsumerWebsocketManager(ConsumerWebsocketManagerOptions{ + WebsocketConn: websocketConn, + RpcConsumerLogs: apil.logger, + RefererMatchString: refererMatchString, + CmdFlags: cmdFlags, + RelayMsgLogMaxChars: relayMsgLogMaxChars, + ChainID: chainID, + ApiInterface: apiInterface, + ConnectionType: "", // We use it for the ParseMsg method, which needs to know the connection type to find the method in the spec + RefererData: apil.refererData, + RelaySender: apil.relaySender, + ConsumerWsSubscriptionManager: apil.consumerWsSubscriptionManager, + WebsocketConnectionUID: strconv.FormatUint(utils.GenerateUniqueIdentifier(), 10), + }) - if err = websocketConn.WriteMessage(mt, reply.Data); err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, err, msgSeed, msg, "tendermint", time.Since(startTime)) - continue - } - apil.logger.LogRequestAndResponse("tendermint ws", false, "ws", websocketConn.LocalAddr().String(), string(msg), string(reply.Data), msgSeed, time.Since(startTime), nil) - for { - err = (*replyServer).RecvMsg(&reply) - if err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, err, msgSeed, msg, "tendermint", time.Since(startTime)) - break - } - - // If portal cant write to the client - if err = websocketConn.WriteMessage(mt, reply.Data); err != nil { - cancel() - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, err, msgSeed, msg, "tendermint", time.Since(startTime)) - // break - } - apil.logger.LogRequestAndResponse("tendermint ws", false, "ws", websocketConn.LocalAddr().String(), string(msg), string(reply.Data), msgSeed, time.Since(startTime), nil) - } - } else { - if err = websocketConn.WriteMessage(mt, reply.Data); err != nil { - apil.logger.AnalyzeWebSocketErrorAndWriteMessage(websocketConn, mt, err, msgSeed, msg, "tendermint", time.Since(startTime)) - continue - } - apil.logger.LogRequestAndResponse("tendermint ws", false, "ws", websocketConn.LocalAddr().String(), string(msg), string(reply.Data), msgSeed, time.Since(startTime), nil) - } - } + consumerWebsocketManager.ListenToMessages() }) websocketCallbackWithDappID := constructFiberCallbackWithHeaderAndParameterExtraction(webSocketCallback, apil.logger.StoreMetricData) app.Get("/ws", websocketCallbackWithDappID) @@ -455,6 +410,7 @@ func (apil *TendermintRpcChainListener) Serve(ctx context.Context, cmdFlags comm defer endTx() dappID := extractDappIDFromFiberContext(fiberCtx) metricsData := metrics.NewRelayAnalytics(dappID, chainID, apiInterface) + metricsData.SetProcessingTimestampBeforeRelay(startTime) ctx, cancel := context.WithCancel(context.Background()) guid := utils.GenerateUniqueIdentifier() ctx = utils.WithUniqueIdentifier(ctx, guid) @@ -515,7 +471,9 @@ func (apil *TendermintRpcChainListener) Serve(ctx context.Context, cmdFlags comm } response := string(reply.Data) // Return json response - return addHeadersAndSendString(fiberCtx, reply.GetMetadata(), response) + err = addHeadersAndSendString(fiberCtx, reply.GetMetadata(), response) + apil.logger.AddMetricForProcessingLatencyAfterProvider(metricsData, chainID, apiInterface) + return err } handlerGet := func(fiberCtx *fiber.Ctx) error { @@ -533,6 +491,7 @@ func (apil *TendermintRpcChainListener) Serve(ctx context.Context, cmdFlags comm ctx = utils.WithUniqueIdentifier(ctx, guid) defer cancel() // incase there's a problem make sure to cancel the connection metricsData := metrics.NewRelayAnalytics(dappID, chainID, apiInterface) + metricsData.SetProcessingTimestampBeforeRelay(startTime) metadataValues := fiberCtx.GetReqHeaders() headers := convertToMetadataMap(metadataValues) utils.LavaFormatDebug("urirpc in <<<", @@ -581,7 +540,9 @@ func (apil *TendermintRpcChainListener) Serve(ctx context.Context, cmdFlags comm fiberCtx.Status(relayResult.StatusCode) } // Return json response - return addHeadersAndSendString(fiberCtx, reply.GetMetadata(), response) + err = addHeadersAndSendString(fiberCtx, reply.GetMetadata(), response) + apil.logger.AddMetricForProcessingLatencyAfterProvider(metricsData, chainID, apiInterface) + return err } if apil.refererData != nil && apil.refererData.Marker != "" { @@ -603,15 +564,24 @@ func (apil *TendermintRpcChainListener) Serve(ctx context.Context, cmdFlags comm app.Get("/*", handlerGet) // // Go - ListenWithRetry(app, apil.endpoint.NetworkAddress) + addrChannel := make(chan string) + addrChannelSafe := common.NewSafeChannelSender(ctx, addrChannel) + go func() { + addr := <-addrChannel + apil.listeningAddress = addr + }() + + ListenWithRetry(app, apil.endpoint.NetworkAddress, addrChannelSafe) +} + +func (apil *TendermintRpcChainListener) GetListeningAddress() string { + return apil.listeningAddress } type tendermintRpcChainProxy struct { // embedding the jrpc chain proxy because the only diff is on parse message JrpcChainProxy - httpNodeUrl common.NodeUrl - httpConnector *chainproxy.Connector - httpClient *http.Client + httpClient *http.Client } func NewtendermintRpcChainProxy(ctx context.Context, nConns uint, rpcProviderEndpoint lavasession.RPCProviderEndpoint, chainParser ChainParser) (ChainProxy, error) { @@ -619,26 +589,23 @@ func NewtendermintRpcChainProxy(ctx context.Context, nConns uint, rpcProviderEnd return nil, utils.LavaFormatError("rpcProviderEndpoint.NodeUrl list is empty missing node url", nil, utils.Attribute{Key: "chainID", Value: rpcProviderEndpoint.ChainID}, utils.Attribute{Key: "ApiInterface", Value: rpcProviderEndpoint.ApiInterface}) } _, averageBlockTime, _, _ := chainParser.ChainBlockStats() - websocketUrl, httpUrl := verifyTendermintEndpoint(rpcProviderEndpoint.NodeUrls) + + validateEndpoints(rpcProviderEndpoint.NodeUrls, spectypes.APIInterfaceTendermintRPC) + + nodeUrl := rpcProviderEndpoint.NodeUrls[0] cp := &tendermintRpcChainProxy{ - JrpcChainProxy: JrpcChainProxy{BaseChainProxy: BaseChainProxy{averageBlockTime: averageBlockTime, NodeUrl: websocketUrl, ErrorHandler: &TendermintRPCErrorHandler{}, ChainID: rpcProviderEndpoint.ChainID}, conn: map[string]*chainproxy.Connector{}}, - httpNodeUrl: httpUrl, - httpConnector: nil, + JrpcChainProxy: JrpcChainProxy{ + BaseChainProxy: BaseChainProxy{ + averageBlockTime: averageBlockTime, + NodeUrl: nodeUrl, + ErrorHandler: &TendermintRPCErrorHandler{}, + ChainID: rpcProviderEndpoint.ChainID, + }, + conn: map[string]*chainproxy.Connector{}, + }, } - cp.addHttpConnector(ctx, nConns, httpUrl) - return cp, cp.start(ctx, nConns, websocketUrl, nil) -} -func (cp *tendermintRpcChainProxy) addHttpConnector(ctx context.Context, nConns uint, nodeUrl common.NodeUrl) error { - conn, err := chainproxy.NewConnector(ctx, nConns, nodeUrl) - if err != nil { - return err - } - cp.httpConnector = conn - if cp.httpConnector == nil { - return errors.New("g_conn == nil") - } - return nil + return cp, cp.start(ctx, nConns, nodeUrl, nil) } func (cp *tendermintRpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend) (relayReply *RelayReplyWrapper, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error) { @@ -669,25 +636,28 @@ func (cp *tendermintRpcChainProxy) SendURI(ctx context.Context, nodeMessage *rpc // return an error if the channel is not nil return nil, "", nil, utils.LavaFormatError("Subscribe is not allowed on Tendermint URI", nil) } + if cp.httpClient == nil { cp.httpClient = &http.Client{ Timeout: 5 * time.Minute, // we are doing a timeout by request } } + httpClient := cp.httpClient // appending hashed url - grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeAddressHash, cp.httpConnector.GetUrlHash())) + internalPath := chainMessage.GetApiCollection().GetCollectionData().InternalPath + grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeAddressHash, cp.conn[internalPath].GetUrlHash())) // construct the url by concatenating the node url with the path variable - url := cp.httpNodeUrl.Url + "/" + nodeMessage.Path + url := cp.NodeUrl.Url + "/" + nodeMessage.Path // set context with timeout connectCtx, cancel := cp.CapTimeoutForSend(ctx, chainMessage) defer cancel() // create a new http request - req, err := http.NewRequestWithContext(connectCtx, http.MethodGet, cp.httpNodeUrl.AuthConfig.AddAuthPath(url), nil) + req, err := http.NewRequestWithContext(connectCtx, http.MethodGet, cp.NodeUrl.AuthConfig.AddAuthPath(url), nil) if err != nil { // Validate if the error is related to the provider connection to the node or it is a valid error // in case the error is valid (e.g. bad input parameters) the error will return in the form of a valid error reply @@ -704,9 +674,9 @@ func (cp *tendermintRpcChainProxy) SendURI(ctx context.Context, nodeMessage *rpc } } - cp.httpNodeUrl.SetAuthHeaders(ctx, req.Header.Set) + cp.NodeUrl.SetAuthHeaders(ctx, req.Header.Set) - cp.httpNodeUrl.SetIpForwardingIfNecessary(ctx, req.Header.Set) + cp.NodeUrl.SetIpForwardingIfNecessary(ctx, req.Header.Set) // send the http request and get the response res, err := httpClient.Do(req) if res != nil { @@ -753,26 +723,19 @@ func (cp *tendermintRpcChainProxy) SendURI(ctx context.Context, nodeMessage *rpc func (cp *tendermintRpcChainProxy) SendRPC(ctx context.Context, nodeMessage *rpcInterfaceMessages.TendermintrpcMessage, ch chan interface{}, chainMessage ChainMessageForSend) (relayReply *RelayReplyWrapper, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error) { // Get rpc connection from the connection pool var rpc *rpcclient.Client - if ch != nil { - internalPath := chainMessage.GetApiCollection().CollectionData.InternalPath - rpc, err = cp.conn[internalPath].GetRpc(ctx, true) - if err != nil { - return nil, "", nil, err - } - // return the rpc connection to the websocket pool after the function completes - defer cp.conn[internalPath].ReturnRpc(rpc) - // appending hashed url - grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeAddressHash, cp.conn[internalPath].GetUrlHash())) - } else { - rpc, err = cp.httpConnector.GetRpc(ctx, true) - if err != nil { - return nil, "", nil, err - } - // return the rpc connection to the http pool after the function completes - defer cp.httpConnector.ReturnRpc(rpc) - // appending hashed url - grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeAddressHash, cp.httpConnector.GetUrlHash())) + internalPath := chainMessage.GetApiCollection().CollectionData.InternalPath + + connector := cp.conn[internalPath] + + rpc, err = connector.GetRpc(ctx, true) + if err != nil { + return nil, "", nil, err } + // return the rpc connection to the websocket pool after the function completes + defer connector.ReturnRpc(rpc) + + // appending hashed url + grpc.SetTrailer(ctx, metadata.Pairs(RPCProviderNodeAddressHash, connector.GetUrlHash())) // create variables for the rpc message and reply message var rpcMessage *rpcclient.JsonrpcMessage @@ -786,9 +749,17 @@ func (cp *tendermintRpcChainProxy) SendRPC(ctx context.Context, nodeMessage *rpc } } // If ch is not nil do subscription + var nodeErr error if ch != nil { // subscribe to the rpc call if the channel is not nil - sub, rpcMessage, err = rpc.Subscribe(context.Background(), nodeMessage.ID, nodeMessage.Method, ch, nodeMessage.Params) + utils.LavaFormatTrace("Sending subscription", + utils.LogAttr("chainID", cp.BaseChainProxy.ChainID), + utils.LogAttr("apiName", chainMessage.GetApi().Name), + utils.LogAttr("nodeMessage.ID", nodeMessage.ID), + utils.LogAttr("nodeMessage.Method", nodeMessage.Method), + utils.LogAttr("nodeMessage.Params", nodeMessage.Params), + ) + sub, rpcMessage, nodeErr = rpc.Subscribe(context.Background(), nodeMessage.ID, nodeMessage.Method, ch, nodeMessage.Params) } else { // set context with timeout connectCtx, cancel := cp.CapTimeoutForSend(ctx, chainMessage) @@ -796,7 +767,7 @@ func (cp *tendermintRpcChainProxy) SendRPC(ctx context.Context, nodeMessage *rpc cp.NodeUrl.SetIpForwardingIfNecessary(ctx, rpc.SetHeader) // perform the rpc call - rpcMessage, err = rpc.CallContext(connectCtx, nodeMessage.ID, nodeMessage.Method, nodeMessage.Params, false, nodeMessage.GetDisableErrorHandling()) + rpcMessage, nodeErr = rpc.CallContext(connectCtx, nodeMessage.ID, nodeMessage.Method, nodeMessage.Params, false, nodeMessage.GetDisableErrorHandling()) if err != nil { if common.StatusCodeError504.Is(err) || common.StatusCodeError429.Is(err) || common.StatusCodeErrorStrict.Is(err) { return nil, "", nil, utils.LavaFormatWarning("Received invalid status code", err, utils.Attribute{Key: "chainID", Value: cp.BaseChainProxy.ChainID}, utils.Attribute{Key: "apiName", Value: chainMessage.GetApi().Name}) @@ -811,33 +782,35 @@ func (cp *tendermintRpcChainProxy) SendRPC(ctx context.Context, nodeMessage *rpc var replyMsg *rpcInterfaceMessages.RPCResponse // the error check here would only wrap errors not from the rpc + + if nodeErr != nil { + utils.LavaFormatDebug("got error from node", utils.LogAttr("GUID", ctx), utils.LogAttr("nodeErr", nodeErr)) + return nil, "", nil, nodeErr + } + + replyMessage, err = rpcInterfaceMessages.ConvertTendermintMsg(rpcMessage) if err != nil { - utils.LavaFormatDebug("received an error from SendNodeMsg", utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "error", Value: err}) - return nil, "", nil, err - } else { - replyMessage, err = rpcInterfaceMessages.ConvertTendermintMsg(rpcMessage) - if err != nil { - return nil, "", nil, utils.LavaFormatError("tendermingRPC error", err) - } - // if we didn't get a node error. - if replyMessage.Error == nil { - // validate result is valid - responseIsNilValidationError := ValidateNilResponse(string(replyMessage.Result)) - if responseIsNilValidationError != nil { - return nil, "", nil, responseIsNilValidationError - } - } - replyMsg = replyMessage + return nil, "", nil, utils.LavaFormatError("tendermintRPC error", err) + } - err := cp.ValidateRequestAndResponseIds(nodeMessage.ID, rpcMessage.ID) - if err != nil { - return nil, "", nil, utils.LavaFormatError("tendermintRPC ID mismatch error", err, - utils.Attribute{Key: "GUID", Value: ctx}, - utils.Attribute{Key: "requestId", Value: nodeMessage.ID}, - utils.Attribute{Key: "responseId", Value: rpcMessage.ID}, - ) + // if we didn't get a node error. + if replyMessage.Error == nil { + // validate result is valid + responseIsNilValidationError := ValidateNilResponse(string(replyMessage.Result)) + if responseIsNilValidationError != nil { + return nil, "", nil, responseIsNilValidationError } } + replyMsg = replyMessage + + err = cp.ValidateRequestAndResponseIds(nodeMessage.ID, rpcMessage.ID) + if err != nil { + return nil, "", nil, utils.LavaFormatError("tendermintRPC ID mismatch error", err, + utils.Attribute{Key: "GUID", Value: ctx}, + utils.Attribute{Key: "requestId", Value: nodeMessage.ID}, + utils.Attribute{Key: "responseId", Value: rpcMessage.ID}, + ) + } // marshal the jsonrpc message to json data, err := json.Marshal(replyMsg) @@ -863,7 +836,9 @@ func (cp *tendermintRpcChainProxy) SendRPC(ctx context.Context, nodeMessage *rpc } subscriptionID, ok = paramsMap["query"].(string) if !ok { - return nil, "", nil, utils.LavaFormatError("unknown subscriptionID type on tendermint subscribe", nil) + utils.LavaFormatTrace("could not get subscriptionID from query params", utils.LogAttr("params", params)) + // This is probably because of a misuse, therefore the provider will return a node error to the user as the subscription failed + subscriptionID = "" } } diff --git a/protocol/chainlib/tendermintRPC_test.go b/protocol/chainlib/tendermintRPC_test.go index aaa24f0847..a40de882a8 100644 --- a/protocol/chainlib/tendermintRPC_test.go +++ b/protocol/chainlib/tendermintRPC_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -149,7 +149,7 @@ func TestTendermintRpcChainProxy(t *testing.T) { }`) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, "../../", nil) + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, nil, "../../", nil) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -180,7 +180,7 @@ func TestTendermintRpcBatchCall(t *testing.T) { fmt.Fprint(w, response) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, "../../", nil) + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, nil, "../../", nil) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -222,7 +222,7 @@ func TestTendermintRpcBatchCallWithSameID(t *testing.T) { fmt.Fprint(w, nodeResponse) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, "../../", nil) + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, nil, "../../", nil) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) @@ -256,7 +256,7 @@ func TestTendermintURIRPC(t *testing.T) { }`) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, "../../", nil) + chainParser, chainProxy, chainFetcher, closeServer, _, err := CreateChainLibMocks(ctx, "LAV1", spectypes.APIInterfaceTendermintRPC, serverHandle, nil, "../../", nil) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) diff --git a/protocol/chaintracker/chain_tracker.go b/protocol/chaintracker/chain_tracker.go index 22ff149bb1..303b88615b 100644 --- a/protocol/chaintracker/chain_tracker.go +++ b/protocol/chaintracker/chain_tracker.go @@ -3,39 +3,36 @@ package chaintracker import ( "context" "errors" - fmt "fmt" "net" "net/http" "os" "os/signal" - "strconv" "sync" "sync/atomic" "time" - rand "github.com/lavanet/lava/utils/rand" + rand "github.com/lavanet/lava/v2/utils/rand" - sdkerrors "cosmossdk.io/errors" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" grpc "google.golang.org/grpc" ) const ( - initRetriesCount = 4 - BACKOFF_MAX_TIME = 10 * time.Minute - maxFails = 10 - debug = false - GoodStabilityThreshold = 0.3 - PollingUpdateLength = 10 - MostFrequentPollingMultiplier = 16 - PollingMultiplierFlagName = "polling-multiplier" + initRetriesCount = 4 + BACKOFF_MAX_TIME = 10 * time.Minute + maxFails = 10 + GoodStabilityThreshold = 0.3 + PollingUpdateLength = 10 + MostFrequentPollingMultiplier = 16 + LavaPollingMultiplierFrequency = 4 + PollingMultiplierFlagName = "polling-multiplier" ) var PollingMultiplier = uint64(1) @@ -52,7 +49,8 @@ type blockTimeUpdatable interface { type ChainTracker struct { chainFetcher ChainFetcher // used to communicate with the node - blocksToSave uint64 // how many finalized blocks to keep + pollingTimeMultiplier time.Duration + blocksToSave uint64 // how many finalized blocks to keep latestBlockNum int64 blockQueueMu sync.RWMutex blocksQueue []BlockStore // holds all past hashes up until latest block @@ -88,10 +86,14 @@ func (cs *ChainTracker) GetLatestBlockData(fromBlock, toBlock, specificBlock int wantedBlocksData := WantedBlocksData{} err = wantedBlocksData.New(fromBlock, toBlock, specificBlock, latestBlock, earliestBlockSaved) if err != nil { - return latestBlock, nil, time.Time{}, sdkerrors.Wrap(err, fmt.Sprintf("invalid input for GetLatestBlockData %v", &map[string]string{ - "fromBlock": strconv.FormatInt(fromBlock, 10), "toBlock": strconv.FormatInt(toBlock, 10), "specificBlock": strconv.FormatInt(specificBlock, 10), - "latestBlock": strconv.FormatInt(latestBlock, 10), "earliestBlockSaved": strconv.FormatInt(earliestBlockSaved, 10), - })) + return latestBlock, nil, time.Time{}, utils.LavaFormatDebug("invalid input for GetLatestBlockData", + utils.LogAttr("err", err), + utils.LogAttr("fromBlock", fromBlock), + utils.LogAttr("toBlock", toBlock), + utils.LogAttr("specificBlock", specificBlock), + utils.LogAttr("latestBlock", latestBlock), + utils.LogAttr("earliestBlockSaved", earliestBlockSaved), + ) } for _, blocksQueueIdx := range wantedBlocksData.IterationIndexes() { @@ -102,8 +104,8 @@ func (cs *ChainTracker) GetLatestBlockData(fromBlock, toBlock, specificBlock int } requestedHashes = append(requestedHashes, &blockStore) } - changeTime = cs.latestChangeTime - return + + return latestBlock, requestedHashes, cs.latestChangeTime, nil } func (cs *ChainTracker) RegisterForBlockTimeUpdates(updatable blockTimeUpdatable) { @@ -361,13 +363,14 @@ func (cs *ChainTracker) start(ctx context.Context, pollingTime time.Duration) er // start polling every averageBlockTime/4, then averageBlockTime/8 after passing middle, then averageBlockTime/16 after passing averageBlockTime*3/4 // so polling at averageBlockTime/4,averageBlockTime/2,averageBlockTime*5/8,averageBlockTime*3/4,averageBlockTime*13/16,,averageBlockTime*14/16,,averageBlockTime*15/16,averageBlockTime*16/16,averageBlockTime*17/16 // initial polling = averageBlockTime/16 - initialPollingTime := pollingTime / MostFrequentPollingMultiplier // on boot we need to query often to catch changes - cs.latestChangeTime = time.Time{} // we will discard the first change time, so this is uninitialized + initialPollingTime := pollingTime / cs.pollingTimeMultiplier // on boot we need to query often to catch changes + cs.latestChangeTime = time.Time{} // we will discard the first change time, so this is uninitialized cs.timer = time.NewTimer(initialPollingTime) err := cs.fetchInitDataWithRetry(ctx) if err != nil { return err } + utils.LavaFormatDebug("ChainTracker fetched init data successfully") blockGapTicker := time.NewTicker(pollingTime) // initially every block we check for a polling time // Polls blocks and keeps a queue of them go func() { @@ -375,9 +378,7 @@ func (cs *ChainTracker) start(ctx context.Context, pollingTime time.Duration) er for { select { case <-cs.timer.C: - if debug { - utils.LavaFormatDebug("chain tracker fetch triggered", utils.Attribute{Key: "currTime", Value: time.Now()}) - } + utils.LavaFormatTrace("chain tracker fetch triggered", utils.LogAttr("currTime", time.Now())) fetchCtx, cancel := context.WithTimeout(ctx, 3*time.Second) // protect this flow from hanging code err := cs.fetchAllPreviousBlocksIfNecessary(fetchCtx) cancel() @@ -413,19 +414,23 @@ func (cs *ChainTracker) updateTimer(tickerBaseTime time.Duration, fetchFails uin timeSinceLastUpdate := time.Since(cs.latestChangeTime) var newPollingTime time.Duration if timeSinceLastUpdate <= tickerBaseTime/2 && blockGap > tickerBaseTime/4 { - newPollingTime = tickerBaseTime / (MostFrequentPollingMultiplier / 4) + newPollingTime = tickerBaseTime / (cs.pollingTimeMultiplier / 4) } else if timeSinceLastUpdate <= (tickerBaseTime*3)/4 && blockGap > tickerBaseTime/4 { - newPollingTime = tickerBaseTime / (MostFrequentPollingMultiplier / 2) + newPollingTime = tickerBaseTime / (cs.pollingTimeMultiplier / 2) } else { - newPollingTime = tickerBaseTime / MostFrequentPollingMultiplier + newPollingTime = tickerBaseTime / cs.pollingTimeMultiplier } newTickerDuration := exponentialBackoff(newPollingTime, fetchFails) if PollingMultiplier > 1 { newTickerDuration /= time.Duration(PollingMultiplier) } - if debug { - utils.LavaFormatDebug("state tracker ticker set", utils.Attribute{Key: "timeSinceLastUpdate", Value: timeSinceLastUpdate}, utils.Attribute{Key: "time", Value: time.Now()}, utils.Attribute{Key: "newTickerDuration", Value: newTickerDuration}) - } + + utils.LavaFormatTrace("state tracker ticker set", + utils.LogAttr("timeSinceLastUpdate", timeSinceLastUpdate), + utils.LogAttr("time", time.Now()), + utils.LogAttr("newTickerDuration", newTickerDuration), + ) + cs.timer = time.NewTimer(newTickerDuration) } @@ -469,9 +474,11 @@ func (ct *ChainTracker) updatePollingTimeBasedOnBlockGap(pollingTime time.Durati // so we take a 0.33 percentile because we want to be on the safe side by have a smaller time than expected percentileTime := lavaslices.Percentile(ct.blockEventsGap, 0.33) stability := lavaslices.Stability(ct.blockEventsGap, percentileTime) - if debug { - utils.LavaFormatDebug("block gaps", utils.Attribute{Key: "block gaps", Value: ct.blockEventsGap}, utils.Attribute{Key: "specID", Value: ct.endpoint.ChainID}) - } + utils.LavaFormatTrace("block gaps", + utils.LogAttr("block gaps", ct.blockEventsGap), + utils.LogAttr("specID", ct.endpoint.ChainID), + ) + if blockGapsLen > int(ct.serverBlockMemory)-2 || stability < GoodStabilityThreshold { // only update if there is a 10% difference or more if percentileTime < (pollingTime*9/10) || percentileTime > (pollingTime*11/10) { @@ -483,8 +490,11 @@ func (ct *ChainTracker) updatePollingTimeBasedOnBlockGap(pollingTime time.Durati return percentileTime, true } return pollingTime, true - } else if debug { - utils.LavaFormatDebug("current stability measurement", utils.Attribute{Key: "chainID", Value: ct.endpoint.ChainID}, utils.Attribute{Key: "stability", Value: stability}) + } else { + utils.LavaFormatTrace("current stability measurement", + utils.LogAttr("chainID", ct.endpoint.ChainID), + utils.LogAttr("stability", stability), + ) } } return pollingTime, false @@ -575,6 +585,10 @@ func NewChainTracker(ctx context.Context, chainFetcher ChainFetcher, config Chai if err != nil { return nil, err } + pollingTime := MostFrequentPollingMultiplier + if config.PollingTimeMultiplier != 0 { + pollingTime = config.PollingTimeMultiplier + } chainTracker = &ChainTracker{ consistencyCallback: config.ConsistencyCallback, @@ -590,6 +604,7 @@ func NewChainTracker(ctx context.Context, chainFetcher ChainFetcher, config Chai blockTimeUpdatables: map[blockTimeUpdatable]struct{}{}, startupTime: time.Now(), pmetrics: config.Pmetrics, + pollingTimeMultiplier: time.Duration(pollingTime), } if chainFetcher == nil { return nil, utils.LavaFormatError("can't start chainTracker with nil chainFetcher argument", nil) diff --git a/protocol/chaintracker/chain_tracker_test.go b/protocol/chaintracker/chain_tracker_test.go index 6da1261e97..598eb0730a 100644 --- a/protocol/chaintracker/chain_tracker_test.go +++ b/protocol/chaintracker/chain_tracker_test.go @@ -9,11 +9,11 @@ import ( "testing" "time" - chaintracker "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - rand "github.com/lavanet/lava/utils/rand" - spectypes "github.com/lavanet/lava/x/spec/types" + chaintracker "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + rand "github.com/lavanet/lava/v2/utils/rand" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -357,6 +357,7 @@ func TestChainTrackerFetchSpreadAcrossPollingTime(t *testing.T) { called := 0 lastCall := time.Now() timeDiff := 0 * time.Millisecond + localTimeForPollingMock := 500 * time.Millisecond callback := func() { called++ timeDiff = time.Since(lastCall) @@ -364,28 +365,30 @@ func TestChainTrackerFetchSpreadAcrossPollingTime(t *testing.T) { } mockChainFetcher := NewMockChainFetcher(1000, mockBlocks, callback) mockChainFetcher.AdvanceBlock() - localTimeForPollingMock := 50 * time.Millisecond chainTrackerConfig := chaintracker.ChainTrackerConfig{BlocksToSave: uint64(fetcherBlocks), AverageBlockTime: localTimeForPollingMock, ServerBlockMemory: uint64(mockBlocks)} tracker, err := chaintracker.NewChainTracker(context.Background(), mockChainFetcher, chainTrackerConfig) require.NoError(t, err) - // fool the tracker so it thinks blocks will come every 50ms, and not adjust it's polling timers + // fool the tracker so it thinks blocks will come every localTimeForPollingMock (ms), and not adjust it's polling timers for i := 0; i < 50; i++ { - tracker.AddBlockGap(50*time.Millisecond, 1) + tracker.AddBlockGap(localTimeForPollingMock, 1) } // initially we start with 1/16 block probing time.Sleep(localTimeForPollingMock) // we expect 15+init calls require.GreaterOrEqual(t, called, 15*8/10) // 15 to give a gap, give a 20% margin require.Greater(t, timeDiff, localTimeForPollingMock/16*8/10) // give a 20% margin - require.Less(t, timeDiff, localTimeForPollingMock/8*12/10) // give a 20% margin - mockChainFetcher.AdvanceBlock() // we advanced a block + fmt.Println(timeDiff, localTimeForPollingMock/16*8/10, localTimeForPollingMock/8*12/10) + require.Less(t, timeDiff, localTimeForPollingMock/8*12/10) // give a 20% margin + mockChainFetcher.AdvanceBlock() // we advanced a block time.Sleep(localTimeForPollingMock / 2) - require.LessOrEqual(t, called, (3+16)*12/10) // init + 2 new + 16 from first block advancement, give 20% margin - require.GreaterOrEqual(t, called, 17*8/10) // give a 20% margin + require.LessOrEqual(t, called, (3+16)*12/10) // init + 2 new + 16 from first block advancement, give 20% margin + require.GreaterOrEqual(t, called, 17*8/10) // give a 20% margin + fmt.Println(timeDiff, localTimeForPollingMock/2*12/10, localTimeForPollingMock/8*8/10) require.Less(t, timeDiff, localTimeForPollingMock/2*12/10) // give a 20% margin require.Greater(t, timeDiff, localTimeForPollingMock/8*8/10) // give a 20% margin time.Sleep(localTimeForPollingMock / 2) require.GreaterOrEqual(t, called, (6+16)*8/10) - require.Less(t, timeDiff, localTimeForPollingMock/8*12/10) // give a 20% margin + require.Less(t, timeDiff, localTimeForPollingMock/8*12/10) // give a 20% margin + fmt.Println(timeDiff, localTimeForPollingMock/8*12/10, localTimeForPollingMock/16*8/10) require.Greater(t, timeDiff, localTimeForPollingMock/16*8/10) // give a 20% margin }) } diff --git a/protocol/chaintracker/config.go b/protocol/chaintracker/config.go index c4407cb579..344defdcec 100644 --- a/protocol/chaintracker/config.go +++ b/protocol/chaintracker/config.go @@ -3,11 +3,11 @@ package chaintracker import ( "time" - "github.com/lavanet/lava/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/metrics" ) const ( - DefualtAssumedBlockMemory = 20 + DefaultAssumedBlockMemory = 20 DefaultBlockCheckpointDistance = 100 ) @@ -22,6 +22,7 @@ type ChainTrackerConfig struct { ServerBlockMemory uint64 BlocksCheckpointDistance uint64 // this causes the chainTracker to trigger it's checkpoint every X blocks Pmetrics *metrics.ProviderMetricsManager + PollingTimeMultiplier int } func (cnf *ChainTrackerConfig) validate() error { @@ -33,7 +34,7 @@ func (cnf *ChainTrackerConfig) validate() error { } if cnf.ServerBlockMemory == 0 { - cnf.ServerBlockMemory = DefualtAssumedBlockMemory + cnf.ServerBlockMemory = DefaultAssumedBlockMemory } if cnf.BlocksCheckpointDistance == 0 { cnf.BlocksCheckpointDistance = DefaultBlockCheckpointDistance diff --git a/protocol/chaintracker/errors.go b/protocol/chaintracker/errors.go index 034d7cc30c..2ece9ec7b9 100644 --- a/protocol/chaintracker/errors.go +++ b/protocol/chaintracker/errors.go @@ -10,7 +10,7 @@ var ( // Consumer Side Errors InvalidLatestBlockNumValue = sdkerrors.New("Invalid value for latestBlockNum", 10703, "returned latest block num should be greater than 0, but it's not") InvalidReturnedHashes = sdkerrors.New("Invalid value for requestedHashes length", 10704, "returned requestedHashes key count should be greater than 0, but it's not") ErrorFailedToFetchLatestBlock = sdkerrors.New("Error FailedToFetchLatestBlock", 10705, "Failed to fetch latest block from node") - InvalidRequestedBlocks = sdkerrors.New("Error InvalidRequestedBlocks", 10706, "provided requested blocks for function do not compse a valid request") + InvalidRequestedBlocks = sdkerrors.New("Error InvalidRequestedBlocks", 10706, "provided requested blocks for function do not compose a valid request") RequestedBlocksOutOfRange = sdkerrors.New("RequestedBlocksOutOfRange", 10707, "requested blocks are outside the supported range by the state tracker") ErrorFailedToFetchTooEarlyBlock = sdkerrors.New("Error ErrorFailedToFetchTooEarlyBlock", 10708, "server memory protection triggered, requested block is too early") InvalidRequestedSpecificBlock = sdkerrors.New("Error InvalidRequestedSpecificBlock", 10709, "provided requested specific blocks for function do not compose a stored entry") diff --git a/protocol/chaintracker/wanted_block_data.go b/protocol/chaintracker/wanted_block_data.go index aec5ad1015..082a3b2d2c 100644 --- a/protocol/chaintracker/wanted_block_data.go +++ b/protocol/chaintracker/wanted_block_data.go @@ -3,7 +3,7 @@ package chaintracker import ( fmt "fmt" - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type BlockRange struct { @@ -48,7 +48,7 @@ func (wbd *WantedBlocksData) New(fromBlock, toBlock, specificBlock, latestBlock, toBlockArg := fromBlockArg // [from,to] with only one block wbd.specificBlock, err = NewBlockRange(fromBlockArg, toBlockArg, earliestBlockSaved, latestBlock) if err != nil { - return InvalidRequestedSpecificBlock.Wrapf("specific " + err.Error()) + return InvalidRequestedSpecificBlock.Wrapf("specific %s", err.Error()) } } } else { diff --git a/protocol/chaintracker/wanted_block_data_test.go b/protocol/chaintracker/wanted_block_data_test.go index ec4dc72da6..7af8df060f 100644 --- a/protocol/chaintracker/wanted_block_data_test.go +++ b/protocol/chaintracker/wanted_block_data_test.go @@ -4,8 +4,8 @@ import ( fmt "fmt" "testing" - chaintracker "github.com/lavanet/lava/protocol/chaintracker" - spectypes "github.com/lavanet/lava/x/spec/types" + chaintracker "github.com/lavanet/lava/v2/protocol/chaintracker" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/common/cobra_common.go b/protocol/common/cobra_common.go index 076198c542..d7daa95e59 100644 --- a/protocol/common/cobra_common.go +++ b/protocol/common/cobra_common.go @@ -3,7 +3,7 @@ package common import ( "time" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -29,6 +29,10 @@ const ( RelayHealthIntervalFlag = "relays-health-interval" // interval between each relay health check, default 5m SharedStateFlag = "shared-state" DisableConflictTransactionsFlag = "disable-conflict-transactions" // disable conflict transactions, this will hard the network's data reliability and therefore will harm the service. + // Disable relay retries when we get node errors. + // This feature is suppose to help with successful relays in some chains that return node errors on rare race conditions on the serviced chains. + DisableRetryOnNodeErrorsFlag = "disable-retry-on-node-error" + UseOfflineSpecFlag = "use-offline-spec" // allows the user to manually load a spec providing a path, this is useful to test spec changes before they hit the blockchain ) const ( @@ -51,6 +55,8 @@ type ConsumerCmdFlags struct { RelaysHealthIntervalFlag time.Duration // interval for relay health check DebugRelays bool // enables debug mode for relays DisableConflictTransactions bool // disable conflict transactions + DisableRetryOnNodeErrors bool // disable retries on node errors + OfflineSpecPath string // path to the spec file, works only when bootstrapping a single chain. } // default rolling logs behavior (if enabled) will store 3 files each 100MB for up to 1 day every time. diff --git a/protocol/common/collections.go b/protocol/common/collections.go index 7e75f5028d..427ccc66d5 100644 --- a/protocol/common/collections.go +++ b/protocol/common/collections.go @@ -1,7 +1,7 @@ package common import ( - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( diff --git a/protocol/common/conf.go b/protocol/common/conf.go index b2b4bad9bd..5df9ebf1b9 100644 --- a/protocol/common/conf.go +++ b/protocol/common/conf.go @@ -13,6 +13,7 @@ type Test_mode_ctx_key struct{} const ( PlainTextConnection = "allow-plaintext-connection" EndpointsConfigName = "endpoints" + StaticProvidersConfigName = "static-providers" SaveConfigFlagName = "save-conf" GeolocationFlag = "geolocation" TestModeFlagName = "test-mode" diff --git a/protocol/common/endpoints.go b/protocol/common/endpoints.go index 0e97c157db..b91de7be8c 100644 --- a/protocol/common/endpoints.go +++ b/protocol/common/endpoints.go @@ -8,10 +8,10 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" ) @@ -26,17 +26,27 @@ const ( GUID_HEADER_NAME = "Lava-Guid" ERRORED_PROVIDERS_HEADER_NAME = "Lava-Errored-Providers" REPORTED_PROVIDERS_HEADER_NAME = "Lava-Reported-Providers" + LAVA_CONSUMER_PROCESS_GUID = "lava-consumer-process-guid" // these headers need to be lowercase BLOCK_PROVIDERS_ADDRESSES_HEADER_NAME = "lava-providers-block" RELAY_TIMEOUT_HEADER_NAME = "lava-relay-timeout" EXTENSION_OVERRIDE_HEADER_NAME = "lava-extension" FORCE_CACHE_REFRESH_HEADER_NAME = "lava-force-cache-refresh" LAVA_DEBUG_RELAY = "lava-debug-relay" + LAVA_LB_UNIQUE_ID_HEADER = "lava-lb-unique-id" // send http request to /lava/health to see if the process is up - (ret code 200) DEFAULT_HEALTH_PATH = "/lava/health" MAXIMUM_ALLOWED_TIMEOUT_EXTEND_MULTIPLIER_BY_THE_CONSUMER = 4 ) +var SPECIAL_LAVA_DIRECTIVE_HEADERS = map[string]struct{}{ + BLOCK_PROVIDERS_ADDRESSES_HEADER_NAME: {}, + RELAY_TIMEOUT_HEADER_NAME: {}, + EXTENSION_OVERRIDE_HEADER_NAME: {}, + FORCE_CACHE_REFRESH_HEADER_NAME: {}, + LAVA_DEBUG_RELAY: {}, +} + type NodeUrl struct { Url string `yaml:"url,omitempty" json:"url,omitempty" mapstructure:"url"` InternalPath string `yaml:"internal-path,omitempty" json:"internal-path,omitempty" mapstructure:"internal-path"` @@ -45,6 +55,7 @@ type NodeUrl struct { Timeout time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty" mapstructure:"timeout"` Addons []string `yaml:"addons,omitempty" json:"addons,omitempty" mapstructure:"addons"` SkipVerifications []string `yaml:"skip-verifications,omitempty" json:"skip-verifications,omitempty" mapstructure:"skip-verifications"` + Methods []string `yaml:"methods,omitempty" json:"methods,omitempty" mapstructure:"methods"` } type ChainMessageGetApiInterface interface { @@ -55,7 +66,7 @@ func (nurl NodeUrl) String() string { urlStr := nurl.UrlStr() if len(nurl.Addons) > 0 { - return urlStr + "(" + strings.Join(nurl.Addons, ",") + ")" + return urlStr + ", addons: (" + strings.Join(nurl.Addons, ",") + ")" } return urlStr } @@ -157,18 +168,43 @@ func (ac *AuthConfig) AddAuthPath(url string) string { func ValidateEndpoint(endpoint, apiInterface string) error { switch apiInterface { - case spectypes.APIInterfaceJsonRPC, spectypes.APIInterfaceTendermintRPC, spectypes.APIInterfaceRest: + case spectypes.APIInterfaceRest: + parsedUrl, err := url.Parse(endpoint) + if err != nil { + return utils.LavaFormatError("could not parse node url", err, + utils.LogAttr("url", endpoint), + utils.LogAttr("apiInterface", apiInterface), + ) + } + + switch parsedUrl.Scheme { + case "http", "https": + return nil + default: + return utils.LavaFormatError("URL scheme should be (http/https), got: "+parsedUrl.Scheme, nil, + utils.LogAttr("url", endpoint), + utils.LogAttr("apiInterface", apiInterface), + ) + } + case spectypes.APIInterfaceJsonRPC, spectypes.APIInterfaceTendermintRPC: parsedUrl, err := url.Parse(endpoint) if err != nil { - return utils.LavaFormatError("could not parse node url", err, utils.Attribute{Key: "url", Value: endpoint}, utils.Attribute{Key: "apiInterface", Value: apiInterface}) + return utils.LavaFormatError("could not parse node url", err, + utils.LogAttr("url", endpoint), + utils.LogAttr("apiInterface", apiInterface), + ) } + switch parsedUrl.Scheme { case "http", "https": return nil case "ws", "wss": return nil default: - return utils.LavaFormatError("URL scheme should be websocket (ws/wss) or (http/https), got: "+parsedUrl.Scheme, nil, utils.Attribute{Key: "apiInterface", Value: apiInterface}) + return utils.LavaFormatError("URL scheme should be websocket (ws/wss) or (http/https), got: "+parsedUrl.Scheme, nil, + utils.LogAttr("url", endpoint), + utils.LogAttr("apiInterface", apiInterface), + ) } case spectypes.APIInterfaceGrpc: if endpoint == "" { @@ -209,7 +245,7 @@ type RelayResult struct { Request *pairingtypes.RelayRequest Reply *pairingtypes.RelayReply ProviderInfo ProviderInfo - ReplyServer *pairingtypes.Relayer_RelaySubscribeClient + ReplyServer pairingtypes.Relayer_RelaySubscribeClient Finalized bool ConflictHandler ConflictHandlerInterface StatusCode int @@ -217,7 +253,7 @@ type RelayResult struct { ProviderTrailer metadata.MD // the provider trailer attached to the request. used to transfer useful information (which is not signed so shouldn't be trusted completely). } -func (rr *RelayResult) GetReplyServer() *pairingtypes.Relayer_RelaySubscribeClient { +func (rr *RelayResult) GetReplyServer() pairingtypes.Relayer_RelaySubscribeClient { if rr == nil { return nil } diff --git a/protocol/common/errors.go b/protocol/common/errors.go index 77a88cb6bd..72a4148af9 100644 --- a/protocol/common/errors.go +++ b/protocol/common/errors.go @@ -3,9 +3,11 @@ package common import sdkerrors "cosmossdk.io/errors" var ( - ContextDeadlineExceededError = sdkerrors.New("ContextDeadlineExceeded Error", 300, "context deadline exceeded") - StatusCodeError504 = sdkerrors.New("Disallowed StatusCode Error", 504, "Disallowed status code error") - StatusCodeError429 = sdkerrors.New("Disallowed StatusCode Error", 429, "Disallowed status code error") - StatusCodeErrorStrict = sdkerrors.New("Disallowed StatusCode Error", 800, "Disallowed status code error") - APINotSupportedError = sdkerrors.New("APINotSupported Error", 900, "api not supported") + ContextDeadlineExceededError = sdkerrors.New("ContextDeadlineExceeded Error", 300, "context deadline exceeded") + StatusCodeError504 = sdkerrors.New("Disallowed StatusCode Error", 504, "Disallowed status code error") + StatusCodeError429 = sdkerrors.New("Disallowed StatusCode Error", 429, "Disallowed status code error") + StatusCodeErrorStrict = sdkerrors.New("Disallowed StatusCode Error", 800, "Disallowed status code error") + APINotSupportedError = sdkerrors.New("APINotSupported Error", 900, "api not supported") + SubscriptionNotFoundError = sdkerrors.New("SubscriptionNotFoundError Error", 901, "subscription not found") + ProviderFinalizationDataAccountabilityError = sdkerrors.New("ProviderFinalizationDataAccountability Error", 3365, "provider returned invalid finalization data, with accountability") ) diff --git a/protocol/common/return_errors.go b/protocol/common/return_errors.go index f0c124ad73..5394ba1f3d 100644 --- a/protocol/common/return_errors.go +++ b/protocol/common/return_errors.go @@ -9,6 +9,7 @@ import "github.com/gofiber/fiber/v2" type JsonRPCError struct { Code int `json:"code"` Message string `json:"message"` + Data string `json:"data"` } type JsonRPCErrorMessage struct { @@ -26,6 +27,16 @@ var JsonRpcMethodNotFoundError = JsonRPCErrorMessage{ }, } +var JsonRpcSubscriptionNotFoundError = JsonRPCErrorMessage{ + JsonRPC: "2.0", + Id: 1, + Error: JsonRPCError{ + Code: -32603, + Message: "Internal error", + Data: "subscription not found", + }, +} + // ####### // Rest // ####### diff --git a/protocol/common/safe_channel_sender.go b/protocol/common/safe_channel_sender.go new file mode 100644 index 0000000000..c8dcb3ea49 --- /dev/null +++ b/protocol/common/safe_channel_sender.go @@ -0,0 +1,99 @@ +package common + +import ( + "context" + "sync" + "time" + + "github.com/lavanet/lava/v2/utils" +) + +const retryAttemptsForChannelWrite = 10 + +type SafeChannelSender[T any] struct { + ctx context.Context + cancelCtx context.CancelFunc + ch chan<- T + closed bool + lock sync.Mutex +} + +func NewSafeChannelSender[T any](ctx context.Context, ch chan<- T) *SafeChannelSender[T] { + ctx, cancel := context.WithCancel(ctx) + return &SafeChannelSender[T]{ + ctx: ctx, + cancelCtx: cancel, + ch: ch, + closed: false, + lock: sync.Mutex{}, + } +} + +func (scs *SafeChannelSender[T]) sendInner(msg T) { + if scs.closed { + utils.LavaFormatTrace("Attempted to send message to closed channel") + return + } + + shouldBreak := false + for retry := 0; retry < retryAttemptsForChannelWrite; retry++ { + select { + case <-scs.ctx.Done(): + // trying to write to the channel, if the channel is not ready this will fail and retry again up to retryAttemptsForChannelWrite times + case scs.ch <- msg: + shouldBreak = true + default: + utils.LavaFormatTrace("Failed to send message to channel", utils.LogAttr("attempt", retry)) + } + if shouldBreak { + break + } + time.Sleep(time.Millisecond) // wait 1 millisecond between each attempt to write to the channel + } +} + +// Used when there is a need to validate locked, but you don't want to wait for the channel +// to return. +func (scs *SafeChannelSender[T]) LockAndSendAsynchronously(msg T) { + scs.lock.Lock() + go func() { + defer scs.lock.Unlock() + scs.sendInner(msg) + }() +} + +// Used when you need to wait for the other side to receive the message. +func (scs *SafeChannelSender[T]) Send(msg T) { + scs.lock.Lock() + defer scs.lock.Unlock() + scs.sendInner(msg) +} + +func (scs *SafeChannelSender[T]) ReplaceChannel(ch chan<- T) { + scs.lock.Lock() + defer scs.lock.Unlock() + + if scs.closed { + return + } + + // check wether the incoming channel is different than the one we currently have. + // this helps us avoids closing our channel and holding a closed channel causing Close to panic. + if scs.ch != ch { + close(scs.ch) + scs.ch = ch + } +} + +func (scs *SafeChannelSender[T]) Close() { + scs.lock.Lock() + defer scs.lock.Unlock() + + if scs.closed { + return + } + + scs.cancelCtx() + close(scs.ch) + scs.closed = true +} diff --git a/protocol/common/safe_channel_sender_test.go b/protocol/common/safe_channel_sender_test.go new file mode 100644 index 0000000000..eb05f5316a --- /dev/null +++ b/protocol/common/safe_channel_sender_test.go @@ -0,0 +1,41 @@ +package common + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestSafeChannelSender(t *testing.T) { + t.Run("Send message", func(t *testing.T) { + ctx := context.Background() + ch := make(chan int) + sender := NewSafeChannelSender(ctx, ch) + + msg := 42 + chEnd := make(chan bool) + go func() { + defer func() { chEnd <- true }() + select { + case received, ok := <-ch: + fmt.Println("got message from channel", ok, received) + require.True(t, ok) + require.Equal(t, msg, received) + return + case <-time.After(time.Second * 20): + require.Fail(t, "Expected message to be sent, but channel is empty") + } + }() + + // wait for the routine to listen to the channel + <-time.After(time.Second * 1) + sender.Send(msg) + sender.Close() + require.True(t, sender.closed) + // wait for the test to end + <-chEnd + }) +} diff --git a/protocol/common/strings.go b/protocol/common/strings.go new file mode 100644 index 0000000000..831e47943a --- /dev/null +++ b/protocol/common/strings.go @@ -0,0 +1,18 @@ +package common + +import "strings" + +func IsQuoted(s string) bool { + return strings.HasPrefix(s, "\"") && strings.HasSuffix(s, "\"") +} + +func IsSquareBracketed(s string) bool { + return strings.HasPrefix(s, "[") && strings.HasSuffix(s, "]") +} + +func UnSquareBracket(s string) string { + if IsSquareBracketed(s) { + return s[1 : len(s)-1] + } + return s +} diff --git a/protocol/common/timeout.go b/protocol/common/timeout.go index 464937deca..af1137ffa7 100644 --- a/protocol/common/timeout.go +++ b/protocol/common/timeout.go @@ -20,6 +20,11 @@ const ( DefaultTimeoutLongIsh = 1 * time.Minute DefaultTimeoutLong = 3 * time.Minute CacheTimeout = 50 * time.Millisecond + // On subscriptions we must use context.Background(), + // we cant have a context.WithTimeout() context, meaning we can hang for ever. + // to avoid that we introduced a first reply timeout using a routine. + // if the first reply doesn't return after the specified timeout a timeout error will occur + SubscriptionFirstReplyTimeout = 10 * time.Second ) func LocalNodeTimePerCu(cu uint64) time.Duration { diff --git a/protocol/common/tx_parsing.go b/protocol/common/tx_parsing.go index 5572049497..6b04d3f2ca 100644 --- a/protocol/common/tx_parsing.go +++ b/protocol/common/tx_parsing.go @@ -6,7 +6,7 @@ import ( "strconv" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/spf13/pflag" ) diff --git a/protocol/integration/mocks.go b/protocol/integration/mocks.go index 3eb06f89a7..5790a09c17 100644 --- a/protocol/integration/mocks.go +++ b/protocol/integration/mocks.go @@ -3,45 +3,57 @@ package integration_test import ( "context" "fmt" + "net" "net/http" - "path/filepath" "strconv" "sync" "time" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - plantypes "github.com/lavanet/lava/x/plans/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/rpcprovider" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) -type mockConsumerStateTracker struct{} +type TxConflictDetectionMock func(context.Context, *conflicttypes.FinalizationConflict, *conflicttypes.ResponseConflict, common.ConflictHandlerInterface) error + +type mockConsumerStateTracker struct { + txConflictDetectionMock TxConflictDetectionMock +} func (m *mockConsumerStateTracker) RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, versionValidator updaters.VersionValidationInf) { } -func (m *mockConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager) { +func (m *mockConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager, staticProviders []*lavasession.RPCProviderEndpoint) { } func (m *mockConsumerStateTracker) RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, endpoint lavasession.RPCEndpoint) error { return nil } -func (m *mockConsumerStateTracker) RegisterFinalizationConsensusForUpdates(context.Context, *lavaprotocol.FinalizationConsensus) { +func (m *mockConsumerStateTracker) RegisterFinalizationConsensusForUpdates(context.Context, *finalizationconsensus.FinalizationConsensus) { } func (m *mockConsumerStateTracker) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable updaters.DowntimeParamsUpdatable) error { return nil } -func (m *mockConsumerStateTracker) TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict, conflictHandler common.ConflictHandlerInterface) error { +func (m *mockConsumerStateTracker) SetTxConflictDetectionWrapper(txConflictDetectionWrapper TxConflictDetectionMock) { + m.txConflictDetectionMock = txConflictDetectionWrapper +} + +func (m *mockConsumerStateTracker) TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error { + if m.txConflictDetectionMock != nil { + return m.txConflictDetectionMock(ctx, finalizationConflict, responseConflict, conflictHandler) + } return nil } @@ -246,27 +258,79 @@ func NewMockChainFetcher(startBlock, blocksToSave int64, callback func()) *MockC return &mockCHainFetcher } +const ( + minPort = 1024 + maxPort = 49151 +) + type uniqueAddressGenerator struct { - seed int - lock sync.Mutex + currentPort int + lock sync.Mutex } -func (ug *uniqueAddressGenerator) GetAddress() string { - ug.lock.Lock() - defer ug.lock.Unlock() - ug.seed++ - if ug.seed < 100 { - return "localhost:111" + strconv.Itoa(ug.seed) +func isPortInUse(port int) bool { + // Attempt to listen on the port + ln, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) + if err != nil { + // If there's an error, the port is likely in use + return true } - return "localhost:11" + strconv.Itoa(ug.seed) + + // Close the listener immediately if successful + ln.Close() + return false } -func (ug *uniqueAddressGenerator) GetUnixSocketAddress() string { - ug.lock.Lock() - defer ug.lock.Unlock() - ug.seed++ - if ug.seed < 100 { - return filepath.Join("/tmp", "unix:"+strconv.Itoa(ug.seed)+".sock") +func NewUniqueAddressGenerator() uniqueAddressGenerator { + return uniqueAddressGenerator{ + currentPort: minPort, + } +} + +func (ag *uniqueAddressGenerator) GetAddress() string { + ag.lock.Lock() + defer ag.lock.Unlock() + + for { + if !isPortInUse(ag.currentPort) { + break + } + ag.currentPort++ + } + + if ag.currentPort > maxPort { + panic("all ports have been exhausted") } - return filepath.Join("/tmp", "unix:"+strconv.Itoa(ug.seed)+".sock") + + address := fmt.Sprintf("localhost:%d", ag.currentPort) + ag.currentPort++ + return address +} + +type GetLatestBlockDataWrapper func(rpcprovider.ReliabilityManagerInf, int64, int64, int64) (int64, []*chaintracker.BlockStore, time.Time, error) + +type MockReliabilityManager struct { + ReliabilityManager rpcprovider.ReliabilityManagerInf + getLatestBlockDataWrapper GetLatestBlockDataWrapper +} + +func NewMockReliabilityManager(reliabilityManager rpcprovider.ReliabilityManagerInf) *MockReliabilityManager { + return &MockReliabilityManager{ + ReliabilityManager: reliabilityManager, + } +} + +func (mrm *MockReliabilityManager) SetGetLatestBlockDataWrapper(wrapper GetLatestBlockDataWrapper) { + mrm.getLatestBlockDataWrapper = wrapper +} + +func (mrm *MockReliabilityManager) GetLatestBlockData(fromBlock, toBlock, specificBlock int64) (latestBlock int64, requestedHashes []*chaintracker.BlockStore, changeTime time.Time, err error) { + if mrm.getLatestBlockDataWrapper != nil { + return mrm.getLatestBlockDataWrapper(mrm.ReliabilityManager, fromBlock, toBlock, specificBlock) + } + return mrm.ReliabilityManager.GetLatestBlockData(fromBlock, toBlock, specificBlock) +} + +func (mrm *MockReliabilityManager) GetLatestBlockNum() (int64, time.Time) { + return mrm.ReliabilityManager.GetLatestBlockNum() } diff --git a/protocol/integration/protocol_test.go b/protocol/integration/protocol_test.go index 358a9025a2..8fece3cd9f 100644 --- a/protocol/integration/protocol_test.go +++ b/protocol/integration/protocol_test.go @@ -7,29 +7,34 @@ import ( "fmt" "io" "net/http" + "net/url" "os" + "strconv" + "sync" "testing" "time" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/provideroptimizer" - "github.com/lavanet/lava/protocol/rpcconsumer" - "github.com/lavanet/lava/protocol/rpcprovider" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" + "github.com/gorilla/websocket" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + "github.com/lavanet/lava/v2/protocol/rpcconsumer" + "github.com/lavanet/lava/v2/protocol/rpcprovider" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v2/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" "github.com/stretchr/testify/require" "google.golang.org/grpc/connectivity" - spectypes "github.com/lavanet/lava/x/spec/types" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) var ( @@ -42,7 +47,7 @@ func TestMain(m *testing.M) { // This code will run once before any test cases are executed. seed = time.Now().Unix() rand.SetSpecificSeed(seed) - addressGen = uniqueAddressGenerator{} + addressGen = NewUniqueAddressGenerator() randomizer = sigs.NewZeroReader(seed) lavasession.AllowInsecureConnectionToProviders = true // Run the actual tests @@ -92,12 +97,28 @@ func checkGrpcServerStatusWithTimeout(url string, totalTimeout time.Duration) bo return false } -func isServerUp(url string) bool { +func isServerUp(urlPath string) bool { + u, err := url.Parse(urlPath) + if err != nil { + panic(err) + } + + switch { + case u.Scheme == "http": + return isHttpServerUp(urlPath) + case u.Scheme == "ws": + return isWebsocketServerUp(urlPath) + default: + panic("unsupported scheme") + } +} + +func isHttpServerUp(urlPath string) bool { client := http.Client{ Timeout: 20 * time.Millisecond, } - resp, err := client.Get(url) + resp, err := client.Get(urlPath) if err != nil { return false } @@ -107,6 +128,15 @@ func isServerUp(url string) bool { return resp.ContentLength > 0 } +func isWebsocketServerUp(urlPath string) bool { + client, _, err := websocket.DefaultDialer.Dial(urlPath, nil) + if err != nil { + return false + } + client.Close() + return true +} + func checkServerStatusWithTimeout(url string, totalTimeout time.Duration) bool { startTime := time.Now() @@ -132,12 +162,12 @@ func createInMemoryRewardDb(specs []string) (*rewardserver.RewardDB, error) { return rewardDB, nil } -func createRpcConsumer(t *testing.T, ctx context.Context, specId string, apiInterface string, account sigs.Account, consumerListenAddress string, epoch uint64, pairingList map[uint64]*lavasession.ConsumerSessionsWithProvider, requiredResponses int, lavaChainID string) *rpcconsumer.RPCConsumerServer { +func createRpcConsumer(t *testing.T, ctx context.Context, specId string, apiInterface string, account sigs.Account, consumerListenAddress string, epoch uint64, pairingList map[uint64]*lavasession.ConsumerSessionsWithProvider, requiredResponses int, lavaChainID string) (*rpcconsumer.RPCConsumerServer, *mockConsumerStateTracker) { serverHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Handle the incoming request and provide the desired response w.WriteHeader(http.StatusOK) }) - chainParser, _, chainFetcher, _, _, err := chainlib.CreateChainLibMocks(ctx, specId, apiInterface, serverHandler, "../../", nil) + chainParser, _, chainFetcher, _, _, err := chainlib.CreateChainLibMocks(ctx, specId, apiInterface, serverHandler, nil, "../../", nil) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainFetcher) @@ -152,27 +182,39 @@ func createRpcConsumer(t *testing.T, ctx context.Context, specId string, apiInte Geolocation: 1, } consumerStateTracker := &mockConsumerStateTracker{} - finalizationConsensus := lavaprotocol.NewFinalizationConsensus(rpcEndpoint.ChainID) + finalizationConsensus := finalizationconsensus.NewFinalizationConsensus(rpcEndpoint.ChainID) _, averageBlockTime, _, _ := chainParser.ChainBlockStats() baseLatency := common.AverageWorldLatency / 2 optimizer := provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, averageBlockTime, baseLatency, 2) - consumerSessionManager := lavasession.NewConsumerSessionManager(rpcEndpoint, optimizer, nil, nil, "test") + consumerSessionManager := lavasession.NewConsumerSessionManager(rpcEndpoint, optimizer, nil, nil, "test", lavasession.NewActiveSubscriptionProvidersStorage()) consumerSessionManager.UpdateAllProviders(epoch, pairingList) consumerConsistency := rpcconsumer.NewConsumerConsistency(specId) consumerCmdFlags := common.ConsumerCmdFlags{} - rpcsonumerLogs, err := metrics.NewRPCConsumerLogs(nil, nil) + rpcconsumerLogs, err := metrics.NewRPCConsumerLogs(nil, nil) require.NoError(t, err) - err = rpcConsumerServer.ServeRPCRequests(ctx, rpcEndpoint, consumerStateTracker, chainParser, finalizationConsensus, consumerSessionManager, requiredResponses, account.SK, lavaChainID, nil, rpcsonumerLogs, account.Addr, consumerConsistency, nil, consumerCmdFlags, false, nil, nil) + err = rpcConsumerServer.ServeRPCRequests(ctx, rpcEndpoint, consumerStateTracker, chainParser, finalizationConsensus, consumerSessionManager, requiredResponses, account.SK, lavaChainID, nil, rpcconsumerLogs, account.Addr, consumerConsistency, nil, consumerCmdFlags, false, nil, nil, nil) require.NoError(t, err) + + // wait for consumer to finish initialization + listeningAddr := rpcConsumerServer.GetListeningAddress() + for listeningAddr == "" { + time.Sleep(10 * time.Millisecond) + listeningAddr = rpcConsumerServer.GetListeningAddress() + } + // wait for consumer server to be up - consumerUp := checkServerStatusWithTimeout("http://"+consumerListenAddress, time.Millisecond*61) + consumerUp := checkServerStatusWithTimeout("http://"+listeningAddr, time.Millisecond*61) require.True(t, consumerUp) + if rpcEndpoint.ApiInterface == "tendermintrpc" || rpcEndpoint.ApiInterface == "jsonrpc" { + consumerUp = checkServerStatusWithTimeout("ws://"+listeningAddr+"/ws", time.Millisecond*61) + require.True(t, consumerUp) + } - return rpcConsumerServer + return rpcConsumerServer, consumerStateTracker } -func createRpcProvider(t *testing.T, ctx context.Context, consumerAddress string, specId string, apiInterface string, listenAddress string, account sigs.Account, lavaChainID string, addons []string) (*rpcprovider.RPCProviderServer, *lavasession.RPCProviderEndpoint, *ReplySetter, *MockChainFetcher) { +func createRpcProvider(t *testing.T, ctx context.Context, consumerAddress string, specId string, apiInterface string, listenAddress string, account sigs.Account, lavaChainID string, addons []string, providerUniqueId string) (*rpcprovider.RPCProviderServer, *lavasession.RPCProviderEndpoint, *ReplySetter, *MockChainFetcher, *MockReliabilityManager) { replySetter := ReplySetter{ status: http.StatusOK, replyDataBuf: []byte(`{"reply": "REPLY-STUB"}`), @@ -192,7 +234,7 @@ func createRpcProvider(t *testing.T, ctx context.Context, consumerAddress string fmt.Fprint(w, string(data)) }) - chainParser, chainRouter, chainFetcher, _, endpoint, err := chainlib.CreateChainLibMocks(ctx, specId, apiInterface, serverHandler, "../../", addons) + chainParser, chainRouter, chainFetcher, _, endpoint, err := chainlib.CreateChainLibMocks(ctx, specId, apiInterface, serverHandler, nil, "../../", addons) require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainFetcher) @@ -200,6 +242,10 @@ func createRpcProvider(t *testing.T, ctx context.Context, consumerAddress string endpoint.NetworkAddress.Address = listenAddress rpcProviderServer := &rpcprovider.RPCProviderServer{} + if providerUniqueId != "" { + rpcProviderServer.SetProviderUniqueId(providerUniqueId) + } + rpcProviderEndpoint := &lavasession.RPCProviderEndpoint{ NetworkAddress: lavasession.NetworkAddressData{ Address: endpoint.NetworkAddress.Address, @@ -248,7 +294,8 @@ func createRpcProvider(t *testing.T, ctx context.Context, consumerAddress string chainTracker, err := chaintracker.NewChainTracker(ctx, mockChainFetcher, chainTrackerConfig) require.NoError(t, err) reliabilityManager := reliabilitymanager.NewReliabilityManager(chainTracker, &mockProviderStateTracker, account.Addr.String(), chainRouter, chainParser) - rpcProviderServer.ServeRPCRequests(ctx, rpcProviderEndpoint, chainParser, rws, providerSessionManager, reliabilityManager, account.SK, nil, chainRouter, &mockProviderStateTracker, account.Addr, lavaChainID, rpcprovider.DEFAULT_ALLOWED_MISSING_CU, nil, nil) + mockReliabilityManager := NewMockReliabilityManager(reliabilityManager) + rpcProviderServer.ServeRPCRequests(ctx, rpcProviderEndpoint, chainParser, rws, providerSessionManager, mockReliabilityManager, account.SK, nil, chainRouter, &mockProviderStateTracker, account.Addr, lavaChainID, rpcprovider.DEFAULT_ALLOWED_MISSING_CU, nil, nil, nil, false) listener := rpcprovider.NewProviderListener(ctx, rpcProviderEndpoint.NetworkAddress, "/health") err = listener.RegisterReceiver(rpcProviderServer, rpcProviderEndpoint) require.NoError(t, err) @@ -256,7 +303,7 @@ func createRpcProvider(t *testing.T, ctx context.Context, consumerAddress string chainTracker.RegisterForBlockTimeUpdates(chainParser) providerUp := checkGrpcServerStatusWithTimeout(rpcProviderEndpoint.NetworkAddress.Address, time.Millisecond*261) require.True(t, providerUp) - return rpcProviderServer, endpoint, &replySetter, mockChainFetcher + return rpcProviderServer, endpoint, &replySetter, mockChainFetcher, mockReliabilityManager } func TestConsumerProviderBasic(t *testing.T) { @@ -282,7 +329,6 @@ func TestConsumerProviderBasic(t *testing.T) { providers := []providerData{} for i := 0; i < numProviders; i++ { - // providerListenAddress := "localhost:111" + strconv.Itoa(i) account := sigs.GenerateDeterministicFloatingKey(randomizer) providerDataI := providerData{account: account} providers = append(providers, providerDataI) @@ -292,7 +338,7 @@ func TestConsumerProviderBasic(t *testing.T) { ctx := context.Background() providerDataI := providers[i] listenAddress := addressGen.GetAddress() - providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil)) + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, _ = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) } for i := 0; i < numProviders; i++ { pairingList[uint64(i)] = &lavasession.ConsumerSessionsWithProvider{ @@ -310,7 +356,7 @@ func TestConsumerProviderBasic(t *testing.T) { PairingEpoch: epoch, } } - rpcconsumerServer := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + rpcconsumerServer, _ := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) require.NotNil(t, rpcconsumerServer) client := http.Client{} resp, err := client.Get("http://" + consumerListenAddress + "/status") @@ -359,7 +405,6 @@ func TestConsumerProviderWithProviders(t *testing.T) { providers := []providerData{} for i := 0; i < numProviders; i++ { - // providerListenAddress := "localhost:111" + strconv.Itoa(i) account := sigs.GenerateDeterministicFloatingKey(randomizer) providerDataI := providerData{account: account} providers = append(providers, providerDataI) @@ -369,7 +414,7 @@ func TestConsumerProviderWithProviders(t *testing.T) { ctx := context.Background() providerDataI := providers[i] listenAddress := addressGen.GetAddress() - providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil)) + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, _ = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) providers[i].replySetter.replyDataBuf = []byte(fmt.Sprintf(`{"reply": %d}`, i+1)) } for i := 0; i < numProviders; i++ { @@ -388,7 +433,7 @@ func TestConsumerProviderWithProviders(t *testing.T) { PairingEpoch: epoch, } } - rpcconsumerServer := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + rpcconsumerServer, _ := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) require.NotNil(t, rpcconsumerServer) if play.scenario != 1 { counter := map[int]int{} @@ -504,7 +549,7 @@ func TestConsumerProviderTx(t *testing.T) { ctx := context.Background() providerDataI := providers[i] listenAddress := addressGen.GetAddress() - providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil)) + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, _ = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) providers[i].replySetter.replyDataBuf = []byte(fmt.Sprintf(`{"result": %d}`, i+1)) } for i := 0; i < numProviders; i++ { @@ -523,7 +568,7 @@ func TestConsumerProviderTx(t *testing.T) { PairingEpoch: epoch, } } - rpcconsumerServer := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + rpcconsumerServer, _ := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) require.NotNil(t, rpcconsumerServer) for i := 0; i < numProviders; i++ { @@ -601,7 +646,6 @@ func TestConsumerProviderJsonRpcWithNullID(t *testing.T) { providers := []providerData{} for i := 0; i < numProviders; i++ { - // providerListenAddress := "localhost:111" + strconv.Itoa(i) account := sigs.GenerateDeterministicFloatingKey(randomizer) providerDataI := providerData{account: account} providers = append(providers, providerDataI) @@ -611,7 +655,7 @@ func TestConsumerProviderJsonRpcWithNullID(t *testing.T) { ctx := context.Background() providerDataI := providers[i] listenAddress := addressGen.GetAddress() - providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil)) + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, _ = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) providers[i].replySetter.replyDataBuf = []byte(fmt.Sprintf(`{"result": %d}`, i+1)) } for i := 0; i < numProviders; i++ { @@ -630,7 +674,7 @@ func TestConsumerProviderJsonRpcWithNullID(t *testing.T) { PairingEpoch: epoch, } } - rpcconsumerServer := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + rpcconsumerServer, _ := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) require.NotNil(t, rpcconsumerServer) for i := 0; i < numProviders; i++ { @@ -665,3 +709,516 @@ func TestConsumerProviderJsonRpcWithNullID(t *testing.T) { }) } } + +func TestConsumerProviderSubscriptionsHappyFlow(t *testing.T) { + playbook := []struct { + name string + specId string + method string + expected string + apiInterface string + }{ + { + name: "jsonrpc", + specId: "ETH1", + method: "eth_blockNumber", + expected: `{"jsonrpc":"2.0","id":null,"result":{}}`, + apiInterface: spectypes.APIInterfaceJsonRPC, + }, + { + name: "tendermintrpc", + specId: "LAV1", + method: "status", + expected: `{"jsonrpc":"2.0","result":{}}`, + apiInterface: spectypes.APIInterfaceTendermintRPC, + }, + } + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + ctx := context.Background() + // can be any spec and api interface + specId := play.specId + apiInterface := play.apiInterface + epoch := uint64(100) + requiredResponses := 1 + lavaChainID := "lava" + numProviders := 5 + + consumerListenAddress := addressGen.GetAddress() + pairingList := map[uint64]*lavasession.ConsumerSessionsWithProvider{} + type providerData struct { + account sigs.Account + endpoint *lavasession.RPCProviderEndpoint + server *rpcprovider.RPCProviderServer + replySetter *ReplySetter + mockChainFetcher *MockChainFetcher + } + providers := []providerData{} + + for i := 0; i < numProviders; i++ { + account := sigs.GenerateDeterministicFloatingKey(randomizer) + providerDataI := providerData{account: account} + providers = append(providers, providerDataI) + } + consumerAccount := sigs.GenerateDeterministicFloatingKey(randomizer) + for i := 0; i < numProviders; i++ { + ctx := context.Background() + providerDataI := providers[i] + listenAddress := addressGen.GetAddress() + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, _ = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) + providers[i].replySetter.replyDataBuf = []byte(fmt.Sprintf(`{"result": %d}`, i+1)) + } + for i := 0; i < numProviders; i++ { + pairingList[uint64(i)] = &lavasession.ConsumerSessionsWithProvider{ + PublicLavaAddress: providers[i].account.Addr.String(), + Endpoints: []*lavasession.Endpoint{ + { + NetworkAddress: providers[i].endpoint.NetworkAddress.Address, + Enabled: true, + Geolocation: 1, + }, + }, + Sessions: map[int64]*lavasession.SingleConsumerSession{}, + MaxComputeUnits: 10000, + UsedComputeUnits: 0, + PairingEpoch: epoch, + } + } + rpcconsumerServer, _ := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + require.NotNil(t, rpcconsumerServer) + + for i := 0; i < numProviders; i++ { + handler := func(req []byte, header http.Header) (data []byte, status int) { + var jsonRpcMessage rpcInterfaceMessages.JsonrpcMessage + err := json.Unmarshal(req, &jsonRpcMessage) + require.NoError(t, err) + + response := fmt.Sprintf(`{"jsonrpc":"2.0","result": {}, "id": %v}`, string(jsonRpcMessage.ID)) + return []byte(response), http.StatusOK + } + providers[i].replySetter.handler = handler + } + + client := http.Client{Timeout: 500 * time.Millisecond} + jsonMsg := fmt.Sprintf(`{"jsonrpc":"2.0","method":"%v","params": [], "id":null}`, play.method) + msgBuffer := bytes.NewBuffer([]byte(jsonMsg)) + req, err := http.NewRequest(http.MethodPost, "http://"+consumerListenAddress, msgBuffer) + require.NoError(t, err) + req.Header.Set("Content-Type", "application/json") + + resp, err := client.Do(req) + require.NoError(t, err) + + bodyBytes, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Equal(t, http.StatusOK, resp.StatusCode, string(bodyBytes)) + + resp.Body.Close() + + require.Equal(t, play.expected, string(bodyBytes)) + }) + } +} + +func TestSameProviderConflictBasicResponseCheck(t *testing.T) { + playbook := []struct { + name string + shouldGetError bool + numOfProviders int + numOfLyingProviders int + }{ + { + name: "one provider - fake block hashes - return conflict error", + numOfProviders: 1, + numOfLyingProviders: 1, + shouldGetError: true, + }, + { + name: "multiple providers - only one with fake block hashes - return ok", + numOfProviders: 2, + numOfLyingProviders: 1, + shouldGetError: false, + }, + { + name: "multiple providers - everyone is returning fake block hashes - return conflict error", + numOfProviders: 3, + numOfLyingProviders: 3, + shouldGetError: true, + }, + } + for _, play := range playbook { + t.Run(play.name, func(t *testing.T) { + require.LessOrEqual(t, play.numOfLyingProviders, play.numOfProviders, "too many lying providers") + ctx := context.Background() + // can be any spec and api interface + specId := "LAV1" + apiInterface := spectypes.APIInterfaceRest + epoch := uint64(100) + requiredResponses := 1 + lavaChainID := "lava" + numProviders := play.numOfProviders + + consumerListenAddress := addressGen.GetAddress() + pairingList := map[uint64]*lavasession.ConsumerSessionsWithProvider{} + + type providerData struct { + account sigs.Account + endpoint *lavasession.RPCProviderEndpoint + server *rpcprovider.RPCProviderServer + replySetter *ReplySetter + mockChainFetcher *MockChainFetcher + mockReliabilityManager *MockReliabilityManager + } + providers := []providerData{} + + for i := 0; i < numProviders; i++ { + account := sigs.GenerateDeterministicFloatingKey(randomizer) + providerDataI := providerData{account: account} + providers = append(providers, providerDataI) + } + consumerAccount := sigs.GenerateDeterministicFloatingKey(randomizer) + + for i := 0; i < numProviders; i++ { + ctx := context.Background() + providerDataI := providers[i] + listenAddress := addressGen.GetAddress() + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, providers[i].mockReliabilityManager = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) + providers[i].replySetter.replyDataBuf = []byte(fmt.Sprintf(`{"result": %d}`, i+1)) + } + + for i := 0; i < numProviders; i++ { + pairingList[uint64(i)] = &lavasession.ConsumerSessionsWithProvider{ + PublicLavaAddress: providers[i].account.Addr.String(), + Endpoints: []*lavasession.Endpoint{ + { + NetworkAddress: providers[i].endpoint.NetworkAddress.Address, + Enabled: true, + Geolocation: 1, + }, + }, + Sessions: map[int64]*lavasession.SingleConsumerSession{}, + MaxComputeUnits: 10000, + UsedComputeUnits: 0, + PairingEpoch: epoch, + } + } + rpcconsumerServer, _ := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + require.NotNil(t, rpcconsumerServer) + + // Set first provider as a "liar", to return wrong block hashes + getLatestBlockDataWrapper := func(rmi rpcprovider.ReliabilityManagerInf, fromBlock, toBlock, specificBlock int64) (int64, []*chaintracker.BlockStore, time.Time, error) { + latestBlock, requestedHashes, changeTime, err := rmi.GetLatestBlockData(fromBlock, toBlock, specificBlock) + + for _, block := range requestedHashes { + block.Hash += strconv.Itoa(int(rand.Int63())) + } + + return latestBlock, requestedHashes, changeTime, err + } + + for i := 0; i < play.numOfLyingProviders; i++ { + providers[i].mockReliabilityManager.SetGetLatestBlockDataWrapper(getLatestBlockDataWrapper) + } + + client := http.Client{Timeout: 500 * time.Millisecond} + req, err := http.NewRequest(http.MethodPost, "http://"+consumerListenAddress+"/cosmos/tx/v1beta1/txs", nil) + require.NoError(t, err) + + resp, err := client.Do(req) + require.NoError(t, err) + require.Equal(t, http.StatusOK, resp.StatusCode) + + bodyBytes, err := io.ReadAll(resp.Body) + require.NoError(t, err) + + resp.Body.Close() + if play.shouldGetError { + require.Contains(t, string(bodyBytes), "found same provider conflict") + } else { + require.Equal(t, `{"result": 2}`, string(bodyBytes)) + } + }) + } +} + +func TestSameProviderConflictReport(t *testing.T) { + type providerData struct { + account sigs.Account + endpoint *lavasession.RPCProviderEndpoint + server *rpcprovider.RPCProviderServer + replySetter *ReplySetter + mockChainFetcher *MockChainFetcher + mockReliabilityManager *MockReliabilityManager + } + + createProvidersData := func(numProviders int) (providers []*providerData) { + providers = []*providerData{} + + for i := 0; i < numProviders; i++ { + account := sigs.GenerateDeterministicFloatingKey(randomizer) + providerDataI := providerData{account: account} + providers = append(providers, &providerDataI) + } + + return providers + } + + initProvidersData := func(consumerAccount sigs.Account, providers []*providerData, specId, apiInterface, lavaChainID string) { + for i := 0; i < len(providers); i++ { + ctx := context.Background() + providerDataI := providers[i] + listenAddress := addressGen.GetAddress() + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, providers[i].mockReliabilityManager = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) + providers[i].replySetter.replyDataBuf = []byte(fmt.Sprintf(`{"result": %d}`, i+1)) + } + } + + initPairingList := func(providers []*providerData, epoch uint64) (pairingList map[uint64]*lavasession.ConsumerSessionsWithProvider) { + pairingList = map[uint64]*lavasession.ConsumerSessionsWithProvider{} + + for i := 0; i < len(providers); i++ { + pairingList[uint64(i)] = &lavasession.ConsumerSessionsWithProvider{ + PublicLavaAddress: providers[i].account.Addr.String(), + Endpoints: []*lavasession.Endpoint{ + { + NetworkAddress: providers[i].endpoint.NetworkAddress.Address, + Enabled: true, + Geolocation: 1, + }, + }, + Sessions: map[int64]*lavasession.SingleConsumerSession{}, + MaxComputeUnits: 10000, + UsedComputeUnits: 0, + PairingEpoch: epoch, + } + } + + return pairingList + } + + t.Run("same provider conflict report", func(t *testing.T) { + ctx := context.Background() + // can be any spec and api interface + specId := "LAV1" + apiInterface := spectypes.APIInterfaceRest + epoch := uint64(100) + requiredResponses := 1 + lavaChainID := "lava" + numProviders := 1 + + consumerListenAddress := addressGen.GetAddress() + + providers := createProvidersData(numProviders) + consumerAccount := sigs.GenerateDeterministicFloatingKey(randomizer) + + initProvidersData(consumerAccount, providers, specId, apiInterface, lavaChainID) + + pairingList := initPairingList(providers, epoch) + rpcconsumerServer, mockConsumerStateTracker := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + + conflictSent := false + wg := sync.WaitGroup{} + wg.Add(1) + txConflictDetectionMock := func(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error { + if finalizationConflict == nil { + wg.Done() + require.FailNow(t, "Finalization conflict should not be nil") + return nil + } + utils.LavaFormatDebug("@@@@@@@@@@@@@@@ Called conflict mock tx", utils.LogAttr("provider0", finalizationConflict.RelayFinalization_0.RelaySession.Provider), utils.LogAttr("provider0", finalizationConflict.RelayFinalization_1.RelaySession.Provider)) + + if finalizationConflict.RelayFinalization_0.RelaySession.Provider != finalizationConflict.RelayFinalization_1.RelaySession.Provider { + require.FailNow(t, "Finalization conflict should not have different provider addresses") + } + + if finalizationConflict.RelayFinalization_0.RelaySession.Provider != providers[0].account.Addr.String() { + require.FailNow(t, "Finalization conflict provider address is not the provider address") + } + wg.Done() + conflictSent = true + return nil + } + mockConsumerStateTracker.SetTxConflictDetectionWrapper(txConflictDetectionMock) + require.NotNil(t, rpcconsumerServer) + + // Set first provider as a "liar", to return wrong block hashes + getLatestBlockDataWrapper := func(rmi rpcprovider.ReliabilityManagerInf, fromBlock, toBlock, specificBlock int64) (int64, []*chaintracker.BlockStore, time.Time, error) { + latestBlock, requestedHashes, changeTime, err := rmi.GetLatestBlockData(fromBlock, toBlock, specificBlock) + + for _, block := range requestedHashes { + block.Hash += strconv.Itoa(int(rand.Int63())) + } + + return latestBlock, requestedHashes, changeTime, err + } + + providers[0].mockReliabilityManager.SetGetLatestBlockDataWrapper(getLatestBlockDataWrapper) + + client := http.Client{Timeout: 1 * time.Minute} + clientCtx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + defer cancel() + + req, err := http.NewRequestWithContext(clientCtx, http.MethodPost, "http://"+consumerListenAddress+"/cosmos/tx/v1beta1/txs", nil) + require.NoError(t, err) + + resp, err := client.Do(req) + require.NoError(t, err) + require.Equal(t, http.StatusOK, resp.StatusCode) + // conflict calls happen concurrently, therefore we need to wait the call. + wg.Wait() + require.True(t, conflictSent) + }) + + t.Run("two providers conflict report", func(t *testing.T) { + ctx := context.Background() + // can be any spec and api interface + specId := "LAV1" + apiInterface := spectypes.APIInterfaceRest + epoch := uint64(100) + requiredResponses := 1 + lavaChainID := "lava" + numProviders := 2 + + consumerListenAddress := addressGen.GetAddress() + providers := createProvidersData(numProviders) + consumerAccount := sigs.GenerateDeterministicFloatingKey(randomizer) + + initProvidersData(consumerAccount, providers, specId, apiInterface, lavaChainID) + + pairingList := initPairingList(providers, epoch) + rpcconsumerServer, mockConsumerStateTracker := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + + twoProvidersConflictSent := false + sameProviderConflictSent := false + wg := sync.WaitGroup{} + wg.Add(1) + txConflictDetectionMock := func(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error { + if finalizationConflict == nil { + require.FailNow(t, "Finalization conflict should not be nil") + wg.Done() + return nil + } + utils.LavaFormatDebug("@@@@@@@@@@@@@@@ Called conflict mock tx", utils.LogAttr("provider0", finalizationConflict.RelayFinalization_0.RelaySession.Provider), utils.LogAttr("provider0", finalizationConflict.RelayFinalization_1.RelaySession.Provider)) + + if finalizationConflict.RelayFinalization_0.RelaySession.Provider == finalizationConflict.RelayFinalization_1.RelaySession.Provider { + utils.LavaFormatDebug("@@@@@@@@@@@@@@@ Called SAME conflict tx") + sameProviderConflictSent = true + } + + if finalizationConflict.RelayFinalization_0.RelaySession.Provider != providers[0].account.Addr.String() { + require.FailNow(t, "Finalization conflict provider 0 address is not the first provider") + } + + if !sameProviderConflictSent && finalizationConflict.RelayFinalization_1.RelaySession.Provider != providers[1].account.Addr.String() { + require.FailNow(t, "Finalization conflict provider 1 address is not the first provider") + } + + twoProvidersConflictSent = true + wg.Done() + return nil + } + mockConsumerStateTracker.SetTxConflictDetectionWrapper(txConflictDetectionMock) + require.NotNil(t, rpcconsumerServer) + + // Set first provider as a "liar", to return wrong block hashes + getLatestBlockDataWrapper := func(rmi rpcprovider.ReliabilityManagerInf, fromBlock, toBlock, specificBlock int64) (int64, []*chaintracker.BlockStore, time.Time, error) { + latestBlock, requestedHashes, changeTime, err := rmi.GetLatestBlockData(fromBlock, toBlock, specificBlock) + + for _, block := range requestedHashes { + block.Hash += strconv.Itoa(int(rand.Int63())) + } + + return latestBlock, requestedHashes, changeTime, err + } + + providers[0].mockReliabilityManager.SetGetLatestBlockDataWrapper(getLatestBlockDataWrapper) + + client := http.Client{Timeout: 1000 * time.Millisecond} + req, err := http.NewRequest(http.MethodPost, "http://"+consumerListenAddress+"/cosmos/tx/v1beta1/txs", nil) + require.NoError(t, err) + + for i := 0; i < 2; i++ { + // Two relays to trigger both same provider conflict and + resp, err := client.Do(req) + require.NoError(t, err) + require.Equal(t, http.StatusOK, resp.StatusCode) + } + // conflict calls happen concurrently, therefore we need to wait the call. + wg.Wait() + require.True(t, sameProviderConflictSent) + require.True(t, twoProvidersConflictSent) + }) +} + +func TestConsumerProviderStatic(t *testing.T) { + ctx := context.Background() + // can be any spec and api interface + specId := "LAV1" + apiInterface := spectypes.APIInterfaceTendermintRPC + epoch := uint64(100) + requiredResponses := 1 + lavaChainID := "lava" + + numProviders := 1 + + consumerListenAddress := addressGen.GetAddress() + pairingList := map[uint64]*lavasession.ConsumerSessionsWithProvider{} + type providerData struct { + account sigs.Account + endpoint *lavasession.RPCProviderEndpoint + server *rpcprovider.RPCProviderServer + replySetter *ReplySetter + mockChainFetcher *MockChainFetcher + } + providers := []providerData{} + + for i := 0; i < numProviders; i++ { + account := sigs.GenerateDeterministicFloatingKey(randomizer) + providerDataI := providerData{account: account} + providers = append(providers, providerDataI) + } + consumerAccount := sigs.GenerateDeterministicFloatingKey(randomizer) + for i := 0; i < numProviders; i++ { + ctx := context.Background() + providerDataI := providers[i] + listenAddress := addressGen.GetAddress() + providers[i].server, providers[i].endpoint, providers[i].replySetter, providers[i].mockChainFetcher, _ = createRpcProvider(t, ctx, consumerAccount.Addr.String(), specId, apiInterface, listenAddress, providerDataI.account, lavaChainID, []string(nil), fmt.Sprintf("provider%d", i)) + } + // provider is static + for i := 0; i < numProviders; i++ { + pairingList[uint64(i)] = &lavasession.ConsumerSessionsWithProvider{ + PublicLavaAddress: "BANANA" + strconv.Itoa(i), + Endpoints: []*lavasession.Endpoint{ + { + NetworkAddress: providers[i].endpoint.NetworkAddress.Address, + Enabled: true, + Geolocation: 1, + }, + }, + Sessions: map[int64]*lavasession.SingleConsumerSession{}, + MaxComputeUnits: 10000, + UsedComputeUnits: 0, + PairingEpoch: epoch, + StaticProvider: true, + } + } + rpcconsumerServer, _ := createRpcConsumer(t, ctx, specId, apiInterface, consumerAccount, consumerListenAddress, epoch, pairingList, requiredResponses, lavaChainID) + require.NotNil(t, rpcconsumerServer) + client := http.Client{} + // consumer sends the relay to a provider with an address BANANA+%d so the provider needs to skip validations for this to work + resp, err := client.Get("http://" + consumerListenAddress + "/status") + require.NoError(t, err) + // we expect provider to fail the request on a verification + require.Equal(t, http.StatusInternalServerError, resp.StatusCode) + for i := 0; i < numProviders; i++ { + providers[i].server.StaticProvider = true + } + resp, err = client.Get("http://" + consumerListenAddress + "/status") + require.NoError(t, err) + // we expect provider to fail the request on a verification + require.Equal(t, http.StatusOK, resp.StatusCode) + bodyBytes, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Equal(t, providers[0].replySetter.replyDataBuf, bodyBytes) + resp.Body.Close() +} diff --git a/protocol/lavaprotocol/errors.go b/protocol/lavaprotocol/errors.go deleted file mode 100644 index aedb32ec0e..0000000000 --- a/protocol/lavaprotocol/errors.go +++ /dev/null @@ -1,14 +0,0 @@ -package lavaprotocol - -import ( - sdkerrors "cosmossdk.io/errors" -) - -var ( - ProviderFinzalizationDataError = sdkerrors.New("ProviderFinzalizationData Error", 3365, "provider did not sign finalization data correctly") - ProviderFinzalizationDataAccountabilityError = sdkerrors.New("ProviderFinzalizationDataAccountability Error", 3366, "provider returned invalid finalization data, with accountability") - HashesConsunsusError = sdkerrors.New("HashesConsunsus Error", 3367, "identified finalized responses with conflicting hashes, from two providers") - ConsistencyError = sdkerrors.New("Consistency Error", 3368, "does not meet consistency requirements") - UnhandledRelayReceiverError = sdkerrors.New("UnhandledRelayReceiver Error", 3369, "provider does not handle requested api interface and spec") - DisabledRelayReceiverError = sdkerrors.New("DisabledRelayReceiverError Error", 3370, "provider does not pass verification and disabled this interface and spec") -) diff --git a/protocol/lavaprotocol/finalization_consensus.go b/protocol/lavaprotocol/finalization_consensus.go deleted file mode 100644 index ca255e48a9..0000000000 --- a/protocol/lavaprotocol/finalization_consensus.go +++ /dev/null @@ -1,278 +0,0 @@ -package lavaprotocol - -import ( - "fmt" - "strconv" - "sync" - "sync/atomic" - "time" - - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" -) - -type FinalizationConsensus struct { - currentProviderHashesConsensus []ProviderHashesConsensus - prevEpochProviderHashesConsensus []ProviderHashesConsensus - providerDataContainersMu sync.RWMutex - currentEpoch uint64 - latestBlockByMedian uint64 // for caching - SpecId string -} - -type ProviderHashesConsensus struct { - FinalizedBlocksHashes map[int64]string - agreeingProviders map[string]providerDataContainer -} - -type providerDataContainer struct { - LatestFinalizedBlock int64 - LatestBlockTime time.Time - FinalizedBlocksHashes map[int64]string - SigBlocks []byte - SessionId uint64 - BlockHeight int64 - RelayNum uint64 - LatestBlock int64 - // TODO:: keep relay request for conflict reporting -} - -func NewFinalizationConsensus(specId string) *FinalizationConsensus { - return &FinalizationConsensus{SpecId: specId} -} - -func GetLatestFinalizedBlock(latestBlock, blockDistanceForFinalizedData int64) int64 { - finalization_criteria := blockDistanceForFinalizedData - return latestBlock - finalization_criteria -} - -// print the current status -func (fc *FinalizationConsensus) String() string { - fc.providerDataContainersMu.RLock() - defer fc.providerDataContainersMu.RUnlock() - mapExpectedBlockHeights := fc.GetExpectedBlockHeights(10 * time.Millisecond) // it's not super important so we hardcode this - return fmt.Sprintf("{FinalizationConsensus: {mapExpectedBlockHeights:%v} epoch: %d latestBlockByMedian %d}", mapExpectedBlockHeights, fc.currentEpoch, fc.latestBlockByMedian) -} - -func (fc *FinalizationConsensus) newProviderHashesConsensus(blockDistanceForFinalizedData int64, providerAcc string, latestBlock int64, finalizedBlocks map[int64]string, reply *pairingtypes.RelayReply, req *pairingtypes.RelaySession) ProviderHashesConsensus { - newProviderDataContainer := providerDataContainer{ - LatestFinalizedBlock: GetLatestFinalizedBlock(latestBlock, blockDistanceForFinalizedData), - LatestBlockTime: time.Now(), - FinalizedBlocksHashes: finalizedBlocks, - SigBlocks: reply.SigBlocks, - SessionId: req.SessionId, - RelayNum: req.RelayNum, - BlockHeight: req.Epoch, - LatestBlock: latestBlock, - } - providerDataContainers := map[string]providerDataContainer{} - providerDataContainers[providerAcc] = newProviderDataContainer - return ProviderHashesConsensus{ - FinalizedBlocksHashes: finalizedBlocks, - agreeingProviders: providerDataContainers, - } -} - -func (fc *FinalizationConsensus) insertProviderToConsensus(blockDistanceForFinalizedData int64, consensus *ProviderHashesConsensus, finalizedBlocks map[int64]string, latestBlock int64, reply *pairingtypes.RelayReply, req *pairingtypes.RelaySession, providerAcc string) { - newProviderDataContainer := providerDataContainer{ - LatestFinalizedBlock: GetLatestFinalizedBlock(latestBlock, blockDistanceForFinalizedData), - LatestBlockTime: time.Now(), - FinalizedBlocksHashes: finalizedBlocks, - SigBlocks: reply.SigBlocks, - SessionId: req.SessionId, - RelayNum: req.RelayNum, - BlockHeight: req.Epoch, - LatestBlock: latestBlock, - } - consensus.agreeingProviders[providerAcc] = newProviderDataContainer - - for blockNum, blockHash := range finalizedBlocks { - consensus.FinalizedBlocksHashes[blockNum] = blockHash - } -} - -// Compare finalized block hashes with previous providers -// Looks for discrepancy with current epoch providers -// if no conflicts, insert into consensus and break -// create new consensus group if no consensus matched -// check for discrepancy with old epoch -// checks if there is a consensus mismatch between hashes provided by different providers -func (fc *FinalizationConsensus) UpdateFinalizedHashes(blockDistanceForFinalizedData int64, providerAddress string, finalizedBlocks map[int64]string, req *pairingtypes.RelaySession, reply *pairingtypes.RelayReply) (finalizationConflict *conflicttypes.FinalizationConflict, err error) { - latestBlock := reply.LatestBlock - fc.providerDataContainersMu.Lock() - defer fc.providerDataContainersMu.Unlock() - - if len(fc.currentProviderHashesConsensus) == 0 && len(fc.prevEpochProviderHashesConsensus) == 0 { - newHashConsensus := fc.newProviderHashesConsensus(blockDistanceForFinalizedData, providerAddress, latestBlock, finalizedBlocks, reply, req) - fc.currentProviderHashesConsensus = append(make([]ProviderHashesConsensus, 0), newHashConsensus) - } else { - inserted := false - // Looks for discrepancy with current epoch providers - // go over all consensus groups, if there is a mismatch add it as a consensus group and send a conflict - for _, consensus := range fc.currentProviderHashesConsensus { - err := fc.discrepancyChecker(finalizedBlocks, consensus) - if err != nil { - // TODO: bring the other data as proof - finalizationConflict = &conflicttypes.FinalizationConflict{RelayReply0: reply} - // we need to insert into a new consensus group before returning - // or create new consensus group if no consensus matched - continue - } - - if !inserted { - // if no discrepency with this group and not inserted yet -> insert into consensus - fc.insertProviderToConsensus(blockDistanceForFinalizedData, &consensus, finalizedBlocks, latestBlock, reply, req, providerAddress) - inserted = true - } - // keep comparing with other groups, if there is a new message with a conflict we need to report it too - } - if !inserted { - // means there was a consensus mismatch with everything, so it wasn't inserted and we add it here - newHashConsensus := fc.newProviderHashesConsensus(blockDistanceForFinalizedData, providerAddress, latestBlock, finalizedBlocks, reply, req) - fc.currentProviderHashesConsensus = append(fc.currentProviderHashesConsensus, newHashConsensus) - } - if finalizationConflict != nil { - // means there was a conflict and we need to report - return finalizationConflict, utils.LavaFormatError("Simulation: Conflict found in discrepancyChecker", err) - } - - // check for discrepancy with old epoch - for idx, consensus := range fc.prevEpochProviderHashesConsensus { - err := fc.discrepancyChecker(finalizedBlocks, consensus) - if err != nil { - // TODO: bring the other data as proof - finalizationConflict = &conflicttypes.FinalizationConflict{RelayReply0: reply} - return finalizationConflict, utils.LavaFormatError("Simulation: prev epoch Conflict found in discrepancyChecker", err, utils.Attribute{Key: "Consensus idx", Value: strconv.Itoa(idx)}, utils.Attribute{Key: "provider", Value: providerAddress}) - } - } - } - if debug { - utils.LavaFormatDebug("finalization information update successfully", utils.Attribute{Key: "specId", Value: fc.SpecId}, utils.Attribute{Key: "finalization data", Value: finalizedBlocks}, utils.Attribute{Key: "currentProviderHashesConsensus", Value: fc.currentProviderHashesConsensus}, utils.Attribute{Key: "currentProviderHashesConsensus", Value: fc.currentProviderHashesConsensus}) - } - return finalizationConflict, nil -} - -func (fc *FinalizationConsensus) discrepancyChecker(finalizedBlocksA map[int64]string, consensus ProviderHashesConsensus) (errRet error) { - var toIterate map[int64]string // the smaller map between the two to compare - var otherBlocks map[int64]string // the other map - - if len(finalizedBlocksA) < len(consensus.FinalizedBlocksHashes) { - toIterate = finalizedBlocksA - otherBlocks = consensus.FinalizedBlocksHashes - } else { - toIterate = consensus.FinalizedBlocksHashes - otherBlocks = finalizedBlocksA - } - // Iterate over smaller array, looks for mismatching hashes between the inputs - for blockNum, blockHash := range toIterate { - if otherHash, ok := otherBlocks[blockNum]; ok { - if blockHash != otherHash { - // TODO: gather discrepancy data - return utils.LavaFormatError("Simulation: reliability discrepancy, different hashes detected for block", HashesConsunsusError, utils.Attribute{Key: "blockNum", Value: blockNum}, utils.Attribute{Key: "Hashes", Value: fmt.Sprintf("%s vs %s", blockHash, otherHash)}, utils.Attribute{Key: "toIterate", Value: toIterate}, utils.Attribute{Key: "otherBlocks", Value: otherBlocks}) - } - } - } - - return nil -} - -func (fc *FinalizationConsensus) NewEpoch(epoch uint64) { - fc.providerDataContainersMu.Lock() - defer fc.providerDataContainersMu.Unlock() - - if fc.currentEpoch < epoch { - if debug { - utils.LavaFormatDebug("finalization information epoch changed", utils.Attribute{Key: "specId", Value: fc.SpecId}, utils.Attribute{Key: "epoch", Value: epoch}) - } - // means it's time to refresh the epoch - fc.prevEpochProviderHashesConsensus = fc.currentProviderHashesConsensus - fc.currentProviderHashesConsensus = []ProviderHashesConsensus{} - fc.currentEpoch = epoch - } -} - -func (fc *FinalizationConsensus) LatestBlock() uint64 { - fc.providerDataContainersMu.RLock() - defer fc.providerDataContainersMu.RUnlock() - return fc.latestBlockByMedian -} - -func (fc *FinalizationConsensus) GetExpectedBlockHeights(averageBlockTime_ms time.Duration) map[string]int64 { - var highestBlockNumber int64 = 0 - FindAndUpdateHighestBlockNumber := func(listProviderHashesConsensus []ProviderHashesConsensus) { - for _, providerHashesConsensus := range listProviderHashesConsensus { - for _, providerDataContainer := range providerHashesConsensus.agreeingProviders { - if highestBlockNumber < providerDataContainer.LatestFinalizedBlock { - highestBlockNumber = providerDataContainer.LatestFinalizedBlock - } - } - } - } - - FindAndUpdateHighestBlockNumber(fc.prevEpochProviderHashesConsensus) // update the highest in place - FindAndUpdateHighestBlockNumber(fc.currentProviderHashesConsensus) - - now := time.Now() - calcExpectedBlocks := func(mapExpectedBlockHeights map[string]int64, listProviderHashesConsensus []ProviderHashesConsensus) map[string]int64 { - for _, providerHashesConsensus := range listProviderHashesConsensus { - for providerAddress, providerDataContainer := range providerHashesConsensus.agreeingProviders { - interpolation := InterpolateBlocks(now, providerDataContainer.LatestBlockTime, averageBlockTime_ms) - expected := providerDataContainer.LatestFinalizedBlock + interpolation - // limit the interpolation to the highest seen block height - if expected > highestBlockNumber { - expected = highestBlockNumber - } - mapExpectedBlockHeights[providerAddress] = expected - } - } - return mapExpectedBlockHeights - } - mapExpectedBlockHeights := map[string]int64{} - // prev must be before current because we overwrite - mapExpectedBlockHeights = calcExpectedBlocks(mapExpectedBlockHeights, fc.prevEpochProviderHashesConsensus) - mapExpectedBlockHeights = calcExpectedBlocks(mapExpectedBlockHeights, fc.currentProviderHashesConsensus) - return mapExpectedBlockHeights -} - -// returns the expected latest block to be at based on the current finalization data, and the number of providers we have information for -// does the calculation on finalized entries then extrapolates the ending based on blockDistance -func (fc *FinalizationConsensus) ExpectedBlockHeight(chainParser chainlib.ChainParser) (expectedBlockHeight int64, numOfProviders int) { - fc.providerDataContainersMu.RLock() - defer fc.providerDataContainersMu.RUnlock() - allowedBlockLagForQosSync, averageBlockTime_ms, blockDistanceForFinalizedData, _ := chainParser.ChainBlockStats() - mapExpectedBlockHeights := fc.GetExpectedBlockHeights(averageBlockTime_ms) - median := func(dataMap map[string]int64) int64 { - data := make([]int64, len(dataMap)) - i := 0 - for _, latestBlock := range dataMap { - data[i] = latestBlock - i++ - } - return lavaslices.Median(data) - } - medianOfExpectedBlocks := median(mapExpectedBlockHeights) - providersMedianOfLatestBlock := medianOfExpectedBlocks + int64(blockDistanceForFinalizedData) - if debug { - utils.LavaFormatDebug("finalization information", utils.Attribute{Key: "specId", Value: fc.SpecId}, utils.Attribute{Key: "mapExpectedBlockHeights", Value: mapExpectedBlockHeights}, utils.Attribute{Key: "medianOfExpectedBlocks", Value: medianOfExpectedBlocks}, utils.Attribute{Key: "latestBlock", Value: fc.latestBlockByMedian}, utils.Attribute{Key: "providersMedianOfLatestBlock", Value: providersMedianOfLatestBlock}) - } - if medianOfExpectedBlocks > 0 && uint64(providersMedianOfLatestBlock) > fc.latestBlockByMedian { - if uint64(providersMedianOfLatestBlock) > fc.latestBlockByMedian+1000 && fc.latestBlockByMedian > 0 { - utils.LavaFormatError("uncontinuous jump in finalization data", nil, utils.Attribute{Key: "specId", Value: fc.SpecId}, utils.Attribute{Key: "s.prevEpochProviderHashesConsensus", Value: fc.prevEpochProviderHashesConsensus}, utils.Attribute{Key: "s.currentProviderHashesConsensus", Value: fc.currentProviderHashesConsensus}, utils.Attribute{Key: "latestBlock", Value: fc.latestBlockByMedian}, utils.Attribute{Key: "providersMedianOfLatestBlock", Value: providersMedianOfLatestBlock}) - } - atomic.StoreUint64(&fc.latestBlockByMedian, uint64(providersMedianOfLatestBlock)) // we can only set conflict to "reported". - } - - // median of all latest blocks after interpolation minus allowedBlockLagForQosSync is the lowest block in the finalization proof - // then we move forward blockDistanceForFinalizedData to get the expected latest block - return providersMedianOfLatestBlock - allowedBlockLagForQosSync, len(mapExpectedBlockHeights) -} - -func InterpolateBlocks(timeNow, latestBlockTime time.Time, averageBlockTime time.Duration) int64 { - if timeNow.Before(latestBlockTime) { - return 0 - } - return int64(timeNow.Sub(latestBlockTime) / averageBlockTime) // interpolation -} diff --git a/protocol/lavaprotocol/finalization_consensus_test.go b/protocol/lavaprotocol/finalization_consensus_test.go deleted file mode 100644 index 2b93fdc86f..0000000000 --- a/protocol/lavaprotocol/finalization_consensus_test.go +++ /dev/null @@ -1,309 +0,0 @@ -package lavaprotocol - -import ( - "context" - "net/http" - "strconv" - "testing" - "time" - - "github.com/lavanet/lava/utils/rand" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/lavasession" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - "github.com/stretchr/testify/require" -) - -type testPlays struct { - name string - finalizationInsertions []finalizationTestInsertion - consensusHashesCount int -} -type finalizationTestInsertion struct { - providerAddr string - latestBlock uint64 - finalizedBlocks map[int64]string - success bool - relaySession *pairingtypes.RelaySession - relayReply *pairingtypes.RelayReply -} - -func createStubHashes(from, to uint64, identifier string) map[int64]string { - ret := map[int64]string{} - for i := from; i <= to; i++ { - ret[int64(i)] = strconv.Itoa(int(i)) + identifier - } - return ret -} - -func finalizationInsertionForProviders(chainID string, epoch, latestBlock uint64, startProvider, providersNum int, success bool, identifier string, blocksInFinalizationProof, blockDistanceForFinalizedData uint32) (rets []finalizationTestInsertion) { - fromBlock := latestBlock - uint64(blockDistanceForFinalizedData) - for i := startProvider; i < startProvider+providersNum; i++ { - rets = append(rets, finalizationTestInsertion{ - providerAddr: "lava@provider" + strconv.Itoa(i), - latestBlock: latestBlock, - finalizedBlocks: createStubHashes(fromBlock, fromBlock+uint64(blocksInFinalizationProof)-1, identifier), - success: success, - relaySession: &pairingtypes.RelaySession{ - SpecId: chainID, - ContentHash: []byte{}, - SessionId: uint64(i), - CuSum: 0, - Provider: "lava@provider" + strconv.Itoa(i), - RelayNum: 1, - QosReport: &pairingtypes.QualityOfServiceReport{}, - Epoch: int64(epoch), - UnresponsiveProviders: nil, - LavaChainId: "lava", - Sig: []byte{}, - }, - relayReply: &pairingtypes.RelayReply{ - LatestBlock: int64(latestBlock), - FinalizedBlocksHashes: []byte{}, - SigBlocks: []byte{}, - Metadata: []pairingtypes.Metadata{}, - }, - }) - } - return rets -} - -func TestConsensusHashesInsertion(t *testing.T) { - chainsToTest := []string{"APT1", "LAV1", "ETH1"} - for _, chainID := range chainsToTest { - ctx := context.Background() - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, chainID, "0", func(http.ResponseWriter, *http.Request) {}, "../../", nil) - if closeServer != nil { - defer closeServer() - } - require.NoError(t, err) - require.NotNil(t, chainParser) - epoch := uint64(200) - - _, _, blockDistanceForFinalizedData, blocksInFinalizationProof := chainParser.ChainBlockStats() - require.Greater(t, blocksInFinalizationProof, uint32(0)) - - shouldSucceedOnOneBeofreOrAfter := blocksInFinalizationProof <= 1 - - consensusHashesCountOnOneBeofreOrAfter := 2 - if shouldSucceedOnOneBeofreOrAfter { - consensusHashesCountOnOneBeofreOrAfter = 1 - } - playbook := []testPlays{ - { - name: "happy-flow", - consensusHashesCount: 1, - finalizationInsertions: append(append(finalizationInsertionForProviders(chainID, epoch, 100, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 101, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - finalizationInsertionForProviders(chainID, epoch, 102, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - }, - { - name: "happy-flow-with-gap", - consensusHashesCount: 1, - finalizationInsertions: append(finalizationInsertionForProviders(chainID, epoch, 100, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 100+uint64(blocksInFinalizationProof), 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - }, - { - name: "mismatch-with-self", - consensusHashesCount: 2, - finalizationInsertions: append(finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, false, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - }, - { - name: "mismatch-with-others", - consensusHashesCount: 2, - finalizationInsertions: append(finalizationInsertionForProviders(chainID, epoch, 100, 1, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, false, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - }, - { - name: "mismatch-with-others-one-after", - consensusHashesCount: consensusHashesCountOnOneBeofreOrAfter, - finalizationInsertions: append(finalizationInsertionForProviders(chainID, epoch, 100, 1, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 101, 0, 1, shouldSucceedOnOneBeofreOrAfter, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - }, - { - name: "mismatch-with-others-one-before", - consensusHashesCount: consensusHashesCountOnOneBeofreOrAfter, - finalizationInsertions: append(finalizationInsertionForProviders(chainID, epoch, 100, 1, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 99, 0, 1, shouldSucceedOnOneBeofreOrAfter, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - }, - { - name: "mismatch-three-groups", - consensusHashesCount: 3, - finalizationInsertions: append(append(finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 100, 1, 1, false, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), finalizationInsertionForProviders(chainID, epoch, 100, 2, 1, false, "B", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - }, - } - for _, play := range playbook { - t.Run(chainID+":"+play.name, func(t *testing.T) { - finalizationConsensus := &FinalizationConsensus{} - finalizationConsensus.NewEpoch(epoch) - // check updating hashes works - for _, insertion := range play.finalizationInsertions { - _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) - if insertion.success { - require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) - } else { - require.Error(t, err) - } - } - require.Len(t, finalizationConsensus.currentProviderHashesConsensus, play.consensusHashesCount) - }) - } - } -} - -func TestQoS(t *testing.T) { - decToSet, _ := sdk.NewDecFromStr("0.05") // test values fit 0.05 Availability requirements - lavasession.AvailabilityPercentage = decToSet - rand.InitRandomSeed() - chainsToTest := []string{"APT1", "LAV1", "ETH1"} - for _, chainID := range chainsToTest { - t.Run(chainID, func(t *testing.T) { - ctx := context.Background() - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, chainID, "0", func(http.ResponseWriter, *http.Request) {}, "../../", nil) - if closeServer != nil { - defer closeServer() - } - require.NoError(t, err) - require.NotNil(t, chainParser) - epoch := uint64(200) - - consumerSessionsWithProvider := lavasession.ConsumerSessionsWithProvider{ - PublicLavaAddress: "", - Endpoints: []*lavasession.Endpoint{}, - Sessions: map[int64]*lavasession.SingleConsumerSession{}, - MaxComputeUnits: 10000, - UsedComputeUnits: 0, - PairingEpoch: epoch, - } - singleConsumerSession, _, err := consumerSessionsWithProvider.GetConsumerSessionInstanceFromEndpoint(&lavasession.Endpoint{ - NetworkAddress: "", - Enabled: true, - Client: nil, - ConnectionRefusals: 0, - }, 1) - require.NoError(t, err) - require.NotNil(t, singleConsumerSession) - - allowedBlockLagForQosSync, _, blockDistanceForFinalizedData, blocksInFinalizationProof := chainParser.ChainBlockStats() - require.Greater(t, blocksInFinalizationProof, uint32(0)) - - finalizationInsertions := append(append(finalizationInsertionForProviders(chainID, epoch, 200, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 201, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - finalizationInsertionForProviders(chainID, epoch, 202, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...) - - newEpoch := epoch + 20 - finalizationInsertionsAfterEpoch := append(append(finalizationInsertionForProviders(chainID, newEpoch, 203, 2, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), - finalizationInsertionForProviders(chainID, epoch, 204, 2, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), - finalizationInsertionForProviders(chainID, epoch, 205, 2, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...) - - finalizationConsensus := &FinalizationConsensus{} - finalizationConsensus.NewEpoch(epoch) - for _, insertion := range finalizationInsertions { - _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) - require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) - } - plannedExpectedBH := int64(202) // this is the most advanced in all finalizations - require.Len(t, finalizationConsensus.currentProviderHashesConsensus, 1) - expectedBH, numOfProviders := finalizationConsensus.ExpectedBlockHeight(chainParser) - require.Equal(t, uint64(plannedExpectedBH), finalizationConsensus.LatestBlock()) - require.Equal(t, 3, numOfProviders) - require.Equal(t, plannedExpectedBH-allowedBlockLagForQosSync, expectedBH) - - // now advance an epoch to make it interesting - finalizationConsensus.NewEpoch(newEpoch) - for _, insertion := range finalizationInsertionsAfterEpoch { - _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) - require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) - } - plannedExpectedBH = 205 // this is the most advanced in all finalizations after epoch change - expectedBH, numOfProviders = finalizationConsensus.ExpectedBlockHeight(chainParser) - require.Equal(t, 5, numOfProviders) - require.Equal(t, plannedExpectedBH-allowedBlockLagForQosSync, expectedBH) - - currentLatency := time.Millisecond - expectedLatency := time.Millisecond - latestServicedBlock := expectedBH - singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) - require.Equal(t, uint64(1), singleConsumerSession.QoSInfo.AnsweredRelays) - require.Equal(t, uint64(1), singleConsumerSession.QoSInfo.TotalRelays) - require.Equal(t, int64(1), singleConsumerSession.QoSInfo.SyncScoreSum) - require.Equal(t, int64(1), singleConsumerSession.QoSInfo.TotalSyncScore) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) - - latestServicedBlock = expectedBH + 1 - singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) - require.Equal(t, uint64(2), singleConsumerSession.QoSInfo.AnsweredRelays) - require.Equal(t, uint64(2), singleConsumerSession.QoSInfo.TotalRelays) - require.Equal(t, int64(2), singleConsumerSession.QoSInfo.SyncScoreSum) - require.Equal(t, int64(2), singleConsumerSession.QoSInfo.TotalSyncScore) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) - - singleConsumerSession.QoSInfo.TotalRelays++ // this is how we add a failure - singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) - require.Equal(t, uint64(3), singleConsumerSession.QoSInfo.AnsweredRelays) - require.Equal(t, uint64(4), singleConsumerSession.QoSInfo.TotalRelays) - require.Equal(t, int64(3), singleConsumerSession.QoSInfo.SyncScoreSum) - require.Equal(t, int64(3), singleConsumerSession.QoSInfo.TotalSyncScore) - - require.Equal(t, sdk.ZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) - - latestServicedBlock = expectedBH - 1 // is one block below threshold - singleConsumerSession.CalculateQoS(currentLatency, expectedLatency*2, expectedBH-latestServicedBlock, numOfProviders, 1) - require.Equal(t, uint64(4), singleConsumerSession.QoSInfo.AnsweredRelays) - require.Equal(t, uint64(5), singleConsumerSession.QoSInfo.TotalRelays) - require.Equal(t, int64(3), singleConsumerSession.QoSInfo.SyncScoreSum) - require.Equal(t, int64(4), singleConsumerSession.QoSInfo.TotalSyncScore) - - require.Equal(t, sdk.ZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 - require.Equal(t, sdk.MustNewDecFromStr("0.75"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) - latestServicedBlock = expectedBH + 1 - // add in a loop so availability goes above 95% - for i := 5; i < 100; i++ { - singleConsumerSession.CalculateQoS(currentLatency, expectedLatency*2, expectedBH-latestServicedBlock, numOfProviders, 1) - } - require.Equal(t, sdk.MustNewDecFromStr("0.8"), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 - require.Equal(t, sdk.MustNewDecFromStr("0.989898989898989898"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) - require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) - - finalizationInsertionsSpreadBlocks := []finalizationTestInsertion{ - finalizationInsertionForProviders(chainID, epoch, 200, 0, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], - finalizationInsertionForProviders(chainID, epoch, 201, 1, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], - finalizationInsertionForProviders(chainID, epoch, 202, 2, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], - finalizationInsertionForProviders(chainID, epoch, 200, 3, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], - finalizationInsertionForProviders(chainID, epoch, 201, 4, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], - } - - finalizationConsensus = &FinalizationConsensus{} - finalizationConsensus.NewEpoch(epoch) - for _, insertion := range finalizationInsertionsSpreadBlocks { - _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) - require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) - } - - plannedExpectedBH = int64(201) // this is the most advanced in all finalizations - require.Len(t, finalizationConsensus.currentProviderHashesConsensus, 1) - expectedBH, numOfProviders = finalizationConsensus.ExpectedBlockHeight(chainParser) - require.Equal(t, 5, numOfProviders) - require.Equal(t, plannedExpectedBH-allowedBlockLagForQosSync, expectedBH) - - now := time.Now() - interpolation := InterpolateBlocks(now, now.Add(-2*time.Millisecond), time.Millisecond) - require.Equal(t, int64(2), interpolation) - interpolation = InterpolateBlocks(now, now.Add(-5*time.Millisecond), time.Millisecond) - require.Equal(t, int64(5), interpolation) - interpolation = InterpolateBlocks(now, now.Add(5*time.Millisecond), time.Millisecond) - require.Equal(t, int64(0), interpolation) - }) - } -} diff --git a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus.go b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus.go new file mode 100644 index 0000000000..bc7b51b361 --- /dev/null +++ b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus.go @@ -0,0 +1,368 @@ +package finalizationconsensus + +import ( + "encoding/json" + "errors" + "fmt" + "sync" + "sync/atomic" + "time" + + sdkerrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" +) + +type ChainBlockStatsGetter interface { + ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, blockDistanceForFinalizedData, blocksInFinalizationProof uint32) +} + +type ( + BlockToHashesToAgreeingProviders map[int64]map[string]map[string]providerDataContainer // first key is block num, second key is block hash, third key is provider address + FinalizationConsensusInf interface { + UpdateFinalizedHashes( + blockDistanceForFinalizedData int64, + consumerAddress sdk.AccAddress, + providerAddress string, + finalizedBlocks map[int64]string, + relaySession *pairingtypes.RelaySession, + reply *pairingtypes.RelayReply, + ) (finalizationConflict *conflicttypes.FinalizationConflict, err error) + GetExpectedBlockHeight(chainParser ChainBlockStatsGetter) (expectedBlockHeight int64, numOfProviders int) + NewEpoch(epoch uint64) + } +) + +type providerLatestBlockTimeAndFinalizedBlockContainer struct { + LatestBlockTime time.Time + LatestFinalizedBlock int64 +} + +type FinalizationConsensus struct { + currentEpochBlockToHashesToAgreeingProviders BlockToHashesToAgreeingProviders + prevEpochBlockToHashesToAgreeingProviders BlockToHashesToAgreeingProviders + lock sync.RWMutex + currentEpoch uint64 + prevLatestBlockByMedian uint64 // for caching + SpecId string + highestRecordedBlockHeight int64 + currentEpochLatestProviderBlockTimeAndFinalizedBlock map[string]providerLatestBlockTimeAndFinalizedBlockContainer + prevEpochLatestProviderBlockTimeAndFinalizedBlock map[string]providerLatestBlockTimeAndFinalizedBlockContainer +} + +type providerDataContainer struct { + LatestFinalizedBlock int64 + LatestBlockTime time.Time + FinalizedBlocksHashes map[int64]string + SigBlocks []byte + LatestBlock int64 + BlockDistanceFromFinalization int64 + RelaySession pairingtypes.RelaySession +} + +func NewFinalizationConsensus(specId string) *FinalizationConsensus { + return &FinalizationConsensus{ + SpecId: specId, + currentEpochBlockToHashesToAgreeingProviders: make(BlockToHashesToAgreeingProviders), + prevEpochBlockToHashesToAgreeingProviders: make(BlockToHashesToAgreeingProviders), + currentEpochLatestProviderBlockTimeAndFinalizedBlock: make(map[string]providerLatestBlockTimeAndFinalizedBlockContainer), + prevEpochLatestProviderBlockTimeAndFinalizedBlock: make(map[string]providerLatestBlockTimeAndFinalizedBlockContainer), + } +} + +func GetLatestFinalizedBlock(latestBlock, blockDistanceForFinalizedData int64) int64 { + finalization_criteria := blockDistanceForFinalizedData + return latestBlock - finalization_criteria +} + +func (fc *FinalizationConsensus) insertProviderToConsensus(latestBlock, blockDistanceForFinalizedData int64, finalizedBlocks map[int64]string, reply *pairingtypes.RelayReply, req *pairingtypes.RelaySession, providerAcc string) { + latestBlockTime := time.Now() + newProviderDataContainer := providerDataContainer{ + LatestFinalizedBlock: GetLatestFinalizedBlock(latestBlock, blockDistanceForFinalizedData), + LatestBlockTime: latestBlockTime, + FinalizedBlocksHashes: finalizedBlocks, + SigBlocks: reply.SigBlocks, + LatestBlock: latestBlock, + BlockDistanceFromFinalization: blockDistanceForFinalizedData, + RelaySession: *req, + } + + previousProviderContainer, foundPrevious := fc.currentEpochLatestProviderBlockTimeAndFinalizedBlock[providerAcc] + if !foundPrevious || newProviderDataContainer.LatestFinalizedBlock > previousProviderContainer.LatestFinalizedBlock { + fc.currentEpochLatestProviderBlockTimeAndFinalizedBlock[providerAcc] = providerLatestBlockTimeAndFinalizedBlockContainer{ + LatestFinalizedBlock: newProviderDataContainer.LatestFinalizedBlock, + LatestBlockTime: latestBlockTime, + } + } + + maxBlockNum := int64(0) + + for blockNum, blockHash := range finalizedBlocks { + if _, ok := fc.currentEpochBlockToHashesToAgreeingProviders[blockNum]; !ok { + fc.currentEpochBlockToHashesToAgreeingProviders[blockNum] = map[string]map[string]providerDataContainer{} + } + + if _, ok := fc.currentEpochBlockToHashesToAgreeingProviders[blockNum][blockHash]; !ok { + fc.currentEpochBlockToHashesToAgreeingProviders[blockNum][blockHash] = map[string]providerDataContainer{} + } + + fc.currentEpochBlockToHashesToAgreeingProviders[blockNum][blockHash][providerAcc] = newProviderDataContainer + + utils.LavaFormatTrace("Added provider to block hash consensus", + utils.LogAttr("blockNum", blockNum), + utils.LogAttr("blockHash", blockHash), + utils.LogAttr("provider", providerAcc), + ) + + if blockNum > maxBlockNum { + maxBlockNum = blockNum + } + } + + if maxBlockNum > fc.highestRecordedBlockHeight { + fc.highestRecordedBlockHeight = maxBlockNum + } +} + +// Compare finalized block hashes with previous providers +// Looks for discrepancy with current epoch providers +// if no conflicts, insert into consensus and break +// create new consensus group if no consensus matched +// check for discrepancy with old epoch +// checks if there is a consensus mismatch between hashes provided by different providers +func (fc *FinalizationConsensus) UpdateFinalizedHashes(blockDistanceForFinalizedData int64, consumerAddress sdk.AccAddress, providerAddress string, finalizedBlocks map[int64]string, relaySession *pairingtypes.RelaySession, reply *pairingtypes.RelayReply) (finalizationConflict *conflicttypes.FinalizationConflict, err error) { + fc.lock.Lock() + defer func() { + fc.insertProviderToConsensus(reply.LatestBlock, blockDistanceForFinalizedData, finalizedBlocks, reply, relaySession, providerAddress) + fc.lock.Unlock() + }() + + logSuccessUpdate := func() { + utils.LavaFormatTrace("finalization information update successfully", + utils.LogAttr("specId", fc.SpecId), + utils.LogAttr("finalizationData", finalizedBlocks), + ) + } + + var blockToHashesToAgreeingProviders BlockToHashesToAgreeingProviders + foundDiscrepancy, discrepancyBlock := fc.findDiscrepancy(finalizedBlocks, fc.currentEpochBlockToHashesToAgreeingProviders) + if foundDiscrepancy { + utils.LavaFormatTrace("found discrepancy for provider", + utils.LogAttr("specId", fc.SpecId), + utils.LogAttr("currentEpoch", fc.currentEpoch), + utils.LogAttr("provider", providerAddress), + utils.LogAttr("discrepancyBlock", discrepancyBlock), + utils.LogAttr("finalizedBlocks", finalizedBlocks), + ) + blockToHashesToAgreeingProviders = fc.currentEpochBlockToHashesToAgreeingProviders + } else { + // Could not find discrepancy, let's check with previous epoch + foundDiscrepancy, discrepancyBlock = fc.findDiscrepancy(finalizedBlocks, fc.prevEpochBlockToHashesToAgreeingProviders) + if foundDiscrepancy { + utils.LavaFormatTrace("found discrepancy for provider with previous epoch", + utils.LogAttr("specId", fc.SpecId), + utils.LogAttr("currentEpoch", fc.currentEpoch), + utils.LogAttr("provider", providerAddress), + utils.LogAttr("discrepancyBlock", discrepancyBlock), + utils.LogAttr("finalizedBlocks", finalizedBlocks), + ) + blockToHashesToAgreeingProviders = fc.prevEpochBlockToHashesToAgreeingProviders + } else { + // No discrepancy found, log and return nil + logSuccessUpdate() + return finalizationConflict, nil + } + } + + // Found discrepancy, create finalization conflict + replyFinalization := conflicttypes.NewRelayFinalizationFromRelaySessionAndRelayReply(relaySession, reply, consumerAddress) + finalizationConflict = &conflicttypes.FinalizationConflict{RelayFinalization_0: &replyFinalization} + + var otherBlockHash string + for blockHash, agreeingProviders := range blockToHashesToAgreeingProviders[discrepancyBlock] { + if providerPrevReply, ok := agreeingProviders[providerAddress]; ok { + // Same provider conflict found - Report and block provider + utils.LavaFormatTrace("found same provider conflict, creating relay finalization from provider data container", + utils.LogAttr("provider", providerAddress), + utils.LogAttr("discrepancyBlock", discrepancyBlock), + utils.LogAttr("blockHash", blockHash), + ) + relayFinalization, err := fc.createRelayFinalizationFromProviderDataContainer(providerPrevReply, consumerAddress) + if err != nil { + return nil, err + } + + logSuccessUpdate() + finalizationConflict.RelayFinalization_1 = relayFinalization + + // We now want to block this provider, so we wrap the error with lavasession.BlockProviderError which will be caught later + err = sdkerrors.Wrap(errors.Join(lavasession.BlockProviderError, lavasession.SessionOutOfSyncError), + fmt.Sprintf("found same provider conflict on block [%d], provider address [%s]", discrepancyBlock, providerAddress)) + return finalizationConflict, err + } else if otherBlockHash == "" { + // Use some other hash to create proof, in case of no same provider conflict + otherBlockHash = blockHash + } + } + + var otherProviderAddress string + // Same provider conflict not found, create proof with other provider + utils.LavaFormatTrace("did not find any same provider conflict, looking for other providers to create conflict proof", utils.LogAttr("provider", providerAddress)) + for currentOtherProviderAddress, providerDataContainer := range blockToHashesToAgreeingProviders[discrepancyBlock][otherBlockHash] { + // Finalization conflict + utils.LavaFormatTrace("creating finalization conflict with another provider", + utils.LogAttr("provider", providerAddress), + utils.LogAttr("otherProvider", currentOtherProviderAddress), + utils.LogAttr("discrepancyBlock", discrepancyBlock), + utils.LogAttr("blockHash", otherBlockHash), + ) + relayFinalization, err := fc.createRelayFinalizationFromProviderDataContainer(providerDataContainer, consumerAddress) + if err != nil { + return nil, err + } + + finalizationConflict.RelayFinalization_1 = relayFinalization + otherProviderAddress = currentOtherProviderAddress + break + } + + logSuccessUpdate() + // We don't block the provider here, as we found a conflict with another provider, and we don't know which one is correct + return finalizationConflict, fmt.Errorf("found finalization conflict on block %d between provider [%s] and provider [%s] ", discrepancyBlock, providerAddress, otherProviderAddress) +} + +func (fc *FinalizationConsensus) findDiscrepancy(finalizedBlocks map[int64]string, consensus BlockToHashesToAgreeingProviders) (foundDiscrepancy bool, discrepancyBlock int64) { + for blockNum, blockHash := range finalizedBlocks { + blockHashes, ok := consensus[blockNum] + if !ok { + continue + } + + // We found the matching block, now we need to check if the hash exists + if _, ok := blockHashes[blockHash]; !ok { + utils.LavaFormatTrace("found discrepancy in finalized blocks", + utils.LogAttr("blockNumber", blockNum), + utils.LogAttr("blockHash", blockHash), + utils.LogAttr("consensusBlockHashes", blockHashes), + ) + return true, blockNum + } + } + + return false, 0 +} + +func (fc *FinalizationConsensus) createRelayFinalizationFromProviderDataContainer(dataContainer providerDataContainer, consumerAddr sdk.AccAddress) (*conflicttypes.RelayFinalization, error) { + finalizedBlocksHashesBytes, err := json.Marshal(dataContainer.FinalizedBlocksHashes) + if err != nil { + utils.LavaFormatError("error in marshaling finalized blocks hashes", err) + return nil, err + } + + return &conflicttypes.RelayFinalization{ + FinalizedBlocksHashes: finalizedBlocksHashesBytes, + LatestBlock: dataContainer.LatestBlock, + ConsumerAddress: consumerAddr.String(), + RelaySession: &dataContainer.RelaySession, + SigBlocks: dataContainer.SigBlocks, + }, nil +} + +func (fc *FinalizationConsensus) NewEpoch(epoch uint64) { + fc.lock.Lock() + defer fc.lock.Unlock() + + if fc.currentEpoch < epoch { + utils.LavaFormatTrace("finalization information epoch changed", + utils.LogAttr("specId", fc.SpecId), + utils.LogAttr("epoch", epoch), + ) + + // means it's time to refresh the epoch + fc.prevEpochBlockToHashesToAgreeingProviders = fc.currentEpochBlockToHashesToAgreeingProviders + fc.currentEpochBlockToHashesToAgreeingProviders = BlockToHashesToAgreeingProviders{} + + fc.prevEpochLatestProviderBlockTimeAndFinalizedBlock = fc.currentEpochLatestProviderBlockTimeAndFinalizedBlock + fc.currentEpochLatestProviderBlockTimeAndFinalizedBlock = make(map[string]providerLatestBlockTimeAndFinalizedBlockContainer) + + fc.currentEpoch = epoch + } +} + +func (fc *FinalizationConsensus) getExpectedBlockHeightsOfProviders(averageBlockTime_ms time.Duration) map[string]int64 { + // This function calculates the expected block heights for providers based on their last known activity and the average block time. + // It accounts for both the current and previous epochs, determining the maximum block height from both and adjusting the expected heights accordingly to not exceed this maximum. + // The method merges results from both epochs, with the previous epoch's data processed first. + + now := time.Now() + mapExpectedBlockHeights := map[string]int64{} + for providerAddress, latestProviderContainer := range fc.prevEpochLatestProviderBlockTimeAndFinalizedBlock { + interpolation := InterpolateBlocks(now, latestProviderContainer.LatestBlockTime, averageBlockTime_ms) + expected := latestProviderContainer.LatestFinalizedBlock + interpolation + mapExpectedBlockHeights[providerAddress] = expected + } + + for providerAddress, latestProviderContainer := range fc.currentEpochLatestProviderBlockTimeAndFinalizedBlock { + interpolation := InterpolateBlocks(now, latestProviderContainer.LatestBlockTime, averageBlockTime_ms) + expected := latestProviderContainer.LatestFinalizedBlock + interpolation + mapExpectedBlockHeights[providerAddress] = expected + } + + return mapExpectedBlockHeights +} + +// Returns the expected latest block to be at based on the current finalization data, and the number of providers we have information for. +// It does the calculation on finalized entries then extrapolates the ending based on blockDistance +func (fc *FinalizationConsensus) GetExpectedBlockHeight(chainParser ChainBlockStatsGetter) (expectedBlockHeight int64, numOfProviders int) { + fc.lock.RLock() + defer fc.lock.RUnlock() + + allowedBlockLagForQosSync, averageBlockTime_ms, blockDistanceForFinalizedData, _ := chainParser.ChainBlockStats() + mapExpectedBlockHeights := fc.getExpectedBlockHeightsOfProviders(averageBlockTime_ms) + median := func(dataMap map[string]int64) int64 { + data := make([]int64, len(dataMap)) + i := 0 + for _, latestBlock := range dataMap { + data[i] = latestBlock + i++ + } + return lavaslices.Median(data) + } + + medianOfExpectedBlocks := median(mapExpectedBlockHeights) + providersMedianOfLatestBlock := medianOfExpectedBlocks + int64(blockDistanceForFinalizedData) + + utils.LavaFormatTrace("finalization information", + utils.LogAttr("specId", fc.SpecId), + utils.LogAttr("mapExpectedBlockHeights", mapExpectedBlockHeights), + utils.LogAttr("medianOfExpectedBlocks", medianOfExpectedBlocks), + utils.LogAttr("latestBlock", fc.prevLatestBlockByMedian), + utils.LogAttr("providersMedianOfLatestBlock", providersMedianOfLatestBlock), + ) + + if medianOfExpectedBlocks > 0 && uint64(providersMedianOfLatestBlock) > fc.prevLatestBlockByMedian { + if uint64(providersMedianOfLatestBlock) > fc.prevLatestBlockByMedian+1000 && fc.prevLatestBlockByMedian > 0 { + utils.LavaFormatError("uncontinuous jump in finalization data", nil, + utils.LogAttr("specId", fc.SpecId), + utils.LogAttr("latestBlock", fc.prevLatestBlockByMedian), + utils.LogAttr("providersMedianOfLatestBlock", providersMedianOfLatestBlock), + ) + } + atomic.StoreUint64(&fc.prevLatestBlockByMedian, uint64(providersMedianOfLatestBlock)) // we can only set conflict to "reported". + } + + // median of all latest blocks after interpolation minus allowedBlockLagForQosSync is the lowest block in the finalization proof + // then we move forward blockDistanceForFinalizedData to get the expected latest block + return providersMedianOfLatestBlock - allowedBlockLagForQosSync, len(mapExpectedBlockHeights) +} + +func InterpolateBlocks(timeNow, latestBlockTime time.Time, averageBlockTime time.Duration) int64 { + if timeNow.Before(latestBlockTime) { + return 0 + } + return int64(timeNow.Sub(latestBlockTime) / averageBlockTime) // interpolation +} diff --git a/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go new file mode 100644 index 0000000000..2e70775818 --- /dev/null +++ b/protocol/lavaprotocol/finalizationconsensus/finalization_consensus_test.go @@ -0,0 +1,540 @@ +package finalizationconsensus + +import ( + "context" + "fmt" + "net/http" + "os" + "strconv" + "testing" + "time" + + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/lavasession" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + "github.com/stretchr/testify/require" +) + +type testPlays struct { + name string + finalizationInsertions []finalizationTestInsertion + consensusHashesCount int + consensusBlocksCount int +} +type finalizationTestInsertion struct { + providerAddr string + latestBlock uint64 + finalizedBlocks map[int64]string + success bool + relaySession *pairingtypes.RelaySession + relayReply *pairingtypes.RelayReply +} + +var ( + seed int64 + randomizer *sigs.ZeroReader +) + +func TestMain(m *testing.M) { + seed = time.Now().Unix() + randomizer = sigs.NewZeroReader(seed) + // Run the actual tests + exitCode := m.Run() + if exitCode != 0 { + utils.LavaFormatDebug("failed tests seed", utils.Attribute{Key: "seed", Value: seed}) + } + os.Exit(exitCode) +} + +func createStubHashes(from, to uint64, identifier string) map[int64]string { + ret := map[int64]string{} + for i := from; i <= to; i++ { + ret[int64(i)] = strconv.Itoa(int(i)) + identifier + } + return ret +} + +func finalizationInsertionForProviders(chainID string, epoch, latestBlock uint64, startProvider, providersNum int, success bool, identifier string, blocksInFinalizationProof, blockDistanceForFinalizedData uint32) (rets []finalizationTestInsertion) { + latestFinalizedBlock := latestBlock - uint64(blockDistanceForFinalizedData) + earliestFinalizedBlock := latestFinalizedBlock - uint64(blocksInFinalizationProof) + 1 + for i := startProvider; i < startProvider+providersNum; i++ { + rets = append(rets, finalizationTestInsertion{ + providerAddr: "lava@provider" + strconv.Itoa(i), + latestBlock: latestBlock, + finalizedBlocks: createStubHashes(earliestFinalizedBlock, latestFinalizedBlock, identifier), + success: success, + relaySession: &pairingtypes.RelaySession{ + SpecId: chainID, + ContentHash: []byte{}, + SessionId: uint64(i), + CuSum: 0, + Provider: "lava@provider" + strconv.Itoa(i), + RelayNum: 1, + QosReport: &pairingtypes.QualityOfServiceReport{}, + Epoch: int64(epoch), + UnresponsiveProviders: nil, + LavaChainId: "lava", + Sig: []byte{}, + }, + relayReply: &pairingtypes.RelayReply{ + LatestBlock: int64(latestBlock), + FinalizedBlocksHashes: []byte{}, + SigBlocks: []byte{}, + Metadata: []pairingtypes.Metadata{}, + }, + }) + } + return rets +} + +func TestConsensusHashesInsertion(t *testing.T) { + chainsToTest := []string{"APT1", "LAV1", "ETH1"} + for _, chainID := range chainsToTest { + ctx := context.Background() + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, chainID, "0", func(http.ResponseWriter, *http.Request) {}, nil, "../../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) + require.NotNil(t, chainParser) + epoch := uint64(200) + + _, _, blockDistanceForFinalizedData, blocksInFinalizationProof := chainParser.ChainBlockStats() + require.Greater(t, blocksInFinalizationProof, uint32(0)) + + shouldSucceedOnOneBeforeOrAfter := blocksInFinalizationProof <= 1 + + playbook := []testPlays{ + { + name: "happy-flow", + consensusHashesCount: int(blocksInFinalizationProof + 2), + consensusBlocksCount: int(blocksInFinalizationProof + 2), + finalizationInsertions: append(append( + finalizationInsertionForProviders(chainID, epoch, 100, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 101, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + finalizationInsertionForProviders(chainID, epoch, 102, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + }, + { + name: "happy-flow-with-gap", + consensusHashesCount: int(blocksInFinalizationProof * 2), + consensusBlocksCount: int(blocksInFinalizationProof * 2), + finalizationInsertions: append( + finalizationInsertionForProviders(chainID, epoch, 100, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 100+uint64(blocksInFinalizationProof), 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + }, + { + name: "mismatch-with-self", + consensusHashesCount: int(blocksInFinalizationProof * 2), + consensusBlocksCount: int(blocksInFinalizationProof), + finalizationInsertions: append( + finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, false, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + }, + { + name: "mismatch-with-others", + consensusHashesCount: int(blocksInFinalizationProof * 2), + consensusBlocksCount: int(blocksInFinalizationProof), + finalizationInsertions: append( + finalizationInsertionForProviders(chainID, epoch, 100, 1, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, false, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + }, + { + name: "mismatch-with-others-one-after", + consensusHashesCount: int(blocksInFinalizationProof * 2), + consensusBlocksCount: int(blocksInFinalizationProof + 1), + finalizationInsertions: append( + finalizationInsertionForProviders(chainID, epoch, 100, 1, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 101, 0, 1, shouldSucceedOnOneBeforeOrAfter, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + }, + { + name: "mismatch-with-others-one-before", + consensusHashesCount: int(blocksInFinalizationProof * 2), + consensusBlocksCount: int(blocksInFinalizationProof + 1), + finalizationInsertions: append( + finalizationInsertionForProviders(chainID, epoch, 100, 1, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 99, 0, 1, shouldSucceedOnOneBeforeOrAfter, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + }, + { + name: "mismatch-three-groups", + consensusHashesCount: int(blocksInFinalizationProof * 3), + consensusBlocksCount: int(blocksInFinalizationProof), + finalizationInsertions: append(append( + finalizationInsertionForProviders(chainID, epoch, 100, 0, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 100, 1, 1, false, "A", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + finalizationInsertionForProviders(chainID, epoch, 100, 2, 1, false, "B", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + }, + } + for _, play := range playbook { + t.Run(chainID+":"+play.name, func(t *testing.T) { + finalizationConsensus := NewFinalizationConsensus(chainID) + finalizationConsensus.NewEpoch(epoch) + // check updating hashes works + for _, insertion := range play.finalizationInsertions { + _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), sdk.AccAddress{}, insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) + if insertion.success { + require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) + } else { + require.Error(t, err, "succeeded insertion when was supposed to fail, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) + } + } + + require.Len(t, finalizationConsensus.currentEpochBlockToHashesToAgreeingProviders, play.consensusBlocksCount, + fmt.Sprintf("wrong number of consensus blocks. expected %d, got %d", play.consensusBlocksCount, len(finalizationConsensus.currentEpochBlockToHashesToAgreeingProviders))) + + // count all block hashes + blockHashes := 0 + for _, hashes := range finalizationConsensus.currentEpochBlockToHashesToAgreeingProviders { + blockHashes += len(hashes) + } + + require.Equal(t, play.consensusHashesCount, blockHashes, + fmt.Sprintf("wrong number of consensus hashes. expected %d, got %d", play.consensusHashesCount, blockHashes)) + }) + } + } +} + +func TestQoS(t *testing.T) { + decToSet, _ := sdk.NewDecFromStr("0.05") // test values fit 0.05 Availability requirements + lavasession.AvailabilityPercentage = decToSet + rand.InitRandomSeed() + chainsToTest := []string{"APT1", "LAV1", "ETH1"} + for i := 0; i < 10; i++ { + for _, chainID := range chainsToTest { + t.Run(chainID, func(t *testing.T) { + ctx := context.Background() + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, chainID, "0", func(http.ResponseWriter, *http.Request) {}, nil, "../../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) + require.NotNil(t, chainParser) + epoch := uint64(200) + + consumerSessionsWithProvider := lavasession.ConsumerSessionsWithProvider{ + PublicLavaAddress: "", + Endpoints: []*lavasession.Endpoint{}, + Sessions: map[int64]*lavasession.SingleConsumerSession{}, + MaxComputeUnits: 10000, + UsedComputeUnits: 0, + PairingEpoch: epoch, + } + + singleConsumerSession, _, err := consumerSessionsWithProvider.GetConsumerSessionInstanceFromEndpoint(&lavasession.EndpointConnection{}, 1) + + require.NoError(t, err) + require.NotNil(t, singleConsumerSession) + + allowedBlockLagForQosSync, _, blockDistanceForFinalizedData, blocksInFinalizationProof := chainParser.ChainBlockStats() + require.Greater(t, blocksInFinalizationProof, uint32(0)) + + finalizationInsertions := append(append( + finalizationInsertionForProviders(chainID, epoch, 200, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 201, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + finalizationInsertionForProviders(chainID, epoch, 202, 0, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...) + + newEpoch := epoch + 20 + finalizationInsertionsAfterEpoch := append(append( + finalizationInsertionForProviders(chainID, newEpoch, 203, 2, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData), + finalizationInsertionForProviders(chainID, epoch, 204, 2, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...), + finalizationInsertionForProviders(chainID, epoch, 205, 2, 3, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)...) + + finalizationConsensus := NewFinalizationConsensus(chainID) + finalizationConsensus.NewEpoch(epoch) + for _, insertion := range finalizationInsertions { + _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), sdk.AccAddress{}, insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) + require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) + } + + require.Len(t, finalizationConsensus.currentEpochBlockToHashesToAgreeingProviders, int(blocksInFinalizationProof+2)) + blockHashes := 0 + for _, hashes := range finalizationConsensus.currentEpochBlockToHashesToAgreeingProviders { + blockHashes += len(hashes) + } + require.Equal(t, int(blocksInFinalizationProof+2), blockHashes) + + plannedExpectedBH := int64(202) // this is the most advanced in all finalizations + expectedBH, numOfProviders := finalizationConsensus.GetExpectedBlockHeight(chainParser) + latestBH := uint64(expectedBH + allowedBlockLagForQosSync) + require.Equal(t, uint64(plannedExpectedBH), latestBH) + require.Equal(t, 3, numOfProviders) + require.Equal(t, plannedExpectedBH-allowedBlockLagForQosSync, expectedBH) + + // now advance an epoch to make it interesting + finalizationConsensus.NewEpoch(newEpoch) + for _, insertion := range finalizationInsertionsAfterEpoch { + _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), sdk.AccAddress{}, insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) + require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) + } + plannedExpectedBH = 205 // this is the most advanced in all finalizations after epoch change + expectedBH, numOfProviders = finalizationConsensus.GetExpectedBlockHeight(chainParser) + latestBH = uint64(expectedBH + allowedBlockLagForQosSync) + require.Equal(t, uint64(plannedExpectedBH), latestBH) + require.Equal(t, 5, numOfProviders) + require.Equal(t, plannedExpectedBH-allowedBlockLagForQosSync, expectedBH, chainID) + + currentLatency := time.Millisecond + expectedLatency := time.Millisecond + latestServicedBlock := expectedBH + singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) + require.Equal(t, uint64(1), singleConsumerSession.QoSInfo.AnsweredRelays) + require.Equal(t, uint64(1), singleConsumerSession.QoSInfo.TotalRelays) + require.Equal(t, int64(1), singleConsumerSession.QoSInfo.SyncScoreSum) + require.Equal(t, int64(1), singleConsumerSession.QoSInfo.TotalSyncScore) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + + latestServicedBlock = expectedBH + 1 + singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) + require.Equal(t, uint64(2), singleConsumerSession.QoSInfo.AnsweredRelays) + require.Equal(t, uint64(2), singleConsumerSession.QoSInfo.TotalRelays) + require.Equal(t, int64(2), singleConsumerSession.QoSInfo.SyncScoreSum) + require.Equal(t, int64(2), singleConsumerSession.QoSInfo.TotalSyncScore) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + + singleConsumerSession.QoSInfo.TotalRelays++ // this is how we add a failure + singleConsumerSession.CalculateQoS(currentLatency, expectedLatency, expectedBH-latestServicedBlock, numOfProviders, 1) + require.Equal(t, uint64(3), singleConsumerSession.QoSInfo.AnsweredRelays) + require.Equal(t, uint64(4), singleConsumerSession.QoSInfo.TotalRelays) + require.Equal(t, int64(3), singleConsumerSession.QoSInfo.SyncScoreSum) + require.Equal(t, int64(3), singleConsumerSession.QoSInfo.TotalSyncScore) + + require.Equal(t, sdk.ZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + + latestServicedBlock = expectedBH - 1 // is one block below threshold + singleConsumerSession.CalculateQoS(currentLatency, expectedLatency*2, expectedBH-latestServicedBlock, numOfProviders, 1) + require.Equal(t, uint64(4), singleConsumerSession.QoSInfo.AnsweredRelays) + require.Equal(t, uint64(5), singleConsumerSession.QoSInfo.TotalRelays) + require.Equal(t, int64(3), singleConsumerSession.QoSInfo.SyncScoreSum) + require.Equal(t, int64(4), singleConsumerSession.QoSInfo.TotalSyncScore) + + require.Equal(t, sdk.ZeroDec(), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 + require.Equal(t, sdk.MustNewDecFromStr("0.75"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + latestServicedBlock = expectedBH + 1 + // add in a loop so availability goes above 95% + for i := 5; i < 100; i++ { + singleConsumerSession.CalculateQoS(currentLatency, expectedLatency*2, expectedBH-latestServicedBlock, numOfProviders, 1) + } + require.Equal(t, sdk.MustNewDecFromStr("0.8"), singleConsumerSession.QoSInfo.LastQoSReport.Availability) // because availability below 95% is 0 + require.Equal(t, sdk.MustNewDecFromStr("0.989898989898989898"), singleConsumerSession.QoSInfo.LastQoSReport.Sync) + require.Equal(t, sdk.OneDec(), singleConsumerSession.QoSInfo.LastQoSReport.Latency) + + finalizationInsertionsSpreadBlocks := []finalizationTestInsertion{ + finalizationInsertionForProviders(chainID, epoch, 200, 0, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], + finalizationInsertionForProviders(chainID, epoch, 200, 3, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], + finalizationInsertionForProviders(chainID, epoch, 201, 1, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], + finalizationInsertionForProviders(chainID, epoch, 201, 4, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], + finalizationInsertionForProviders(chainID, epoch, 202, 2, 1, true, "", blocksInFinalizationProof, blockDistanceForFinalizedData)[0], + } + + finalizationConsensus = NewFinalizationConsensus(chainID) + finalizationConsensus.NewEpoch(epoch) + for _, insertion := range finalizationInsertionsSpreadBlocks { + _, err := finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), sdk.AccAddress{}, insertion.providerAddr, insertion.finalizedBlocks, insertion.relaySession, insertion.relayReply) + require.NoError(t, err, "failed insertion when was supposed to succeed, provider %s, latest block %d", insertion.providerAddr, insertion.latestBlock) + } + + plannedExpectedBH = int64(201) // this is the most advanced in all finalizations + require.Len(t, finalizationConsensus.currentEpochBlockToHashesToAgreeingProviders, int(blocksInFinalizationProof+2)) + expectedBH, numOfProviders = finalizationConsensus.GetExpectedBlockHeight(chainParser) + require.Equal(t, 5, numOfProviders) + require.Equal(t, plannedExpectedBH-allowedBlockLagForQosSync, expectedBH) + + now := time.Now() + interpolation := InterpolateBlocks(now, now.Add(-2*time.Millisecond), time.Millisecond) + require.Equal(t, int64(2), interpolation) + interpolation = InterpolateBlocks(now, now.Add(-5*time.Millisecond), time.Millisecond) + require.Equal(t, int64(5), interpolation) + interpolation = InterpolateBlocks(now, now.Add(5*time.Millisecond), time.Millisecond) + require.Equal(t, int64(0), interpolation) + }) + } + } +} + +func BenchmarkFinalizationConsensusGetExpectedBlockHeight(b *testing.B) { + ctx := context.Background() + specId := "LAV1" + apiInterface := spectypes.APIInterfaceJsonRPC + serverHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Handle the incoming request and provide the desired response + w.WriteHeader(http.StatusOK) + }) + chainParser, _, chainFetcher, _, _, err := chainlib.CreateChainLibMocks(ctx, specId, apiInterface, serverHandler, nil, "../../../", nil) + require.NoError(b, err) + require.NotNil(b, chainParser) + require.NotNil(b, chainFetcher) + + finalizationConsensus := NewFinalizationConsensus("LAV1") + _, _, blockDistanceForFinalizedData, _ := chainParser.ChainBlockStats() + relaySession := &pairingtypes.RelaySession{ + SpecId: specId, + ContentHash: []byte{}, + SessionId: uint64(1), + CuSum: 0, + Provider: "provider1", + RelayNum: 1, + QosReport: &pairingtypes.QualityOfServiceReport{}, + Epoch: int64(1), + UnresponsiveProviders: nil, + LavaChainId: "lava", + Sig: []byte{}, + } + + relayReply := &pairingtypes.RelayReply{ + LatestBlock: int64(100), + FinalizedBlocksHashes: []byte{}, + SigBlocks: []byte{}, + Metadata: []pairingtypes.Metadata{}, + } + + account := sigs.GenerateDeterministicFloatingKey(randomizer) + + finalizationConsensus.NewEpoch(1) + + numberOfBlocks := 4500 + numberOfProviders := 24 + + fmt.Println("Starting to propagate finalized hashes") + + for i := 0; i < numberOfProviders; i++ { + for j := 0; j < numberOfBlocks; j += 6 { + hashes := make(map[int64]string) + for k := j; k < j+6; k++ { + hashes[int64(k)] = fmt.Sprintf("hash%d", k) + } + + finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), account.Addr, fmt.Sprintf("provider%d", i), hashes, relaySession, relayReply) + } + } + fmt.Println("Epoch 1 done") + finalizationConsensus.NewEpoch(2) + for i := 0; i < numberOfProviders; i++ { + for j := numberOfBlocks; j < numberOfBlocks*2; j += 6 { + hashes := make(map[int64]string) + for k := j; k < j+6; k++ { + hashes[int64(k)] = fmt.Sprintf("hash%d", k) + } + + finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), account.Addr, fmt.Sprintf("provider%d", i), hashes, relaySession, relayReply) + } + } + + fmt.Println("Done propagating finalized hashes") + + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + finalizationConsensus.GetExpectedBlockHeight(chainParser) + } +} + +func BenchmarkFinalizationConsensusUpdateFinalizedHashes(b *testing.B) { + ctx := context.Background() + specId := "LAV1" + apiInterface := spectypes.APIInterfaceJsonRPC + + chainParser, _, chainFetcher, _, _, err := chainlib.CreateChainLibMocks(ctx, specId, apiInterface, nil, nil, "../../../", nil) + require.NoError(b, err) + require.NotNil(b, chainParser) + require.NotNil(b, chainFetcher) + + providerAddr := "provider1" + + _, _, blockDistanceForFinalizedData, _ := chainParser.ChainBlockStats() + relaySession := &pairingtypes.RelaySession{ + SpecId: specId, + ContentHash: []byte{}, + SessionId: uint64(1), + CuSum: 0, + Provider: providerAddr, + RelayNum: 1, + QosReport: &pairingtypes.QualityOfServiceReport{}, + Epoch: int64(1), + UnresponsiveProviders: nil, + LavaChainId: "lava", + Sig: []byte{}, + } + + relayReply := &pairingtypes.RelayReply{ + LatestBlock: int64(100), + FinalizedBlocksHashes: []byte{}, + SigBlocks: []byte{}, + Metadata: []pairingtypes.Metadata{}, + } + + account := sigs.GenerateDeterministicFloatingKey(randomizer) + blockDistanceForFinalizedDataInt := int64(blockDistanceForFinalizedData) + + blocksCountInFinalization := 6 + newEpochInterval := 10 + + b.Run("without proof data", func(b *testing.B) { + finalizationConsensus := NewFinalizationConsensus(specId) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + b.StopTimer() + hashes := make(map[int64]string) + + b.StartTimer() + finalizationConsensus.UpdateFinalizedHashes(blockDistanceForFinalizedDataInt, account.Addr, providerAddr, hashes, relaySession, relayReply) + } + }) + + b.Run("without conflict", func(b *testing.B) { + finalizationConsensus := NewFinalizationConsensus(specId) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + b.StopTimer() + hashes := make(map[int64]string) + for k := 0; k < blocksCountInFinalization; k++ { + hashes[int64(i*blocksCountInFinalization+k)] = fmt.Sprintf("hash%d", i*blocksCountInFinalization+k) + } + + if i%newEpochInterval == 0 { + finalizationConsensus.NewEpoch(uint64(i)) + } + + b.StartTimer() + finalizationConsensus.UpdateFinalizedHashes(blockDistanceForFinalizedDataInt, account.Addr, providerAddr, hashes, relaySession, relayReply) + } + }) + + b.Run("with conflict", func(b *testing.B) { + finalizationConsensus := NewFinalizationConsensus(specId) + b.ReportAllocs() + b.ResetTimer() + + for i := 0; i < b.N; i++ { + b.StopTimer() + hashes := make(map[int64]string) + for k := 0; k < blocksCountInFinalization; k++ { + hashes[int64(i*blocksCountInFinalization+k)] = fmt.Sprintf("hash%d", i*blocksCountInFinalization+k) + } + + finalizationConsensus.UpdateFinalizedHashes(blockDistanceForFinalizedDataInt, account.Addr, providerAddr, hashes, relaySession, relayReply) + + hashes = make(map[int64]string) + for k := 0; k < blocksCountInFinalization; k++ { + hashes[int64(i*blocksCountInFinalization+k)] = fmt.Sprintf("dhash%d", i*blocksCountInFinalization+k) + } + + b.StartTimer() + finalizationConsensus.UpdateFinalizedHashes(blockDistanceForFinalizedDataInt, account.Addr, providerAddr, hashes, relaySession, relayReply) + } + }) +} diff --git a/protocol/lavaprotocol/finalizationverification/finalization_verification.go b/protocol/lavaprotocol/finalizationverification/finalization_verification.go new file mode 100644 index 0000000000..fad9c601b4 --- /dev/null +++ b/protocol/lavaprotocol/finalizationverification/finalization_verification.go @@ -0,0 +1,142 @@ +package finalizationverification + +import ( + "encoding/json" + "errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" +) + +func VerifyFinalizationData(reply *pairingtypes.RelayReply, relayRequest *pairingtypes.RelayRequest, providerAddr string, consumerAcc sdk.AccAddress, latestSessionBlock, blockDistanceForFinalization, blocksInFinalizationProof int64) (finalizedBlocks map[int64]string, errRet error) { + relayFinalization := conflicttypes.NewRelayFinalizationFromRelaySessionAndRelayReply(relayRequest.RelaySession, reply, consumerAcc) + recoveredProviderPubKey, err := sigs.RecoverPubKey(relayFinalization) + if err != nil { + return nil, utils.LavaFormatWarning("Finalization data verification failed, RecoverPubKey returned error", err) + } + + recoveredProviderAddr, err := sdk.AccAddressFromHexUnsafe(recoveredProviderPubKey.Address().String()) + if err != nil { + return nil, utils.LavaFormatWarning("Finalization data verification failed, AccAddressFromHexUnsafe returned error", err) + } + + if recoveredProviderAddr.String() != providerAddr { + return nil, utils.LavaFormatError("provider address mismatch in finalization data ", + errors.Join(common.ProviderFinalizationDataAccountabilityError, lavasession.BlockProviderError, lavasession.SessionOutOfSyncError), + utils.LogAttr("parsed Address", recoveredProviderAddr.String()), + utils.LogAttr("expected address", providerAddr), + ) + } + + finalizedBlocks = map[int64]string{} + err = json.Unmarshal(reply.FinalizedBlocksHashes, &finalizedBlocks) + if err != nil { + return nil, utils.LavaFormatError("failed in unmarshalling finalized blocks data", + errors.Join(common.ProviderFinalizationDataAccountabilityError, lavasession.BlockProviderError, lavasession.SessionOutOfSyncError), + utils.LogAttr("FinalizedBlocksHashes", string(reply.FinalizedBlocksHashes)), + utils.LogAttr("errMsg", err.Error()), + ) + } + + err = verifyFinalizationDataIntegrity(reply, latestSessionBlock, finalizedBlocks, blockDistanceForFinalization, blocksInFinalizationProof, providerAddr) + if err != nil { + return nil, err + } + + providerLatestBlock := reply.LatestBlock + seenBlock := relayRequest.RelayData.SeenBlock + requestBlock := relayRequest.RelayData.RequestBlock + + if providerLatestBlock < lavaslices.Min([]int64{seenBlock, requestBlock}) { + return nil, utils.LavaFormatError("provider response does not meet consistency requirements", + errors.Join(common.ProviderFinalizationDataAccountabilityError, lavasession.SessionOutOfSyncError), + utils.LogAttr("ProviderAddress", relayRequest.RelaySession.Provider), + utils.LogAttr("providerLatestBlock", providerLatestBlock), + utils.LogAttr("seenBlock", seenBlock), + utils.LogAttr("requestBlock", requestBlock), + utils.LogAttr("provider address", providerAddr), + ) + } + return finalizedBlocks, errRet +} + +func verifyFinalizationDataIntegrity(reply *pairingtypes.RelayReply, latestSessionBlock int64, finalizedBlocks map[int64]string, blockDistanceForFinalization, blocksInFinalizationProof int64, providerAddr string) (err error) { + latestBlock := reply.LatestBlock + sorted := make([]int64, len(finalizedBlocks)) + idx := 0 + maxBlockNum := int64(0) + + if int64(len(finalizedBlocks)) != blocksInFinalizationProof { + return utils.LavaFormatError("Simulation: provider returned incorrect number of finalized blocks", + errors.Join(common.ProviderFinalizationDataAccountabilityError, lavasession.BlockProviderError, lavasession.SessionOutOfSyncError), + utils.LogAttr("Provider", providerAddr), + utils.LogAttr("blocksInFinalizationProof", blocksInFinalizationProof), + utils.LogAttr("len(finalizedBlocks)", len(finalizedBlocks)), + utils.LogAttr("finalizedBlocks", finalizedBlocks), + ) + } + + for blockNum := range finalizedBlocks { + // Check if finalized + if !spectypes.IsFinalizedBlock(blockNum, latestBlock, blockDistanceForFinalization) { + return utils.LavaFormatError("Simulation: provider returned non finalized block reply for reliability", + errors.Join(common.ProviderFinalizationDataAccountabilityError, lavasession.BlockProviderError, lavasession.SessionOutOfSyncError), + utils.LogAttr("blockNum", blockNum), + utils.LogAttr("latestBlock", latestBlock), + utils.LogAttr("Provider", providerAddr), + utils.LogAttr("finalizedBlocks", finalizedBlocks), + ) + } + + // Add to sorted + sorted[idx] = blockNum + + // Update maxBlockNum + if blockNum > maxBlockNum { + maxBlockNum = blockNum + } + idx++ + } + + lavaslices.SortStable(sorted) + + // Check for consecutive blocks + nonConsecutiveIndex, isConsecutive := lavaslices.IsSliceConsecutive(sorted) + if !isConsecutive { + return utils.LavaFormatError("Simulation: provider returned non consecutive finalized blocks reply", protocolerrors.ProviderFinalizationDataAccountabilityError, + utils.LogAttr("currBlock", sorted[nonConsecutiveIndex]), + utils.LogAttr("prevBlock", sorted[nonConsecutiveIndex-1]), + utils.LogAttr("providerAddr", providerAddr), + utils.LogAttr("finalizedBlocks", finalizedBlocks), + ) + } + + // Check that latest finalized block address + 1 points to a non finalized block + if spectypes.IsFinalizedBlock(maxBlockNum+1, latestBlock, blockDistanceForFinalization) { + return utils.LavaFormatError("Simulation: provider returned finalized hashes for an older latest block", protocolerrors.ProviderFinalizationDataAccountabilityError, + utils.LogAttr("maxBlockNum", maxBlockNum), + utils.LogAttr("latestBlock", latestBlock), + utils.LogAttr("Provider", providerAddr), + utils.LogAttr("finalizedBlocks", finalizedBlocks), + ) + } + + // New reply should have blocknum >= from block same provider + if latestSessionBlock > latestBlock { + return utils.LavaFormatError("Simulation: Provider supplied an older latest block than it has previously", protocolerrors.ProviderFinalizationDataAccountabilityError, + utils.LogAttr("session.LatestBlock", latestSessionBlock), + utils.LogAttr("latestBlock", latestBlock), + utils.LogAttr("Provider", providerAddr), + ) + } + + return nil +} diff --git a/protocol/lavaprotocol/protocolerrors/errors.go b/protocol/lavaprotocol/protocolerrors/errors.go new file mode 100644 index 0000000000..28adc78429 --- /dev/null +++ b/protocol/lavaprotocol/protocolerrors/errors.go @@ -0,0 +1,14 @@ +package protocolerrors + +import ( + sdkerrors "cosmossdk.io/errors" +) + +var ( + ProviderFinalizationDataError = sdkerrors.New("ProviderFinalizationData Error", 3365, "provider did not sign finalization data correctly") + ProviderFinalizationDataAccountabilityError = sdkerrors.New("ProviderFinalizationDataAccountability Error", 3366, "provider returned invalid finalization data, with accountability") + HashesConsensusError = sdkerrors.New("HashesConsensus Error", 3367, "identified finalized responses with conflicting hashes, from two providers") + ConsistencyError = sdkerrors.New("Consistency Error", 3368, "does not meet consistency requirements") + UnhandledRelayReceiverError = sdkerrors.New("UnhandledRelayReceiver Error", 3369, "provider does not handle requested api interface and spec") + DisabledRelayReceiverError = sdkerrors.New("DisabledRelayReceiverError Error", 3370, "provider does not pass verification and disabled this interface and spec") +) diff --git a/protocol/lavaprotocol/request_builder.go b/protocol/lavaprotocol/request_builder.go index 078c4f4075..69a44f0a94 100644 --- a/protocol/lavaprotocol/request_builder.go +++ b/protocol/lavaprotocol/request_builder.go @@ -5,19 +5,15 @@ import ( "context" "encoding/binary" - "github.com/btcsuite/btcd/btcec" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - conflictconstruct "github.com/lavanet/lava/x/conflict/types/construct" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" -) - -const ( - debug = false + "github.com/btcsuite/btcd/btcec/v2" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + conflictconstruct "github.com/lavanet/lava/v2/x/conflict/types/construct" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type HeaderFilterer interface { @@ -76,7 +72,7 @@ func ConstructRelaySession(lavaChainID string, relayRequestData *pairingtypes.Re } copiedQOS := copyQoSServiceReport(singleConsumerSession.QoSInfo.LastQoSReport) - copiedExcellenceQOS := copyQoSServiceReport(singleConsumerSession.QoSInfo.LastExcellenceQoSReport) + copiedExcellenceQOS := copyQoSServiceReport(singleConsumerSession.QoSInfo.LastExcellenceQoSReportRaw) // copy raw report for the node return &pairingtypes.RelaySession{ SpecId: chainID, @@ -160,12 +156,16 @@ func compareRelaysFindConflict(ctx context.Context, reply1 pairingtypes.RelayRep ConflictRelayData0: conflictconstruct.ConstructConflictRelayData(&reply1, &request1), ConflictRelayData1: conflictconstruct.ConstructConflictRelayData(&reply2, &request2), } - if debug { + if utils.IsTraceLogLevelEnabled() { firstAsString := string(reply1.Data) secondAsString := string(reply2.Data) _, idxDiff := findFirstDifferentChar(firstAsString, secondAsString) if idxDiff > 0 && idxDiff+100 < len(firstAsString) && idxDiff+100 < len(secondAsString) { - utils.LavaFormatDebug("difference in responses detected", utils.Attribute{Key: "index", Value: idxDiff}, utils.Attribute{Key: "first_diff", Value: firstAsString[idxDiff : idxDiff+100]}, utils.Attribute{Key: "second_diff", Value: secondAsString[idxDiff : idxDiff+100]}) + utils.LavaFormatTrace("difference in responses detected", + utils.LogAttr("index", idxDiff), + utils.LogAttr("first_diff", firstAsString[idxDiff:idxDiff+100]), + utils.LogAttr("second_diff", secondAsString[idxDiff:idxDiff+100]), + ) } } return true, responseConflict diff --git a/protocol/lavaprotocol/response_builder.go b/protocol/lavaprotocol/response_builder.go index 4c3adf5d98..d969bccd07 100644 --- a/protocol/lavaprotocol/response_builder.go +++ b/protocol/lavaprotocol/response_builder.go @@ -2,40 +2,78 @@ package lavaprotocol import ( "context" - "sort" + "encoding/json" - "github.com/goccy/go-json" - - btcSecp256k1 "github.com/btcsuite/btcd/btcec" + btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) +func CraftEmptyRPCResponseFromGenericMessage(message rpcInterfaceMessages.GenericMessage) (*rpcInterfaceMessages.RPCResponse, error) { + createRPCResponse := func(rawId json.RawMessage) (*rpcInterfaceMessages.RPCResponse, error) { + jsonRpcId, err := rpcInterfaceMessages.IdFromRawMessage(rawId) + if err != nil { + return nil, utils.LavaFormatError("failed creating jsonrpc id", err) + } + + jsonResponse := &rpcInterfaceMessages.RPCResponse{ + JSONRPC: "2.0", + ID: jsonRpcId, + Result: nil, + Error: nil, + } + + return jsonResponse, nil + } + + var err error + var rpcResponse *rpcInterfaceMessages.RPCResponse + if hasID, ok := message.(interface{ GetID() json.RawMessage }); ok { + rpcResponse, err = createRPCResponse(hasID.GetID()) + if err != nil { + return nil, utils.LavaFormatError("failed creating jsonrpc id", err) + } + } else { + rpcResponse, err = createRPCResponse([]byte("1")) + if err != nil { + return nil, utils.LavaFormatError("failed creating jsonrpc id", err) + } + } + + return rpcResponse, nil +} + func SignRelayResponse(consumerAddress sdk.AccAddress, request pairingtypes.RelayRequest, pkey *btcSecp256k1.PrivateKey, reply *pairingtypes.RelayReply, signDataReliability bool) (*pairingtypes.RelayReply, error) { // request is a copy of the original request, but won't modify it // update relay request requestedBlock to the provided one in case it was arbitrary UpdateRequestedBlock(request.RelayData, reply) + // Update signature, relayExchange := pairingtypes.NewRelayExchange(request, *reply) sig, err := sigs.Sign(pkey, relayExchange) if err != nil { return nil, utils.LavaFormatError("failed signing relay response", err, - utils.Attribute{Key: "request", Value: request}, utils.Attribute{Key: "reply", Value: reply}) + utils.LogAttr("request", request), + utils.LogAttr("reply", reply), + ) } reply.Sig = sig if signDataReliability { // update sig blocks signature - relayFinalization := pairingtypes.NewRelayFinalization(pairingtypes.NewRelayExchange(request, *reply), consumerAddress) + relayFinalization := conflicttypes.NewRelayFinalizationFromRelaySessionAndRelayReply(request.RelaySession, reply, consumerAddress) sigBlocks, err := sigs.Sign(pkey, relayFinalization) if err != nil { return nil, utils.LavaFormatError("failed signing finalization data", err, - utils.Attribute{Key: "request", Value: request}, utils.Attribute{Key: "reply", Value: reply}, utils.Attribute{Key: "userAddr", Value: consumerAddress}) + utils.LogAttr("request", request), + utils.LogAttr("reply", reply), + utils.LogAttr("userAddr", consumerAddress), + ) } reply.SigBlocks = sigBlocks } @@ -46,101 +84,21 @@ func VerifyRelayReply(ctx context.Context, reply *pairingtypes.RelayReply, relay relayExchange := pairingtypes.NewRelayExchange(*relayRequest, *reply) serverKey, err := sigs.RecoverPubKey(relayExchange) if err != nil { - return err + return utils.LavaFormatWarning("Relay reply verification failed, RecoverPubKey returned error", err, utils.LogAttr("GUID", ctx)) } serverAddr, err := sdk.AccAddressFromHexUnsafe(serverKey.Address().String()) if err != nil { - return err + return utils.LavaFormatWarning("Relay reply verification failed, AccAddressFromHexUnsafe returned error", err, utils.LogAttr("GUID", ctx)) } if serverAddr.String() != addr { - return utils.LavaFormatError("reply server address mismatch ", ProviderFinzalizationDataError, utils.LogAttr("GUID", ctx), utils.Attribute{Key: "parsed Address", Value: serverAddr.String()}, utils.Attribute{Key: "expected address", Value: addr}, utils.Attribute{Key: "requestedBlock", Value: relayRequest.RelayData.RequestBlock}, utils.Attribute{Key: "latestBlock", Value: reply.GetLatestBlock()}) + return utils.LavaFormatError("reply server address mismatch", protocolerrors.ProviderFinalizationDataError, + utils.LogAttr("GUID", ctx), + utils.LogAttr("parsedAddress", serverAddr.String()), + utils.LogAttr("expectedAddress", addr), + utils.LogAttr("requestedBlock", relayRequest.RelayData.RequestBlock), + utils.LogAttr("latestBlock", reply.GetLatestBlock()), + ) } return nil } - -func VerifyFinalizationData(reply *pairingtypes.RelayReply, relayRequest *pairingtypes.RelayRequest, providerAddr string, consumerAcc sdk.AccAddress, latestSessionBlock int64, blockDistanceForfinalization uint32) (finalizedBlocks map[int64]string, finalizationConflict *conflicttypes.FinalizationConflict, errRet error) { - relayFinalization := pairingtypes.NewRelayFinalization(pairingtypes.NewRelayExchange(*relayRequest, *reply), consumerAcc) - serverKey, err := sigs.RecoverPubKey(relayFinalization) - if err != nil { - return nil, nil, err - } - - serverAddr, err := sdk.AccAddressFromHexUnsafe(serverKey.Address().String()) - if err != nil { - return nil, nil, err - } - - if serverAddr.String() != providerAddr { - return nil, nil, utils.LavaFormatError("reply server address mismatch in finalization data ", ProviderFinzalizationDataError, utils.Attribute{Key: "parsed Address", Value: serverAddr.String()}, utils.Attribute{Key: "expected address", Value: providerAddr}) - } - - finalizedBlocks = map[int64]string{} // TODO:: define struct in relay response - err = json.Unmarshal(reply.FinalizedBlocksHashes, &finalizedBlocks) - if err != nil { - return nil, nil, utils.LavaFormatError("failed in unmarshalling finalized blocks data", ProviderFinzalizationDataError, utils.Attribute{Key: "FinalizedBlocksHashes", Value: string(reply.FinalizedBlocksHashes)}, utils.Attribute{Key: "errMsg", Value: err.Error()}) - } - - finalizationConflict, err = verifyFinalizationDataIntegrity(reply, latestSessionBlock, finalizedBlocks, blockDistanceForfinalization, providerAddr) - if err != nil { - return nil, finalizationConflict, err - } - providerLatestBlock := reply.LatestBlock - seenBlock := relayRequest.RelayData.SeenBlock - requestBlock := relayRequest.RelayData.RequestBlock - if providerLatestBlock < lavaslices.Min([]int64{seenBlock, requestBlock}) { - return nil, nil, utils.LavaFormatError("provider response does not meet consistency requirements", ProviderFinzalizationDataError, utils.LogAttr("ProviderAddress", relayRequest.RelaySession.Provider), utils.LogAttr("providerLatestBlock", providerLatestBlock), utils.LogAttr("seenBlock", seenBlock), utils.LogAttr("requestBlock", requestBlock), utils.Attribute{Key: "provider address", Value: providerAddr}) - } - return finalizedBlocks, finalizationConflict, errRet -} - -func verifyFinalizationDataIntegrity(reply *pairingtypes.RelayReply, latestSessionBlock int64, finalizedBlocks map[int64]string, blockDistanceForfinalization uint32, providerAddr string) (finalizationConflict *conflicttypes.FinalizationConflict, err error) { - latestBlock := reply.LatestBlock - sorted := make([]int64, len(finalizedBlocks)) - idx := 0 - maxBlockNum := int64(0) - // TODO: compare finalizedBlocks len vs chain parser len to validate (get from same place as blockDistanceForfinalization arrives) - - for blockNum := range finalizedBlocks { - if !spectypes.IsFinalizedBlock(blockNum, latestBlock, blockDistanceForfinalization) { - finalizationConflict = &conflicttypes.FinalizationConflict{RelayReply0: reply} - return finalizationConflict, utils.LavaFormatError("Simulation: provider returned non finalized block reply for reliability", ProviderFinzalizationDataAccountabilityError, utils.Attribute{Key: "blockNum", Value: blockNum}, utils.Attribute{Key: "latestBlock", Value: latestBlock}, utils.Attribute{Key: "Provider", Value: providerAddr}, utils.Attribute{Key: "finalizedBlocks", Value: finalizedBlocks}) - } - - sorted[idx] = blockNum - - if blockNum > maxBlockNum { - maxBlockNum = blockNum - } - idx++ - // TODO: check blockhash length and format - } - - // check for consecutive blocks - sort.Slice(sorted, func(i, j int) bool { return sorted[i] < sorted[j] }) - for index := range sorted { - if index != 0 && sorted[index]-1 != sorted[index-1] { - // log.Println("provider returned non consecutive finalized blocks reply.\n Provider: %s", providerAcc) - finalizationConflict = &conflicttypes.FinalizationConflict{RelayReply0: reply} - return finalizationConflict, utils.LavaFormatError("Simulation: provider returned non consecutive finalized blocks reply", ProviderFinzalizationDataAccountabilityError, utils.Attribute{Key: "curr block", Value: sorted[index]}, utils.Attribute{Key: "prev block", Value: sorted[index-1]}, utils.Attribute{Key: "Provider", Value: providerAddr}, utils.Attribute{Key: "finalizedBlocks", Value: finalizedBlocks}) - } - } - - // check that latest finalized block address + 1 points to a non finalized block - if spectypes.IsFinalizedBlock(maxBlockNum+1, latestBlock, blockDistanceForfinalization) { - finalizationConflict = &conflicttypes.FinalizationConflict{RelayReply0: reply} - return finalizationConflict, utils.LavaFormatError("Simulation: provider returned finalized hashes for an older latest block", ProviderFinzalizationDataAccountabilityError, - utils.Attribute{Key: "maxBlockNum", Value: maxBlockNum}, - utils.Attribute{Key: "latestBlock", Value: latestBlock}, utils.Attribute{Key: "Provider", Value: providerAddr}, utils.Attribute{Key: "finalizedBlocks", Value: finalizedBlocks}) - } - - // New reply should have blocknum >= from block same provider - if latestSessionBlock > latestBlock { - finalizationConflict = &conflicttypes.FinalizationConflict{RelayReply0: reply} - return finalizationConflict, utils.LavaFormatError("Simulation: Provider supplied an older latest block than it has previously", ProviderFinzalizationDataAccountabilityError, - utils.Attribute{Key: "session.LatestBlock", Value: latestSessionBlock}, - utils.Attribute{Key: "latestBlock", Value: latestBlock}, utils.Attribute{Key: "Provider", Value: providerAddr}) - } - - return finalizationConflict, nil -} diff --git a/protocol/lavaprotocol/response_builder_test.go b/protocol/lavaprotocol/response_builder_test.go index 7b3ceb09ed..c433eb2224 100644 --- a/protocol/lavaprotocol/response_builder_test.go +++ b/protocol/lavaprotocol/response_builder_test.go @@ -6,10 +6,11 @@ import ( "encoding/json" "testing" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationverification" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -26,15 +27,15 @@ func TestSignAndExtractResponse(t *testing.T) { specId := "LAV1" epoch := int64(100) singleConsumerSession := &lavasession.SingleConsumerSession{ - CuSum: 20, - LatestRelayCu: 10, // set by GetSessions cuNeededForSession - QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, - SessionId: 123, - Parent: nil, - RelayNum: 1, - LatestBlock: epoch, - Endpoint: nil, - BlockListed: false, // if session lost sync we blacklist it. + CuSum: 20, + LatestRelayCu: 10, // set by GetSessions cuNeededForSession + QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, + SessionId: 123, + Parent: nil, + RelayNum: 1, + LatestBlock: epoch, + EndpointConnection: nil, + BlockListed: false, // if session lost sync we blacklist it. } metadataValue := make([]pairingtypes.Metadata, 1) metadataValue[0] = pairingtypes.Metadata{ @@ -61,7 +62,7 @@ func TestSignAndExtractResponse(t *testing.T) { require.NoError(t, err) err = VerifyRelayReply(ctx, reply, relay, provider_address.String()) require.NoError(t, err) - _, _, err = VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0) + _, err = finalizationverification.VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0, 1) require.NoError(t, err) } @@ -74,15 +75,15 @@ func TestSignAndExtractResponseLatest(t *testing.T) { testSpecId := "BLAV1" epoch := int64(100) singleConsumerSession := &lavasession.SingleConsumerSession{ - CuSum: 20, - LatestRelayCu: 10, // set by GetSessions cuNeededForSession - QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, - SessionId: 123, - Parent: nil, - RelayNum: 1, - LatestBlock: epoch, - Endpoint: nil, - BlockListed: false, // if session lost sync we blacklist it. + CuSum: 20, + LatestRelayCu: 10, // set by GetSessions cuNeededForSession + QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, + SessionId: 123, + Parent: nil, + RelayNum: 1, + LatestBlock: epoch, + EndpointConnection: nil, + BlockListed: false, // if session lost sync we blacklist it. } metadataValue := make([]pairingtypes.Metadata, 1) metadataValue[0] = pairingtypes.Metadata{ @@ -111,6 +112,6 @@ func TestSignAndExtractResponseLatest(t *testing.T) { require.NoError(t, err) err = VerifyRelayReply(ctx, reply, relay, provider_address.String()) require.NoError(t, err) - _, _, err = VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0) + _, err = finalizationverification.VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0, 1) require.NoError(t, err) } diff --git a/protocol/lavaprotocol/reuqest_builder_test.go b/protocol/lavaprotocol/reuqest_builder_test.go index fc967648e3..f60a11d462 100644 --- a/protocol/lavaprotocol/reuqest_builder_test.go +++ b/protocol/lavaprotocol/reuqest_builder_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) @@ -16,15 +16,15 @@ func TestSignAndExtract(t *testing.T) { specId := "LAV1" epoch := int64(100) singleConsumerSession := &lavasession.SingleConsumerSession{ - CuSum: 20, - LatestRelayCu: 10, // set by GetSessions cuNeededForSession - QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, - SessionId: 123, - Parent: nil, - RelayNum: 1, - LatestBlock: epoch, - Endpoint: nil, - BlockListed: false, // if session lost sync we blacklist it. + CuSum: 20, + LatestRelayCu: 10, // set by GetSessions cuNeededForSession + QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, + SessionId: 123, + Parent: nil, + RelayNum: 1, + LatestBlock: epoch, + EndpointConnection: nil, + BlockListed: false, // if session lost sync we blacklist it. } metadataValue := make([]pairingtypes.Metadata, 1) metadataValue[0] = pairingtypes.Metadata{ diff --git a/protocol/lavasession/active_subscription_provider_storage.go b/protocol/lavasession/active_subscription_provider_storage.go new file mode 100644 index 0000000000..65f0520cff --- /dev/null +++ b/protocol/lavasession/active_subscription_provider_storage.go @@ -0,0 +1,71 @@ +package lavasession + +import ( + "sync" + + "github.com/lavanet/lava/v2/utils" +) + +// stores all providers that are currently used to stream subscriptions. + +type NumberOfActiveSubscriptions int64 + +type ActiveSubscriptionProvidersStorage struct { + lock sync.RWMutex + providers map[string]NumberOfActiveSubscriptions + purgeWhenDone map[string]func() +} + +func NewActiveSubscriptionProvidersStorage() *ActiveSubscriptionProvidersStorage { + return &ActiveSubscriptionProvidersStorage{ + providers: map[string]NumberOfActiveSubscriptions{}, + purgeWhenDone: map[string]func(){}, + } +} + +func (asps *ActiveSubscriptionProvidersStorage) AddProvider(providerAddress string) { + asps.lock.Lock() + defer asps.lock.Unlock() + numberOfSubscriptionsActive := asps.providers[providerAddress] + // Increase numberOfSubscriptionsActive by 1 (even if it didn't exist it will be 0) + asps.providers[providerAddress] = numberOfSubscriptionsActive + 1 +} + +func (asps *ActiveSubscriptionProvidersStorage) RemoveProvider(providerAddress string) { + asps.lock.Lock() + defer asps.lock.Unlock() + // Fetch number of currently active subscriptions for this provider address. + activeSubscriptions, foundProviderAddress := asps.providers[providerAddress] + if foundProviderAddress { + // Check there are no other active subscriptions + if activeSubscriptions <= 1 { + delete(asps.providers, providerAddress) + purgeCallBack, foundPurgerCb := asps.purgeWhenDone[providerAddress] + if foundPurgerCb { + utils.LavaFormatTrace("RemoveProvider, Purging provider on callback", utils.LogAttr("address", providerAddress)) + if purgeCallBack != nil { + purgeCallBack() + } + delete(asps.purgeWhenDone, providerAddress) + } + } else { + // Reduce number of active subscriptions on this provider address + utils.LavaFormatTrace("RemoveProvider, Reducing number of active provider subscriptions", utils.LogAttr("address", providerAddress)) + asps.providers[providerAddress] = activeSubscriptions - 1 + } + } +} + +func (asps *ActiveSubscriptionProvidersStorage) IsProviderCurrentlyUsed(providerAddress string) bool { + asps.lock.RLock() + defer asps.lock.RUnlock() + + _, ok := asps.providers[providerAddress] + return ok +} + +func (asps *ActiveSubscriptionProvidersStorage) addToPurgeWhenDone(providerAddress string, purgeCallback func()) { + asps.lock.Lock() + defer asps.lock.Unlock() + asps.purgeWhenDone[providerAddress] = purgeCallback +} diff --git a/protocol/lavasession/active_subscription_provider_storage_test.go b/protocol/lavasession/active_subscription_provider_storage_test.go new file mode 100644 index 0000000000..6d7cf733e0 --- /dev/null +++ b/protocol/lavasession/active_subscription_provider_storage_test.go @@ -0,0 +1,65 @@ +package lavasession + +import ( + "strconv" + "sync" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestIsProviderInActiveSubscription(t *testing.T) { + acps := NewActiveSubscriptionProvidersStorage() + + // Add a provider + providerAddress := "provider1" + acps.AddProvider(providerAddress) + + // Check if the provider is long-lasting + isActiveSubscription := acps.IsProviderCurrentlyUsed(providerAddress) + require.True(t, isActiveSubscription) + + // Remove the provider + acps.RemoveProvider(providerAddress) + + // Check if the provider is still long-lasting + isActiveSubscription = acps.IsProviderCurrentlyUsed(providerAddress) + require.False(t, isActiveSubscription) +} + +func TestConcurrentAccess(t *testing.T) { + acps := NewActiveSubscriptionProvidersStorage() + + // Add and remove providers concurrently + numProviders := 100 + var wg sync.WaitGroup + wg.Add(numProviders * 2) + for i := 0; i < numProviders; i++ { + providerSpecificWg := sync.WaitGroup{} + providerSpecificWg.Add(1) + go func(providerIndex int) { + defer func() { + wg.Done() + providerSpecificWg.Done() + }() + + providerAddress := "provider" + strconv.Itoa(providerIndex) + acps.AddProvider(providerAddress) + }(i) + + go func(providerIndex int) { + providerSpecificWg.Wait() + defer wg.Done() + providerAddress := "provider" + strconv.Itoa(providerIndex) + acps.RemoveProvider(providerAddress) + }(i) + } + wg.Wait() + + // Check if all providers were added and removed + for i := 0; i < numProviders; i++ { + providerAddress := "provider" + strconv.Itoa(i) + isCurrentlyActive := acps.IsProviderCurrentlyUsed(providerAddress) + require.False(t, isCurrentlyActive) + } +} diff --git a/protocol/lavasession/common.go b/protocol/lavasession/common.go index 649d8e6ab6..5f5dbed492 100644 --- a/protocol/lavasession/common.go +++ b/protocol/lavasession/common.go @@ -17,10 +17,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/status" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/keeper/scores" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/keeper/scores" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" diff --git a/protocol/lavasession/common_test.go b/protocol/lavasession/common_test.go index 903fd8111c..c16280118d 100644 --- a/protocol/lavasession/common_test.go +++ b/protocol/lavasession/common_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/protocol/lavasession/consumer_session_manager.go b/protocol/lavasession/consumer_session_manager.go index 5a935d337e..0074c74508 100644 --- a/protocol/lavasession/consumer_session_manager.go +++ b/protocol/lavasession/consumer_session_manager.go @@ -10,19 +10,18 @@ import ( "time" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/protocol/common" - metrics "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/provideroptimizer" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/common" + metrics "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) const ( - debug = false BlockedProviderSessionUsedStatus = uint32(1) BlockedProviderSessionUnusedStatus = uint32(0) ) @@ -57,10 +56,11 @@ type ConsumerSessionManager struct { reportedProviders *ReportedProviders // pairingPurge - contains all pairings that are unwanted this epoch, keeps them in memory in order to avoid release. // (if a consumer session still uses one of them or we want to report it.) - pairingPurge map[string]*ConsumerSessionsWithProvider - providerOptimizer ProviderOptimizer - consumerMetricsManager *metrics.ConsumerMetricsManager - consumerPublicAddress string + pairingPurge map[string]*ConsumerSessionsWithProvider + providerOptimizer ProviderOptimizer + consumerMetricsManager *metrics.ConsumerMetricsManager + consumerPublicAddress string + activeSubscriptionProvidersStorage *ActiveSubscriptionProvidersStorage } // this is being read in multiple locations and but never changes so no need to lock. @@ -155,12 +155,29 @@ func (csm *ConsumerSessionManager) getValidAddresses(addon string, extensions [] // otherwise golang garbage collector is not closing network connections and they // will remain open forever. func (csm *ConsumerSessionManager) closePurgedUnusedPairingsConnections() { - for _, purgedPairing := range csm.pairingPurge { - for _, endpoint := range purgedPairing.Endpoints { - if endpoint.connection != nil { - endpoint.connection.Close() + for providerAddr, purgedPairing := range csm.pairingPurge { + callbackPurge := func() { + for _, endpoint := range purgedPairing.Endpoints { + for _, endpointConnection := range endpoint.Connections { + if endpointConnection.connection != nil { + utils.LavaFormatTrace("purging connection", + utils.LogAttr("providerAddr", providerAddr), + utils.LogAttr("endpoint", endpoint.NetworkAddress), + ) + endpointConnection.connection.Close() + } + } } } + // on cases where there is still an active subscription over the epoch handover, we purge the connection when subscription ends. + if csm.activeSubscriptionProvidersStorage.IsProviderCurrentlyUsed(providerAddr) { + utils.LavaFormatTrace("skipping purge for provider, as its currently used in a subscription", + utils.LogAttr("providerAddr", providerAddr), + ) + csm.activeSubscriptionProvidersStorage.addToPurgeWhenDone(providerAddr, callbackPurge) + continue + } + callbackPurge() } } @@ -205,7 +222,7 @@ func (csm *ConsumerSessionManager) probeProviders(ctx context.Context, pairingLi // this code needs to be thread safe func (csm *ConsumerSessionManager) probeProvider(ctx context.Context, consumerSessionsWithProvider *ConsumerSessionsWithProvider, epoch uint64, tryReconnectToDisabledEndpoints bool) (latency time.Duration, providerAddress string, err error) { - connected, endpoints, providerAddress, err := consumerSessionsWithProvider.fetchEndpointConnectionFromConsumerSessionWithProvider(ctx, tryReconnectToDisabledEndpoints, true) + connected, endpoints, providerAddress, err := consumerSessionsWithProvider.fetchEndpointConnectionFromConsumerSessionWithProvider(ctx, tryReconnectToDisabledEndpoints, true, "", nil) if err != nil || !connected { if AllProviderEndpointsDisabledError.Is(err) { csm.blockProvider(providerAddress, true, epoch, MaxConsecutiveConnectionAttempts, 0, false, csm.GenerateReconnectCallback(consumerSessionsWithProvider), []error{err}) // reporting and blocking provider this epoch @@ -215,7 +232,7 @@ func (csm *ConsumerSessionManager) probeProvider(ctx context.Context, consumerSe var endpointInfos []EndpointInfo lastError := fmt.Errorf("endpoints list is empty") // this error will happen if we had 0 endpoints - for _, endpoint := range endpoints { + for _, endpointAndConnection := range endpoints { err := func() error { connectCtx, cancel := context.WithTimeout(ctx, common.AverageWorldLatency) defer cancel() @@ -223,12 +240,15 @@ func (csm *ConsumerSessionManager) probeProvider(ctx context.Context, consumerSe if !found { return utils.LavaFormatError("probeProvider failed fetching unique identifier from context when it's set", nil) } - if endpoint.Client == nil { + if endpointAndConnection == nil || + endpointAndConnection.chosenEndpointConnection == nil || + endpointAndConnection.chosenEndpointConnection.Client == nil { + // returned nil client in endpoint, this should never happen, but checking just in case. consumerSessionsWithProvider.Lock.Lock() defer consumerSessionsWithProvider.Lock.Unlock() return utils.LavaFormatError("returned nil client in endpoint", nil, utils.Attribute{Key: "consumerSessionWithProvider", Value: consumerSessionsWithProvider}) } - client := *endpoint.Client + client := endpointAndConnection.chosenEndpointConnection.Client probeReq := &pairingtypes.ProbeRequest{ Guid: guid, SpecId: csm.rpcEndpoint.ChainID, @@ -236,7 +256,11 @@ func (csm *ConsumerSessionManager) probeProvider(ctx context.Context, consumerSe } var trailer metadata.MD relaySentTime := time.Now() + metadataAdd := metadata.New(map[string]string{common.LAVA_LB_UNIQUE_ID_HEADER: endpointAndConnection.chosenEndpointConnection.GetLbUniqueId()}) + connectCtx = metadata.NewOutgoingContext(connectCtx, metadataAdd) + probeResp, err := client.Probe(connectCtx, probeReq, grpc.Trailer(&trailer)) + relayLatency := time.Since(relaySentTime) versions := trailer.Get(common.VersionMetadataKey) if err != nil { @@ -252,7 +276,7 @@ func (csm *ConsumerSessionManager) probeProvider(ctx context.Context, consumerSe endpointInfos = append(endpointInfos, EndpointInfo{ Latency: relayLatency, - Endpoint: endpoint, + Endpoint: endpointAndConnection.endpoint, }) // public lava address is a value that is not changing, so it's thread safe if DebugProbes { @@ -393,8 +417,11 @@ func (csm *ConsumerSessionManager) GetSessions(ctx context.Context, cuNeededForS // set usedProviders if they were chosen for this relay timeoutCtx, cancel := context.WithTimeout(ctx, time.Second) defer cancel() - canSelect := usedProviders.TryLockSelection(timeoutCtx) - if !canSelect { + cantSelectError := usedProviders.TryLockSelection(timeoutCtx) + if cantSelectError != nil { + if ContextDoneNoNeedToLockSelectionError.Is(cantSelectError) { + return nil, utils.LavaFormatDebug("Context deadline exceeded when trying to lock selection") + } return nil, utils.LavaFormatError("failed getting sessions from used Providers", nil, utils.LogAttr("usedProviders", usedProviders), utils.LogAttr("endpoint", csm.rpcEndpoint)) } defer func() { usedProviders.AddUsed(consumerSessionMap, errRet) }() @@ -427,7 +454,7 @@ func (csm *ConsumerSessionManager) GetSessions(ctx context.Context, cuNeededForS sessionEpoch := sessionWithProvider.CurrentEpoch // Get a valid Endpoint from the provider chosen - connected, endpoints, _, err := consumerSessionsWithProvider.fetchEndpointConnectionFromConsumerSessionWithProvider(ctx, false, false) + connected, endpoints, _, err := consumerSessionsWithProvider.fetchEndpointConnectionFromConsumerSessionWithProvider(ctx, false, false, addon, extensionNames) if err != nil { // verify err is AllProviderEndpointsDisabled and report. if AllProviderEndpointsDisabledError.Is(err) { @@ -457,7 +484,7 @@ func (csm *ConsumerSessionManager) GetSessions(ctx context.Context, cuNeededForS reportedProviders := csm.GetReportedProviders(sessionEpoch) // Get session from endpoint or create new or continue. if more than 10 connections are open. - consumerSession, pairingEpoch, err := consumerSessionsWithProvider.GetConsumerSessionInstanceFromEndpoint(endpoint, numberOfResets) + consumerSession, pairingEpoch, err := consumerSessionsWithProvider.GetConsumerSessionInstanceFromEndpoint(endpoint.chosenEndpointConnection, numberOfResets) if err != nil { utils.LavaFormatDebug("Error on consumerSessionWithProvider.getConsumerSessionInstanceFromEndpoint", utils.LogAttr("providerAddress", providerAddress), @@ -501,22 +528,15 @@ func (csm *ConsumerSessionManager) GetSessions(ctx context.Context, cuNeededForS } } else { // consumer session is locked and valid, we need to set the relayNumber and the relay cu. before returning. - - // add metric to currently open sessions metric - info := csm.RPCEndpoint() - apiInterface := info.ApiInterface - chainId := info.ChainID - go csm.consumerMetricsManager.AddOpenSessionMetric(chainId, apiInterface, providerAddress) // Successfully created/got a consumerSession. - if debug { - utils.LavaFormatDebug("Consumer get session", - utils.Attribute{Key: "provider", Value: providerAddress}, - utils.Attribute{Key: "sessionEpoch", Value: sessionEpoch}, - utils.Attribute{Key: "consumerSession.CUSum", Value: consumerSession.CuSum}, - utils.Attribute{Key: "consumerSession.RelayNum", Value: consumerSession.RelayNum}, - utils.Attribute{Key: "consumerSession.SessionId", Value: consumerSession.SessionId}, - ) - } + + utils.LavaFormatTrace("Consumer get session", + utils.LogAttr("provider", providerAddress), + utils.LogAttr("sessionEpoch", sessionEpoch), + utils.LogAttr("consumerSession.CUSum", consumerSession.CuSum), + utils.LogAttr("consumerSession.RelayNum", consumerSession.RelayNum), + utils.LogAttr("consumerSession.SessionId", consumerSession.SessionId), + ) // If no error, add provider session map sessionInfo := &SessionInfo{ @@ -531,7 +551,15 @@ func (csm *ConsumerSessionManager) GetSessions(ctx context.Context, cuNeededForS sessionInfo.QoSSummeryResult = consumerSession.getQosComputedResultOrZero() sessions[providerAddress] = sessionInfo - consumerSession.SetUsageForSession(cuNeededForSession, csm.providerOptimizer.GetExcellenceQoSReportForProvider(providerAddress), usedProviders) + qosReport, rawQosReport := csm.providerOptimizer.GetExcellenceQoSReportForProvider(providerAddress) + if csm.rpcEndpoint.Geolocation != uint64(endpoint.endpoint.Geolocation) { + // rawQosReport is used only when building the relay payment message to be used to update + // the provider's reputation on-chain. If the consumer and provider don't share geolocation + // (consumer geo: csm.rpcEndpoint.Geolocation, provider geo: endpoint.endpoint.Geolocation) + // we don't want to update the reputation by it, so we null the rawQosReport + rawQosReport = nil + } + consumerSession.SetUsageForSession(cuNeededForSession, qosReport, rawQosReport, usedProviders) // We successfully added provider, we should ignore it if we need to fetch new tempIgnoredProviders.providers[providerAddress] = struct{}{} if len(sessions) == wantedSession { @@ -606,16 +634,15 @@ func (csm *ConsumerSessionManager) getValidProviderAddresses(ignoredProvidersLis } else { providers = csm.providerOptimizer.ChooseProvider(validAddresses, ignoredProvidersList, cu, requestedBlock, OptimizerPerturbation) } - if debug { - utils.LavaFormatDebug("choosing providers", - utils.Attribute{Key: "validAddresses", Value: validAddresses}, - utils.Attribute{Key: "ignoredProvidersList", Value: ignoredProvidersList}, - utils.Attribute{Key: "chosenProviders", Value: providers}, - utils.Attribute{Key: "addon", Value: addon}, - utils.Attribute{Key: "extensions", Value: extensions}, - utils.Attribute{Key: "stateful", Value: stateful}, - ) - } + + utils.LavaFormatTrace("Choosing providers", + utils.LogAttr("validAddresses", validAddresses), + utils.LogAttr("ignoredProvidersList", ignoredProvidersList), + utils.LogAttr("chosenProviders", providers), + utils.LogAttr("addon", addon), + utils.LogAttr("extensions", extensions), + utils.LogAttr("stateful", stateful), + ) // make sure we have at least 1 valid provider if len(providers) == 0 || providers[0] == "" { @@ -692,9 +719,9 @@ func (csm *ConsumerSessionManager) tryGetConsumerSessionWithProviderFromBlockedP func (csm *ConsumerSessionManager) getValidConsumerSessionsWithProvider(ignoredProviders *ignoredProviders, cuNeededForSession uint64, requestedBlock int64, addon string, extensions []string, stateful uint32, virtualEpoch uint64) (sessionWithProviderMap SessionWithProviderMap, err error) { csm.lock.RLock() defer csm.lock.RUnlock() - if debug { - utils.LavaFormatDebug("called getValidConsumerSessionsWithProvider", utils.Attribute{Key: "ignoredProviders", Value: ignoredProviders}) - } + + utils.LavaFormatTrace("Called getValidConsumerSessionsWithProvider", utils.LogAttr("ignoredProviders", ignoredProviders)) + currentEpoch := csm.atomicReadCurrentEpoch() // reading the epoch here while locked, to get the epoch of the pairing. if ignoredProviders.currentEpoch < currentEpoch { utils.LavaFormatDebug("ignoredProviders epoch is not the current epoch, resetting ignoredProviders", utils.Attribute{Key: "ignoredProvidersEpoch", Value: ignoredProviders.currentEpoch}, utils.Attribute{Key: "currentEpoch", Value: currentEpoch}) @@ -814,6 +841,7 @@ func (csm *ConsumerSessionManager) blockProvider(address string, reportProvider go func() { <-time.After(retrySecondChanceAfter) // check epoch is still relevant, if not just return + utils.LavaFormatDebug("Running second chance for provider", utils.LogAttr("address", address)) if sessionEpoch != csm.atomicReadCurrentEpoch() { return } @@ -829,8 +857,8 @@ func (csm *ConsumerSessionManager) blockProvider(address string, reportProvider err := csm.removeAddressFromValidAddresses(address) if err != nil { if AddressIndexWasNotFoundError.Is(err) { - // in case index wasnt found just continue with the method - utils.LavaFormatError("address was not found in valid addresses", err, utils.Attribute{Key: "address", Value: address}, utils.Attribute{Key: "validAddresses", Value: csm.validAddresses}) + // in case index wasn't found just continue with the method + utils.LavaFormatDebug("address was not found in valid addresses list", utils.Attribute{Key: "address", Value: address}, utils.Attribute{Key: "error", Value: err}, utils.Attribute{Key: "validAddresses", Value: csm.validAddresses}) } else { return err } @@ -882,6 +910,17 @@ func (csm *ConsumerSessionManager) OnSessionFailure(consumerSession *SingleConsu blockProvider = true } + if sdkerrors.IsOf(errorReceived, BlockEndpointError) { + utils.LavaFormatTrace("Got BlockEndpointError, blocking endpoint and session", + utils.LogAttr("error", errorReceived), + utils.LogAttr("sessionID", consumerSession.SessionId), + ) + + // Block the endpoint and the consumer session from future usages + consumerSession.EndpointConnection.blockListed.Store(true) + consumerSession.BlockListed = true + } + consumerSession.QoSInfo.TotalRelays++ consumerSession.ConsecutiveErrors = append(consumerSession.ConsecutiveErrors, errorReceived) // copy consecutive errors for report. @@ -909,7 +948,7 @@ func (csm *ConsumerSessionManager) OnSessionFailure(consumerSession *SingleConsu } } cuToDecrease := consumerSession.LatestRelayCu - // latency, isHangingApi, syncScore arent updated when there is a failure + // latency, isHangingApi, syncScore aren't updated when there is a failure go csm.providerOptimizer.AppendRelayFailure(consumerSession.Parent.PublicLavaAddress) consumerSession.LatestRelayCu = 0 // making sure no one uses it in a wrong way consecutiveErrors := uint64(len(consumerSession.ConsecutiveErrors)) @@ -922,7 +961,6 @@ func (csm *ConsumerSessionManager) OnSessionFailure(consumerSession *SingleConsu if err != nil { return err } - if !redemptionSession && blockProvider { publicProviderAddress, pairingEpoch := parentConsumerSessionsWithProvider.getPublicLavaAddressAndPairingEpoch() err = csm.blockProvider(publicProviderAddress, reportProvider, pairingEpoch, 0, consecutiveErrors, allowSecondChance, nil, errorsForConsumerSession) @@ -943,12 +981,16 @@ func (csm *ConsumerSessionManager) validateAndReturnBlockedProviderToValidAddres defer csm.lock.Unlock() for idx, addr := range csm.currentlyBlockedProviderAddresses { if addr == providerAddress { - // remove it from the csm.currentlyBlockedProviderAddresses + // Remove it from the csm.currentlyBlockedProviderAddresses csm.currentlyBlockedProviderAddresses = append(csm.currentlyBlockedProviderAddresses[:idx], csm.currentlyBlockedProviderAddresses[idx+1:]...) - // reapply it to the valid addresses. + // Reapply it to the valid addresses. csm.validAddresses = append(csm.validAddresses, addr) - // purge the current addon addresses so it will be created again next time get session is called. + // Purge the current addon addresses so it will be created again next time get session is called. csm.RemoveAddonAddresses("", nil) + // Reset redemption status + if provider, ok := csm.pairing[providerAddress]; ok { + provider.atomicWriteBlockedStatus(BlockedProviderSessionUnusedStatus) + } return } } @@ -1013,16 +1055,10 @@ func (csm *ConsumerSessionManager) updateMetricsManager(consumerSession *SingleC qosEx := *consumerSession.QoSInfo.LastExcellenceQoSReport lastQosExcellence = &qosEx } - blockedSession := consumerSession.BlockListed publicProviderAddress := consumerSession.Parent.PublicLavaAddress go func() { csm.consumerMetricsManager.SetQOSMetrics(chainId, apiInterface, publicProviderAddress, lastQos, lastQosExcellence, consumerSession.LatestBlock, consumerSession.RelayNum, relayLatency, sessionSuccessful) - // in case we blocked the session add it to our block sessions metric - if blockedSession { - csm.consumerMetricsManager.AddNumberOfBlockedSessionMetric(chainId, apiInterface, publicProviderAddress) - } - csm.consumerMetricsManager.DecrementOpenSessionMetric(chainId, apiInterface, publicProviderAddress) }() } @@ -1055,12 +1091,13 @@ func (csm *ConsumerSessionManager) GetAtomicPairingAddressesLength() uint64 { } // On a successful Subscribe relay -func (csm *ConsumerSessionManager) OnSessionDoneIncreaseCUOnly(consumerSession *SingleConsumerSession) error { +func (csm *ConsumerSessionManager) OnSessionDoneIncreaseCUOnly(consumerSession *SingleConsumerSession, latestServicedBlock int64) error { if err := consumerSession.VerifyLock(); err != nil { return sdkerrors.Wrapf(err, "OnSessionDoneIncreaseRelayAndCu consumerSession.lock must be locked before accessing this method") } - defer consumerSession.Free(nil) // we need to be locked here, if we didn't get it locked we try lock anyway + defer consumerSession.Free(nil) // we need to be locked here, if we didn't get it locked we try lock anyway + consumerSession.LatestBlock = latestServicedBlock consumerSession.CuSum += consumerSession.LatestRelayCu // add CuSum to current cu usage. consumerSession.LatestRelayCu = 0 // reset cu just in case consumerSession.ConsecutiveErrors = []error{} @@ -1079,7 +1116,7 @@ func (csm *ConsumerSessionManager) GenerateReconnectCallback(consumerSessionsWit } } -func NewConsumerSessionManager(rpcEndpoint *RPCEndpoint, providerOptimizer ProviderOptimizer, consumerMetricsManager *metrics.ConsumerMetricsManager, reporter metrics.Reporter, consumerPublicAddress string) *ConsumerSessionManager { +func NewConsumerSessionManager(rpcEndpoint *RPCEndpoint, providerOptimizer ProviderOptimizer, consumerMetricsManager *metrics.ConsumerMetricsManager, reporter metrics.Reporter, consumerPublicAddress string, activeSubscriptionProvidersStorage *ActiveSubscriptionProvidersStorage) *ConsumerSessionManager { csm := &ConsumerSessionManager{ reportedProviders: NewReportedProviders(reporter, rpcEndpoint.ChainID), consumerMetricsManager: consumerMetricsManager, @@ -1087,5 +1124,6 @@ func NewConsumerSessionManager(rpcEndpoint *RPCEndpoint, providerOptimizer Provi } csm.rpcEndpoint = rpcEndpoint csm.providerOptimizer = providerOptimizer + csm.activeSubscriptionProvidersStorage = activeSubscriptionProvidersStorage return csm } diff --git a/protocol/lavasession/consumer_session_manager_test.go b/protocol/lavasession/consumer_session_manager_test.go index d78432a6b8..ad44b5010e 100644 --- a/protocol/lavasession/consumer_session_manager_test.go +++ b/protocol/lavasession/consumer_session_manager_test.go @@ -8,16 +8,17 @@ import ( "net" "os" "strconv" + "strings" "testing" "time" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/provideroptimizer" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/rand" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/rand" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -132,7 +133,7 @@ func TestEndpointSortingFlow(t *testing.T) { require.NoError(t, err) csm := CreateConsumerSessionManager() pairingList := createPairingList("", true) - pairingList[0].Endpoints = append(pairingList[0].Endpoints, &Endpoint{NetworkAddress: delayedAddress, Enabled: true, Client: nil, ConnectionRefusals: 0}) + pairingList[0].Endpoints = append(pairingList[0].Endpoints, &Endpoint{NetworkAddress: delayedAddress, Enabled: true, Connections: []*EndpointConnection{}, ConnectionRefusals: 0}) // swap locations so that the endpoint of the delayed will be first pairingList[0].Endpoints[0], pairingList[0].Endpoints[1] = pairingList[0].Endpoints[1], pairingList[0].Endpoints[0] @@ -161,7 +162,7 @@ func TestEndpointSortingFlow(t *testing.T) { func CreateConsumerSessionManager() *ConsumerSessionManager { rand.InitRandomSeed() baseLatency := common.AverageWorldLatency / 2 // we want performance to be half our timeout or better - return NewConsumerSessionManager(&RPCEndpoint{"stub", "stub", "stub", false, "/", 0}, provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, 0, baseLatency, 1), nil, nil, "lava@test") + return NewConsumerSessionManager(&RPCEndpoint{"stub", "stub", "stub", false, "/", 0}, provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, 0, baseLatency, 1), nil, nil, "lava@test", NewActiveSubscriptionProvidersStorage()) } func TestMain(m *testing.M) { @@ -221,14 +222,29 @@ func createGRPCServer(changeListener string, probeDelay time.Duration) error { const providerStr = "provider" +type DirectiveHeaders struct { + directiveHeaders map[string]string +} + +func (bpm DirectiveHeaders) GetBlockedProviders() []string { + if bpm.directiveHeaders == nil { + return nil + } + blockedProviders, ok := bpm.directiveHeaders[common.BLOCK_PROVIDERS_ADDRESSES_HEADER_NAME] + if ok { + return strings.Split(blockedProviders, ",") + } + return nil +} + func createPairingList(providerPrefixAddress string, enabled bool) map[uint64]*ConsumerSessionsWithProvider { cswpList := make(map[uint64]*ConsumerSessionsWithProvider, 0) pairingEndpoints := make([]*Endpoint, 1) // we need a grpc server to connect to. so we use the public rpc endpoint for now. - pairingEndpoints[0] = &Endpoint{NetworkAddress: grpcListener, Enabled: enabled, Client: nil, ConnectionRefusals: 0} - pairingEndpointsWithAddon := []*Endpoint{{NetworkAddress: grpcListener, Enabled: enabled, Client: nil, ConnectionRefusals: 0, Addons: map[string]struct{}{"addon": {}}}} - pairingEndpointsWithExtension := []*Endpoint{{NetworkAddress: grpcListener, Enabled: enabled, Client: nil, ConnectionRefusals: 0, Addons: map[string]struct{}{"addon": {}}, Extensions: map[string]struct{}{"ext1": {}}}} - pairingEndpointsWithExtensions := []*Endpoint{{NetworkAddress: grpcListener, Enabled: enabled, Client: nil, ConnectionRefusals: 0, Addons: map[string]struct{}{"addon": {}}, Extensions: map[string]struct{}{"ext1": {}, "ext2": {}}}} + pairingEndpoints[0] = &Endpoint{Connections: []*EndpointConnection{}, NetworkAddress: grpcListener, Enabled: enabled, ConnectionRefusals: 0} + pairingEndpointsWithAddon := []*Endpoint{{Connections: []*EndpointConnection{}, NetworkAddress: grpcListener, Enabled: enabled, ConnectionRefusals: 0, Addons: map[string]struct{}{"addon": {}}}} + pairingEndpointsWithExtension := []*Endpoint{{Connections: []*EndpointConnection{}, NetworkAddress: grpcListener, Enabled: enabled, ConnectionRefusals: 0, Addons: map[string]struct{}{"addon": {}}, Extensions: map[string]struct{}{"ext1": {}}}} + pairingEndpointsWithExtensions := []*Endpoint{{Connections: []*EndpointConnection{}, NetworkAddress: grpcListener, Enabled: enabled, ConnectionRefusals: 0, Addons: map[string]struct{}{"addon": {}}, Extensions: map[string]struct{}{"ext1": {}, "ext2": {}}}} for p := 0; p < numberOfProviders; p++ { var endpoints []*Endpoint switch p { @@ -319,9 +335,12 @@ func TestSecondChanceRecoveryFlow(t *testing.T) { pairingList := createPairingList("", true) err := csm.UpdateAllProviders(firstEpochHeight, map[uint64]*ConsumerSessionsWithProvider{0: pairingList[0], 1: pairingList[1]}) // create two providers require.NoError(t, err) - - for i := 0; i <= MaximumNumberOfFailuresAllowedPerConsumerSession; i++ { - usedProviders := NewUsedProviders(map[string]string{"lava-providers-block": pairingList[1].PublicLavaAddress}) + timeLimit := time.Second * 30 + loopStartTime := time.Now() + for { + // implement a struct that returns: map[string]string{"lava-providers-block": pairingList[1].PublicLavaAddress} in the implementation for the DirectiveHeadersInf interface + directiveHeaders := DirectiveHeaders{map[string]string{"lava-providers-block": pairingList[1].PublicLavaAddress}} + usedProviders := NewUsedProviders(directiveHeaders) css, err := csm.GetSessions(ctx, cuForFirstRequest, usedProviders, servicedBlockNumber, "", nil, common.NO_STATE, 0) // get a session require.NoError(t, err) _, expectedProviderAddress := css[pairingList[0].PublicLavaAddress] @@ -329,14 +348,16 @@ func TestSecondChanceRecoveryFlow(t *testing.T) { for _, sessionInfo := range css { csm.OnSessionFailure(sessionInfo.Session, fmt.Errorf("testError")) } + _, ok := csm.secondChanceGivenToAddresses[pairingList[0].PublicLavaAddress] + if ok { + // should be present in secondChanceGivenToAddresses at some point. + fmt.Println(csm.secondChanceGivenToAddresses) + break + } + require.True(t, time.Since(loopStartTime) < timeLimit) } - _, ok := csm.secondChanceGivenToAddresses[pairingList[0].PublicLavaAddress] - fmt.Println(csm.secondChanceGivenToAddresses) - // should be present in secondChanceGivenToAddresses. - require.True(t, ok) // check we get provider1. - usedProviders := NewUsedProviders(nil) css, err := csm.GetSessions(ctx, cuForFirstRequest, usedProviders, servicedBlockNumber, "", nil, common.NO_STATE, 0) // get a session require.NoError(t, err) @@ -344,23 +365,49 @@ func TestSecondChanceRecoveryFlow(t *testing.T) { require.True(t, expectedProviderAddress) // check this provider is not reported. require.False(t, csm.reportedProviders.IsReported(pairingList[0].PublicLavaAddress)) + require.False(t, csm.reportedProviders.IsReported(pairingList[1].PublicLavaAddress)) // sleep for the duration of the retrySecondChanceAfter - time.Sleep(retrySecondChanceAfter + time.Second) + loopStartTime = time.Now() + for { + if func() bool { + csm.lock.RLock() + defer csm.lock.RUnlock() + utils.LavaFormatInfo("waiting for provider to return to valid addresses", utils.LogAttr("provider", pairingList[0].PublicLavaAddress), utils.LogAttr("csm.validAddresses", csm.validAddresses)) + return lavaslices.Contains(csm.validAddresses, pairingList[0].PublicLavaAddress) + }() { + utils.LavaFormatInfo("Wait Completed") + break + } + time.Sleep(time.Second) + require.True(t, time.Since(loopStartTime) < timeLimit) + } require.True(t, lavaslices.Contains(csm.validAddresses, pairingList[0].PublicLavaAddress)) require.False(t, lavaslices.Contains(csm.currentlyBlockedProviderAddresses, pairingList[0].PublicLavaAddress)) + require.Equal(t, BlockedProviderSessionUnusedStatus, csm.pairing[pairingList[0].PublicLavaAddress].blockedAndUsedWithChanceForRecoveryStatus) // now after we gave it a second chance, we give it another failure sequence, expecting it to this time be reported. - for i := 0; i <= MaximumNumberOfFailuresAllowedPerConsumerSession; i++ { - usedProviders := NewUsedProviders(map[string]string{"lava-providers-block": pairingList[1].PublicLavaAddress}) + loopStartTime = time.Now() + for { + utils.LavaFormatDebug("Test", utils.LogAttr("csm.validAddresses", csm.validAddresses), utils.LogAttr("csm.currentlyBlockedProviderAddresses", csm.currentlyBlockedProviderAddresses), utils.LogAttr("csm.pairing[pairingList[0].PublicLavaAddress].blockedAndUsedWithChanceForRecoveryStatus", csm.pairing[pairingList[0].PublicLavaAddress].blockedAndUsedWithChanceForRecoveryStatus)) + directiveHeaders := DirectiveHeaders{map[string]string{"lava-providers-block": pairingList[1].PublicLavaAddress}} + usedProviders := NewUsedProviders(directiveHeaders) + require.Equal(t, BlockedProviderSessionUnusedStatus, csm.pairing[pairingList[0].PublicLavaAddress].blockedAndUsedWithChanceForRecoveryStatus) css, err := csm.GetSessions(ctx, cuForFirstRequest, usedProviders, servicedBlockNumber, "", nil, common.NO_STATE, 0) // get a session + require.Equal(t, BlockedProviderSessionUnusedStatus, csm.pairing[pairingList[0].PublicLavaAddress].blockedAndUsedWithChanceForRecoveryStatus) require.NoError(t, err) _, expectedProviderAddress := css[pairingList[0].PublicLavaAddress] require.True(t, expectedProviderAddress) for _, sessionInfo := range css { csm.OnSessionFailure(sessionInfo.Session, fmt.Errorf("testError")) + require.Equal(t, BlockedProviderSessionUnusedStatus, csm.pairing[pairingList[0].PublicLavaAddress].blockedAndUsedWithChanceForRecoveryStatus) + } + if _, ok := csm.reportedProviders.addedToPurgeAndReport[pairingList[0].PublicLavaAddress]; ok { + break } + require.True(t, time.Since(loopStartTime) < timeLimit) } + utils.LavaFormatInfo("csm.reportedProviders", utils.LogAttr("csm.reportedProviders", csm.reportedProviders.addedToPurgeAndReport)) require.True(t, csm.reportedProviders.IsReported(pairingList[0].PublicLavaAddress)) } @@ -861,8 +908,8 @@ func TestGetSession(t *testing.T) { func TestContext(t *testing.T) { ctx := context.Background() - ctxTO, cancel := context.WithTimeout(ctx, time.Millisecond) - time.Sleep(20 * time.Millisecond) + ctxTO, cancel := context.WithTimeout(ctx, 20*time.Millisecond) + time.Sleep(2 * time.Second) require.Equal(t, ctxTO.Err(), context.DeadlineExceeded) cancel() } diff --git a/protocol/lavasession/consumer_types.go b/protocol/lavasession/consumer_types.go index 8206991909..77a50ca685 100644 --- a/protocol/lavasession/consumer_types.go +++ b/protocol/lavasession/consumer_types.go @@ -8,11 +8,11 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/provideroptimizer" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "google.golang.org/grpc" "google.golang.org/grpc/connectivity" ) @@ -41,6 +41,7 @@ func (list EndpointInfoList) Swap(i, j int) { const ( AllowInsecureConnectionToProvidersFlag = "allow-insecure-provider-dialing" AllowGRPCCompressionFlag = "allow-grpc-compression-for-consumer-provider-communication" + maximumStreamsOverASingleConnection = 100 ) var ( @@ -50,7 +51,7 @@ var ( type UsedProvidersInf interface { RemoveUsed(providerAddress string, err error) - TryLockSelection(context.Context) bool + TryLockSelection(context.Context) error AddUsed(ConsumerSessionsMap, error) GetUnwantedProvidersToSend() map[string]struct{} AddUnwantedAddresses(address string) @@ -72,7 +73,7 @@ type ProviderOptimizer interface { AppendRelayFailure(providerAddress string) AppendRelayData(providerAddress string, latency time.Duration, isHangingApi bool, cu, syncBlock uint64) ChooseProvider(allAddresses []string, ignoredProviders map[string]struct{}, cu uint64, requestedBlock int64, perturbationPercentage float64) (addresses []string) - GetExcellenceQoSReportForProvider(string) *pairingtypes.QualityOfServiceReport + GetExcellenceQoSReportForProvider(string) (*pairingtypes.QualityOfServiceReport, *pairingtypes.QualityOfServiceReport) Strategy() provideroptimizer.Strategy } @@ -82,13 +83,14 @@ type ignoredProviders struct { } type QoSReport struct { - LastQoSReport *pairingtypes.QualityOfServiceReport - LastExcellenceQoSReport *pairingtypes.QualityOfServiceReport - LatencyScoreList []sdk.Dec - SyncScoreSum int64 - TotalSyncScore int64 - TotalRelays uint64 - AnsweredRelays uint64 + LastQoSReport *pairingtypes.QualityOfServiceReport + LastExcellenceQoSReport *pairingtypes.QualityOfServiceReport + LastExcellenceQoSReportRaw *pairingtypes.QualityOfServiceReport + LatencyScoreList []sdk.Dec + SyncScoreSum int64 + TotalSyncScore int64 + TotalRelays uint64 + AnsweredRelays uint64 } type DataReliabilitySession struct { @@ -98,17 +100,76 @@ type DataReliabilitySession struct { UniqueIdentifier bool } +type EndpointConnection struct { + Client pairingtypes.RelayerClient + connection *grpc.ClientConn + numberOfSessionsUsingThisConnection uint64 + blockListed atomic.Bool + lbUniqueId string + // In case we got disconnected, we cant reconnect as we might lose stickiness + // with the provider, if its using a load balancer + disconnected bool +} + +func (ec *EndpointConnection) GetLbUniqueId() string { + return ec.lbUniqueId +} + +func (ec *EndpointConnection) addSessionUsingConnection() { + atomic.AddUint64(&ec.numberOfSessionsUsingThisConnection, 1) +} + +func (ec *EndpointConnection) decreaseSessionUsingConnection() { + for { + knownValue := ec.getNumberOfLiveSessionsUsingThisConnection() + if knownValue >= 1 { + swapped := atomic.CompareAndSwapUint64(&ec.numberOfSessionsUsingThisConnection, knownValue, knownValue-1) + if swapped { + return + } + } else { + utils.LavaFormatError("decreaseSessionUsingConnection, Value below 1 is stored in numberOfSessionsUsingThisConnection. it must always be above 1", nil) + return + } + } +} + +func (ec *EndpointConnection) getNumberOfLiveSessionsUsingThisConnection() uint64 { + return atomic.LoadUint64(&ec.numberOfSessionsUsingThisConnection) +} + +type EndpointAndChosenConnection struct { + endpoint *Endpoint + chosenEndpointConnection *EndpointConnection +} + type Endpoint struct { NetworkAddress string // change at the end to NetworkAddress Enabled bool - Client *pairingtypes.RelayerClient - connection *grpc.ClientConn + Connections []*EndpointConnection ConnectionRefusals uint64 Addons map[string]struct{} Extensions map[string]struct{} Geolocation planstypes.Geolocation } +func (e *Endpoint) CheckSupportForServices(addon string, extensions []string) (supported bool) { + if addon != "" { + if _, ok := e.Addons[addon]; !ok { + return false + } + } + for _, extension := range extensions { + if extension == "" { + continue + } + if _, ok := e.Extensions[extension]; !ok { + return false + } + } + return true +} + type SessionWithProvider struct { SessionsWithProvider *ConsumerSessionsWithProvider CurrentEpoch uint64 @@ -158,6 +219,7 @@ type ConsumerSessionsWithProvider struct { // blocked provider recovery status if 0 currently not used, if 1 a session has tried resume communication with this provider // if the provider is not blocked at all this field is irrelevant blockedAndUsedWithChanceForRecoveryStatus uint32 + StaticProvider bool } func NewConsumerSessionWithProvider(publicLavaAddress string, pairingEndpoints []*Endpoint, maxCu uint64, epoch uint64, stakeSize sdk.Coin) *ConsumerSessionsWithProvider { @@ -219,7 +281,7 @@ endpointLoop: for _, endpoint := range cswp.Endpoints { for _, extension := range extensions { if _, ok := endpoint.Extensions[extension]; !ok { - // doesn;t support the extension required, continue to next endpoint + // doesn't support the extension required, continue to next endpoint continue endpointLoop } } @@ -250,9 +312,9 @@ func (cswp *ConsumerSessionsWithProvider) validateComputeUnits(cu uint64, virtua // add additional CU for virtual epochs if (cswp.UsedComputeUnits + cu) > cswp.MaxComputeUnits*(virtualEpoch+1) { return utils.LavaFormatWarning("validateComputeUnits", MaxComputeUnitsExceededError, - utils.Attribute{Key: "cu", Value: cswp.UsedComputeUnits + cu}, - utils.Attribute{Key: "maxCu", Value: cswp.MaxComputeUnits * (virtualEpoch + 1)}, - utils.Attribute{Key: "virtualEpoch", Value: virtualEpoch}, + utils.LogAttr("cu", cswp.UsedComputeUnits+cu), + utils.LogAttr("maxCu", cswp.MaxComputeUnits*(virtualEpoch+1)), + utils.LogAttr("virtualEpoch", virtualEpoch), ) } return nil @@ -302,7 +364,7 @@ func (cswp *ConsumerSessionsWithProvider) decreaseUsedComputeUnits(cu uint64) er return nil } -func (cswp *ConsumerSessionsWithProvider) ConnectRawClientWithTimeout(ctx context.Context, addr string) (*pairingtypes.RelayerClient, *grpc.ClientConn, error) { +func (cswp *ConsumerSessionsWithProvider) ConnectRawClientWithTimeout(ctx context.Context, addr string) (pairingtypes.RelayerClient, *grpc.ClientConn, error) { connectCtx, cancel := context.WithTimeout(ctx, TimeoutForEstablishingAConnection) defer cancel() conn, err := ConnectGRPCClient(connectCtx, addr, AllowInsecureConnectionToProviders, false, AllowGRPCCompressionForConsumerProviderCommunication) @@ -326,10 +388,10 @@ func (cswp *ConsumerSessionsWithProvider) ConnectRawClientWithTimeout(ctx contex case <-ch: } c := pairingtypes.NewRelayerClient(conn) - return &c, conn, nil + return c, conn, nil } -func (cswp *ConsumerSessionsWithProvider) GetConsumerSessionInstanceFromEndpoint(endpoint *Endpoint, numberOfResets uint64) (singleConsumerSession *SingleConsumerSession, pairingEpoch uint64, err error) { +func (cswp *ConsumerSessionsWithProvider) GetConsumerSessionInstanceFromEndpoint(endpointConnection *EndpointConnection, numberOfResets uint64) (singleConsumerSession *SingleConsumerSession, pairingEpoch uint64, err error) { // TODO: validate that the endpoint even belongs to the ConsumerSessionsWithProvider and is enabled. // Multiply numberOfReset +1 by MaxAllowedBlockListedSessionPerProvider as every reset needs to allow more blocked sessions allowed. @@ -343,7 +405,7 @@ func (cswp *ConsumerSessionsWithProvider) GetConsumerSessionInstanceFromEndpoint if sessionID == DataReliabilitySessionId { continue // we cant use the data reliability session. which is located at key DataReliabilitySessionId } - if session.Endpoint != endpoint { + if session.EndpointConnection != endpointConnection { // skip sessions that don't belong to the active connection continue } @@ -370,14 +432,14 @@ func (cswp *ConsumerSessionsWithProvider) GetConsumerSessionInstanceFromEndpoint for randomSessionId == 0 { // we don't allow 0 randomSessionId = rand.Int63() } - consumerSession := &SingleConsumerSession{ - SessionId: randomSessionId, - Parent: cswp, - Endpoint: endpoint, + SessionId: randomSessionId, + Parent: cswp, + EndpointConnection: endpointConnection, + StaticProvider: cswp.StaticProvider, } - consumerSession.TryUseSession() // we must lock the session so other requests wont get it. + consumerSession.TryUseSession() // we must lock the session so other requests wont get it. cswp.Sessions[consumerSession.SessionId] = consumerSession // applying the session to the pool of sessions. return consumerSession, cswp.PairingEpoch, nil } @@ -414,9 +476,9 @@ func (cswp *ConsumerSessionsWithProvider) sortEndpointsByLatency(endpointInfos [ // fetching an endpoint from a ConsumerSessionWithProvider and establishing a connection, // can fail without an error if trying to connect once to each endpoint but none of them are active. -func (cswp *ConsumerSessionsWithProvider) fetchEndpointConnectionFromConsumerSessionWithProvider(ctx context.Context, retryDisabledEndpoints bool, getAllEndpoints bool) (connected bool, endpointsList []*Endpoint, providerAddress string, err error) { - getConnectionFromConsumerSessionsWithProvider := func(ctx context.Context) (connected bool, endpointPtr []*Endpoint, allDisabled bool) { - endpoints := make([]*Endpoint, 0) +func (cswp *ConsumerSessionsWithProvider) fetchEndpointConnectionFromConsumerSessionWithProvider(ctx context.Context, retryDisabledEndpoints bool, getAllEndpoints bool, addon string, extensionNames []string) (connected bool, endpointsList []*EndpointAndChosenConnection, providerAddress string, err error) { + getConnectionFromConsumerSessionsWithProvider := func(ctx context.Context) (connected bool, endpointPtr []*EndpointAndChosenConnection, allDisabled bool) { + endpoints := make([]*EndpointAndChosenConnection, 0) cswp.Lock.Lock() defer cswp.Lock.Unlock() for idx, endpoint := range cswp.Endpoints { @@ -425,52 +487,72 @@ func (cswp *ConsumerSessionsWithProvider) fetchEndpointConnectionFromConsumerSes if !retryDisabledEndpoints && !endpoint.Enabled { continue } - connectEndpoint := func(cswp *ConsumerSessionsWithProvider, ctx context.Context, endpoint *Endpoint) (connected_ bool) { - if endpoint.Client != nil && endpoint.connection != nil && endpoint.connection.GetState() != connectivity.Shutdown && endpoint.connection.GetState() != connectivity.Idle { - return true + + // check endpoint supports the requested addons + supported := endpoint.CheckSupportForServices(addon, extensionNames) + if !supported { + continue + } + // return + connectEndpoint := func(cswp *ConsumerSessionsWithProvider, ctx context.Context, endpoint *Endpoint) (endpointConnection_ *EndpointConnection, connected_ bool) { + for _, endpointConnection := range endpoint.Connections { + // If connection is active and we don't have more than maximumStreamsOverASingleConnection sessions using it already, + // and it didn't disconnect before. Use it. + if endpointConnection.Client != nil && endpointConnection.connection != nil && !endpointConnection.disconnected { + // Check if the endpoint is not blocked + if endpointConnection.blockListed.Load() { + continue + } + connectionState := endpointConnection.connection.GetState() + // Check Disconnections + if connectionState == connectivity.Shutdown { // || connectionState == connectivity.Idle + // We got disconnected, we can't use this connection anymore. + endpointConnection.disconnected = true + continue + } + // Check if we can use the connection later. + if connectionState == connectivity.TransientFailure || connectionState == connectivity.Connecting { + continue + } + // Check we didn't reach the maximum streams per connection. + if endpointConnection.getNumberOfLiveSessionsUsingThisConnection() < maximumStreamsOverASingleConnection { + return endpointConnection, true + } + } } client, conn, err := cswp.ConnectRawClientWithTimeout(ctx, endpoint.NetworkAddress) if err != nil { endpoint.ConnectionRefusals++ - utils.LavaFormatInfo("error connecting to provider", utils.LogAttr("err", err), utils.Attribute{Key: "provider endpoint", Value: endpoint.NetworkAddress}, utils.Attribute{Key: "provider address", Value: cswp.PublicLavaAddress}, utils.Attribute{Key: "endpoint", Value: endpoint}, utils.Attribute{Key: "refusals", Value: endpoint.ConnectionRefusals}) + utils.LavaFormatInfo("error connecting to provider", + utils.LogAttr("err", err), + utils.LogAttr("provider endpoint", endpoint.NetworkAddress), + utils.LogAttr("provider address", cswp.PublicLavaAddress), + utils.LogAttr("endpoint", endpoint), + utils.LogAttr("refusals", endpoint.ConnectionRefusals), + ) + if endpoint.ConnectionRefusals >= MaxConsecutiveConnectionAttempts { endpoint.Enabled = false - utils.LavaFormatWarning("disabling provider endpoint for the duration of current epoch.", nil, utils.Attribute{Key: "Endpoint", Value: endpoint.NetworkAddress}, utils.Attribute{Key: "address", Value: cswp.PublicLavaAddress}) + utils.LavaFormatWarning("disabling provider endpoint for the duration of current epoch.", nil, + utils.LogAttr("Endpoint", endpoint.NetworkAddress), + utils.LogAttr("address", cswp.PublicLavaAddress), + ) } - return false + return nil, false } endpoint.ConnectionRefusals = 0 - endpoint.Client = client - if endpoint.connection != nil { - endpoint.connection.Close() // just to be safe - } - endpoint.connection = conn - return true - } - endpointState := connectivity.Idle - if endpoint.connection != nil { - endpointState = endpoint.connection.GetState() + newConnection := &EndpointConnection{connection: conn, Client: client, lbUniqueId: strconv.FormatUint(utils.GenerateUniqueIdentifier(), 10)} + endpoint.Connections = append(endpoint.Connections, newConnection) + return newConnection, true } - if endpoint.Client == nil { - connected_ := connectEndpoint(cswp, ctx, endpoint) - if !connected_ { - continue - } - } else if endpointState == connectivity.Shutdown || endpointState == connectivity.Idle { - // connection was shut down, so we need to create a new one - endpoint.connection.Close() - connected_ := connectEndpoint(cswp, ctx, endpoint) - if !connected_ { - continue - } - } else if endpointState == connectivity.TransientFailure || endpointState == connectivity.Connecting { - // can't use this one right now, but we could in the future + + endpointConnection, connected_ := connectEndpoint(cswp, ctx, endpoint) + if !connected_ { continue } - cswp.Endpoints[idx] = endpoint cswp.Endpoints[idx].Enabled = true // return enabled once we successfully reconnect - // successful connection add to endpoints list - endpoints = append(endpoints, endpoint) + // successful new connection add to endpoints list + endpoints = append(endpoints, &EndpointAndChosenConnection{endpoint: endpoint, chosenEndpointConnection: endpointConnection}) if !getAllEndpoints { return true, endpoints, false } @@ -497,7 +579,10 @@ func (cswp *ConsumerSessionsWithProvider) fetchEndpointConnectionFromConsumerSes var allDisabled bool connected, endpointsList, allDisabled = getConnectionFromConsumerSessionsWithProvider(ctx) if allDisabled { - utils.LavaFormatInfo("purging provider after all endpoints are disabled", utils.Attribute{Key: "provider endpoints", Value: cswp.Endpoints}, utils.Attribute{Key: "provider address", Value: cswp.PublicLavaAddress}) + utils.LavaFormatInfo("purging provider after all endpoints are disabled", + utils.LogAttr("provider endpoints", cswp.Endpoints), + utils.LogAttr("provider address", cswp.PublicLavaAddress), + ) // report provider. return connected, endpointsList, cswp.PublicLavaAddress, AllProviderEndpointsDisabledError } diff --git a/protocol/lavasession/end_to_end_lavasession_test.go b/protocol/lavasession/end_to_end_lavasession_test.go index abc42fb087..393fa6f416 100644 --- a/protocol/lavasession/end_to_end_lavasession_test.go +++ b/protocol/lavasession/end_to_end_lavasession_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/common" + "github.com/lavanet/lava/v2/protocol/common" "github.com/stretchr/testify/require" ) @@ -146,7 +146,7 @@ func prepareSessionsWithFirstRelay(t *testing.T, cuForFirstRequest uint64) (*Con cswpList := make(map[uint64]*ConsumerSessionsWithProvider, 1) pairingEndpoints := make([]*Endpoint, 1) // we need a grpc server to connect to. so we use the public rpc endpoint for now. - pairingEndpoints[0] = &Endpoint{NetworkAddress: grpcListener, Enabled: true, Client: nil, ConnectionRefusals: 0} + pairingEndpoints[0] = &Endpoint{NetworkAddress: grpcListener, Enabled: true, Connections: []*EndpointConnection{}, ConnectionRefusals: 0} cswpList[0] = &ConsumerSessionsWithProvider{ PublicLavaAddress: "provider", Endpoints: pairingEndpoints, diff --git a/protocol/lavasession/errors.go b/protocol/lavasession/errors.go index cd61818680..4c56544666 100644 --- a/protocol/lavasession/errors.go +++ b/protocol/lavasession/errors.go @@ -26,6 +26,8 @@ var ( // Consumer Side Errors FailedToConnectToEndPointForDataReliabilityError = sdkerrors.New("FailedToConnectToEndPointForDataReliability Error", 683, "Failed to connect to a providers endpoints") DataReliabilityEpochMismatchError = sdkerrors.New("DataReliabilityEpochMismatch Error", 684, "Data reliability epoch mismatch original session epoch.") NoDataReliabilitySessionWasCreatedError = sdkerrors.New("NoDataReliabilitySessionWasCreated Error", 685, "No Data reliability session was created") + ContextDoneNoNeedToLockSelectionError = sdkerrors.New("ContextDoneNoNeedToLockSelection Error", 687, "Context deadline exceeded while trying to lock selection") + BlockEndpointError = sdkerrors.New("BlockEndpoint Error", 688, "Block the endpoint") ) var ( // Provider Side Errors diff --git a/protocol/lavasession/provider_session_manager.go b/protocol/lavasession/provider_session_manager.go index c7042fca09..cc805168b4 100644 --- a/protocol/lavasession/provider_session_manager.go +++ b/protocol/lavasession/provider_session_manager.go @@ -5,9 +5,9 @@ import ( "sync" "sync/atomic" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) type ProviderSessionManager struct { @@ -272,7 +272,6 @@ func filterOldEpochEntries[T dataHandler](blockedEpochHeight uint64, allEpochsMa if !IsEpochValidForUse(epochStored, blockedEpochHeight) { // epoch is not valid so we don't keep its key in the new map - // in the case of subscribe, we need to unsubscribe before deleting the key from storage. value.onDeleteEvent() continue @@ -283,110 +282,6 @@ func filterOldEpochEntries[T dataHandler](blockedEpochHeight uint64, allEpochsMa return } -func (psm *ProviderSessionManager) ProcessUnsubscribe(apiName, subscriptionID, consumerAddress string, epoch uint64) error { - providerSessionWithConsumer, activeError := psm.getActiveProjectFromConsumerAddress(consumerAddress, epoch) - if activeError != nil { - return utils.LavaFormatError("[ProcessUnsubscribe] Couldn't find providerSessionWithConsumer", activeError, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "address", Value: consumerAddress}) - } - - psm.lock.Lock() - defer psm.lock.Unlock() - var err error - if apiName == TendermintUnsubscribeAll { - // unsubscribe all subscriptions - for _, v := range providerSessionWithConsumer.ongoingSubscriptions { - if v.Sub == nil { - err = utils.LavaFormatError("[ProcessUnsubscribe] TendermintUnsubscribeAll providerSessionWithConsumer.ongoingSubscriptions Error", SubscriptionPointerIsNilError, utils.Attribute{Key: "subscripionId", Value: subscriptionID}) - } else { - v.Sub.Unsubscribe() - } - } - providerSessionWithConsumer.ongoingSubscriptions = make(map[string]*RPCSubscription) // delete the entire map. - return err - } - - subscription, foundSubscription := providerSessionWithConsumer.ongoingSubscriptions[subscriptionID] - if !foundSubscription { - return utils.LavaFormatError("Couldn't find subscription Id in psm.subscriptionSessionsWithAllConsumers", nil, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "address", Value: consumerAddress}, utils.Attribute{Key: "subscriptionId", Value: subscriptionID}) - } - - if subscription.Sub == nil { - err = utils.LavaFormatError("ProcessUnsubscribe Error", SubscriptionPointerIsNilError, utils.Attribute{Key: "subscripionId", Value: subscriptionID}) - } else { - subscription.Sub.Unsubscribe() - } - delete(providerSessionWithConsumer.ongoingSubscriptions, subscriptionID) // delete subscription after finished with it - return err -} - -// use this method when unlocked. -func (psm *ProviderSessionManager) getActiveProjectFromConsumerAddress(consumerAddress string, epoch uint64) (*ProviderSessionsWithConsumerProject, error) { - projectId, found := psm.readConsumerToPairedWithProjectMap(consumerAddress, epoch) - if !found { - return nil, utils.LavaFormatError("getActiveProjectFromConsumerAddress Couldn't find consumerAddress readConsumerToPairedWithProjectMap", nil, - utils.Attribute{Key: "epoch", Value: epoch}, - utils.Attribute{Key: "address", Value: consumerAddress}, - ) - } - providerSessionWithConsumer, activeError := psm.IsActiveProject(epoch, projectId) - if activeError != nil { - return nil, utils.LavaFormatError("getActiveProjectFromConsumerAddress Couldn't find projectId in psm.subscriptionSessionsWithAllConsumers", activeError, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "address", Value: projectId}) - } - return providerSessionWithConsumer, nil -} - -func (psm *ProviderSessionManager) addSubscriptionToStorage(subscription *RPCSubscription, consumerAddress string, epoch uint64) error { - // we already validated the epoch is valid in the GetSessions no need to verify again. - providerSessionWithConsumer, activeError := psm.getActiveProjectFromConsumerAddress(consumerAddress, epoch) - if activeError != nil { - return utils.LavaFormatError("[addSubscriptionToStorage] Couldn't find providerSessionWithConsumer", activeError, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "address", Value: consumerAddress}) - } - - psm.lock.Lock() - defer psm.lock.Unlock() - _, foundSubscription := providerSessionWithConsumer.ongoingSubscriptions[subscription.Id] - if !foundSubscription { - // we shouldnt find a subscription already in the storage. - providerSessionWithConsumer.ongoingSubscriptions[subscription.Id] = subscription - return nil // successfully added subscription to storage - } - - // if we get here we found a subscription already in the storage and we need to return an error as we can't add two subscriptions with the same id - return utils.LavaFormatError("addSubscription", SubscriptionAlreadyExistsError, utils.Attribute{Key: "SubscriptionId", Value: subscription.Id}, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "address", Value: consumerAddress}) -} - -func (psm *ProviderSessionManager) ReleaseSessionAndCreateSubscription(session *SingleProviderSession, subscription *RPCSubscription, consumerAddress string, epoch, relayNumber uint64) error { - err := psm.OnSessionDone(session, relayNumber) - if err != nil { - return utils.LavaFormatError("Failed ReleaseSessionAndCreateSubscription", err) - } - return psm.addSubscriptionToStorage(subscription, consumerAddress, epoch) -} - -// try to disconnect the subscription incase we got an error. -// if fails to find assumes it was unsubscribed normally -func (psm *ProviderSessionManager) SubscriptionEnded(consumerAddress string, epoch uint64, subscriptionID string) { - providerSessionWithConsumer, activeError := psm.getActiveProjectFromConsumerAddress(consumerAddress, epoch) - if activeError != nil { - utils.LavaFormatError("[SubscriptionEnded] Couldn't find providerSessionWithConsumer, this must be found when getting here", activeError, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "address", Value: consumerAddress}) - return - } - - psm.lock.Lock() - defer psm.lock.Unlock() - subscription, foundSubscription := providerSessionWithConsumer.ongoingSubscriptions[subscriptionID] - if !foundSubscription { - return - } - - if subscription.Sub == nil { // validate subscription not nil - utils.LavaFormatError("SubscriptionEnded Error", SubscriptionPointerIsNilError, utils.Attribute{Key: "subscripionId", Value: subscription.Id}) - } else { - subscription.Sub.Unsubscribe() - } - delete(providerSessionWithConsumer.ongoingSubscriptions, subscriptionID) // delete subscription after finished with it -} - // Called when the reward server has information on a higher cu proof and usage and this providerSessionsManager needs to sync up on it func (psm *ProviderSessionManager) UpdateSessionCU(consumerAddress string, epoch, sessionID, newCU uint64) error { // load the session and update the CU inside diff --git a/protocol/lavasession/provider_session_manager_test.go b/protocol/lavasession/provider_session_manager_test.go index 0af1160957..16d4efb9d6 100644 --- a/protocol/lavasession/provider_session_manager_test.go +++ b/protocol/lavasession/provider_session_manager_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) @@ -20,8 +20,6 @@ const ( dataReliabilityRelayCu = uint64(0) epoch1 = uint64(10) sessionId = uint64(123) - subscriptionID = "124" - subscriptionID2 = "125" dataReliabilitySessionId = uint64(0) relayNumber = uint64(1) relayNumberBeforeUse = uint64(0) @@ -556,192 +554,6 @@ func TestPSMCUMisMatch(t *testing.T) { require.True(t, ProviderConsumerCuMisMatch.Is(err)) } -func TestPSMSubscribeHappyFlowProcessUnsubscribe(t *testing.T) { - // init test - psm, sps := prepareSession(t, context.Background()) - - // validate subscription map is empty - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - - // subscribe - var channel chan interface{} - subscription := &RPCSubscription{ - Id: subscriptionID, - Sub: nil, - SubscribeRepliesChan: channel, - } - psm.ReleaseSessionAndCreateSubscription(sps, subscription, consumerOneAddress, epoch1, relayNumber) - - // verify state after subscription creation - require.True(t, LockMisUseDetectedError.Is(sps.VerifyLock())) // validating session was unlocked. - require.NotEmpty(t, psm.sessionsWithAllConsumers) - _, foundSubscription := psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions[subscriptionID] - require.True(t, foundSubscription) - - err := psm.ProcessUnsubscribe("unsubscribe", subscriptionID, consumerOneAddress, epoch1) - require.True(t, SubscriptionPointerIsNilError.Is(err)) - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) -} - -func TestPSMSubscribeHappyFlowProcessUnsubscribeUnsubscribeAll(t *testing.T) { - // init test - psm, sps := prepareSession(t, context.Background()) - - // validate subscription map is empty - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - - // subscribe - var channel chan interface{} - subscription := &RPCSubscription{ - Id: subscriptionID, - Sub: nil, - SubscribeRepliesChan: channel, - } - subscription2 := &RPCSubscription{ - Id: subscriptionID2, - Sub: nil, - SubscribeRepliesChan: channel, - } - psm.ReleaseSessionAndCreateSubscription(sps, subscription, consumerOneAddress, epoch1, relayNumber) - - sps, err := psm.GetSession(context.Background(), consumerOneAddress, epoch1, sessionId, relayNumber+1, nil) - require.NoError(t, err) - require.NotNil(t, sps) - - // create 2nd subscription - psm.ReleaseSessionAndCreateSubscription(sps, subscription2, consumerOneAddress, epoch1, relayNumber+1) - - // verify state after subscription creation - require.True(t, LockMisUseDetectedError.Is(sps.VerifyLock())) // validating session was unlocked. - require.NotEmpty(t, psm.sessionsWithAllConsumers) - _, foundSubscription := psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions[subscriptionID] - require.True(t, foundSubscription) - _, foundSubscription2 := psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions[subscriptionID2] - require.True(t, foundSubscription2) - - err = psm.ProcessUnsubscribe(TendermintUnsubscribeAll, subscriptionID, consumerOneAddress, epoch1) - require.True(t, SubscriptionPointerIsNilError.Is(err)) - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) -} - -func TestPSMSubscribeHappyFlowProcessUnsubscribeUnsubscribeOneOutOfTwo(t *testing.T) { - // init test - psm, sps := prepareSession(t, context.Background()) - - // validate subscription map is empty - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - - // subscribe - var channel chan interface{} - subscription := &RPCSubscription{ - Id: subscriptionID, - Sub: nil, - SubscribeRepliesChan: channel, - } - subscription2 := &RPCSubscription{ - Id: subscriptionID2, - Sub: nil, - SubscribeRepliesChan: channel, - } - psm.ReleaseSessionAndCreateSubscription(sps, subscription, consumerOneAddress, epoch1, relayNumber) - // create 2nd subscription as we release the session we can just ask for it again with relayNumber + 1 - sps, err := psm.GetSession(context.Background(), consumerOneAddress, epoch1, sessionId, relayNumber+1, nil) - require.NoError(t, err) - psm.ReleaseSessionAndCreateSubscription(sps, subscription2, consumerOneAddress, epoch1, relayNumber+1) - - err = psm.ProcessUnsubscribe("unsubscribeOne", subscriptionID, consumerOneAddress, epoch1) - require.True(t, SubscriptionPointerIsNilError.Is(err)) - require.NotEmpty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - _, foundId2 := psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions[subscriptionID2] - require.True(t, foundId2) -} - -func TestPSMSubscribeHappyFlowSubscriptionEnded(t *testing.T) { - // init test - psm, sps := prepareSession(t, context.Background()) - - // validate subscription map is empty - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - - // subscribe - var channel chan interface{} - subscription := &RPCSubscription{ - Id: subscriptionID, - Sub: nil, - SubscribeRepliesChan: channel, - } - psm.ReleaseSessionAndCreateSubscription(sps, subscription, consumerOneAddress, epoch1, relayNumber) - - // verify state after subscription creation - require.True(t, LockMisUseDetectedError.Is(sps.VerifyLock())) // validating session was unlocked. - require.NotEmpty(t, psm.sessionsWithAllConsumers) - _, foundSubscription := psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions[subscriptionID] - require.True(t, foundSubscription) - - psm.SubscriptionEnded(consumerOneAddress, epoch1, subscriptionID) - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) -} - -func TestPSMSubscribeHappyFlowSubscriptionEndedOneOutOfTwo(t *testing.T) { - // init test - psm, sps := prepareSession(t, context.Background()) - - // validate subscription map is empty - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - - // subscribe - var channel chan interface{} - subscription := &RPCSubscription{ - Id: subscriptionID, - Sub: nil, - SubscribeRepliesChan: channel, - } - subscription2 := &RPCSubscription{ - Id: subscriptionID2, - Sub: nil, - SubscribeRepliesChan: channel, - } - psm.ReleaseSessionAndCreateSubscription(sps, subscription, consumerOneAddress, epoch1, relayNumber) - // create 2nd subscription as we release the session we can just ask for it again with relayNumber + 1 - sps, err := psm.GetSession(context.Background(), consumerOneAddress, epoch1, sessionId, relayNumber+1, nil) - require.NoError(t, err) - psm.ReleaseSessionAndCreateSubscription(sps, subscription2, consumerOneAddress, epoch1, relayNumber) - - psm.SubscriptionEnded(consumerOneAddress, epoch1, subscriptionID) - require.NotEmpty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - _, foundId2 := psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions[subscriptionID2] - require.True(t, foundId2) -} - -func TestPSMSubscribeEpochChange(t *testing.T) { - // init test - psm, sps := prepareSession(t, context.Background()) - - // validate subscription map is empty - require.Empty(t, psm.sessionsWithAllConsumers[epoch1].sessionMap[projectId].ongoingSubscriptions) - - // subscribe - var channel chan interface{} - subscription := &RPCSubscription{ - Id: subscriptionID, - Sub: nil, - SubscribeRepliesChan: channel, - } - subscription2 := &RPCSubscription{ - Id: subscriptionID2, - Sub: nil, - SubscribeRepliesChan: channel, - } - psm.ReleaseSessionAndCreateSubscription(sps, subscription, consumerOneAddress, epoch1, relayNumber) - // create 2nd subscription as we release the session we can just ask for it again with relayNumber + 1 - sps, err := psm.GetSession(context.Background(), consumerOneAddress, epoch1, sessionId, relayNumber+1, nil) - require.NoError(t, err) - psm.ReleaseSessionAndCreateSubscription(sps, subscription2, consumerOneAddress, epoch1, relayNumber+1) - - psm.UpdateEpoch(epoch2) - require.Empty(t, psm.sessionsWithAllConsumers[epoch2]) -} - type testSessionData struct { currentCU uint64 inUse bool diff --git a/protocol/lavasession/provider_types.go b/protocol/lavasession/provider_types.go index 8ebbdf5321..df9dcc7634 100644 --- a/protocol/lavasession/provider_types.go +++ b/protocol/lavasession/provider_types.go @@ -7,9 +7,9 @@ import ( "sync" "sync/atomic" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" ) type ProviderSessionsEpochData struct { diff --git a/protocol/lavasession/reported_providers.go b/protocol/lavasession/reported_providers.go index 9bd6c33195..25d7efb9de 100644 --- a/protocol/lavasession/reported_providers.go +++ b/protocol/lavasession/reported_providers.go @@ -4,9 +4,9 @@ import ( "sync" "time" - metrics "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + metrics "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) const ( diff --git a/protocol/lavasession/router_key.go b/protocol/lavasession/router_key.go index 441bdc6660..291e543235 100644 --- a/protocol/lavasession/router_key.go +++ b/protocol/lavasession/router_key.go @@ -2,15 +2,22 @@ package lavasession import ( "sort" + "strconv" "strings" ) const ( - sep = "|" + sep = "|" + methodRouteSep = "method-route:" ) type RouterKey string +func (rk *RouterKey) ApplyMethodsRoute(routeNum int) RouterKey { + additionalPath := strconv.FormatInt(int64(routeNum), 10) + return RouterKey(string(*rk) + methodRouteSep + additionalPath) +} + func NewRouterKey(extensions []string) RouterKey { // make sure addons have no repetitions uniqueExtensions := map[string]struct{}{} diff --git a/protocol/lavasession/single_consumer_session.go b/protocol/lavasession/single_consumer_session.go index 4e6d2c9365..92d698ed56 100644 --- a/protocol/lavasession/single_consumer_session.go +++ b/protocol/lavasession/single_consumer_session.go @@ -7,24 +7,27 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) type SingleConsumerSession struct { - CuSum uint64 - LatestRelayCu uint64 // set by GetSessions cuNeededForSession - QoSInfo QoSReport - SessionId int64 - Parent *ConsumerSessionsWithProvider - lock utils.LavaMutex - RelayNum uint64 - LatestBlock int64 - Endpoint *Endpoint - BlockListed bool // if session lost sync we blacklist it. - ConsecutiveErrors []error - errorsCount uint64 - relayProcessor UsedProvidersInf + CuSum uint64 + LatestRelayCu uint64 // set by GetSessions cuNeededForSession + QoSInfo QoSReport + SessionId int64 + Parent *ConsumerSessionsWithProvider + lock utils.LavaMutex + RelayNum uint64 + LatestBlock int64 + // Each session will holds a pointer to a connection, if the connection is lost, this session will be banned (wont be picked) + EndpointConnection *EndpointConnection + BlockListed bool // if session lost sync we blacklist it. + ConsecutiveErrors []error + errorsCount uint64 + relayProcessor UsedProvidersInf + providerUniqueId string + StaticProvider bool } // returns the expected latency to a threshold. @@ -100,12 +103,13 @@ func (cs *SingleConsumerSession) CalculateQoS(latency, expectedLatency time.Dura } } -func (scs *SingleConsumerSession) SetUsageForSession(cuNeededForSession uint64, qoSExcellenceReport *pairingtypes.QualityOfServiceReport, usedProviders UsedProvidersInf) error { +func (scs *SingleConsumerSession) SetUsageForSession(cuNeededForSession uint64, qoSExcellenceReport *pairingtypes.QualityOfServiceReport, rawQoSExcellenceReport *pairingtypes.QualityOfServiceReport, usedProviders UsedProvidersInf) error { scs.LatestRelayCu = cuNeededForSession // set latestRelayCu scs.RelayNum += RelayNumberIncrement // increase relayNum if scs.RelayNum > 1 { // we only set excellence for sessions with more than one successful relays, this guarantees data within the epoch exists scs.QoSInfo.LastExcellenceQoSReport = qoSExcellenceReport + scs.QoSInfo.LastExcellenceQoSReportRaw = rawQoSExcellenceReport } scs.relayProcessor = usedProviders return nil @@ -116,6 +120,7 @@ func (scs *SingleConsumerSession) Free(err error) { scs.relayProcessor.RemoveUsed(scs.Parent.PublicLavaAddress, err) scs.relayProcessor = nil } + scs.EndpointConnection.decreaseSessionUsingConnection() scs.lock.Unlock() } @@ -131,6 +136,7 @@ func (session *SingleConsumerSession) TryUseSession() (blocked bool, ok bool) { session.lock.Unlock() return true, false } + session.EndpointConnection.addSessionUsingConnection() return false, true } return false, false @@ -148,3 +154,21 @@ func (consumerSession *SingleConsumerSession) VerifyLock() error { } return nil } + +func (scs *SingleConsumerSession) VerifyProviderUniqueIdAndStoreIfFirstTime(providerUniqueId string) bool { + if scs.providerUniqueId == "" { + utils.LavaFormatTrace("First time getting providerUniqueId for SingleConsumerSession", + utils.LogAttr("sessionId", scs.SessionId), + utils.LogAttr("providerUniqueId", providerUniqueId), + ) + + scs.providerUniqueId = providerUniqueId + return true + } + + return providerUniqueId == scs.providerUniqueId +} + +func (scs *SingleConsumerSession) GetProviderUniqueId() string { + return scs.providerUniqueId +} diff --git a/protocol/lavasession/single_provider_session.go b/protocol/lavasession/single_provider_session.go index e42ee5bdf8..256cd94e2b 100644 --- a/protocol/lavasession/single_provider_session.go +++ b/protocol/lavasession/single_provider_session.go @@ -6,7 +6,7 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) const ( diff --git a/protocol/lavasession/used_providers.go b/protocol/lavasession/used_providers.go index 2b61b22e1c..b1d72de953 100644 --- a/protocol/lavasession/used_providers.go +++ b/protocol/lavasession/used_providers.go @@ -2,28 +2,34 @@ package lavasession import ( "context" - "strings" "sync" "time" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) -const MaximumNumberOfSelectionLockAttempts = 10000 +const MaximumNumberOfSelectionLockAttempts = 500 -func NewUsedProviders(directiveHeaders map[string]string) *UsedProviders { +type BlockedProvidersInf interface { + GetBlockedProviders() []string +} + +func NewUsedProviders(blockedProviders BlockedProvidersInf) *UsedProviders { unwantedProviders := map[string]struct{}{} - if len(directiveHeaders) > 0 { - blockedProviders, ok := directiveHeaders[common.BLOCK_PROVIDERS_ADDRESSES_HEADER_NAME] - if ok { - providerAddressesToBlock := strings.Split(blockedProviders, ",") + if blockedProviders != nil { + providerAddressesToBlock := blockedProviders.GetBlockedProviders() + if len(providerAddressesToBlock) > 0 { for _, providerAddress := range providerAddressesToBlock { unwantedProviders[providerAddress] = struct{}{} } } } - return &UsedProviders{providers: map[string]struct{}{}, unwantedProviders: unwantedProviders, blockOnSyncLoss: map[string]struct{}{}, erroredProviders: map[string]struct{}{}} + return &UsedProviders{ + providers: map[string]struct{}{}, + unwantedProviders: unwantedProviders, + blockOnSyncLoss: map[string]struct{}{}, + erroredProviders: map[string]struct{}{}, + } } type UsedProviders struct { @@ -155,26 +161,26 @@ func (up *UsedProviders) setUnwanted(provider string) { up.unwantedProviders[provider] = struct{}{} } -func (up *UsedProviders) TryLockSelection(ctx context.Context) bool { +func (up *UsedProviders) TryLockSelection(ctx context.Context) error { if up == nil { - return true + return nil } for counter := 0; counter < MaximumNumberOfSelectionLockAttempts; counter++ { select { case <-ctx.Done(): - return false + utils.LavaFormatTrace("Failed locking selection, context is done") + return ContextDoneNoNeedToLockSelectionError default: canSelect := up.tryLockSelection() if canSelect { - return true + return nil } - time.Sleep(10 * time.Millisecond) + time.Sleep(5 * time.Millisecond) } } // if we got here we failed locking the selection. - utils.LavaFormatError("Failed locking selection after MaximumNumberOfSelectionLockAttempts", nil) - return false + return utils.LavaFormatError("Failed locking selection after MaximumNumberOfSelectionLockAttempts", nil, utils.LogAttr("GUID", ctx)) } func (up *UsedProviders) tryLockSelection() bool { diff --git a/protocol/lavasession/used_providers_test.go b/protocol/lavasession/used_providers_test.go index 042394b4e5..30f3c7a641 100644 --- a/protocol/lavasession/used_providers_test.go +++ b/protocol/lavasession/used_providers_test.go @@ -62,7 +62,7 @@ func TestUsedProvidersAsync(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100) defer cancel() canUse := usedProviders.TryLockSelection(ctx) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) go func() { @@ -73,7 +73,7 @@ func TestUsedProvidersAsync(t *testing.T) { ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*100) defer cancel() canUseAgain := usedProviders.TryLockSelection(ctx) - require.True(t, canUseAgain) + require.Nil(t, canUseAgain) unwanted := usedProviders.GetUnwantedProvidersToSend() require.Len(t, unwanted, 2) require.Equal(t, 2, usedProviders.CurrentlyUsed()) @@ -83,17 +83,32 @@ func TestUsedProvidersAsync(t *testing.T) { func TestUsedProvidersAsyncFail(t *testing.T) { t.Run("concurrency", func(t *testing.T) { usedProviders := NewUsedProviders(nil) - ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) defer cancel() canUse := usedProviders.TryLockSelection(ctx) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) - ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*10) + ctx, cancel = context.WithTimeout(context.Background(), time.Second*15) defer cancel() canUseAgain := usedProviders.TryLockSelection(ctx) - require.False(t, canUseAgain) - err := ctx.Err() - require.Error(t, err) + require.Error(t, canUseAgain) + }) +} + +func TestUsedProviderContextTimeout(t *testing.T) { + t.Run("concurrency", func(t *testing.T) { + usedProviders := NewUsedProviders(nil) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + canUse := usedProviders.TryLockSelection(ctx) + require.Nil(t, canUse) + require.Zero(t, usedProviders.CurrentlyUsed()) + require.Zero(t, usedProviders.SessionsLatestBatch()) + ctx, cancel = context.WithTimeout(context.Background(), time.Second*1) + defer cancel() + canUseAgain := usedProviders.TryLockSelection(ctx) + require.Error(t, canUseAgain) + require.True(t, ContextDoneNoNeedToLockSelectionError.Is(canUseAgain)) }) } diff --git a/protocol/loadtest/testing.go b/protocol/loadtest/testing.go new file mode 100644 index 0000000000..2b1ddd6b54 --- /dev/null +++ b/protocol/loadtest/testing.go @@ -0,0 +1,184 @@ +package loadtest + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strconv" + "strings" + "sync" + "time" + + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/v2/utils" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +func startLoadTest(endpoint string, parallelClients int, callsPerClient int, method string, data string) { + wg := sync.WaitGroup{} + wg.Add(parallelClients) + + singleClient := func() { + defer wg.Done() + requestCreateErrors := 0 + failToSendErrors := 0 + non200StatusErrors := 0 + readBodyErrors := 0 + + sendRequest := func() (*http.Response, error) { + var body io.Reader + if method == "POST" { + body = bytes.NewBuffer([]byte(data)) + } else { + body = nil + } + + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) + defer cancel() + req, err := http.NewRequestWithContext(ctx, method, endpoint, body) + if err != nil { + utils.LavaFormatError("Failed to create request", err) + requestCreateErrors++ + return nil, err + } + + client := http.Client{ + Transport: &http.Transport{ + MaxIdleConnsPerHost: 10000, + }, + } + + resp, err := client.Do(req) + if err != nil { + utils.LavaFormatDebug("Failed to send request", utils.LogAttr("error", err)) + failToSendErrors++ + return nil, err + } + + return resp, nil + } + + for j := 0; j < callsPerClient; j++ { + resp, err := sendRequest() + if err != nil { + continue + } + + if resp.StatusCode != http.StatusOK { + bodyBytes, err := io.ReadAll(resp.Body) + if err != nil { + utils.LavaFormatDebug("Failed to read response body", utils.LogAttr("error", err)) + readBodyErrors++ + } + + utils.LavaFormatDebug("Received non-200 status code", + utils.LogAttr("statusCode", resp.StatusCode), + utils.LogAttr("responseData", string(bodyBytes)), + ) + + non200StatusErrors++ + continue + } + } + + utils.LavaFormatInfo("Client finished", + utils.LogAttr("failToSendErrorCount", failToSendErrors), + utils.LogAttr("non200StatusErrorCount", non200StatusErrors), + utils.LogAttr("readBodyErrorCount", readBodyErrors), + utils.LogAttr("clientCreateErrorCount", requestCreateErrors), + ) + } + + for i := 0; i < parallelClients; i++ { + utils.LavaFormatDebug("Starting client", utils.LogAttr("client", i)) + go singleClient() + } + + wg.Wait() +} + +func CreateTestLoadCobraCommand() *cobra.Command { + cmdTestLoad := &cobra.Command{ + Use: `load [--data ]`, + Short: `run a load test on the given endpoint, with the given number of parallel clients, and the given number of calls per client`, + Example: `load "http://127.0.0.1:3361" 50 20 POST --data '{"jsonrpc":"2.0","method":"status","params":[],"id":"1"}' +load "http://127.0.0.1:3361/cosmos/base/tendermint/v1beta1/blocks/latest" 50 20 GET`, + Args: func(cmd *cobra.Command, args []string) error { + if err := cobra.RangeArgs(4, 5)(cmd, args); err != nil { + return fmt.Errorf("invalid number of arguments, either its a single config file or repeated groups of 4 HOST:PORT chain-id api-interface [node_url,node_url_2], arg count: %d", len(args)) + } + return nil + }, + RunE: func(cmd *cobra.Command, args []string) error { + utils.LavaFormatInfo("Load Test started", utils.LogAttr("args", strings.Join(args, ";"))) + + logLevel, err := cmd.Flags().GetString(flags.FlagLogLevel) + if err != nil { + utils.LavaFormatFatal("failed to read log level flag", err) + } + + utils.SetGlobalLoggingLevel(logLevel) + + endpoint := args[0] + parallelClients := args[1] + callsPerClient := args[2] + method := args[3] + data := "" + if len(args) == 5 { + data = args[4] + } else if viper.IsSet("data") { + data = viper.GetString("data") + var dataJson map[string]interface{} + err := json.Unmarshal([]byte(data), &dataJson) + if err != nil { + return fmt.Errorf("invalid data, must be a valid json object") + } + } + + if method != "GET" && method != "POST" { + return fmt.Errorf("invalid method, only GET and POST are supported") + } + + if method == "GET" && data != "" { + return fmt.Errorf("GET method does not support data") + } + + if method == "POST" && data == "" { + return fmt.Errorf("POST method requires data") + } + + parallelClientsInt, err := strconv.Atoi(parallelClients) + if err != nil { + return fmt.Errorf("parallel clients must be an integer") + } + + if parallelClientsInt <= 0 { + return fmt.Errorf("parallel clients must be greater than 0") + } + + callsPerClientInt, err := strconv.Atoi(callsPerClient) + if err != nil { + return fmt.Errorf("calls per client must be an integer") + } + + if callsPerClientInt <= 0 { + return fmt.Errorf("calls per client must be greater than 0") + } + + if !strings.HasPrefix(endpoint, "http://") && !strings.HasPrefix(endpoint, "https://") { + return fmt.Errorf("invalid endpoint, must start with http:// or https://") + } + + startLoadTest(endpoint, parallelClientsInt, callsPerClientInt, method, data) + return nil + }, + } + + cmdTestLoad.Flags().String(flags.FlagLogLevel, "debug", "log level") + cmdTestLoad.Flags().String("data", "", "The data to send with the request") + return cmdTestLoad +} diff --git a/protocol/metrics/analytics.go b/protocol/metrics/analytics.go index 11048fc135..8e40e41740 100644 --- a/protocol/metrics/analytics.go +++ b/protocol/metrics/analytics.go @@ -13,16 +13,18 @@ const ( ) type RelayMetrics struct { - ProjectHash string - Timestamp time.Time - ChainID string - APIType string - Latency int64 - Success bool - ComputeUnits uint64 - Source RelaySource - Origin string - ApiMethod string + ProjectHash string + Timestamp time.Time + ChainID string + APIType string + Latency int64 + Success bool + ComputeUnits uint64 + Source RelaySource + Origin string + ApiMethod string + ProcessingTimestamp time.Time + MeasureAfterProviderProcessingTime bool // we measure processing time only on first relay success so we use this to indicate that the after provider measurement should occur (not true for all code flows) } type RelayAnalyticsDTO struct { @@ -47,3 +49,19 @@ func NewRelayAnalytics(projectHash, chainId, apiType string) *RelayMetrics { Source: GatewaySource, } } + +func (rm *RelayMetrics) SetProcessingTimestampBeforeRelay(timestamp time.Time) { + if rm == nil { + return + } + rm.ProcessingTimestamp = timestamp +} + +func (rm *RelayMetrics) SetProcessingTimestampAfterRelay(timestamp time.Time) { + if rm == nil { + return + } + // we use this flag to make sure the relay passed successfully. (only the first relay has the RelayMetrics) + rm.MeasureAfterProviderProcessingTime = true + rm.ProcessingTimestamp = timestamp +} diff --git a/protocol/metrics/consumer_referrer_client.go b/protocol/metrics/consumer_referrer_client.go index ce4621f953..da4be0d72b 100644 --- a/protocol/metrics/consumer_referrer_client.go +++ b/protocol/metrics/consumer_referrer_client.go @@ -6,7 +6,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) const ( diff --git a/protocol/metrics/consumer_relayserver_client.go b/protocol/metrics/consumer_relayserver_client.go index 107c9fb77c..be74610f21 100644 --- a/protocol/metrics/consumer_relayserver_client.go +++ b/protocol/metrics/consumer_relayserver_client.go @@ -10,7 +10,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type ConsumerRelayServerClient struct { diff --git a/protocol/metrics/consumer_reports_client.go b/protocol/metrics/consumer_reports_client.go index fd900105a3..e575596295 100644 --- a/protocol/metrics/consumer_reports_client.go +++ b/protocol/metrics/consumer_reports_client.go @@ -6,8 +6,8 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) const ( diff --git a/protocol/metrics/consumer_reports_client_test.go b/protocol/metrics/consumer_reports_client_test.go index 8ca7393159..ca86c9c1fc 100644 --- a/protocol/metrics/consumer_reports_client_test.go +++ b/protocol/metrics/consumer_reports_client_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/metrics/health_metrics.go b/protocol/metrics/health_metrics.go index 159eef9f88..9643666f4c 100644 --- a/protocol/metrics/health_metrics.go +++ b/protocol/metrics/health_metrics.go @@ -3,7 +3,7 @@ package metrics import ( "net/http" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/protocol/metrics/metricsService.go b/protocol/metrics/metricsService.go index 7ce99601c2..5a69987564 100644 --- a/protocol/metrics/metricsService.go +++ b/protocol/metrics/metricsService.go @@ -9,7 +9,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type AggregatedMetric struct { diff --git a/protocol/metrics/metrics_consumer_manager.go b/protocol/metrics/metrics_consumer_manager.go index 1d3816b9b2..24a6fd9eda 100644 --- a/protocol/metrics/metrics_consumer_manager.go +++ b/protocol/metrics/metrics_consumer_manager.go @@ -7,8 +7,8 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) @@ -26,30 +26,33 @@ func (lt *LatencyTracker) AddLatency(latency time.Duration) { } type ConsumerMetricsManager struct { - totalCURequestedMetric *prometheus.CounterVec - totalRelaysRequestedMetric *prometheus.CounterVec - totalErroredMetric *prometheus.CounterVec - totalRelaysSentToProvidersMetric *prometheus.CounterVec - totalRelaysReturnedFromProvidersMetric *prometheus.CounterVec - totalRelaysSentByNewBatchTickerMetric *prometheus.CounterVec - currentNumberOfOpenSessionsMetric *prometheus.GaugeVec - currentNumberOfBlockedSessionsMetric *prometheus.GaugeVec - blockMetric *prometheus.GaugeVec - latencyMetric *prometheus.GaugeVec - qosMetric *prometheus.GaugeVec - qosExcellenceMetric *prometheus.GaugeVec - LatestBlockMetric *prometheus.GaugeVec - LatestProviderRelay *prometheus.GaugeVec - virtualEpochMetric *prometheus.GaugeVec - apiMethodCalls *prometheus.GaugeVec - endpointsHealthChecksOkMetric prometheus.Gauge - endpointsHealthChecksOk uint64 - lock sync.Mutex - protocolVersionMetric *prometheus.GaugeVec - providerRelays map[string]uint64 - addMethodsApiGauge bool - averageLatencyPerChain map[string]*LatencyTracker // key == chain Id + api interface - averageLatencyMetric *prometheus.GaugeVec + totalCURequestedMetric *prometheus.CounterVec + totalRelaysRequestedMetric *prometheus.CounterVec + totalErroredMetric *prometheus.CounterVec + totalNodeErroredMetric *prometheus.CounterVec + totalNodeErroredRecoveredSuccessfullyMetric *prometheus.CounterVec + totalNodeErroredRecoveryAttemptsMetric *prometheus.CounterVec + totalRelaysSentToProvidersMetric *prometheus.CounterVec + totalRelaysSentByNewBatchTickerMetric *prometheus.CounterVec + blockMetric *prometheus.GaugeVec + latencyMetric *prometheus.GaugeVec + qosMetric *prometheus.GaugeVec + qosExcellenceMetric *prometheus.GaugeVec + LatestBlockMetric *prometheus.GaugeVec + LatestProviderRelay *prometheus.GaugeVec + virtualEpochMetric *prometheus.GaugeVec + apiMethodCalls *prometheus.GaugeVec + endpointsHealthChecksOkMetric prometheus.Gauge + endpointsHealthChecksOk uint64 + lock sync.Mutex + protocolVersionMetric *prometheus.GaugeVec + providerRelays map[string]uint64 + addMethodsApiGauge bool + averageLatencyPerChain map[string]*LatencyTracker // key == chain Id + api interface + averageLatencyMetric *prometheus.GaugeVec + relayProcessingLatencyBeforeProvider *prometheus.GaugeVec + relayProcessingLatencyAfterProvider *prometheus.GaugeVec + averageProcessingLatency map[string]*LatencyTracker } type ConsumerMetricsManagerOptions struct { @@ -62,6 +65,7 @@ func NewConsumerMetricsManager(options ConsumerMetricsManagerOptions) *ConsumerM utils.LavaFormatWarning("prometheus endpoint inactive, option is disabled", nil) return nil } + totalCURequestedMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "lava_consumer_total_cu_requested", Help: "The total number of CUs requested by the consumer over time.", @@ -73,26 +77,10 @@ func NewConsumerMetricsManager(options ConsumerMetricsManagerOptions) *ConsumerM Help: "The total number of relays serviced by the consumer over time.", }, []string{"spec", "apiInterface"}) - totalRelaysSentToProvidersMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ - Name: "lava_consumer_total_relays_sent_to_providers", - Help: "The total number of relays sent to providers", - }, []string{"spec", "apiInterface"}) - totalRelaysReturnedFromProvidersMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ - Name: "lava_consumer_total_relays_returned_from_providers", - Help: "The total number of relays returned from providers", - }, []string{"spec", "apiInterface"}) totalRelaysSentByNewBatchTickerMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "lava_consumer_total_relays_sent_by_batch_ticker", Help: "The total number of relays sent by the batch ticker", }, []string{"spec", "apiInterface"}) - currentNumberOfOpenSessionsMetric := prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Name: "lava_consumer_current_number_of_open_sessions", - Help: "The total number of currently open sessions", - }, []string{"spec", "apiInterface", "provider"}) - currentNumberOfBlockedSessionsMetric := prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Name: "lava_consumer_current_number_of_blocked_sessions", - Help: "The total number of currently blocked sessions", - }, []string{"spec", "apiInterface", "provider"}) // Create a new GaugeVec metric to represent the TotalErrored over time. totalErroredMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ @@ -124,18 +112,22 @@ func NewConsumerMetricsManager(options ConsumerMetricsManagerOptions) *ConsumerM Name: "lava_consumer_latest_provider_block", Help: "The latest block reported by provider", }, []string{"spec", "provider_address", "apiInterface"}) + latestProviderRelay := prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "lava_consumer_latest_provider_relay_time", Help: "The latest time we sent a relay to provider", }, []string{"spec", "provider_address", "apiInterface"}) + virtualEpochMetric := prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "virtual_epoch", Help: "The current virtual epoch measured", }, []string{"spec"}) + endpointsHealthChecksOkMetric := prometheus.NewGauge(prometheus.GaugeOpts{ Name: "lava_consumer_overall_health", Help: "At least one endpoint is healthy", }) + apiSpecificsMetric := prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "lava_consumer_api_specifics", Help: "api usage specifics", @@ -146,10 +138,42 @@ func NewConsumerMetricsManager(options ConsumerMetricsManagerOptions) *ConsumerM Name: "lava_consumer_protocol_version", Help: "The current running lavap version for the process. major := version / 1000000, minor := (version / 1000) % 1000, patch := version % 1000", }, []string{"version"}) + averageLatencyMetric := prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "lava_consumer_average_latency_in_milliseconds", Help: "average latency per chain id per api interface", }, []string{"spec", "apiInterface"}) + + totalRelaysSentToProvidersMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "lava_consumer_total_relays_sent_to_providers", + Help: "The total number of relays sent to providers", + }, []string{"spec", "apiInterface"}) + + totalNodeErroredMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "lava_consumer_total_node_errors_received_from_providers", + Help: "The total number of relays sent to providers and returned a node error", + }, []string{"spec", "apiInterface"}) + + totalNodeErroredRecoveredSuccessfullyMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "lava_consumer_total_node_errors_recovered_successfully", + Help: "The total number of node errors that managed to recover using a retry", + }, []string{"spec", "apiInterface", "attempt"}) + + totalNodeErroredRecoveryAttemptsMetric := prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "lava_consumer_total_node_errors_recovery_attempts", + Help: "The total number of retries sent due to retry mechanism", + }, []string{"spec", "apiInterface"}) + + relayProcessingLatencyBeforeProvider := prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "lava_relay_processing_latency_before_provider_in_micro_seconds", + Help: "average latency of processing a successful relay before it is sent to the provider in µs (10^6)", + }, []string{"spec", "apiInterface"}) + + relayProcessingLatencyAfterProvider := prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "lava_relay_processing_latency_after_provider_in_micro_seconds", + Help: "average latency of processing a successful relay after it is received from the provider in µs (10^6)", + }, []string{"spec", "apiInterface"}) + // Register the metrics with the Prometheus registry. prometheus.MustRegister(totalCURequestedMetric) prometheus.MustRegister(totalRelaysRequestedMetric) @@ -163,39 +187,43 @@ func NewConsumerMetricsManager(options ConsumerMetricsManagerOptions) *ConsumerM prometheus.MustRegister(virtualEpochMetric) prometheus.MustRegister(endpointsHealthChecksOkMetric) prometheus.MustRegister(protocolVersionMetric) - // metrics related to session management - prometheus.MustRegister(totalRelaysSentToProvidersMetric) - prometheus.MustRegister(totalRelaysReturnedFromProvidersMetric) prometheus.MustRegister(totalRelaysSentByNewBatchTickerMetric) - prometheus.MustRegister(currentNumberOfOpenSessionsMetric) - prometheus.MustRegister(currentNumberOfBlockedSessionsMetric) prometheus.MustRegister(apiSpecificsMetric) prometheus.MustRegister(averageLatencyMetric) + prometheus.MustRegister(totalRelaysSentToProvidersMetric) + prometheus.MustRegister(totalNodeErroredMetric) + prometheus.MustRegister(totalNodeErroredRecoveredSuccessfullyMetric) + prometheus.MustRegister(totalNodeErroredRecoveryAttemptsMetric) + prometheus.MustRegister(relayProcessingLatencyBeforeProvider) + prometheus.MustRegister(relayProcessingLatencyAfterProvider) consumerMetricsManager := &ConsumerMetricsManager{ - totalCURequestedMetric: totalCURequestedMetric, - totalRelaysRequestedMetric: totalRelaysRequestedMetric, - totalErroredMetric: totalErroredMetric, - blockMetric: blockMetric, - latencyMetric: latencyMetric, - qosMetric: qosMetric, - qosExcellenceMetric: qosExcellenceMetric, - LatestBlockMetric: latestBlockMetric, - LatestProviderRelay: latestProviderRelay, - providerRelays: map[string]uint64{}, - averageLatencyPerChain: map[string]*LatencyTracker{}, - virtualEpochMetric: virtualEpochMetric, - endpointsHealthChecksOkMetric: endpointsHealthChecksOkMetric, - endpointsHealthChecksOk: 1, - protocolVersionMetric: protocolVersionMetric, - averageLatencyMetric: averageLatencyMetric, - totalRelaysSentToProvidersMetric: totalRelaysSentToProvidersMetric, - totalRelaysReturnedFromProvidersMetric: totalRelaysReturnedFromProvidersMetric, - totalRelaysSentByNewBatchTickerMetric: totalRelaysSentByNewBatchTickerMetric, - currentNumberOfOpenSessionsMetric: currentNumberOfOpenSessionsMetric, - currentNumberOfBlockedSessionsMetric: currentNumberOfBlockedSessionsMetric, - apiMethodCalls: apiSpecificsMetric, - addMethodsApiGauge: options.AddMethodsApiGauge, + totalCURequestedMetric: totalCURequestedMetric, + totalRelaysRequestedMetric: totalRelaysRequestedMetric, + totalErroredMetric: totalErroredMetric, + blockMetric: blockMetric, + latencyMetric: latencyMetric, + qosMetric: qosMetric, + qosExcellenceMetric: qosExcellenceMetric, + LatestBlockMetric: latestBlockMetric, + LatestProviderRelay: latestProviderRelay, + providerRelays: map[string]uint64{}, + averageLatencyPerChain: map[string]*LatencyTracker{}, + virtualEpochMetric: virtualEpochMetric, + endpointsHealthChecksOkMetric: endpointsHealthChecksOkMetric, + endpointsHealthChecksOk: 1, + protocolVersionMetric: protocolVersionMetric, + averageLatencyMetric: averageLatencyMetric, + totalRelaysSentByNewBatchTickerMetric: totalRelaysSentByNewBatchTickerMetric, + apiMethodCalls: apiSpecificsMetric, + addMethodsApiGauge: options.AddMethodsApiGauge, + totalNodeErroredMetric: totalNodeErroredMetric, + totalNodeErroredRecoveredSuccessfullyMetric: totalNodeErroredRecoveredSuccessfullyMetric, + totalNodeErroredRecoveryAttemptsMetric: totalNodeErroredRecoveryAttemptsMetric, + totalRelaysSentToProvidersMetric: totalRelaysSentToProvidersMetric, + relayProcessingLatencyBeforeProvider: relayProcessingLatencyBeforeProvider, + relayProcessingLatencyAfterProvider: relayProcessingLatencyAfterProvider, + averageProcessingLatency: map[string]*LatencyTracker{}, } http.Handle("/metrics", promhttp.Handler()) @@ -224,6 +252,34 @@ func NewConsumerMetricsManager(options ConsumerMetricsManagerOptions) *ConsumerM return consumerMetricsManager } +func (pme *ConsumerMetricsManager) SetRelaySentToProviderMetric(chainId string, apiInterface string) { + if pme == nil { + return + } + pme.totalRelaysSentToProvidersMetric.WithLabelValues(chainId, apiInterface).Inc() +} + +func (pme *ConsumerMetricsManager) SetRelayNodeErrorMetric(chainId string, apiInterface string) { + if pme == nil { + return + } + pme.totalNodeErroredMetric.WithLabelValues(chainId, apiInterface).Inc() +} + +func (pme *ConsumerMetricsManager) SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string) { + if pme == nil { + return + } + pme.totalNodeErroredRecoveredSuccessfullyMetric.WithLabelValues(chainId, apiInterface, attempt).Inc() +} + +func (pme *ConsumerMetricsManager) SetNodeErrorAttemptMetric(chainId string, apiInterface string) { + if pme == nil { + return + } + pme.totalNodeErroredRecoveryAttemptsMetric.WithLabelValues(chainId, apiInterface).Inc() +} + func (pme *ConsumerMetricsManager) SetBlock(block int64) { if pme == nil { return @@ -247,58 +303,52 @@ func (pme *ConsumerMetricsManager) SetRelayMetrics(relayMetric *RelayMetrics, er } } -func (pme *ConsumerMetricsManager) SetRelaySentToProviderMetric(chainId string, apiInterface string) { - if pme == nil { - return - } - pme.totalRelaysSentToProvidersMetric.WithLabelValues(chainId, apiInterface).Inc() -} - -func (pme *ConsumerMetricsManager) SetRelayReturnedFromProviderMetric(chainId string, apiInterface string) { +func (pme *ConsumerMetricsManager) SetRelayProcessingLatencyBeforeProvider(latency time.Duration, chainId string, apiInterface string) { if pme == nil { return } - pme.totalRelaysReturnedFromProvidersMetric.WithLabelValues(chainId, apiInterface).Inc() + key := pme.getKeyForProcessingLatency(chainId, apiInterface, "before") + updatedLatency := pme.updateRelayProcessingLatency(latency, key) + pme.relayProcessingLatencyBeforeProvider.WithLabelValues(chainId, apiInterface).Set(updatedLatency) } -func (pme *ConsumerMetricsManager) SetRelaySentByNewBatchTickerMetric(chainId string, apiInterface string) { +func (pme *ConsumerMetricsManager) SetRelayProcessingLatencyAfterProvider(latency time.Duration, chainId string, apiInterface string) { if pme == nil { return } - pme.totalRelaysSentByNewBatchTickerMetric.WithLabelValues(chainId, apiInterface).Inc() + key := pme.getKeyForProcessingLatency(chainId, apiInterface, "after") + updatedLatency := pme.updateRelayProcessingLatency(latency, key) + pme.relayProcessingLatencyAfterProvider.WithLabelValues(chainId, apiInterface).Set(updatedLatency) } -func (pme *ConsumerMetricsManager) AddOpenSessionMetric(chainId string, apiInterface string, provider string) { - if pme == nil { - return - } +func (pme *ConsumerMetricsManager) updateRelayProcessingLatency(latency time.Duration, key string) float64 { pme.lock.Lock() defer pme.lock.Unlock() - pme.currentNumberOfOpenSessionsMetric.WithLabelValues(chainId, apiInterface, provider).Inc() -} -func (pme *ConsumerMetricsManager) DecrementOpenSessionMetric(chainId string, apiInterface string, provider string) { - if pme == nil { - return + currentLatency, ok := pme.averageProcessingLatency[key] + if !ok { + currentLatency = &LatencyTracker{AverageLatency: time.Duration(0), TotalRequests: 0} } - pme.lock.Lock() - defer pme.lock.Unlock() - pme.currentNumberOfOpenSessionsMetric.WithLabelValues(chainId, apiInterface, provider).Dec() + currentLatency.AddLatency(latency) + pme.averageProcessingLatency[key] = currentLatency + return float64(currentLatency.AverageLatency.Microseconds()) } -func (pme *ConsumerMetricsManager) AddNumberOfBlockedSessionMetric(chainId string, apiInterface string, provider string) { +func (pme *ConsumerMetricsManager) SetRelaySentByNewBatchTickerMetric(chainId string, apiInterface string) { if pme == nil { return } - pme.lock.Lock() - defer pme.lock.Unlock() - pme.currentNumberOfBlockedSessionsMetric.WithLabelValues(chainId, apiInterface, provider).Inc() + pme.totalRelaysSentByNewBatchTickerMetric.WithLabelValues(chainId, apiInterface).Inc() } func (pme *ConsumerMetricsManager) getKeyForAverageLatency(chainId string, apiInterface string) string { return chainId + apiInterface } +func (pme *ConsumerMetricsManager) getKeyForProcessingLatency(chainId string, apiInterface string, header string) string { + return header + "_" + chainId + "_" + apiInterface +} + func (pme *ConsumerMetricsManager) SetQOSMetrics(chainId string, apiInterface string, providerAddress string, qos *pairingtypes.QualityOfServiceReport, qosExcellence *pairingtypes.QualityOfServiceReport, latestBlock int64, relays uint64, relayLatency time.Duration, sessionSuccessful bool) { if pme == nil { return @@ -389,8 +439,6 @@ func (pme *ConsumerMetricsManager) ResetSessionRelatedMetrics() { defer pme.lock.Unlock() pme.qosMetric.Reset() pme.qosExcellenceMetric.Reset() - pme.currentNumberOfBlockedSessionsMetric.Reset() - pme.currentNumberOfOpenSessionsMetric.Reset() pme.providerRelays = map[string]uint64{} } diff --git a/protocol/metrics/metrics_provider.go b/protocol/metrics/metrics_provider.go index f786f068d6..38aae4f2ae 100644 --- a/protocol/metrics/metrics_provider.go +++ b/protocol/metrics/metrics_provider.go @@ -3,7 +3,7 @@ package metrics import ( "sync" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/prometheus/client_golang/prometheus" ) diff --git a/protocol/metrics/metrics_provider_manager.go b/protocol/metrics/metrics_provider_manager.go index 721a2faa49..420f31f897 100644 --- a/protocol/metrics/metrics_provider_manager.go +++ b/protocol/metrics/metrics_provider_manager.go @@ -7,8 +7,8 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/utils" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) diff --git a/protocol/metrics/queue_sender.go b/protocol/metrics/queue_sender.go index 7c78b18a5f..ad311f9eeb 100644 --- a/protocol/metrics/queue_sender.go +++ b/protocol/metrics/queue_sender.go @@ -11,7 +11,7 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type QueueSender struct { diff --git a/protocol/metrics/relays_monitor.go b/protocol/metrics/relays_monitor.go index aafdaa47c9..09c6545995 100644 --- a/protocol/metrics/relays_monitor.go +++ b/protocol/metrics/relays_monitor.go @@ -6,7 +6,7 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type RelaysMonitor struct { diff --git a/protocol/metrics/rpcconsumerlogs.go b/protocol/metrics/rpcconsumerlogs.go index 2fb8202a5a..74a066dffa 100644 --- a/protocol/metrics/rpcconsumerlogs.go +++ b/protocol/metrics/rpcconsumerlogs.go @@ -12,9 +12,9 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" "github.com/joho/godotenv" - "github.com/lavanet/lava/protocol/parser" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" + "github.com/lavanet/lava/v2/protocol/parser" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" "github.com/newrelic/go-agent/v3/newrelic" "google.golang.org/grpc/metadata" ) @@ -87,6 +87,22 @@ func NewRPCConsumerLogs(consumerMetricsManager *ConsumerMetricsManager, consumer return rpcConsumerLogs, err } +func (rpccl *RPCConsumerLogs) SetRelaySentToProviderMetric(chainId string, apiInterface string) { + rpccl.consumerMetricsManager.SetRelaySentToProviderMetric(chainId, apiInterface) +} + +func (rpccl *RPCConsumerLogs) SetRelayNodeErrorMetric(chainId string, apiInterface string) { + rpccl.consumerMetricsManager.SetRelayNodeErrorMetric(chainId, apiInterface) +} + +func (rpccl *RPCConsumerLogs) SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string) { + rpccl.consumerMetricsManager.SetNodeErrorRecoveredSuccessfullyMetric(chainId, apiInterface, attempt) +} + +func (rpccl *RPCConsumerLogs) SetNodeErrorAttemptMetric(chainId string, apiInterface string) { + rpccl.consumerMetricsManager.SetNodeErrorAttemptMetric(chainId, apiInterface) +} + func (rpccl *RPCConsumerLogs) GetMessageSeed() string { return "GUID_" + strconv.Itoa(rand.Intn(10000000000)) } @@ -113,22 +129,24 @@ func (rpccl *RPCConsumerLogs) GetUniqueGuidResponseForError(responseError error, } // Websocket healthy disconnections throw "websocket: close 1005 (no status)" error, -// We dont want to alert error monitoring for that purpses. -func (rpccl *RPCConsumerLogs) AnalyzeWebSocketErrorAndWriteMessage(c *websocket.Conn, mt int, err error, msgSeed string, msg []byte, rpcType string, timeTaken time.Duration) { +// We don't want to alert error monitoring for that purpses. +func (rpccl *RPCConsumerLogs) AnalyzeWebSocketErrorAndGetFormattedMessage(webSocketAddr string, err error, msgSeed string, msg []byte, rpcType string, timeTaken time.Duration) []byte { if err != nil { errMessage := err.Error() if strings.Contains(errMessage, webSocketCloseMessage) { utils.LavaFormatDebug("Websocket connection closed by the user, " + errMessage) - return + return nil } - rpccl.LogRequestAndResponse(rpcType+" ws msg", true, "ws", c.LocalAddr().String(), string(msg), "", msgSeed, timeTaken, err) + rpccl.LogRequestAndResponse(rpcType+" ws msg", true, "ws", webSocketAddr, string(msg), "", msgSeed, timeTaken, err) jsonResponse, _ := json.Marshal(fiber.Map{ "Error_Received": rpccl.GetUniqueGuidResponseForError(err, msgSeed), }) - c.WriteMessage(mt, jsonResponse) + return jsonResponse } + + return nil } func (rpccl *RPCConsumerLogs) LogRequestAndResponse(module string, hasError bool, method, path, req, resp, msgSeed string, timeTaken time.Duration, err error) { @@ -154,6 +172,20 @@ func (rpccl *RPCConsumerLogs) LogStartTransaction(name string) func() { } } +// AddMetricForProcessingLatencyBeforeProvider adds a time calculation metric for the consumer's processing time before sending a relay to a provider +// it returns whether the latency was added or not +func (rpccl *RPCConsumerLogs) AddMetricForProcessingLatencyBeforeProvider(analytics *RelayMetrics, chainId string, apiInterface string) { + if analytics != nil && analytics.ProcessingTimestamp.Before(time.Now()) { + go rpccl.consumerMetricsManager.SetRelayProcessingLatencyBeforeProvider(time.Since(analytics.ProcessingTimestamp), chainId, apiInterface) + } +} + +func (rpccl *RPCConsumerLogs) AddMetricForProcessingLatencyAfterProvider(analytics *RelayMetrics, chainId string, apiInterface string) { + if analytics != nil && analytics.MeasureAfterProviderProcessingTime && analytics.ProcessingTimestamp.Before(time.Now()) { + go rpccl.consumerMetricsManager.SetRelayProcessingLatencyAfterProvider(time.Since(analytics.ProcessingTimestamp), chainId, apiInterface) + } +} + func (rpccl *RPCConsumerLogs) AddMetricForHttp(data *RelayMetrics, err error, headers map[string][]string) { rpccl.consumerMetricsManager.SetRelayMetrics(data, err) rpccl.consumerRelayServerClient.SetRelayMetrics(data) @@ -212,14 +244,6 @@ func (rpccl *RPCConsumerLogs) shouldCountMetrics(refererHeaderValue string, user return true } -func (rpccl *RPCConsumerLogs) SetRelaySentToProviderMetric(chainId string, apiInterface string) { - rpccl.consumerMetricsManager.SetRelaySentToProviderMetric(chainId, apiInterface) -} - -func (rpccl *RPCConsumerLogs) SetRelayReturnedFromProviderMetric(chainId string, apiInterface string) { - rpccl.consumerMetricsManager.SetRelayReturnedFromProviderMetric(chainId, apiInterface) -} - func (rpccl *RPCConsumerLogs) SetRelaySentByNewBatchTickerMetric(chainId string, apiInterface string) { rpccl.consumerMetricsManager.SetRelaySentByNewBatchTickerMetric(chainId, apiInterface) } diff --git a/protocol/metrics/rpcconsumerlogs_test.go b/protocol/metrics/rpcconsumerlogs_test.go index 3801a7a185..a8482eb93c 100644 --- a/protocol/metrics/rpcconsumerlogs_test.go +++ b/protocol/metrics/rpcconsumerlogs_test.go @@ -9,7 +9,7 @@ import ( "github.com/gofiber/fiber/v2" "github.com/gofiber/websocket/v2" websocket2 "github.com/gorilla/websocket" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/stretchr/testify/assert" ) @@ -60,7 +60,9 @@ func TestAnalyzeWebSocketErrorAndWriteMessage(t *testing.T) { mt, _, _ := c.ReadMessage() plog, _ := NewRPCConsumerLogs(nil, nil) responseError := errors.New("response error") - plog.AnalyzeWebSocketErrorAndWriteMessage(c, mt, responseError, "seed", []byte{}, "rpcType", 1*time.Millisecond) + formatterMsg := plog.AnalyzeWebSocketErrorAndGetFormattedMessage(c.LocalAddr().String(), responseError, "seed", []byte{}, "rpcType", 1*time.Millisecond) + assert.NotNil(t, formatterMsg) + c.WriteMessage(mt, formatterMsg) })) listenFunc := func() { diff --git a/protocol/monitoring/alerting.go b/protocol/monitoring/alerting.go index cd8efa9b4f..f9d3d8a5b7 100644 --- a/protocol/monitoring/alerting.go +++ b/protocol/monitoring/alerting.go @@ -11,8 +11,8 @@ import ( "github.com/goccy/go-json" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" ) const ( diff --git a/protocol/monitoring/health.go b/protocol/monitoring/health.go index c206286757..a928bf31bb 100644 --- a/protocol/monitoring/health.go +++ b/protocol/monitoring/health.go @@ -11,20 +11,20 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/gogo/status" - lvutil "github.com/lavanet/lava/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/rpcprovider" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - spectypes "github.com/lavanet/lava/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" + lvutil "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/rpcprovider" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/viper" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -648,16 +648,8 @@ func CheckProviders(ctx context.Context, clientCtx client.Context, healthResults for _, endpoint := range providerEntry.Endpoints { checkOneProvider := func(endpoint epochstoragetypes.Endpoint, apiInterface string, addon string, providerEntry epochstoragetypes.StakeEntry) (time.Duration, string, int64, error) { cswp := lavasession.ConsumerSessionsWithProvider{} - - var relayerClientPt *pairingtypes.RelayerClient - var conn *grpc.ClientConn - var err error - - for i := 0; i < 3; i++ { - relayerClientPt, conn, err = cswp.ConnectRawClientWithTimeout(ctx, endpoint.IPPORT) - if err == nil { - break - } + relayerClient, conn, err := cswp.ConnectRawClientWithTimeout(ctx, endpoint.IPPORT) + if err != nil { utils.LavaFormatDebug("failed connecting to provider endpoint", utils.LogAttr("error", err), utils.Attribute{Key: "apiInterface", Value: apiInterface}, utils.Attribute{Key: "addon", Value: addon}, utils.Attribute{Key: "chainID", Value: providerEntry.Chain}, utils.Attribute{Key: "network address", Value: endpoint.IPPORT}) } @@ -666,7 +658,6 @@ func CheckProviders(ctx context.Context, clientCtx client.Context, healthResults } defer conn.Close() - relayerClient := *relayerClientPt guid := uint64(rand.Int63()) relaySentTime := time.Now() probeReq := &pairingtypes.ProbeRequest{ @@ -758,10 +749,10 @@ func CheckProviders(ctx context.Context, clientCtx client.Context, healthResults func prettifyProviderError(err error) string { code := status.Code(err) - if code == codes.Code(lavaprotocol.UnhandledRelayReceiverError.ABCICode()) { + if code == codes.Code(protocolerrors.UnhandledRelayReceiverError.ABCICode()) { return "provider running with unhandled support" } - if code == codes.Code(lavaprotocol.DisabledRelayReceiverError.ABCICode()) { + if code == codes.Code(protocolerrors.DisabledRelayReceiverError.ABCICode()) { return "provider running with disabled support due to verification" } if len(err.Error()) < NiceOutputLength { diff --git a/protocol/monitoring/health_cmd.go b/protocol/monitoring/health_cmd.go index 839c65cba8..24a72e98bc 100644 --- a/protocol/monitoring/health_cmd.go +++ b/protocol/monitoring/health_cmd.go @@ -13,12 +13,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -73,7 +73,7 @@ func CreateHealthCobraCommand() *cobra.Command { Short: `start monitoring the health of the protocol processes defined in the config`, Long: `config_file if a path to a yml file`, Example: `health config/health_examples/health_config.yml -example health config files can be found in https://github.com/lavanet/lava/blob/main/config/health_examples +example health config files can be found in https://github.com/lavanet/lava/v2/blob/main/config/health_examples subscription_addresses: - lava@... - lava@... diff --git a/protocol/monitoring/health_results.go b/protocol/monitoring/health_results.go index 1cf3c1a551..f85ed23404 100644 --- a/protocol/monitoring/health_results.go +++ b/protocol/monitoring/health_results.go @@ -4,9 +4,9 @@ import ( "sync" "time" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils/lavaslices" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils/lavaslices" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type HealthResults struct { diff --git a/protocol/parser/parser.go b/protocol/parser/parser.go index 210a0f37e4..7921dd3de8 100644 --- a/protocol/parser/parser.go +++ b/protocol/parser/parser.go @@ -8,17 +8,19 @@ import ( "strings" "github.com/goccy/go-json" + "github.com/itchyny/gojq" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( PARSE_PARAMS = 0 PARSE_RESULT = 1 - debug = false + + MinimumHashLength = 32 // minimum hash length is 32 bits, which is MD5. SHA-1=40, SHA256=64, SHA512=128. ) var ValueNotSetError = sdkerrors.New("Value Not Set ", 6662, "when trying to parse, the value that we attempted to parse did not exist") @@ -29,6 +31,7 @@ type RPCInput interface { ParseBlock(block string) (int64, error) GetHeaders() []pairingtypes.Metadata GetMethod() string + GetID() json.RawMessage } func ParseDefaultBlockParameter(block string) (int64, error) { @@ -65,30 +68,122 @@ func ParseDefaultBlockParameter(block string) (int64, error) { return blockNum, nil } -// this function returns the block that was requested, -func ParseBlockFromParams(rpcInput RPCInput, blockParser spectypes.BlockParser) (int64, error) { - result, err := parse(rpcInput, blockParser, PARSE_PARAMS) - if err != nil || result == nil { - return spectypes.NOT_APPLICABLE, err - } - resString, ok := result[0].(string) - if !ok { - return spectypes.NOT_APPLICABLE, fmt.Errorf("ParseBlockFromParams - result[0].(string) - type assertion failed, type:" + fmt.Sprintf("%s", result[0])) +func getParserTypeMap(parserType int) map[spectypes.PARSER_TYPE]struct{} { + switch parserType { + case PARSE_PARAMS: + return map[spectypes.PARSER_TYPE]struct{}{ + spectypes.PARSER_TYPE_BLOCK_LATEST: {}, + spectypes.PARSER_TYPE_DEFAULT_VALUE: {}, + spectypes.PARSER_TYPE_BLOCK_HASH: {}, + } + case PARSE_RESULT: + return map[spectypes.PARSER_TYPE]struct{}{ + spectypes.PARSER_TYPE_RESULT: {}, + } + default: + utils.LavaFormatError("missing parserType", nil, utils.LogAttr("parserType", parserType)) + return map[spectypes.PARSER_TYPE]struct{}{} } - parsedBlock, err := rpcInput.ParseBlock(resString) - if err != nil { - if blockParser.DefaultValue != "" { - utils.LavaFormatDebug("Failed parsing block from string, assuming default value", utils.LogAttr("failed_parsed_value", resString), utils.LogAttr("default_value", blockParser.DefaultValue)) - return rpcInput.ParseBlock(blockParser.DefaultValue) +} + +func filterGenericParsersByType(genericParsers []spectypes.GenericParser, filterMap map[spectypes.PARSER_TYPE]struct{}) []spectypes.GenericParser { + retGenericParsers := []spectypes.GenericParser{} + for _, parser := range genericParsers { + if _, ok := filterMap[parser.ParseType]; ok { + retGenericParsers = append(retGenericParsers, parser) } } - return parsedBlock, err + return retGenericParsers +} + +func parseInputFromParamsWithGenericParsers(rpcInput RPCInput, genericParsers []spectypes.GenericParser) (*ParsedInput, bool) { + parsedSuccessfully := false + if len(genericParsers) == 0 { + return nil, parsedSuccessfully + } + + genericParserResult, genericParserErr := ParseWithGenericParsers(rpcInput, filterGenericParsersByType(genericParsers, getParserTypeMap(PARSE_PARAMS))) + if genericParserErr != nil { + return nil, parsedSuccessfully + } + + parsed := NewParsedInput() + parsedBlock := genericParserResult.GetBlock() + if parsedBlock != spectypes.NOT_APPLICABLE { + parsedSuccessfully = true + parsed.parsedBlock = parsedBlock + } + + parsedBlockHashes, err := genericParserResult.GetBlockHashes() + if err == nil { + parsed.parsedHashes = parsedBlockHashes + } + + return parsed, parsedSuccessfully +} + +func ParseBlockFromParams(rpcInput RPCInput, blockParser spectypes.BlockParser, genericParsers []spectypes.GenericParser) *ParsedInput { + parsedBlockInfo, parsedSuccessfully := parseInputFromParamsWithGenericParsers(rpcInput, genericParsers) + if parsedSuccessfully { + return parsedBlockInfo + } + if parsedBlockInfo == nil { + parsedBlockInfo = NewParsedInput() + } + + parsedBlockInfo.parsedBlock = func() int64 { + // first we try to parse the value with the block parser + result, err := parse(rpcInput, blockParser, PARSE_PARAMS) + if err != nil || result == nil { + utils.LavaFormatDebug("ParseBlockFromParams - parse failed", + utils.LogAttr("error", err), + utils.LogAttr("result", result), + utils.LogAttr("blockParser", blockParser), + utils.LogAttr("rpcInput", rpcInput), + ) + return spectypes.NOT_APPLICABLE + } + + resString, ok := result[0].(string) + if !ok { + utils.LavaFormatDebug("ParseBlockFromParams - result[0].(string) - type assertion failed", utils.LogAttr("result[0]", result[0])) + return spectypes.NOT_APPLICABLE + } + parsedBlock, err := rpcInput.ParseBlock(resString) + if err != nil { + if blockParser.DefaultValue != "" { + utils.LavaFormatDebug("Failed parsing block from string, assuming default value", + utils.LogAttr("params", rpcInput.GetParams()), + utils.LogAttr("failed_parsed_value", resString), + utils.LogAttr("default_value", blockParser.DefaultValue), + ) + parsedBlock, err = rpcInput.ParseBlock(blockParser.DefaultValue) + if err != nil { + utils.LavaFormatError("Failed parsing default value, setting to NOT_APPLICABLE", err, + utils.LogAttr("default_value", blockParser.DefaultValue), + ) + return spectypes.NOT_APPLICABLE + } + } else { + return spectypes.NOT_APPLICABLE + } + } + return parsedBlock + }() + + return parsedBlockInfo } // This returns the parsed response without decoding func ParseFromReply(rpcInput RPCInput, blockParser spectypes.BlockParser) (string, error) { result, err := parse(rpcInput, blockParser, PARSE_RESULT) if err != nil || result == nil { + utils.LavaFormatDebug("ParseBlockFromParams - parse failed", + utils.LogAttr("error", err), + utils.LogAttr("result", result), + utils.LogAttr("blockParser", blockParser), + utils.LogAttr("rpcInput", rpcInput), + ) return "", err } @@ -155,11 +250,194 @@ func parse(rpcInput RPCInput, blockParser spectypes.BlockParser, dataSource int) } } - if debug { - utils.LavaFormatDebug("parsed block:", utils.LogAttr("retval", retval)) + return retval, nil +} + +type ParsedInput struct { + parsedBlock int64 + parsedHashes []string +} + +func NewParsedInput() *ParsedInput { + return &ParsedInput{ + parsedBlock: spectypes.NOT_APPLICABLE, + parsedHashes: make([]string, 0), + } +} + +func (p *ParsedInput) SetBlock(block int64) { + p.parsedBlock = block +} + +func (p *ParsedInput) GetBlock() int64 { + return p.parsedBlock +} + +func (p *ParsedInput) GetBlockHashes() ([]string, error) { + if len(p.parsedHashes) == 0 { + return nil, fmt.Errorf("no parsed hashes found") } + return p.parsedHashes, nil +} - return retval, nil +func getMapForParse(rpcInput RPCInput) map[string]interface{} { + return map[string]interface{}{"params": rpcInput.GetParams(), "result": rpcInput.GetResult()} +} + +func ParseWithGenericParsers(rpcInput RPCInput, genericParsers []spectypes.GenericParser) (*ParsedInput, error) { + if len(genericParsers) == 0 { + return nil, fmt.Errorf("no generic parsers to use") + } + + parsingMap := getMapForParse(rpcInput) + + // We try to parse the params with all the generic parsers, the first one that succeeds, its value is returned + for _, genericParser := range genericParsers { + retval, err := parseGeneric(parsingMap, genericParser) + if err == nil { + return retval, nil + } + } + + // we didn't find a generic parser that worked + return nil, utils.LavaFormatTrace("failed to parse with generic parsers", + utils.LogAttr("parsingMap", parsingMap), + utils.LogAttr("genericParsers", genericParsers), + ) +} + +func parseRule(rule string, valueInterface interface{}) bool { + // Split the rule by "||" to handle OR conditions + if rule == "" { + return true + } + + // convert to string + value := blockInterfaceToString(valueInterface) + conditions := strings.Split(rule, "||") + + for _, condition := range conditions { + condition = strings.TrimSpace(condition) + if len(condition) <= 1 { + continue + } + + operator := condition[:1] + operand := strings.TrimSpace(condition[1:]) + + switch operator { + case "=": + if value == operand { + return true + } + // Implement other operators when needed + // case "<": + // // Handle "<" logic + // case ">": + // // Handle ">" logic + default: + utils.LavaFormatError("Unsupported operator", nil, utils.LogAttr("operator", operator), utils.LogAttr("rule", rule), utils.LogAttr("value", value)) + continue + } + } + + return false +} + +func parseGeneric(input interface{}, genericParser spectypes.GenericParser) (*ParsedInput, error) { + value, err := findGenericParserValue(input, genericParser) + if err != nil { + return nil, err + } + + if !parseRule(genericParser.Rule, value) { + return nil, utils.LavaFormatWarning("PARSER_TYPE_DEFAULT_VALUE Did not match any rule", nil, utils.LogAttr("value", value), utils.LogAttr("rules", genericParser.Rule)) + } + utils.LavaFormatTrace("parsed generic value", + utils.LogAttr("input", input), + utils.LogAttr("genericParser", genericParser), + utils.LogAttr("value", value), + ) + + switch genericParser.ParseType { + // Case Default value setting parsed block as the value set on spec after being parsed by ParseDefaultBlockParameter + // regardless of the value provided by the user. for example .finality: final + case spectypes.PARSER_TYPE_DEFAULT_VALUE: + parsed := NewParsedInput() + block, err := ParseDefaultBlockParameter(genericParser.Value) + if err != nil { + return nil, utils.LavaFormatError("Failed converting default value to requested block", err, utils.LogAttr("genericParser.Value", genericParser.Value)) + } + parsed.parsedBlock = block + return parsed, nil + // Case Block Latest, setting the value set by the user given a json path hit. + // Example: block_id: 100, will result in requested block 100. + case spectypes.PARSER_TYPE_BLOCK_LATEST: + parsed := NewParsedInput() + valueString := blockInterfaceToString(value) + block, err := ParseDefaultBlockParameter(valueString) + if err != nil { + return nil, utils.LavaFormatWarning("Failed converting valueString to block number", err, utils.LogAttr("value", valueString)) + } + parsed.parsedBlock = block + return parsed, nil + case spectypes.PARSER_TYPE_BLOCK_HASH: + return parseGenericParserBlockHash(value) + // TODO: Implement other cases for different parsers + default: + return nil, fmt.Errorf("unsupported generic parser type") + } +} + +func findGenericParserValue(input interface{}, genericParser spectypes.GenericParser) (interface{}, error) { + jqParser, err := gojq.Parse(genericParser.GetParsePath()) + if err != nil { + return "", utils.LavaFormatError("failed to parse generic parser path", err, utils.LogAttr("path", genericParser.GetParsePath())) + } + + iter := jqParser.Run(input) + for { + val, ok := iter.Next() + if !ok { + break + } + + if val == nil { + continue + } + + if err, ok := val.(error); ok { + utils.LavaFormatTrace("generic parser path returned an error", + utils.LogAttr("error", err), + utils.LogAttr("input", input), + utils.LogAttr("path", genericParser.GetParsePath()), + ) + + continue + } + + return val, nil + } + + return "", utils.LavaFormatTrace("generic parser path did not return the expected value", + utils.LogAttr("input", input), + utils.LogAttr("path", genericParser.GetParsePath()), + ) +} + +func parseGenericParserBlockHash(value interface{}) (*ParsedInput, error) { + parsed := NewParsedInput() + + strVal, ok := value.(string) + if !ok { + return parsed, utils.LavaFormatDebug("failed to cast generic parser value to string", utils.LogAttr("value", value)) + } + if len(strVal) < MinimumHashLength { + return parsed, utils.LavaFormatDebug("value length is below minimum hash length", utils.LogAttr("strVal", strVal), utils.LogAttr("len(strVal)", len(strVal)), utils.LogAttr("MinimumHashLength", MinimumHashLength)) + } + + parsed.parsedHashes = append(parsed.parsedHashes, strVal) + return parsed, nil } func parseDefault(input []string) []interface{} { @@ -225,6 +503,8 @@ func blockInterfaceToString(block interface{}) string { return strconv.FormatInt(castedBlock, 10) case uint64: return strconv.FormatUint(castedBlock, 10) + case int: + return strconv.Itoa(castedBlock) default: return fmt.Sprintf("%s", block) } @@ -233,17 +513,17 @@ func blockInterfaceToString(block interface{}) string { func parseByArg(rpcInput RPCInput, input []string, dataSource int) ([]interface{}, error) { // specified block is one of the direct parameters, input should be one string defining the location of the block if len(input) != 1 { - return nil, utils.LavaFormatProduction("invalid input format, input length", nil, utils.Attribute{Key: "input_len", Value: strconv.Itoa(len(input))}) + return nil, utils.LavaFormatProduction("invalid input format, input length", nil, utils.LogAttr("input_len", strconv.Itoa(len(input)))) } inp := input[0] param_index, err := strconv.ParseUint(inp, 10, 32) if err != nil { - return nil, utils.LavaFormatProduction("invalid input format, input isn't an unsigned index", err, utils.Attribute{Key: "input", Value: inp}) + return nil, utils.LavaFormatProduction("invalid input format, input isn't an unsigned index", err, utils.LogAttr("input", inp)) } unmarshalledData, err := getDataToParse(rpcInput, dataSource) if err != nil { - return nil, utils.LavaFormatProduction("invalid input format, data is not json", err, utils.Attribute{Key: "data", Value: unmarshalledData}) + return nil, utils.LavaFormatProduction("invalid input format, data is not json", err, utils.LogAttr("data", unmarshalledData)) } switch unmarshaledDataTyped := unmarshalledData.(type) { case []interface{}: @@ -258,7 +538,10 @@ func parseByArg(rpcInput RPCInput, input []string, dataSource int) ([]interface{ return retArr, nil default: // Parse by arg can be only list as we dont have the name of the height property. - return nil, utils.LavaFormatProduction("Parse type unsupported in parse by arg, only list parameters are currently supported", nil, utils.Attribute{Key: "request", Value: unmarshaledDataTyped}) + return nil, utils.LavaFormatProduction("Parse type unsupported in parse by arg, only list parameters are currently supported", nil, + utils.LogAttr("params", rpcInput.GetParams()), + utils.LogAttr("request", unmarshaledDataTyped), + ) } } @@ -293,14 +576,26 @@ func parseCanonical(rpcInput RPCInput, input []string, dataSource int) ([]interf for _, key := range input[1:] { // type assertion for blockcontainer if blockContainer, ok := blockContainer.(map[string]interface{}); !ok { - return nil, utils.LavaFormatWarning("invalid parser input format, blockContainer is not map[string]interface{}", ValueNotSetError, utils.LogAttr("method", rpcInput.GetMethod()), utils.LogAttr("blockContainer", fmt.Sprintf("%v", blockContainer)), utils.LogAttr("key", key), utils.LogAttr("unmarshaledDataTyped", unmarshalledDataTyped)) + return nil, utils.LavaFormatWarning("invalid parser input format, blockContainer is not map[string]interface{}", ValueNotSetError, + utils.LogAttr("params", rpcInput.GetParams()), + utils.LogAttr("method", rpcInput.GetMethod()), + utils.LogAttr("blockContainer", fmt.Sprintf("%v", blockContainer)), + utils.LogAttr("key", key), + utils.LogAttr("unmarshaledDataTyped", unmarshalledDataTyped), + ) } // assertion for key if container, ok := blockContainer.(map[string]interface{})[key]; ok { blockContainer = container } else { - return nil, utils.LavaFormatWarning("invalid parser input format, blockContainer does not have the field searched inside", ValueNotSetError, utils.LogAttr("method", rpcInput.GetMethod()), utils.LogAttr("blockContainer", fmt.Sprintf("%v", blockContainer)), utils.LogAttr("key", key), utils.LogAttr("unmarshaledDataTyped", unmarshalledDataTyped)) + return nil, utils.LavaFormatWarning("invalid parser input format, blockContainer does not have the field searched inside", ValueNotSetError, + utils.LogAttr("params", rpcInput.GetParams()), + utils.LogAttr("method", rpcInput.GetMethod()), + utils.LogAttr("blockContainer", fmt.Sprintf("%v", blockContainer)), + utils.LogAttr("key", key), + utils.LogAttr("unmarshaledDataTyped", unmarshalledDataTyped), + ) } } retArr := make([]interface{}, 0) @@ -441,8 +736,17 @@ func parseDictionaryOrOrdered(rpcInput RPCInput, input []string, dataSource int) return appendInterfaceToInterfaceArrayWithError(blockInterfaceToString(val)) } - // Else return not set error - return nil, utils.LavaFormatWarning("Failed parsing parseDictionaryOrOrdered", ValueNotSetError, utils.LogAttr("propName", propName), utils.LogAttr("inp", inp), utils.LogAttr("unmarshalledDataTyped", unmarshalledDataTyped), utils.LogAttr("method", rpcInput.GetMethod())) + // Else return not set error) + utils.LavaFormatDebug("Failed parsing parseDictionaryOrOrdered", + utils.LogAttr("params", rpcInput.GetParams()), + utils.LogAttr("propName", propName), + utils.LogAttr("inp", inp), + utils.LogAttr("unmarshalledDataTyped", unmarshalledDataTyped), + utils.LogAttr("method", rpcInput.GetMethod()), + utils.LogAttr("err", ValueNotSetError), + ) + + return nil, ValueNotSetError case string: return appendInterfaceToInterfaceArrayWithError(blockInterfaceToString(unmarshalledDataTyped)) default: diff --git a/protocol/parser/parser_test.go b/protocol/parser/parser_test.go index a39bc5ff79..c08db60dd8 100644 --- a/protocol/parser/parser_test.go +++ b/protocol/parser/parser_test.go @@ -6,8 +6,8 @@ import ( "reflect" "testing" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -31,6 +31,10 @@ func (rpcInputTest *RPCInputTest) GetResult() json.RawMessage { return rpcInputTest.Result } +func (rpcInputTest *RPCInputTest) GetID() json.RawMessage { + return nil +} + func (rpcInputTest *RPCInputTest) ParseBlock(block string) (int64, error) { if rpcInputTest.ParseBlockFunc == nil { return ParseDefaultBlockParameter(block) @@ -342,9 +346,8 @@ func TestParseBlockFromParamsHappyFlow(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - block, err := ParseBlockFromParams(&testCase.message, testCase.blockParser) - require.NoError(t, err, fmt.Sprintf("Test case name: %s", testCase.name)) - require.Equal(t, testCase.expectedBlock, block) + block := ParseBlockFromParams(&testCase.message, testCase.blockParser, nil) + require.Equal(t, testCase.expectedBlock, block.parsedBlock) }) } } @@ -408,3 +411,294 @@ func TestParseBlockFromReplyHappyFlow(t *testing.T) { }) } } + +func TestParseBlockFromParams(t *testing.T) { + tests := []struct { + name string + rpcInput RPCInput + blockParser spectypes.BlockParser + genericParsers []spectypes.GenericParser + expected int64 + }{ + { + name: "generic_parser_happy_flow_default_value", + rpcInput: &RPCInputTest{ + Params: map[string]interface{}{ + "foo": map[string]interface{}{ + "bar": []interface{}{ + map[string]interface{}{ + "baz": 123, + }, + }, + }, + }, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: ".params.foo.bar.[0].baz", + Rule: "=123", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + }, + }, + expected: spectypes.LATEST_BLOCK, + }, + { + name: "generic_parser_happy_flow_value", + rpcInput: &RPCInputTest{ + Params: map[string]interface{}{ + "foo": map[string]interface{}{ + "bar": []interface{}{ + map[string]interface{}{ + "baz": 123, + }, + }, + }, + }, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: ".params.foo.bar.[0].baz", + ParseType: spectypes.PARSER_TYPE_BLOCK_LATEST, + }, + }, + expected: 123, + }, + { + name: "generic_parser_nil_params", + rpcInput: &RPCInputTest{}, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: ".params.foo", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + }, + }, + expected: spectypes.NOT_APPLICABLE, + }, + { + name: "generic_parser_fail_with_nil_var", + rpcInput: &RPCInputTest{ + Params: map[string]interface{}{ + "bar": 123, + }, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: ".params.foo", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + }, + }, + expected: spectypes.NOT_APPLICABLE, + }, + { + name: "generic_parser_fail_with_iter_error", + rpcInput: &RPCInputTest{ + Params: map[string]interface{}{ + "bar": 123, + }, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: ".params.bar.foo", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + }, + }, + expected: spectypes.NOT_APPLICABLE, + }, + { + name: "generic_parser_wrong_jq_path_no_default", + rpcInput: &RPCInputTest{ + Params: map[string]interface{}{ + "bar": 123, + }, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: "!@#$%^&*()", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + }, + }, + expected: spectypes.NOT_APPLICABLE, + }, + { + name: "generic_parser_wrong_jq_path_with_parser_func_default", + rpcInput: &RPCInputTest{ + Params: map[string]interface{}{ + "bar": 123, + }, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: "!@#$%^&*()", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + }, + }, + blockParser: spectypes.BlockParser{ + ParserFunc: spectypes.PARSER_FUNC_DEFAULT, + ParserArg: []string{"latest"}, + }, + expected: spectypes.LATEST_BLOCK, + }, + { + name: "generic_parser_and_block_parser_fail", + rpcInput: &RPCInputTest{ + Params: map[string]interface{}{}, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: "!@#$%^&*()", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + }, + }, + blockParser: spectypes.BlockParser{ + ParserFunc: spectypes.PARSER_FUNC_PARSE_CANONICAL, + ParserArg: []string{"0", "block"}, + DefaultValue: "latest", + }, + expected: spectypes.LATEST_BLOCK, + }, + + { + name: "generic_parser_no_generic_parser", + rpcInput: &RPCInputTest{ + Params: []interface{}{ + "block=10000", + }, + }, + genericParsers: []spectypes.GenericParser{}, + blockParser: spectypes.BlockParser{ + ParserArg: []string{"block", "="}, + ParserFunc: spectypes.PARSER_FUNC_PARSE_DICTIONARY, + }, + expected: 10000, + }, + } + + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + t.Parallel() + result := ParseBlockFromParams(test.rpcInput, test.blockParser, test.genericParsers) + require.Equal(t, test.expected, result.parsedBlock) + }) + } +} + +func TestParseBlockFromParamsHash(t *testing.T) { + tests := []struct { + name string + rpcInput RPCInput + blockParser spectypes.BlockParser + genericParsers []spectypes.GenericParser + expected int64 + expectedHash string + }{ + { + name: "generic_parser_hash", + rpcInput: &RPCInputTest{ + Params: []interface{}{"a3f1c5e6b8d3e7f9c9d3b7c5e2f9d6e7f9c9a3b7c8d3e7f9c9d3b7c5e2f9d6e7"}, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: ".params.[0]", + ParseType: spectypes.PARSER_TYPE_BLOCK_HASH, + }, + }, + blockParser: spectypes.BlockParser{ + ParserFunc: spectypes.PARSER_FUNC_PARSE_CANONICAL, + ParserArg: []string{"0", "block"}, + DefaultValue: "latest", + }, + expected: spectypes.LATEST_BLOCK, + expectedHash: "a3f1c5e6b8d3e7f9c9d3b7c5e2f9d6e7f9c9a3b7c8d3e7f9c9d3b7c5e2f9d6e7", + }, + { + name: "generic_parser_hash_bad_hash", + rpcInput: &RPCInputTest{ + Params: []interface{}{"a3f1c5e6b8"}, + }, + genericParsers: []spectypes.GenericParser{ + { + ParsePath: ".params.[0]", + ParseType: spectypes.PARSER_TYPE_BLOCK_HASH, + }, + }, + blockParser: spectypes.BlockParser{ + ParserFunc: spectypes.PARSER_FUNC_PARSE_CANONICAL, + ParserArg: []string{"0", "block"}, + DefaultValue: "latest", + }, + expected: spectypes.LATEST_BLOCK, + expectedHash: "", + }, + } + + for _, test := range tests { + test := test + t.Run(test.name, func(t *testing.T) { + t.Parallel() + result := ParseBlockFromParams(test.rpcInput, test.blockParser, test.genericParsers) + if test.expectedHash == "" { + require.Len(t, result.parsedHashes, 0) + } else { + require.Equal(t, test.expectedHash, result.parsedHashes[0]) + } + require.Equal(t, test.expected, result.parsedBlock) + }) + } +} + +func TestParseRule(t *testing.T) { + tests := []struct { + rule string + value string + expected bool + }{ + {"=final || =optimistic", "final", true}, + {"=final || =optimistic", "optimistic", true}, + {"=final || =optimistic", "pessimistic", false}, + {"=final", "final", true}, + {"=final", "notfinal", false}, + {"=final || =optimistic || =neutral", "neutral", true}, + {"=final || =optimistic", "finale", false}, + } + + for _, test := range tests { + result := parseRule(test.rule, test.value) + if result != test.expected { + t.Errorf("parseRule(%q, %q) = %v; expected %v", test.rule, test.value, result, test.expected) + } + } +} + +func TestParseGeneric(t *testing.T) { + jsonMap := map[string]interface{}{ + "jsonrpc": "2.0", + "id": "nil", + "method": "block", + "params": map[string]interface{}{ + "finality": "final", + }, + } + res, err := parseGeneric(jsonMap, spectypes.GenericParser{ + ParsePath: ".params.finality", + Value: "latest", + ParseType: spectypes.PARSER_TYPE_DEFAULT_VALUE, + Rule: "=final || =optimistic", + }) + require.NoError(t, err) + require.Equal(t, spectypes.LATEST_BLOCK, res.parsedBlock) +} + +func TestHashLengthValidation(t *testing.T) { + _, err := parseGenericParserBlockHash("123") + require.Error(t, err) + _, err = parseGenericParserBlockHash("123456789,123456789,123456789,12") + require.NoError(t, err) +} diff --git a/protocol/performance/cache.go b/protocol/performance/cache.go index fcb6adb6fa..0150e8b5f1 100644 --- a/protocol/performance/cache.go +++ b/protocol/performance/cache.go @@ -4,8 +4,8 @@ import ( "context" "time" - "github.com/lavanet/lava/protocol/lavasession" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/lavasession" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) type Cache struct { @@ -39,7 +39,7 @@ func InitCache(ctx context.Context, addr string) (*Cache, error) { func (cache *Cache) GetEntry(ctx context.Context, relayCacheGet *pairingtypes.RelayCacheGet) (reply *pairingtypes.CacheRelayReply, err error) { if cache == nil { // TODO: try to connect again once in a while - return nil, NotInitialisedError + return nil, NotInitializedError } if cache.client == nil { return nil, NotConnectedError.Wrapf("No client connected to address: %s", cache.address) @@ -55,7 +55,7 @@ func (cache *Cache) CacheActive() bool { func (cache *Cache) SetEntry(ctx context.Context, cacheSet *pairingtypes.RelayCacheSet) error { if cache == nil { // TODO: try to connect again once in a while - return NotInitialisedError + return NotInitializedError } if cache.client == nil { return NotConnectedError.Wrapf("No client connected to address: %s", cache.address) diff --git a/protocol/performance/connection/connection_cmd.go b/protocol/performance/connection/connection_cmd.go index 4f88321ae7..f79cd10ce8 100644 --- a/protocol/performance/connection/connection_cmd.go +++ b/protocol/performance/connection/connection_cmd.go @@ -9,10 +9,10 @@ import ( "time" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" "github.com/spf13/viper" "golang.org/x/net/http2" diff --git a/protocol/performance/connection/prober.go b/protocol/performance/connection/prober.go index add6bd38be..08b07ea090 100644 --- a/protocol/performance/connection/prober.go +++ b/protocol/performance/connection/prober.go @@ -5,9 +5,9 @@ import ( "fmt" "math/rand" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -15,14 +15,14 @@ import ( type Prober struct { address string conn *grpc.ClientConn - relayerClient *pairingtypes.RelayerClient + relayerClient pairingtypes.RelayerClient } func NewProber(addrss string) *Prober { return &Prober{address: addrss} } -func createConnection(ctx context.Context, address string) (*pairingtypes.RelayerClient, *grpc.ClientConn, error) { +func createConnection(ctx context.Context, address string) (pairingtypes.RelayerClient, *grpc.ClientConn, error) { cswp := lavasession.ConsumerSessionsWithProvider{} return cswp.ConnectRawClientWithTimeout(ctx, address) } @@ -39,7 +39,7 @@ func (p *Prober) RunOnce(ctx context.Context) error { p.relayerClient = relayer p.conn = conn } - relayerClient := *p.relayerClient + guid := uint64(rand.Int63()) probeReq := &pairingtypes.ProbeRequest{ @@ -49,7 +49,7 @@ func (p *Prober) RunOnce(ctx context.Context) error { } var trailer metadata.MD utils.LavaFormatInfo("[+] sending probe", utils.LogAttr("guid", guid)) - probeResp, err := relayerClient.Probe(ctx, probeReq, grpc.Trailer(&trailer)) + probeResp, err := p.relayerClient.Probe(ctx, probeReq, grpc.Trailer(&trailer)) if err != nil { return err } diff --git a/protocol/performance/connection/server.go b/protocol/performance/connection/server.go index aabfcba51a..895a152cd7 100644 --- a/protocol/performance/connection/server.go +++ b/protocol/performance/connection/server.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) type RelayerConnectionServer struct { diff --git a/protocol/performance/errors.go b/protocol/performance/errors.go index d587ac91af..bb69cd3f51 100644 --- a/protocol/performance/errors.go +++ b/protocol/performance/errors.go @@ -6,5 +6,5 @@ import ( var ( NotConnectedError = sdkerrors.New("Not Connected Error", 700, "No Connection To grpc server") - NotInitialisedError = sdkerrors.New("Not Initialised Error", 701, "to use cache run initCache") + NotInitializedError = sdkerrors.New("Not Initialised Error", 701, "to use cache run initCache") ) diff --git a/protocol/performance/pprofServer.go b/protocol/performance/pprofServer.go index 0cdddc6077..4c555003eb 100644 --- a/protocol/performance/pprofServer.go +++ b/protocol/performance/pprofServer.go @@ -5,7 +5,7 @@ import ( "github.com/gofiber/fiber/v2" fiberpprof "github.com/gofiber/fiber/v2/middleware/pprof" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) const ( diff --git a/protocol/performance/validators/validators.go b/protocol/performance/validators/validators.go index 222a72a89d..02a05534fc 100644 --- a/protocol/performance/validators/validators.go +++ b/protocol/performance/validators/validators.go @@ -21,9 +21,9 @@ import ( "github.com/cosmos/cosmos-sdk/version" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/protocol/provideroptimizer/provider_optimizer.go b/protocol/provideroptimizer/provider_optimizer.go index 9ffd9d923c..38f53b034c 100644 --- a/protocol/provideroptimizer/provider_optimizer.go +++ b/protocol/provideroptimizer/provider_optimizer.go @@ -8,17 +8,16 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/score" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/score" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "gonum.org/v1/gonum/mathext" ) const ( - debug = false CacheMaxCost = 2000 // each item cost would be 1 CacheNumCounters = 20000 // expect 2000 items INITIAL_DATA_STALENESS = 24 @@ -57,6 +56,8 @@ type ProviderData struct { Latency score.ScoreStore // will be used to calculate the latency score Sync score.ScoreStore // will be used to calculate the sync score for spectypes.LATEST_BLOCK/spectypes.NOT_APPLICABLE requests SyncBlock uint64 // will be used to calculate the probability of block error + LatencyRaw score.ScoreStore // will be used when reporting reputation to the node (Latency = LatencyRaw / baseLatency) + SyncRaw score.ScoreStore // will be used when reporting reputation to the node (Sync = SyncRaw / baseSync) } type Strategy int @@ -90,20 +91,26 @@ func (po *ProviderOptimizer) appendRelayData(providerAddress string, latency tim if isHangingApi { baseLatency += po.averageBlockTime / 2 // hanging apis take longer } - providerData = po.updateProbeEntryLatency(providerData, latency, baseLatency, RELAY_UPDATE_WEIGHT, halfTime, sampleTime) + providerData = po.updateProbeEntryLatency(providerData, latency, baseLatency, RELAY_UPDATE_WEIGHT, halfTime, sampleTime, isHangingApi) } if syncBlock > providerData.SyncBlock { // do not allow providers to go back providerData.SyncBlock = syncBlock } syncLag := po.calculateSyncLag(latestSync, timeSync, providerData.SyncBlock, sampleTime) - providerData = po.updateProbeEntrySync(providerData, syncLag, po.averageBlockTime, halfTime, sampleTime) + providerData = po.updateProbeEntrySync(providerData, syncLag, po.averageBlockTime, halfTime, sampleTime, isHangingApi) } po.providersStorage.Set(providerAddress, providerData, 1) po.updateRelayTime(providerAddress, sampleTime) - if debug { - utils.LavaFormatDebug("relay update", utils.Attribute{Key: "providerData", Value: providerData}, utils.Attribute{Key: "syncBlock", Value: syncBlock}, utils.Attribute{Key: "cu", Value: cu}, utils.Attribute{Key: "providerAddress", Value: providerAddress}, utils.Attribute{Key: "latency", Value: latency}, utils.Attribute{Key: "success", Value: success}) - } + + utils.LavaFormatTrace("relay update", + utils.LogAttr("providerData", providerData), + utils.LogAttr("syncBlock", syncBlock), + utils.LogAttr("cu", cu), + utils.LogAttr("providerAddress", providerAddress), + utils.LogAttr("latency", latency), + utils.LogAttr("success", success), + ) } func (po *ProviderOptimizer) AppendProbeRelayData(providerAddress string, latency time.Duration, success bool) { @@ -113,12 +120,15 @@ func (po *ProviderOptimizer) AppendProbeRelayData(providerAddress string, latenc providerData = po.updateProbeEntryAvailability(providerData, success, PROBE_UPDATE_WEIGHT, halfTime, sampleTime) if success && latency > 0 { // base latency for a probe is the world latency - providerData = po.updateProbeEntryLatency(providerData, latency, po.baseWorldLatency, PROBE_UPDATE_WEIGHT, halfTime, sampleTime) + providerData = po.updateProbeEntryLatency(providerData, latency, po.baseWorldLatency, PROBE_UPDATE_WEIGHT, halfTime, sampleTime, false) } po.providersStorage.Set(providerAddress, providerData, 1) - if debug { - utils.LavaFormatDebug("probe update", utils.Attribute{Key: "providerAddress", Value: providerAddress}, utils.Attribute{Key: "latency", Value: latency}, utils.Attribute{Key: "success", Value: success}) - } + + utils.LavaFormatTrace("probe update", + utils.LogAttr("providerAddress", providerAddress), + utils.LogAttr("latency", latency), + utils.LogAttr("success", success), + ) } // returns a sub set of selected providers according to their scores, perturbation factor will be added to each score in order to randomly select providers that are not always on top @@ -137,8 +147,8 @@ func (po *ProviderOptimizer) ChooseProvider(allAddresses []string, ignoredProvid continue } providerData, found := po.getProviderData(providerAddress) - if debug && !found { - utils.LavaFormatDebug("provider data was not found for address", utils.Attribute{Key: "providerAddress", Value: providerAddress}) + if !found { + utils.LavaFormatTrace("provider data was not found for address", utils.LogAttr("providerAddress", providerAddress)) } // latency score latencyScoreCurrent := po.calculateLatencyScore(providerData, cu, requestedBlock) // smaller == better i.e less latency @@ -154,9 +164,14 @@ func (po *ProviderOptimizer) ChooseProvider(allAddresses []string, ignoredProvid syncScoreCurrent = pertrubWithNormalGaussian(syncScoreCurrent, perturbationPercentage) } - if debug { - utils.LavaFormatDebug("scores information", utils.Attribute{Key: "providerAddress", Value: providerAddress}, utils.Attribute{Key: "latencyScoreCurrent", Value: latencyScoreCurrent}, utils.Attribute{Key: "syncScoreCurrent", Value: syncScoreCurrent}, utils.Attribute{Key: "latencyScore", Value: latencyScore}, utils.Attribute{Key: "syncScore", Value: syncScore}) - } + utils.LavaFormatTrace("scores information", + utils.LogAttr("providerAddress", providerAddress), + utils.LogAttr("latencyScoreCurrent", latencyScoreCurrent), + utils.LogAttr("syncScoreCurrent", syncScoreCurrent), + utils.LogAttr("latencyScore", latencyScore), + utils.LogAttr("syncScore", syncScore), + ) + // we want the minimum latency and sync diff if po.isBetterProviderScore(latencyScore, latencyScoreCurrent, syncScore, syncScoreCurrent) || len(returnedProviders) == 0 { if returnedProviders[0] != "" && po.shouldExplore(len(returnedProviders), numProviders) { @@ -172,9 +187,12 @@ func (po *ProviderOptimizer) ChooseProvider(allAddresses []string, ignoredProvid returnedProviders = append(returnedProviders, providerAddress) } } - if debug { - utils.LavaFormatDebug("returned providers", utils.Attribute{Key: "providers", Value: strings.Join(returnedProviders, ",")}, utils.Attribute{Key: "cu", Value: cu}) - } + + utils.LavaFormatTrace("returned providers", + utils.LogAttr("providers", strings.Join(returnedProviders, ",")), + utils.LogAttr("cu", cu), + ) + return returnedProviders } @@ -290,16 +308,16 @@ func (po *ProviderOptimizer) calculateLatencyScore(providerData ProviderData, cu costTimeout := timeoutDuration.Seconds() + baseLatency.Seconds() // on success we are paying the time cost of this provider costSuccess := historicalLatency.Seconds() - if debug { - utils.LavaFormatDebug("latency calculation breakdown", - utils.Attribute{Key: "probabilityBlockError", Value: probabilityBlockError}, - utils.Attribute{Key: "costBlockError", Value: costBlockError}, - utils.Attribute{Key: "probabilityOfTimeout", Value: probabilityOfTimeout}, - utils.Attribute{Key: "costTimeout", Value: costTimeout}, - utils.Attribute{Key: "probabilityOfSuccess", Value: probabilityOfSuccess}, - utils.Attribute{Key: "costSuccess", Value: costSuccess}, - ) - } + + utils.LavaFormatTrace("latency calculation breakdown", + utils.LogAttr("probabilityBlockError", probabilityBlockError), + utils.LogAttr("costBlockError", costBlockError), + utils.LogAttr("probabilityOfTimeout", probabilityOfTimeout), + utils.LogAttr("costTimeout", costTimeout), + utils.LogAttr("probabilityOfSuccess", probabilityOfSuccess), + utils.LogAttr("costSuccess", costSuccess), + ) + return probabilityBlockError*costBlockError + probabilityOfTimeout*costTimeout + probabilityOfSuccess*costSuccess } @@ -353,10 +371,15 @@ func (po *ProviderOptimizer) getProviderData(providerAddress string) (providerDa return providerData, found } -func (po *ProviderOptimizer) updateProbeEntrySync(providerData ProviderData, sync, baseSync, halfTime time.Duration, sampleTime time.Time) ProviderData { +func (po *ProviderOptimizer) updateProbeEntrySync(providerData ProviderData, sync, baseSync, halfTime time.Duration, sampleTime time.Time, isHangingApi bool) ProviderData { newScore := score.NewScoreStore(sync.Seconds(), baseSync.Seconds(), sampleTime) oldScore := providerData.Sync - providerData.Sync = score.CalculateTimeDecayFunctionUpdate(oldScore, newScore, halfTime, RELAY_UPDATE_WEIGHT, sampleTime) + syncScoreStore, syncRawScoreStore := score.CalculateTimeDecayFunctionUpdate(oldScore, newScore, halfTime, RELAY_UPDATE_WEIGHT, sampleTime) + providerData.Sync = syncScoreStore + if !isHangingApi { + // use raw qos excellence reports updates for non-hanging API only + providerData.SyncRaw = syncRawScoreStore + } return providerData } @@ -368,15 +391,21 @@ func (po *ProviderOptimizer) updateProbeEntryAvailability(providerData ProviderD } oldScore := providerData.Availability newScore := score.NewScoreStore(newNumerator, 1, sampleTime) // denom is 1, entry time is now - providerData.Availability = score.CalculateTimeDecayFunctionUpdate(oldScore, newScore, halfTime, weight, sampleTime) + providerData.Availability, _ = score.CalculateTimeDecayFunctionUpdate(oldScore, newScore, halfTime, weight, sampleTime) return providerData } // update latency data, base latency is the latency for the api defined in the spec -func (po *ProviderOptimizer) updateProbeEntryLatency(providerData ProviderData, latency, baseLatency time.Duration, weight float64, halfTime time.Duration, sampleTime time.Time) ProviderData { +func (po *ProviderOptimizer) updateProbeEntryLatency(providerData ProviderData, latency, baseLatency time.Duration, weight float64, halfTime time.Duration, sampleTime time.Time, isHangingApi bool) ProviderData { newScore := score.NewScoreStore(latency.Seconds(), baseLatency.Seconds(), sampleTime) oldScore := providerData.Latency - providerData.Latency = score.CalculateTimeDecayFunctionUpdate(oldScore, newScore, halfTime, weight, sampleTime) + + latencyScoreStore, latencyRawScoreStore := score.CalculateTimeDecayFunctionUpdate(oldScore, newScore, halfTime, weight, sampleTime) + providerData.Latency = latencyScoreStore + if isHangingApi { + // use raw qos excellence reports updates for non-hanging API only + providerData.LatencyRaw = latencyRawScoreStore + } return providerData } @@ -464,10 +493,10 @@ func pertrubWithNormalGaussian(orig, percentage float64) float64 { return orig + perturb } -func (po *ProviderOptimizer) GetExcellenceQoSReportForProvider(providerAddress string) *pairingtypes.QualityOfServiceReport { +func (po *ProviderOptimizer) GetExcellenceQoSReportForProvider(providerAddress string) (qosReport *pairingtypes.QualityOfServiceReport, rawQosReport *pairingtypes.QualityOfServiceReport) { providerData, found := po.getProviderData(providerAddress) if !found { - return nil + return nil, nil } precision := WANTED_PRECISION latencyScore := turnFloatToDec(providerData.Latency.Num/providerData.Latency.Denom, precision) @@ -482,10 +511,22 @@ func (po *ProviderOptimizer) GetExcellenceQoSReportForProvider(providerAddress s Availability: availabilityScore, Sync: syncScore, } - if debug { - utils.LavaFormatDebug("QoS Excellence for provider", utils.Attribute{Key: "address", Value: providerAddress}, utils.Attribute{Key: "Report", Value: ret}) + + latencyScoreRaw := turnFloatToDec(providerData.LatencyRaw.Num/providerData.LatencyRaw.Denom, precision) + syncScoreRaw := turnFloatToDec(providerData.SyncRaw.Num/providerData.SyncRaw.Denom, precision) + rawQosReport = &pairingtypes.QualityOfServiceReport{ + Latency: latencyScoreRaw, + Availability: availabilityScore, + Sync: syncScoreRaw, } - return ret + + utils.LavaFormatTrace("QoS Excellence for provider", + utils.LogAttr("address", providerAddress), + utils.LogAttr("Report", ret), + utils.LogAttr("raw_report", rawQosReport), + ) + + return ret, rawQosReport } func turnFloatToDec(floatNum float64, precision int64) sdk.Dec { diff --git a/protocol/provideroptimizer/provider_optimizer_test.go b/protocol/provideroptimizer/provider_optimizer_test.go index 48a2d361c4..e2f4b5974d 100644 --- a/protocol/provideroptimizer/provider_optimizer_test.go +++ b/protocol/provideroptimizer/provider_optimizer_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -257,6 +257,7 @@ func TestProviderOptimizerAvailabilityBlockError(t *testing.T) { } // TODO::PRT-1114 This needs to be fixed asap. currently commented out as it prevents pushing unrelated code +// Also on typescript sdk // func TestProviderOptimizerUpdatingLatency(t *testing.T) { // providerOptimizer := setupProviderOptimizer(1) // providersCount := 2 @@ -535,11 +536,14 @@ func TestExcellence(t *testing.T) { } time.Sleep(4 * time.Millisecond) } - report := providerOptimizer.GetExcellenceQoSReportForProvider(providersGen.providersAddresses[0]) + report, rawReport := providerOptimizer.GetExcellenceQoSReportForProvider(providersGen.providersAddresses[0]) require.NotNil(t, report) - report2 := providerOptimizer.GetExcellenceQoSReportForProvider(providersGen.providersAddresses[1]) + require.NotNil(t, rawReport) + report2, rawReport2 := providerOptimizer.GetExcellenceQoSReportForProvider(providersGen.providersAddresses[1]) require.NotNil(t, report2) require.Equal(t, report, report2) + require.NotNil(t, rawReport2) + require.Equal(t, rawReport, rawReport2) } func TestPerturbationWithNormalGaussianOnConcurrentComputation(t *testing.T) { diff --git a/protocol/rpcconsumer/consumer_consistency.go b/protocol/rpcconsumer/consumer_consistency.go index 66c1613ef0..dc54667e44 100644 --- a/protocol/rpcconsumer/consumer_consistency.go +++ b/protocol/rpcconsumer/consumer_consistency.go @@ -4,7 +4,7 @@ import ( "time" "github.com/dgraph-io/ristretto" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) // this class handles seen block values in requests @@ -44,17 +44,29 @@ func (cc *ConsumerConsistency) Key(dappId string, ip string) string { return dappId + "__" + ip } -func (cc *ConsumerConsistency) SetSeenBlock(blockSeen int64, dappId string, ip string) { +// used on subscription, where we already have the dapp key stored, but we don't keep the dappId and ip separately +func (cc *ConsumerConsistency) SetSeenBlockFromKey(blockSeen int64, key string) { if cc == nil { return } - block, _ := cc.getLatestBlock(cc.Key(dappId, ip)) + block, _ := cc.getLatestBlock(key) if block < blockSeen { - cc.setLatestBlock(cc.Key(dappId, ip), blockSeen) + cc.setLatestBlock(key, blockSeen) } } +func (cc *ConsumerConsistency) SetSeenBlock(blockSeen int64, dappId string, ip string) { + if cc == nil { + return + } + key := cc.Key(dappId, ip) + cc.SetSeenBlockFromKey(blockSeen, key) +} + func (cc *ConsumerConsistency) GetSeenBlock(dappId string, ip string) (int64, bool) { + if cc == nil { + return 0, false + } return cc.getLatestBlock(cc.Key(dappId, ip)) } diff --git a/protocol/rpcconsumer/consumer_state_tracker_mock.go b/protocol/rpcconsumer/consumer_state_tracker_mock.go new file mode 100644 index 0000000000..23d477b995 --- /dev/null +++ b/protocol/rpcconsumer/consumer_state_tracker_mock.go @@ -0,0 +1,169 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: protocol/rpcconsumer/rpcconsumer.go +// +// Generated by this command: +// +// mockgen -source=protocol/rpcconsumer/rpcconsumer.go -destination protocol/rpcconsumer/consumer_state_tracker_mock.go -package rpcconsumer +// + +// Package rpcconsumer is a generated GoMock package. +package rpcconsumer + +import ( + context "context" + reflect "reflect" + + common "github.com/lavanet/lava/v2/protocol/common" + finalizationconsensus "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + lavasession "github.com/lavanet/lava/v2/protocol/lavasession" + updaters "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + types "github.com/lavanet/lava/v2/x/conflict/types" + types0 "github.com/lavanet/lava/v2/x/plans/types" + types1 "github.com/lavanet/lava/v2/x/protocol/types" + gomock "go.uber.org/mock/gomock" +) + +// MockConsumerStateTrackerInf is a mock of ConsumerStateTrackerInf interface. +type MockConsumerStateTrackerInf struct { + ctrl *gomock.Controller + recorder *MockConsumerStateTrackerInfMockRecorder +} + +// MockConsumerStateTrackerInfMockRecorder is the mock recorder for MockConsumerStateTrackerInf. +type MockConsumerStateTrackerInfMockRecorder struct { + mock *MockConsumerStateTrackerInf +} + +// NewMockConsumerStateTrackerInf creates a new mock instance. +func NewMockConsumerStateTrackerInf(ctrl *gomock.Controller) *MockConsumerStateTrackerInf { + mock := &MockConsumerStateTrackerInf{ctrl: ctrl} + mock.recorder = &MockConsumerStateTrackerInfMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConsumerStateTrackerInf) EXPECT() *MockConsumerStateTrackerInfMockRecorder { + return m.recorder +} + +// GetConsumerPolicy mocks base method. +func (m *MockConsumerStateTrackerInf) GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*types0.Policy, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsumerPolicy", ctx, consumerAddress, chainID) + ret0, _ := ret[0].(*types0.Policy) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConsumerPolicy indicates an expected call of GetConsumerPolicy. +func (mr *MockConsumerStateTrackerInfMockRecorder) GetConsumerPolicy(ctx, consumerAddress, chainID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsumerPolicy", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).GetConsumerPolicy), ctx, consumerAddress, chainID) +} + +// GetLatestVirtualEpoch mocks base method. +func (m *MockConsumerStateTrackerInf) GetLatestVirtualEpoch() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLatestVirtualEpoch") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// GetLatestVirtualEpoch indicates an expected call of GetLatestVirtualEpoch. +func (mr *MockConsumerStateTrackerInfMockRecorder) GetLatestVirtualEpoch() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestVirtualEpoch", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).GetLatestVirtualEpoch)) +} + +// GetProtocolVersion mocks base method. +func (m *MockConsumerStateTrackerInf) GetProtocolVersion(ctx context.Context) (*updaters.ProtocolVersionResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetProtocolVersion", ctx) + ret0, _ := ret[0].(*updaters.ProtocolVersionResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProtocolVersion indicates an expected call of GetProtocolVersion. +func (mr *MockConsumerStateTrackerInfMockRecorder) GetProtocolVersion(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProtocolVersion", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).GetProtocolVersion), ctx) +} + +// RegisterConsumerSessionManagerForPairingUpdates mocks base method. +func (m *MockConsumerStateTrackerInf) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager, staticProviders []*lavasession.RPCProviderEndpoint) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterConsumerSessionManagerForPairingUpdates", ctx, consumerSessionManager) +} + +// RegisterConsumerSessionManagerForPairingUpdates indicates an expected call of RegisterConsumerSessionManagerForPairingUpdates. +func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterConsumerSessionManagerForPairingUpdates(ctx, consumerSessionManager any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterConsumerSessionManagerForPairingUpdates", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).RegisterConsumerSessionManagerForPairingUpdates), ctx, consumerSessionManager) +} + +// RegisterFinalizationConsensusForUpdates mocks base method. +func (m *MockConsumerStateTrackerInf) RegisterFinalizationConsensusForUpdates(arg0 context.Context, arg1 *finalizationconsensus.FinalizationConsensus) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterFinalizationConsensusForUpdates", arg0, arg1) +} + +// RegisterFinalizationConsensusForUpdates indicates an expected call of RegisterFinalizationConsensusForUpdates. +func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterFinalizationConsensusForUpdates(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterFinalizationConsensusForUpdates", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).RegisterFinalizationConsensusForUpdates), arg0, arg1) +} + +// RegisterForDowntimeParamsUpdates mocks base method. +func (m *MockConsumerStateTrackerInf) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable updaters.DowntimeParamsUpdatable) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterForDowntimeParamsUpdates", ctx, downtimeParamsUpdatable) + ret0, _ := ret[0].(error) + return ret0 +} + +// RegisterForDowntimeParamsUpdates indicates an expected call of RegisterForDowntimeParamsUpdates. +func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForDowntimeParamsUpdates(ctx, downtimeParamsUpdatable any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterForDowntimeParamsUpdates", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).RegisterForDowntimeParamsUpdates), ctx, downtimeParamsUpdatable) +} + +// RegisterForSpecUpdates mocks base method. +func (m *MockConsumerStateTrackerInf) RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, endpoint lavasession.RPCEndpoint) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterForSpecUpdates", ctx, specUpdatable, endpoint) + ret0, _ := ret[0].(error) + return ret0 +} + +// RegisterForSpecUpdates indicates an expected call of RegisterForSpecUpdates. +func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForSpecUpdates(ctx, specUpdatable, endpoint any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterForSpecUpdates", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).RegisterForSpecUpdates), ctx, specUpdatable, endpoint) +} + +// RegisterForVersionUpdates mocks base method. +func (m *MockConsumerStateTrackerInf) RegisterForVersionUpdates(ctx context.Context, version *types1.Version, versionValidator updaters.VersionValidationInf) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterForVersionUpdates", ctx, version, versionValidator) +} + +// RegisterForVersionUpdates indicates an expected call of RegisterForVersionUpdates. +func (mr *MockConsumerStateTrackerInfMockRecorder) RegisterForVersionUpdates(ctx, version, versionValidator any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterForVersionUpdates", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).RegisterForVersionUpdates), ctx, version, versionValidator) +} + +// TxConflictDetection mocks base method. +func (m *MockConsumerStateTrackerInf) TxConflictDetection(ctx context.Context, finalizationConflict *types.FinalizationConflict, responseConflict *types.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TxConflictDetection", ctx, finalizationConflict, responseConflict, conflictHandler) + ret0, _ := ret[0].(error) + return ret0 +} + +// TxConflictDetection indicates an expected call of TxConflictDetection. +func (mr *MockConsumerStateTrackerInfMockRecorder) TxConflictDetection(ctx, finalizationConflict, responseConflict, conflictHandler any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TxConflictDetection", reflect.TypeOf((*MockConsumerStateTrackerInf)(nil).TxConflictDetection), ctx, finalizationConflict, responseConflict, conflictHandler) +} diff --git a/protocol/rpcconsumer/policies_map.go b/protocol/rpcconsumer/policies_map.go index 1dca055a12..c4a31766ca 100644 --- a/protocol/rpcconsumer/policies_map.go +++ b/protocol/rpcconsumer/policies_map.go @@ -3,8 +3,8 @@ package rpcconsumer import ( "sync" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" ) type syncMapPolicyUpdaters struct { diff --git a/protocol/rpcconsumer/relay_errors.go b/protocol/rpcconsumer/relay_errors.go index 14a15a7b4e..174b01bba5 100644 --- a/protocol/rpcconsumer/relay_errors.go +++ b/protocol/rpcconsumer/relay_errors.go @@ -6,8 +6,8 @@ import ( "strconv" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/utils" ) type RelayErrors struct { @@ -114,7 +114,7 @@ func (r *RelayErrors) mergeAllErrors() error { mergedMessage += ", " } } - return fmt.Errorf(mergedMessage) + return fmt.Errorf("%s", mergedMessage) } // TODO: there's no need to save error twice and provider info twice, this can just be a relayResponse diff --git a/protocol/rpcconsumer/relay_errors_test.go b/protocol/rpcconsumer/relay_errors_test.go index e88288de5a..0f26ee3857 100644 --- a/protocol/rpcconsumer/relay_errors_test.go +++ b/protocol/rpcconsumer/relay_errors_test.go @@ -5,7 +5,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/common" + "github.com/lavanet/lava/v2/protocol/common" "github.com/stretchr/testify/require" ) @@ -49,7 +49,7 @@ func TestRelayError(t *testing.T) { }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.OneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 50), @@ -106,7 +106,7 @@ func TestRelayError(t *testing.T) { }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.MustNewDecFromStr("0.8"), ProviderStake: sdk.NewInt64Coin("ulava", 10), @@ -135,21 +135,21 @@ func TestRelayError(t *testing.T) { }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.ZeroDec(), ProviderStake: sdk.NewInt64Coin("ulava", 0), }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.ZeroDec(), ProviderStake: sdk.NewInt64Coin("ulava", 0), }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.ZeroDec(), ProviderStake: sdk.NewInt64Coin("ulava", 0), @@ -164,14 +164,14 @@ func TestRelayError(t *testing.T) { onFailureMergeAll: true, relayErrors: []RelayError{ { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.OneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.OneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 20), @@ -192,7 +192,7 @@ func TestRelayError(t *testing.T) { }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.OneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), @@ -207,14 +207,14 @@ func TestRelayError(t *testing.T) { onFailureMergeAll: true, relayErrors: []RelayError{ { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.OneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.OneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 20), @@ -235,7 +235,7 @@ func TestRelayError(t *testing.T) { }, }, { - err: fmt.Errorf(expectedValue), + err: fmt.Errorf("%s", expectedValue), ProviderInfo: common.ProviderInfo{ ProviderQoSExcellenceSummery: sdk.OneDec(), ProviderStake: sdk.NewInt64Coin("ulava", 10), diff --git a/protocol/rpcconsumer/relay_processor.go b/protocol/rpcconsumer/relay_processor.go index 27fe9acc66..f18b276663 100644 --- a/protocol/rpcconsumer/relay_processor.go +++ b/protocol/rpcconsumer/relay_processor.go @@ -5,20 +5,22 @@ import ( "errors" "fmt" "net/http" + "strconv" "strings" "sync" "sync/atomic" sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( - MaxCallsPerRelay = 50 + MaxCallsPerRelay = 50 + NumberOfRetriesAllowedOnNodeErrors = 2 // we will try maximum additional 2 relays on node errors ) type Selection int @@ -28,7 +30,53 @@ const ( BestResult // get the best result, even if it means waiting ) -func NewRelayProcessor(ctx context.Context, usedProviders *lavasession.UsedProviders, requiredSuccesses int, chainMessage chainlib.ChainMessage, consumerConsistency *ConsumerConsistency, dappID string, consumerIp string, debugRelay bool) *RelayProcessor { +type MetricsInterface interface { + SetRelayNodeErrorMetric(chainId string, apiInterface string) + SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string) + SetNodeErrorAttemptMetric(chainId string, apiInterface string) +} + +type chainIdAndApiInterfaceGetter interface { + GetChainIdAndApiInterface() (string, string) +} + +type RelayProcessor struct { + usedProviders *lavasession.UsedProviders + responses chan *relayResponse + requiredSuccesses int + nodeResponseErrors RelayErrors + protocolResponseErrors RelayErrors + successResults []common.RelayResult + lock sync.RWMutex + chainMessage chainlib.ChainMessage + guid uint64 + selection Selection + consumerConsistency *ConsumerConsistency + dappID string + consumerIp string + skipDataReliability bool + debugRelay bool + allowSessionDegradation uint32 // used in the scenario where extension was previously used. + metricsInf MetricsInterface + chainIdAndApiInterfaceGetter chainIdAndApiInterfaceGetter + disableRelayRetry bool + relayRetriesManager *RelayRetriesManager +} + +func NewRelayProcessor( + ctx context.Context, + usedProviders *lavasession.UsedProviders, + requiredSuccesses int, + chainMessage chainlib.ChainMessage, + consumerConsistency *ConsumerConsistency, + dappID string, + consumerIp string, + debugRelay bool, + metricsInf MetricsInterface, + chainIdAndApiInterfaceGetter chainIdAndApiInterfaceGetter, + disableRelayRetry bool, + relayRetriesManager *RelayRetriesManager, +) *RelayProcessor { guid, _ := utils.GetUniqueIdentifier(ctx) selection := Quorum // select the majority of node responses if chainlib.GetStateful(chainMessage) == common.CONSISTENCY_SELECT_ALL_PROVIDERS { @@ -38,40 +86,25 @@ func NewRelayProcessor(ctx context.Context, usedProviders *lavasession.UsedProvi utils.LavaFormatFatal("invalid requirement, successes count must be greater than 0", nil, utils.LogAttr("requiredSuccesses", requiredSuccesses)) } return &RelayProcessor{ - usedProviders: usedProviders, - requiredSuccesses: requiredSuccesses, - responses: make(chan *relayResponse, MaxCallsPerRelay), // we set it as buffered so it is not blocking - nodeResponseErrors: RelayErrors{relayErrors: []RelayError{}}, - protocolResponseErrors: RelayErrors{relayErrors: []RelayError{}, onFailureMergeAll: true}, - chainMessage: chainMessage, - guid: guid, - selection: selection, - consumerConsistency: consumerConsistency, - dappID: dappID, - consumerIp: consumerIp, - debugRelay: debugRelay, + usedProviders: usedProviders, + requiredSuccesses: requiredSuccesses, + responses: make(chan *relayResponse, MaxCallsPerRelay), // we set it as buffered so it is not blocking + nodeResponseErrors: RelayErrors{relayErrors: []RelayError{}}, + protocolResponseErrors: RelayErrors{relayErrors: []RelayError{}, onFailureMergeAll: true}, + chainMessage: chainMessage, + guid: guid, + selection: selection, + consumerConsistency: consumerConsistency, + dappID: dappID, + consumerIp: consumerIp, + debugRelay: debugRelay, + metricsInf: metricsInf, + chainIdAndApiInterfaceGetter: chainIdAndApiInterfaceGetter, + disableRelayRetry: disableRelayRetry, + relayRetriesManager: relayRetriesManager, } } -type RelayProcessor struct { - usedProviders *lavasession.UsedProviders - responses chan *relayResponse - requiredSuccesses int - nodeResponseErrors RelayErrors - protocolResponseErrors RelayErrors - successResults []common.RelayResult - lock sync.RWMutex - chainMessage chainlib.ChainMessage - guid uint64 - selection Selection - consumerConsistency *ConsumerConsistency - dappID string - consumerIp string - skipDataReliability bool - debugRelay bool - allowSessionDegradation uint32 // used in the scenario where extension was previously used. -} - // true if we never got an extension. (default value) func (rp *RelayProcessor) GetAllowSessionDegradation() bool { return atomic.LoadUint32(&rp.allowSessionDegradation) == 0 @@ -188,6 +221,7 @@ func (rp *RelayProcessor) setValidResponse(response *relayResponse) { response.relayResult.Finalized = false // shut down data reliability // } } + if response.relayResult.Reply == nil { utils.LavaFormatError("got to setValidResponse with nil Reply", response.err, @@ -202,17 +236,27 @@ func (rp *RelayProcessor) setValidResponse(response *relayResponse) { blockSeen := response.relayResult.Reply.LatestBlock // nil safe rp.consumerConsistency.SetSeenBlock(blockSeen, rp.dappID, rp.consumerIp) + // on subscribe results, we just append to successful results instead of parsing results because we already have a validation. + if chainlib.IsFunctionTagOfType(rp.chainMessage, spectypes.FUNCTION_TAG_SUBSCRIBE) { + rp.successResults = append(rp.successResults, response.relayResult) + return + } + // check response error foundError, errorMessage := rp.chainMessage.CheckResponseError(response.relayResult.Reply.Data, response.relayResult.StatusCode) if foundError { // this is a node error, meaning we still didn't get a good response. // we may choose to wait until there will be a response or timeout happens // if we decide to wait and timeout happens we will take the majority of response messages - err := fmt.Errorf(errorMessage) + err := fmt.Errorf("%s", errorMessage) rp.nodeResponseErrors.relayErrors = append(rp.nodeResponseErrors.relayErrors, RelayError{err: err, ProviderInfo: response.relayResult.ProviderInfo, response: response}) + // send relay error metrics only on non stateful queries, as stateful queries always return X-1/X errors. + if rp.selection != BestResult { + go rp.metricsInf.SetRelayNodeErrorMetric(rp.chainIdAndApiInterfaceGetter.GetChainIdAndApiInterface()) + utils.LavaFormatInfo("Relay received a node error", utils.LogAttr("Error", err), utils.LogAttr("provider", response.relayResult.ProviderInfo), utils.LogAttr("Request", rp.chainMessage.GetApi().Name), utils.LogAttr("requested_block", reqBlock)) + } return } - rp.successResults = append(rp.successResults, response.relayResult) } @@ -260,6 +304,51 @@ func (rp *RelayProcessor) HasResults() bool { return resultsCount+nodeErrors+protocolErrors > 0 } +func (rp *RelayProcessor) getInputMsgInfoHashString() (string, error) { + hash, err := rp.chainMessage.GetRawRequestHash() + hashString := "" + if err == nil { + hashString = string(hash) + } + return hashString, err +} + +// Deciding wether we should send a relay retry attempt based on the node error +func (rp *RelayProcessor) shouldRetryRelay(resultsCount int, hashErr error, nodeErrors int, hash string) bool { + // Retries will be performed based on the following scenarios: + // 1. rp.disableRelayRetry == false, In case we want to try again if we have a node error. + // 2. If we have 0 successful relays and we have only node errors. + // 3. Hash calculation was successful. + // 4. Number of retries < NumberOfRetriesAllowedOnNodeErrors. + if !rp.disableRelayRetry && resultsCount == 0 && hashErr == nil { + if nodeErrors <= NumberOfRetriesAllowedOnNodeErrors { + // TODO: check chain message retry on archive. (this feature will be added in the generic parsers feature) + + // Check hash already exist, if it does, we don't want to retry + if !rp.relayRetriesManager.CheckHashInCache(hash) { + // If we didn't find the hash in the hash map we can retry + utils.LavaFormatTrace("retrying on relay error", utils.LogAttr("retry_number", nodeErrors), utils.LogAttr("hash", hash)) + go rp.metricsInf.SetNodeErrorAttemptMetric(rp.chainIdAndApiInterfaceGetter.GetChainIdAndApiInterface()) + return false + } + utils.LavaFormatTrace("found hash in map wont retry", utils.LogAttr("hash", hash)) + } else { + // We failed enough times. we need to add this to our hash map so we don't waste time on it again. + chainId, apiInterface := rp.chainIdAndApiInterfaceGetter.GetChainIdAndApiInterface() + utils.LavaFormatWarning("Failed to recover retries on node errors, might be an invalid input", nil, + utils.LogAttr("api", rp.chainMessage.GetApi().Name), + utils.LogAttr("params", rp.chainMessage.GetRPCMessage().GetParams()), + utils.LogAttr("chainId", chainId), + utils.LogAttr("apiInterface", apiInterface), + utils.LogAttr("hash", hash), + ) + rp.relayRetriesManager.AddHashToCache(hash) + } + } + // Do not perform a retry + return true +} + func (rp *RelayProcessor) HasRequiredNodeResults() bool { if rp == nil { return false @@ -267,15 +356,30 @@ func (rp *RelayProcessor) HasRequiredNodeResults() bool { rp.lock.RLock() defer rp.lock.RUnlock() resultsCount := len(rp.successResults) + + hash, hashErr := rp.getInputMsgInfoHashString() if resultsCount >= rp.requiredSuccesses { + if hashErr == nil { // Incase we had a successful relay we can remove the hash from our relay retries map + // Use a routine to run it in parallel + go rp.relayRetriesManager.RemoveHashFromCache(hash) + } + // Check if we need to add node errors retry metrics + if rp.selection == Quorum { + // If nodeErrors length is larger than 0, our retry mechanism was activated. we add our metrics now. + nodeErrors := len(rp.nodeResponseErrors.relayErrors) + if nodeErrors > 0 { + chainId, apiInterface := rp.chainIdAndApiInterfaceGetter.GetChainIdAndApiInterface() + go rp.metricsInf.SetNodeErrorRecoveredSuccessfullyMetric(chainId, apiInterface, strconv.Itoa(nodeErrors)) + } + } return true } if rp.selection == Quorum { - // we need a quorum of all node results + // We need a quorum of all node results nodeErrors := len(rp.nodeResponseErrors.relayErrors) if nodeErrors+resultsCount >= rp.requiredSuccesses { - // we have enough node results for our quorum - return true + // Retry on node error flow: + return rp.shouldRetryRelay(resultsCount, hashErr, nodeErrors, hash) } } // on BestResult we want to retry if there is no success diff --git a/protocol/rpcconsumer/relay_processor_test.go b/protocol/rpcconsumer/relay_processor_test.go index 418eb0a35f..bb21a8eda3 100644 --- a/protocol/rpcconsumer/relay_processor_test.go +++ b/protocol/rpcconsumer/relay_processor_test.go @@ -7,15 +7,34 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) +type relayProcessorMetricsMock struct{} + +func (romm *relayProcessorMetricsMock) SetRelayNodeErrorMetric(chainId string, apiInterface string) {} + +func (romm *relayProcessorMetricsMock) SetNodeErrorRecoveredSuccessfullyMetric(chainId string, apiInterface string, attempt string) { +} + +func (romm *relayProcessorMetricsMock) SetNodeErrorAttemptMetric(chainId string, apiInterface string) { +} + +func (romm *relayProcessorMetricsMock) GetChainIdAndApiInterface() (string, string) { + return "testId", "testInterface" +} + +var ( + relayRetriesManagerInstance = NewRelayRetriesManager() + relayProcessorMetrics = &relayProcessorMetricsMock{} +) + func sendSuccessResp(relayProcessor *RelayProcessor, provider string, delay time.Duration) { time.Sleep(delay) relayProcessor.GetUsedProviders().RemoveUsed(provider, nil) @@ -78,21 +97,21 @@ func TestRelayProcessorHappyFlow(t *testing.T) { w.WriteHeader(http.StatusOK) }) specId := "LAV1" - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } require.NoError(t, err) chainMsg, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) usedProviders := relayProcessor.GetUsedProviders() ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} @@ -112,6 +131,183 @@ func TestRelayProcessorHappyFlow(t *testing.T) { }) } +func TestRelayProcessorNodeErrorRetryFlow(t *testing.T) { + t.Run("retry_flow", func(t *testing.T) { + ctx := context.Background() + serverHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Handle the incoming request and provide the desired response + w.WriteHeader(http.StatusOK) + }) + specId := "LAV1" + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) + chainMsg, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) + + usedProviders := relayProcessor.GetUsedProviders() + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) + defer cancel() + canUse := usedProviders.TryLockSelection(ctx) + require.NoError(t, ctx.Err()) + require.Nil(t, canUse) + require.Zero(t, usedProviders.CurrentlyUsed()) + require.Zero(t, usedProviders.SessionsLatestBatch()) + consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} + usedProviders.AddUsed(consumerSessionsMap, nil) + // check first reply + go sendNodeError(relayProcessor, "lava@test", time.Millisecond*5) + err = relayProcessor.WaitForResults(context.Background()) + require.NoError(t, err) + resultsOk := relayProcessor.HasResults() + require.True(t, resultsOk) + requiredNodeResults := relayProcessor.HasRequiredNodeResults() + require.False(t, requiredNodeResults) + // check first retry + go sendNodeError(relayProcessor, "lava@test", time.Millisecond*5) + err = relayProcessor.WaitForResults(context.Background()) + require.NoError(t, err) + resultsOk = relayProcessor.HasResults() + require.True(t, resultsOk) + requiredNodeResults = relayProcessor.HasRequiredNodeResults() + require.False(t, requiredNodeResults) + + // check first second retry + go sendNodeError(relayProcessor, "lava@test", time.Millisecond*5) + err = relayProcessor.WaitForResults(context.Background()) + require.NoError(t, err) + resultsOk = relayProcessor.HasResults() + require.True(t, resultsOk) + requiredNodeResults = relayProcessor.HasRequiredNodeResults() + require.True(t, requiredNodeResults) + + // 2nd relay, same inputs + // check hash map flow: + chainMsg, err = chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + relayProcessor = NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) + usedProviders = relayProcessor.GetUsedProviders() + ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*10) + defer cancel() + canUse = usedProviders.TryLockSelection(ctx) + require.NoError(t, ctx.Err()) + require.Nil(t, canUse) + require.Zero(t, usedProviders.CurrentlyUsed()) + require.Zero(t, usedProviders.SessionsLatestBatch()) + consumerSessionsMap = lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} + usedProviders.AddUsed(consumerSessionsMap, nil) + // check first reply, this time we have hash in map, so we don't retry node errors. + go sendNodeError(relayProcessor, "lava@test", time.Millisecond*5) + err = relayProcessor.WaitForResults(context.Background()) + require.NoError(t, err) + resultsOk = relayProcessor.HasResults() + require.True(t, resultsOk) + requiredNodeResults = relayProcessor.HasRequiredNodeResults() + require.True(t, requiredNodeResults) + + // 3nd relay, different inputs + // check hash map flow: + chainMsg, err = chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/18", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + relayProcessor = NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) + usedProviders = relayProcessor.GetUsedProviders() + ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*10) + defer cancel() + canUse = usedProviders.TryLockSelection(ctx) + require.NoError(t, ctx.Err()) + require.Nil(t, canUse) + require.Zero(t, usedProviders.CurrentlyUsed()) + require.Zero(t, usedProviders.SessionsLatestBatch()) + consumerSessionsMap = lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} + usedProviders.AddUsed(consumerSessionsMap, nil) + // check first reply, this time we have hash in map, so we don't retry node errors. + go sendNodeError(relayProcessor, "lava@test", time.Millisecond*5) + err = relayProcessor.WaitForResults(context.Background()) + require.NoError(t, err) + resultsOk = relayProcessor.HasResults() + require.True(t, resultsOk) + requiredNodeResults = relayProcessor.HasRequiredNodeResults() + // check our hashing mechanism works with different inputs + require.False(t, requiredNodeResults) + + // 4th relay, same inputs, this time a successful relay, should remove the hash from the map + chainMsg, err = chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + relayProcessor = NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) + usedProviders = relayProcessor.GetUsedProviders() + ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*10) + defer cancel() + canUse = usedProviders.TryLockSelection(ctx) + require.NoError(t, ctx.Err()) + require.Nil(t, canUse) + require.Zero(t, usedProviders.CurrentlyUsed()) + require.Zero(t, usedProviders.SessionsLatestBatch()) + consumerSessionsMap = lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} + usedProviders.AddUsed(consumerSessionsMap, nil) + // check first reply, this time we have hash in map, so we don't retry node errors. + hash, err := relayProcessor.getInputMsgInfoHashString() + require.NoError(t, err) + require.True(t, relayProcessor.relayRetriesManager.CheckHashInCache(hash)) + go sendSuccessResp(relayProcessor, "lava@test", time.Millisecond*5) + err = relayProcessor.WaitForResults(context.Background()) + require.NoError(t, err) + resultsOk = relayProcessor.HasResults() + require.True(t, resultsOk) + requiredNodeResults = relayProcessor.HasRequiredNodeResults() + require.True(t, requiredNodeResults) + + // A way for us to break early from sleep, just waiting up to 5 seconds and breaking as soon as the value we expect is there. + // After 5 seconds if its not there test will fail + for i := 0; i < 100; i++ { + if !relayProcessor.relayRetriesManager.CheckHashInCache(hash) { + break + } + time.Sleep(time.Millisecond * 50) // sleep up to 5 seconds + } + // after the sleep we should not have the hash anymore in the map as it was removed by a successful relay. + require.False(t, relayProcessor.relayRetriesManager.CheckHashInCache(hash)) + }) + + t.Run("retry_flow_disabled", func(t *testing.T) { + ctx := context.Background() + serverHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Handle the incoming request and provide the desired response + w.WriteHeader(http.StatusOK) + }) + specId := "LAV1" + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) + if closeServer != nil { + defer closeServer() + } + require.NoError(t, err) + chainMsg, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) + require.NoError(t, err) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) + relayProcessor.disableRelayRetry = true + usedProviders := relayProcessor.GetUsedProviders() + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) + defer cancel() + canUse := usedProviders.TryLockSelection(ctx) + require.NoError(t, ctx.Err()) + require.Nil(t, canUse) + require.Zero(t, usedProviders.CurrentlyUsed()) + require.Zero(t, usedProviders.SessionsLatestBatch()) + consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} + usedProviders.AddUsed(consumerSessionsMap, nil) + // check first reply + go sendNodeError(relayProcessor, "lava@test", time.Millisecond*5) + err = relayProcessor.WaitForResults(context.Background()) + require.NoError(t, err) + resultsOk := relayProcessor.HasResults() + require.True(t, resultsOk) + requiredNodeResults := relayProcessor.HasRequiredNodeResults() + require.True(t, requiredNodeResults) + }) +} + func TestRelayProcessorTimeout(t *testing.T) { t.Run("timeout", func(t *testing.T) { ctx := context.Background() @@ -120,21 +316,21 @@ func TestRelayProcessorTimeout(t *testing.T) { w.WriteHeader(http.StatusOK) }) specId := "LAV1" - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } require.NoError(t, err) chainMsg, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) usedProviders := relayProcessor.GetUsedProviders() ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} @@ -145,7 +341,7 @@ func TestRelayProcessorTimeout(t *testing.T) { defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava@test3": &lavasession.SessionInfo{}, "lava@test4": &lavasession.SessionInfo{}} usedProviders.AddUsed(consumerSessionsMap, nil) }() @@ -172,21 +368,21 @@ func TestRelayProcessorRetry(t *testing.T) { w.WriteHeader(http.StatusOK) }) specId := "LAV1" - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } require.NoError(t, err) chainMsg, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) usedProviders := relayProcessor.GetUsedProviders() ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} @@ -216,21 +412,21 @@ func TestRelayProcessorRetryNodeError(t *testing.T) { w.WriteHeader(http.StatusOK) }) specId := "LAV1" - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } require.NoError(t, err) chainMsg, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/17", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) usedProviders := relayProcessor.GetUsedProviders() ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava@test": &lavasession.SessionInfo{}, "lava@test2": &lavasession.SessionInfo{}} @@ -261,20 +457,20 @@ func TestRelayProcessorStatefulApi(t *testing.T) { w.WriteHeader(http.StatusOK) }) specId := "LAV1" - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } require.NoError(t, err) chainMsg, err := chainParser.ParseMsg("/cosmos/tx/v1beta1/txs", []byte("data"), http.MethodPost, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) usedProviders := relayProcessor.GetUsedProviders() ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava4@test": &lavasession.SessionInfo{}, "lava3@test": &lavasession.SessionInfo{}, "lava@test": &lavasession.SessionInfo{}, "lava2@test": &lavasession.SessionInfo{}} @@ -306,20 +502,20 @@ func TestRelayProcessorStatefulApiErr(t *testing.T) { w.WriteHeader(http.StatusOK) }) specId := "LAV1" - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } require.NoError(t, err) chainMsg, err := chainParser.ParseMsg("/cosmos/tx/v1beta1/txs", []byte("data"), http.MethodPost, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) usedProviders := relayProcessor.GetUsedProviders() ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) consumerSessionsMap := lavasession.ConsumerSessionsMap{"lava4@test": &lavasession.SessionInfo{}, "lava3@test": &lavasession.SessionInfo{}, "lava@test": &lavasession.SessionInfo{}, "lava2@test": &lavasession.SessionInfo{}} @@ -350,20 +546,20 @@ func TestRelayProcessorLatest(t *testing.T) { w.WriteHeader(http.StatusOK) }) specId := "LAV1" - chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, _, _, closeServer, _, err := chainlib.CreateChainLibMocks(ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } require.NoError(t, err) chainMsg, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/latest", nil, http.MethodGet, nil, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMsg, nil, "", "", false, relayProcessorMetrics, relayProcessorMetrics, false, relayRetriesManagerInstance) usedProviders := relayProcessor.GetUsedProviders() ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*10) defer cancel() canUse := usedProviders.TryLockSelection(ctx) require.NoError(t, ctx.Err()) - require.True(t, canUse) + require.Nil(t, canUse) require.Zero(t, usedProviders.CurrentlyUsed()) require.Zero(t, usedProviders.SessionsLatestBatch()) diff --git a/protocol/rpcconsumer/relay_retries_manager.go b/protocol/rpcconsumer/relay_retries_manager.go new file mode 100644 index 0000000000..aa14324dbe --- /dev/null +++ b/protocol/rpcconsumer/relay_retries_manager.go @@ -0,0 +1,43 @@ +package rpcconsumer + +import ( + "time" + + "github.com/dgraph-io/ristretto" + "github.com/lavanet/lava/v2/utils" +) + +// entries ttl duration +const RetryEntryTTL = 6 * time.Hour + +// On node errors we try to send a relay again. +// If this relay failed all retries we ban it from retries to avoid spam and save resources +type RelayRetriesManager struct { + cache *ristretto.Cache +} + +func NewRelayRetriesManager() *RelayRetriesManager { + cache, err := ristretto.NewCache(&ristretto.Config{NumCounters: CacheNumCounters, MaxCost: CacheMaxCost, BufferItems: 64, IgnoreInternalCost: true}) + if err != nil { + utils.LavaFormatFatal("failed setting up cache for consumer consistency", err) + } + return &RelayRetriesManager{ + cache: cache, + } +} + +// Check if we already have this hash so we don't retry. +func (rrm *RelayRetriesManager) CheckHashInCache(hash string) bool { + _, found := rrm.cache.Get(hash) + return found +} + +// Add hash to the retry cache. +func (rrm *RelayRetriesManager) AddHashToCache(hash string) { + rrm.cache.SetWithTTL(hash, struct{}{}, 1, RetryEntryTTL) +} + +// Remove hash from cache if it exists +func (rrm *RelayRetriesManager) RemoveHashFromCache(hash string) { + rrm.cache.Del(hash) +} diff --git a/protocol/rpcconsumer/relayer_client_mock.go b/protocol/rpcconsumer/relayer_client_mock.go new file mode 100644 index 0000000000..987cbf603b --- /dev/null +++ b/protocol/rpcconsumer/relayer_client_mock.go @@ -0,0 +1,412 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/pairing/types/relay.pb.go +// +// Generated by this command: +// +// mockgen -source=x/pairing/types/relay.pb.go -destination protocol/rpcconsumer/relayer_client_mock.go -package rpcconsumer +// + +// Package rpcconsumer is a generated GoMock package. +package rpcconsumer + +import ( + context "context" + reflect "reflect" + + types "github.com/lavanet/lava/v2/x/pairing/types" + gomock "go.uber.org/mock/gomock" + grpc "google.golang.org/grpc" + metadata "google.golang.org/grpc/metadata" +) + +// MockRelayerClient is a mock of RelayerClient interface. +type MockRelayerClient struct { + ctrl *gomock.Controller + recorder *MockRelayerClientMockRecorder +} + +// MockRelayerClientMockRecorder is the mock recorder for MockRelayerClient. +type MockRelayerClientMockRecorder struct { + mock *MockRelayerClient +} + +// NewMockRelayerClient creates a new mock instance. +func NewMockRelayerClient(ctrl *gomock.Controller) *MockRelayerClient { + mock := &MockRelayerClient{ctrl: ctrl} + mock.recorder = &MockRelayerClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayerClient) EXPECT() *MockRelayerClientMockRecorder { + return m.recorder +} + +// Probe mocks base method. +func (m *MockRelayerClient) Probe(ctx context.Context, in *types.ProbeRequest, opts ...grpc.CallOption) (*types.ProbeReply, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Probe", varargs...) + ret0, _ := ret[0].(*types.ProbeReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Probe indicates an expected call of Probe. +func (mr *MockRelayerClientMockRecorder) Probe(ctx, in any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Probe", reflect.TypeOf((*MockRelayerClient)(nil).Probe), varargs...) +} + +// Relay mocks base method. +func (m *MockRelayerClient) Relay(ctx context.Context, in *types.RelayRequest, opts ...grpc.CallOption) (*types.RelayReply, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Relay", varargs...) + ret0, _ := ret[0].(*types.RelayReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Relay indicates an expected call of Relay. +func (mr *MockRelayerClientMockRecorder) Relay(ctx, in any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Relay", reflect.TypeOf((*MockRelayerClient)(nil).Relay), varargs...) +} + +// RelaySubscribe mocks base method. +func (m *MockRelayerClient) RelaySubscribe(ctx context.Context, in *types.RelayRequest, opts ...grpc.CallOption) (types.Relayer_RelaySubscribeClient, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RelaySubscribe", varargs...) + ret0, _ := ret[0].(types.Relayer_RelaySubscribeClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RelaySubscribe indicates an expected call of RelaySubscribe. +func (mr *MockRelayerClientMockRecorder) RelaySubscribe(ctx, in any, opts ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RelaySubscribe", reflect.TypeOf((*MockRelayerClient)(nil).RelaySubscribe), varargs...) +} + +// MockRelayer_RelaySubscribeClient is a mock of Relayer_RelaySubscribeClient interface. +type MockRelayer_RelaySubscribeClient struct { + ctrl *gomock.Controller + recorder *MockRelayer_RelaySubscribeClientMockRecorder +} + +// MockRelayer_RelaySubscribeClientMockRecorder is the mock recorder for MockRelayer_RelaySubscribeClient. +type MockRelayer_RelaySubscribeClientMockRecorder struct { + mock *MockRelayer_RelaySubscribeClient +} + +// NewMockRelayer_RelaySubscribeClient creates a new mock instance. +func NewMockRelayer_RelaySubscribeClient(ctrl *gomock.Controller) *MockRelayer_RelaySubscribeClient { + mock := &MockRelayer_RelaySubscribeClient{ctrl: ctrl} + mock.recorder = &MockRelayer_RelaySubscribeClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayer_RelaySubscribeClient) EXPECT() *MockRelayer_RelaySubscribeClientMockRecorder { + return m.recorder +} + +// CloseSend mocks base method. +func (m *MockRelayer_RelaySubscribeClient) CloseSend() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CloseSend") + ret0, _ := ret[0].(error) + return ret0 +} + +// CloseSend indicates an expected call of CloseSend. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) CloseSend() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).CloseSend)) +} + +// Context mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Context)) +} + +// Header mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Header() (metadata.MD, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Header") + ret0, _ := ret[0].(metadata.MD) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Header indicates an expected call of Header. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Header() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Header)) +} + +// Recv mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Recv() (*types.RelayReply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Recv") + ret0, _ := ret[0].(*types.RelayReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Recv indicates an expected call of Recv. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Recv() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Recv)) +} + +// RecvMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeClient) RecvMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "RecvMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) RecvMsg(m any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).RecvMsg), m) +} + +// SendMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeClient) SendMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "SendMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) SendMsg(m any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).SendMsg), m) +} + +// Trailer mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Trailer() metadata.MD { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Trailer") + ret0, _ := ret[0].(metadata.MD) + return ret0 +} + +// Trailer indicates an expected call of Trailer. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Trailer() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Trailer)) +} + +// MockRelayerServer is a mock of RelayerServer interface. +type MockRelayerServer struct { + ctrl *gomock.Controller + recorder *MockRelayerServerMockRecorder +} + +// MockRelayerServerMockRecorder is the mock recorder for MockRelayerServer. +type MockRelayerServerMockRecorder struct { + mock *MockRelayerServer +} + +// NewMockRelayerServer creates a new mock instance. +func NewMockRelayerServer(ctrl *gomock.Controller) *MockRelayerServer { + mock := &MockRelayerServer{ctrl: ctrl} + mock.recorder = &MockRelayerServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayerServer) EXPECT() *MockRelayerServerMockRecorder { + return m.recorder +} + +// Probe mocks base method. +func (m *MockRelayerServer) Probe(arg0 context.Context, arg1 *types.ProbeRequest) (*types.ProbeReply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Probe", arg0, arg1) + ret0, _ := ret[0].(*types.ProbeReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Probe indicates an expected call of Probe. +func (mr *MockRelayerServerMockRecorder) Probe(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Probe", reflect.TypeOf((*MockRelayerServer)(nil).Probe), arg0, arg1) +} + +// Relay mocks base method. +func (m *MockRelayerServer) Relay(arg0 context.Context, arg1 *types.RelayRequest) (*types.RelayReply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Relay", arg0, arg1) + ret0, _ := ret[0].(*types.RelayReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Relay indicates an expected call of Relay. +func (mr *MockRelayerServerMockRecorder) Relay(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Relay", reflect.TypeOf((*MockRelayerServer)(nil).Relay), arg0, arg1) +} + +// RelaySubscribe mocks base method. +func (m *MockRelayerServer) RelaySubscribe(arg0 *types.RelayRequest, arg1 types.Relayer_RelaySubscribeServer) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RelaySubscribe", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// RelaySubscribe indicates an expected call of RelaySubscribe. +func (mr *MockRelayerServerMockRecorder) RelaySubscribe(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RelaySubscribe", reflect.TypeOf((*MockRelayerServer)(nil).RelaySubscribe), arg0, arg1) +} + +// MockRelayer_RelaySubscribeServer is a mock of Relayer_RelaySubscribeServer interface. +type MockRelayer_RelaySubscribeServer struct { + ctrl *gomock.Controller + recorder *MockRelayer_RelaySubscribeServerMockRecorder +} + +// MockRelayer_RelaySubscribeServerMockRecorder is the mock recorder for MockRelayer_RelaySubscribeServer. +type MockRelayer_RelaySubscribeServerMockRecorder struct { + mock *MockRelayer_RelaySubscribeServer +} + +// NewMockRelayer_RelaySubscribeServer creates a new mock instance. +func NewMockRelayer_RelaySubscribeServer(ctrl *gomock.Controller) *MockRelayer_RelaySubscribeServer { + mock := &MockRelayer_RelaySubscribeServer{ctrl: ctrl} + mock.recorder = &MockRelayer_RelaySubscribeServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayer_RelaySubscribeServer) EXPECT() *MockRelayer_RelaySubscribeServerMockRecorder { + return m.recorder +} + +// Context mocks base method. +func (m *MockRelayer_RelaySubscribeServer) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).Context)) +} + +// RecvMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeServer) RecvMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "RecvMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) RecvMsg(m any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).RecvMsg), m) +} + +// Send mocks base method. +func (m *MockRelayer_RelaySubscribeServer) Send(arg0 *types.RelayReply) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Send", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Send indicates an expected call of Send. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Send(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).Send), arg0) +} + +// SendHeader mocks base method. +func (m *MockRelayer_RelaySubscribeServer) SendHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendHeader indicates an expected call of SendHeader. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendHeader(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SendHeader), arg0) +} + +// SendMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeServer) SendMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "SendMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendMsg(m any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SendMsg), m) +} + +// SetHeader mocks base method. +func (m *MockRelayer_RelaySubscribeServer) SetHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetHeader indicates an expected call of SetHeader. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetHeader(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SetHeader), arg0) +} + +// SetTrailer mocks base method. +func (m *MockRelayer_RelaySubscribeServer) SetTrailer(arg0 metadata.MD) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetTrailer", arg0) +} + +// SetTrailer indicates an expected call of SetTrailer. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetTrailer(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SetTrailer), arg0) +} diff --git a/protocol/rpcconsumer/rpcconsumer.go b/protocol/rpcconsumer/rpcconsumer.go index fd8bc5ad4b..c5b5a32e5b 100644 --- a/protocol/rpcconsumer/rpcconsumer.go +++ b/protocol/rpcconsumer/rpcconsumer.go @@ -3,6 +3,7 @@ package rpcconsumer import ( "context" "fmt" + "net/http" "os" "os/signal" "strconv" @@ -15,23 +16,26 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/performance" - "github.com/lavanet/lava/protocol/provideroptimizer" - "github.com/lavanet/lava/protocol/statetracker" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/protocol/upgrade" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - plantypes "github.com/lavanet/lava/x/plans/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/performance" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + "github.com/lavanet/lava/v2/protocol/rpcprovider" + "github.com/lavanet/lava/v2/protocol/statetracker" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/protocol/upgrade" + "github.com/lavanet/lava/v2/utils" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -87,11 +91,11 @@ func (s *strategyValue) Type() string { type ConsumerStateTrackerInf interface { RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, versionValidator updaters.VersionValidationInf) - RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager) + RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager, staticProvidersList []*lavasession.RPCProviderEndpoint) RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, endpoint lavasession.RPCEndpoint) error - RegisterFinalizationConsensusForUpdates(context.Context, *lavaprotocol.FinalizationConsensus) + RegisterFinalizationConsensusForUpdates(context.Context, *finalizationconsensus.FinalizationConsensus) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable updaters.DowntimeParamsUpdatable) error - TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict, conflictHandler common.ConflictHandlerInterface) error + TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*plantypes.Policy, error) GetProtocolVersion(ctx context.Context) (*updaters.ProtocolVersionResponse, error) GetLatestVirtualEpoch() uint64 @@ -119,6 +123,7 @@ type rpcConsumerStartOptions struct { cmdFlags common.ConsumerCmdFlags stateShare bool refererData *chainlib.RefererData + staticProvidersList []*lavasession.RPCProviderEndpoint // define static providers as backup to lava providers } // spawns a new RPCConsumer server with all it's processes and internals ready for communications @@ -210,8 +215,19 @@ func (rpcc *RPCConsumer) Start(ctx context.Context, options *rpcConsumerStartOpt } else { policyUpdaters.Store(rpcEndpoint.ChainID, updaters.NewPolicyUpdater(chainID, consumerStateTracker, consumerAddr.String(), chainParser, *rpcEndpoint)) } - // register for spec updates - err = rpcc.consumerStateTracker.RegisterForSpecUpdates(ctx, chainParser, *rpcEndpoint) + + if options.cmdFlags.OfflineSpecPath != "" { + // offline spec mode. + parsedOfflineSpec, loadError := specutils.GetSpecFromPath(options.cmdFlags.OfflineSpecPath, rpcEndpoint.ChainID, nil, nil) + if loadError != nil { + err = utils.LavaFormatError("failed loading offline spec", err, utils.LogAttr("spec_path", options.cmdFlags.OfflineSpecPath), utils.LogAttr("spec_id", rpcEndpoint.ChainID)) + } + utils.LavaFormatInfo("Loaded offline spec successfully", utils.LogAttr("spec_path", options.cmdFlags.OfflineSpecPath), utils.LogAttr("chain_id", parsedOfflineSpec.Index)) + chainParser.SetSpec(parsedOfflineSpec) + } else { + // register for spec updates + err = rpcc.consumerStateTracker.RegisterForSpecUpdates(ctx, chainParser, *rpcEndpoint) + } if err != nil { err = utils.LavaFormatError("failed registering for spec updates", err, utils.Attribute{Key: "endpoint", Value: rpcEndpoint}) errCh <- err @@ -221,7 +237,7 @@ func (rpcc *RPCConsumer) Start(ctx context.Context, options *rpcConsumerStartOpt _, averageBlockTime, _, _ := chainParser.ChainBlockStats() var optimizer *provideroptimizer.ProviderOptimizer var consumerConsistency *ConsumerConsistency - var finalizationConsensus *lavaprotocol.FinalizationConsensus + var finalizationConsensus *finalizationconsensus.FinalizationConsensus getOrCreateChainAssets := func() error { // this is locked so we don't race optimizers creation chainMutexes[chainID].Lock() @@ -256,12 +272,12 @@ func (rpcc *RPCConsumer) Start(ctx context.Context, options *rpcConsumerStartOpt value, exists = finalizationConsensuses.Load(chainID) if !exists { // doesn't exist for this chain create a new one - finalizationConsensus = lavaprotocol.NewFinalizationConsensus(rpcEndpoint.ChainID) + finalizationConsensus = finalizationconsensus.NewFinalizationConsensus(rpcEndpoint.ChainID) consumerStateTracker.RegisterFinalizationConsensusForUpdates(ctx, finalizationConsensus) finalizationConsensuses.Store(chainID, finalizationConsensus) } else { var ok bool - finalizationConsensus, ok = value.(*lavaprotocol.FinalizationConsensus) + finalizationConsensus, ok = value.(*finalizationconsensus.FinalizationConsensus) if !ok { err = utils.LavaFormatError("failed loading finalization consensus, value is of the wrong type", nil, utils.Attribute{Key: "endpoint", Value: rpcEndpoint.Key()}) return err @@ -281,18 +297,29 @@ func (rpcc *RPCConsumer) Start(ctx context.Context, options *rpcConsumerStartOpt return err } + // Create active subscription provider storage for each unique chain + activeSubscriptionProvidersStorage := lavasession.NewActiveSubscriptionProvidersStorage() + consumerSessionManager := lavasession.NewConsumerSessionManager(rpcEndpoint, optimizer, consumerMetricsManager, consumerReportsManager, consumerAddr.String(), activeSubscriptionProvidersStorage) // Register For Updates - consumerSessionManager := lavasession.NewConsumerSessionManager(rpcEndpoint, optimizer, consumerMetricsManager, consumerReportsManager, consumerAddr.String()) - rpcc.consumerStateTracker.RegisterConsumerSessionManagerForPairingUpdates(ctx, consumerSessionManager) + rpcc.consumerStateTracker.RegisterConsumerSessionManagerForPairingUpdates(ctx, consumerSessionManager, options.staticProvidersList) var relaysMonitor *metrics.RelaysMonitor if options.cmdFlags.RelaysHealthEnableFlag { relaysMonitor = metrics.NewRelaysMonitor(options.cmdFlags.RelaysHealthIntervalFlag, rpcEndpoint.ChainID, rpcEndpoint.ApiInterface) relaysMonitorAggregator.RegisterRelaysMonitor(rpcEndpoint.String(), relaysMonitor) } + rpcConsumerServer := &RPCConsumerServer{} + + var consumerWsSubscriptionManager *chainlib.ConsumerWSSubscriptionManager + var specMethodType string + if rpcEndpoint.ApiInterface == spectypes.APIInterfaceJsonRPC { + specMethodType = http.MethodPost + } + consumerWsSubscriptionManager = chainlib.NewConsumerWSSubscriptionManager(consumerSessionManager, rpcConsumerServer, options.refererData, specMethodType, chainParser, activeSubscriptionProvidersStorage) + utils.LavaFormatInfo("RPCConsumer Listening", utils.Attribute{Key: "endpoints", Value: rpcEndpoint.String()}) - err = rpcConsumerServer.ServeRPCRequests(ctx, rpcEndpoint, rpcc.consumerStateTracker, chainParser, finalizationConsensus, consumerSessionManager, options.requiredResponses, privKey, lavaChainID, options.cache, rpcConsumerMetrics, consumerAddr, consumerConsistency, relaysMonitor, options.cmdFlags, options.stateShare, options.refererData, consumerReportsManager) + err = rpcConsumerServer.ServeRPCRequests(ctx, rpcEndpoint, rpcc.consumerStateTracker, chainParser, finalizationConsensus, consumerSessionManager, options.requiredResponses, privKey, lavaChainID, options.cache, rpcConsumerMetrics, consumerAddr, consumerConsistency, relaysMonitor, options.cmdFlags, options.stateShare, options.refererData, consumerReportsManager, consumerWsSubscriptionManager) if err != nil { err = utils.LavaFormatError("failed serving rpc requests", err, utils.Attribute{Key: "endpoint", Value: rpcEndpoint}) errCh <- err @@ -488,8 +515,27 @@ rpcconsumer consumer_examples/full_consumer_example.yml --cache-be "127.0.0.1:77 if err != nil { utils.LavaFormatFatal("failed to create tx factory", err) } - txFactory = txFactory.WithGasAdjustment(viper.GetFloat64(flags.FlagGasAdjustment)) + gasPricesStr := viper.GetString(flags.FlagGasPrices) + if gasPricesStr == "" { + gasPricesStr = statetracker.DefaultGasPrice + } + // check if StaticProvidersConfigName exists in viper, if it does parse it with ParseStaticProvider function + var staticProviderEndpoints []*lavasession.RPCProviderEndpoint + if viper.IsSet(common.StaticProvidersConfigName) { + staticProviderEndpoints, err = rpcprovider.ParseEndpointsCustomName(viper.GetViper(), common.StaticProvidersConfigName, geolocation) + if err != nil { + return utils.LavaFormatError("invalid static providers definition", err) + } + for _, endpoint := range staticProviderEndpoints { + utils.LavaFormatInfo("Static Provider Endpoint:", utils.Attribute{Key: "Urls", Value: endpoint.NodeUrls}, utils.Attribute{Key: "Chain ID", Value: endpoint.ChainID}, utils.Attribute{Key: "API Interface", Value: endpoint.ApiInterface}) + } + } + + // set up the txFactory with gas adjustments and gas + txFactory = txFactory.WithGasAdjustment(viper.GetFloat64(flags.FlagGasAdjustment)) + txFactory = txFactory.WithGasPrices(gasPricesStr) + utils.LavaFormatInfo("Setting gas for tx Factory", utils.LogAttr("gas-prices", gasPricesStr), utils.LogAttr("gas-adjustment", txFactory.GasAdjustment())) rpcConsumer := RPCConsumer{} requiredResponses := 1 // TODO: handle secure flag, for a majority between providers utils.LavaFormatInfo("lavap Binary Version: " + upgrade.GetCurrentVersion().ConsumerVersion) @@ -527,7 +573,6 @@ rpcconsumer consumer_examples/full_consumer_example.yml --cache-be "127.0.0.1:77 } maxConcurrentProviders := viper.GetUint(common.MaximumConcurrentProvidersFlagName) - consumerPropagatedFlags := common.ConsumerCmdFlags{ HeadersFlag: viper.GetString(common.CorsHeadersFlag), CredentialsFlag: viper.GetString(common.CorsCredentialsFlag), @@ -538,10 +583,17 @@ rpcconsumer consumer_examples/full_consumer_example.yml --cache-be "127.0.0.1:77 RelaysHealthIntervalFlag: viper.GetDuration(common.RelayHealthIntervalFlag), DebugRelays: viper.GetBool(DebugRelaysFlagName), DisableConflictTransactions: viper.GetBool(common.DisableConflictTransactionsFlag), + DisableRetryOnNodeErrors: viper.GetBool(common.DisableRetryOnNodeErrorsFlag), + OfflineSpecPath: viper.GetString(common.UseOfflineSpecFlag), + } + + // validate user is does not provide multi chain setup when using the offline spec feature. + if consumerPropagatedFlags.OfflineSpecPath != "" && len(rpcEndpoints) > 1 { + utils.LavaFormatFatal("offline spec modifications are supported only in single chain bootstrapping", nil, utils.LogAttr("len(rpcEndpoints)", len(rpcEndpoints)), utils.LogAttr("rpcEndpoints", rpcEndpoints)) } rpcConsumerSharedState := viper.GetBool(common.SharedStateFlag) - err = rpcConsumer.Start(ctx, &rpcConsumerStartOptions{txFactory, clientCtx, rpcEndpoints, requiredResponses, cache, strategyFlag.Strategy, maxConcurrentProviders, analyticsServerAddressess, consumerPropagatedFlags, rpcConsumerSharedState, refererData}) + err = rpcConsumer.Start(ctx, &rpcConsumerStartOptions{txFactory, clientCtx, rpcEndpoints, requiredResponses, cache, strategyFlag.Strategy, maxConcurrentProviders, analyticsServerAddressess, consumerPropagatedFlags, rpcConsumerSharedState, refererData, staticProviderEndpoints}) return err }, } @@ -579,6 +631,8 @@ rpcconsumer consumer_examples/full_consumer_example.yml --cache-be "127.0.0.1:77 cmdRPCConsumer.Flags().BoolVar(&lavasession.DebugProbes, DebugProbesFlagName, false, "adding information to probes") cmdRPCConsumer.Flags().Bool(common.DisableConflictTransactionsFlag, false, "disabling conflict transactions, this flag should not be used as it harms the network's data reliability and therefore the service.") cmdRPCConsumer.Flags().DurationVar(&updaters.TimeOutForFetchingLavaBlocks, common.TimeOutForFetchingLavaBlocksFlag, time.Second*5, "setting the timeout for fetching lava blocks") + cmdRPCConsumer.Flags().Bool(common.DisableRetryOnNodeErrorsFlag, false, "Disable relay retries on node errors, prevent the rpcconsumer trying a different provider") + cmdRPCConsumer.Flags().String(common.UseOfflineSpecFlag, "", "load offline spec provided path to spec file, used to test specs before they are proposed on chain") common.AddRollingLogConfig(cmdRPCConsumer) return cmdRPCConsumer diff --git a/protocol/rpcconsumer/rpcconsumer_server.go b/protocol/rpcconsumer/rpcconsumer_server.go index 12c7cb1982..595038b5a7 100644 --- a/protocol/rpcconsumer/rpcconsumer_server.go +++ b/protocol/rpcconsumer/rpcconsumer_server.go @@ -6,26 +6,32 @@ import ( "fmt" "strconv" "strings" + "sync" "time" + "github.com/goccy/go-json" + sdkerrors "cosmossdk.io/errors" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/performance" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/protocopy" - "github.com/lavanet/lava/utils/rand" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - plantypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationverification" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/performance" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/protocopy" + "github.com/lavanet/lava/v2/utils/rand" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -40,24 +46,35 @@ const ( var NoResponseTimeout = sdkerrors.New("NoResponseTimeout Error", 685, "timeout occurred while waiting for providers responses") +type CancelableContextHolder struct { + Ctx context.Context + CancelFunc context.CancelFunc +} + // implements Relay Sender interfaced and uses an ChainListener to get it called type RPCConsumerServer struct { - chainParser chainlib.ChainParser - consumerSessionManager *lavasession.ConsumerSessionManager - listenEndpoint *lavasession.RPCEndpoint - rpcConsumerLogs *metrics.RPCConsumerLogs - cache *performance.Cache - privKey *btcec.PrivateKey - consumerTxSender ConsumerTxSender - requiredResponses int - finalizationConsensus *lavaprotocol.FinalizationConsensus - lavaChainID string - ConsumerAddress sdk.AccAddress - consumerConsistency *ConsumerConsistency - sharedState bool // using the cache backend to sync the latest seen block with other consumers - relaysMonitor *metrics.RelaysMonitor - reporter metrics.Reporter - debugRelays bool + consumerProcessGuid string + chainParser chainlib.ChainParser + consumerSessionManager *lavasession.ConsumerSessionManager + listenEndpoint *lavasession.RPCEndpoint + rpcConsumerLogs *metrics.RPCConsumerLogs + cache *performance.Cache + privKey *btcec.PrivateKey + consumerTxSender ConsumerTxSender + requiredResponses int + finalizationConsensus finalizationconsensus.FinalizationConsensusInf + lavaChainID string + ConsumerAddress sdk.AccAddress + consumerConsistency *ConsumerConsistency + sharedState bool // using the cache backend to sync the latest seen block with other consumers + relaysMonitor *metrics.RelaysMonitor + reporter metrics.Reporter + debugRelays bool + connectedSubscriptionsContexts map[string]*CancelableContextHolder + chainListener chainlib.ChainListener + connectedSubscriptionsLock sync.RWMutex + disableNodeErrorRetry bool + relayRetriesManager *RelayRetriesManager } type relayResponse struct { @@ -66,7 +83,7 @@ type relayResponse struct { } type ConsumerTxSender interface { - TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict, conflictHandler common.ConflictHandlerInterface) error + TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*plantypes.Policy, error) GetLatestVirtualEpoch() uint64 } @@ -74,7 +91,7 @@ type ConsumerTxSender interface { func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, consumerStateTracker ConsumerStateTrackerInf, chainParser chainlib.ChainParser, - finalizationConsensus *lavaprotocol.FinalizationConsensus, + finalizationConsensus finalizationconsensus.FinalizationConsensusInf, consumerSessionManager *lavasession.ConsumerSessionManager, requiredResponses int, privKey *btcec.PrivateKey, @@ -88,6 +105,7 @@ func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndp sharedState bool, refererData *chainlib.RefererData, reporter metrics.Reporter, + consumerWsSubscriptionManager *chainlib.ConsumerWSSubscriptionManager, ) (err error) { rpccs.consumerSessionManager = consumerSessionManager rpccs.listenEndpoint = listenEndpoint @@ -104,12 +122,16 @@ func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndp rpccs.sharedState = sharedState rpccs.reporter = reporter rpccs.debugRelays = cmdFlags.DebugRelays - chainListener, err := chainlib.NewChainListener(ctx, listenEndpoint, rpccs, rpccs, rpcConsumerLogs, chainParser, refererData) + rpccs.connectedSubscriptionsContexts = make(map[string]*CancelableContextHolder) + rpccs.consumerProcessGuid = strconv.FormatUint(utils.GenerateUniqueIdentifier(), 10) + rpccs.disableNodeErrorRetry = cmdFlags.DisableRetryOnNodeErrors + rpccs.relayRetriesManager = NewRelayRetriesManager() + rpccs.chainListener, err = chainlib.NewChainListener(ctx, listenEndpoint, rpccs, rpccs, rpcConsumerLogs, chainParser, refererData, consumerWsSubscriptionManager) if err != nil { return err } - go chainListener.Serve(ctx, cmdFlags) + go rpccs.chainListener.Serve(ctx, cmdFlags) initialRelays := true rpccs.relaysMonitor = relaysMonitor @@ -130,6 +152,14 @@ func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndp return nil } +func (rpccs *RPCConsumerServer) SetConsistencySeenBlock(blockSeen int64, key string) { + rpccs.consumerConsistency.SetSeenBlockFromKey(blockSeen, key) +} + +func (rpccs *RPCConsumerServer) GetListeningAddress() string { + return rpccs.chainListener.GetListeningAddress() +} + func (rpccs *RPCConsumerServer) sendCraftedRelaysWrapper(initialRelays bool) (bool, error) { if initialRelays { // Only start after everything is initialized - check consumer session manager @@ -169,13 +199,14 @@ func (rpccs *RPCConsumerServer) waitForPairing() { } func (rpccs *RPCConsumerServer) craftRelay(ctx context.Context) (ok bool, relay *pairingtypes.RelayPrivateData, chainMessage chainlib.ChainMessage, err error) { - parsing, collectionData, ok := rpccs.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) + parsing, apiCollection, ok := rpccs.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) if !ok { return false, nil, nil, utils.LavaFormatWarning("did not send initial relays because the spec does not contain "+spectypes.FUNCTION_TAG_GET_BLOCKNUM.String(), nil, utils.LogAttr("chainID", rpccs.listenEndpoint.ChainID), utils.LogAttr("APIInterface", rpccs.listenEndpoint.ApiInterface), ) } + collectionData := apiCollection.CollectionData path := parsing.ApiName data := []byte(parsing.FunctionTemplate) @@ -192,16 +223,16 @@ func (rpccs *RPCConsumerServer) craftRelay(ctx context.Context) (ok bool, relay return } -func (rpccs *RPCConsumerServer) sendRelayWithRetries(ctx context.Context, retries int, initialRelays bool, relay *pairingtypes.RelayPrivateData, chainMessage chainlib.ChainMessage) (bool, error) { +func (rpccs *RPCConsumerServer) sendRelayWithRetries(ctx context.Context, retries int, initialRelays bool, protocolMessage chainlib.ProtocolMessage) (bool, error) { success := false var err error - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, chainMessage, rpccs.consumerConsistency, "-init-", "", rpccs.debugRelays) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(nil), 1, protocolMessage, rpccs.consumerConsistency, "-init-", "", rpccs.debugRelays, rpccs.rpcConsumerLogs, rpccs, rpccs.disableNodeErrorRetry, rpccs.relayRetriesManager) for i := 0; i < retries; i++ { - err = rpccs.sendRelayToProvider(ctx, chainMessage, relay, "-init-", "", relayProcessor) + err = rpccs.sendRelayToProvider(ctx, protocolMessage, "-init-", "", relayProcessor, nil) if lavasession.PairingListEmptyError.Is(err) { // we don't have pairings anymore, could be related to unwanted providers relayProcessor.GetUsedProviders().ClearUnwanted() - err = rpccs.sendRelayToProvider(ctx, chainMessage, relay, "-init-", "", relayProcessor) + err = rpccs.sendRelayToProvider(ctx, protocolMessage, "-init-", "", relayProcessor, nil) } if err != nil { utils.LavaFormatError("[-] failed sending init relay", err, []utils.Attribute{{Key: "chainID", Value: rpccs.listenEndpoint.ChainID}, {Key: "APIInterface", Value: rpccs.listenEndpoint.ApiInterface}, {Key: "relayProcessor", Value: relayProcessor}}...) @@ -212,7 +243,13 @@ func (rpccs *RPCConsumerServer) sendRelayWithRetries(ctx context.Context, retrie } else { relayResult, err := relayProcessor.ProcessingResult() if err == nil { - utils.LavaFormatInfo("[+] init relay succeeded", []utils.Attribute{{Key: "chainID", Value: rpccs.listenEndpoint.ChainID}, {Key: "APIInterface", Value: rpccs.listenEndpoint.ApiInterface}, {Key: "latestBlock", Value: relayResult.Reply.LatestBlock}, {Key: "provider address", Value: relayResult.ProviderInfo.ProviderAddress}}...) + utils.LavaFormatInfo("[+] init relay succeeded", + utils.LogAttr("GUID", ctx), + utils.LogAttr("chainID", rpccs.listenEndpoint.ChainID), + utils.LogAttr("APIInterface", rpccs.listenEndpoint.ApiInterface), + utils.LogAttr("latestBlock", relayResult.Reply.LatestBlock), + utils.LogAttr("provider address", relayResult.ProviderInfo.ProviderAddress), + ) rpccs.relaysMonitor.LogRelay() success = true // If this is the first time we send relays, we want to send all of them, instead of break on first successful relay @@ -241,14 +278,19 @@ func (rpccs *RPCConsumerServer) sendCraftedRelays(retries int, initialRelays boo ctx := utils.WithUniqueIdentifier(context.Background(), utils.GenerateUniqueIdentifier()) ok, relay, chainMessage, err := rpccs.craftRelay(ctx) if !ok { + enabled, _ := rpccs.chainParser.DataReliabilityParams() + // if DR is disabled it's okay to not have GET_BLOCKNUM + if !enabled { + return true, nil + } return false, err } - - return rpccs.sendRelayWithRetries(ctx, retries, initialRelays, relay, chainMessage) + protocolMessage := chainlib.NewProtocolMessage(chainMessage, nil, relay) + return rpccs.sendRelayWithRetries(ctx, retries, initialRelays, protocolMessage) } func (rpccs *RPCConsumerServer) getLatestBlock() uint64 { - latestKnownBlock, numProviders := rpccs.finalizationConsensus.ExpectedBlockHeight(rpccs.chainParser) + latestKnownBlock, numProviders := rpccs.finalizationConsensus.GetExpectedBlockHeight(rpccs.chainParser) if numProviders > 0 && latestKnownBlock > 0 { return uint64(latestKnownBlock) } @@ -266,42 +308,69 @@ func (rpccs *RPCConsumerServer) SendRelay( analytics *metrics.RelayMetrics, metadata []pairingtypes.Metadata, ) (relayResult *common.RelayResult, errRet error) { + protocolMessage, err := rpccs.ParseRelay(ctx, url, req, connectionType, dappID, consumerIp, analytics, metadata) + if err != nil { + return nil, err + } + + return rpccs.SendParsedRelay(ctx, dappID, consumerIp, analytics, protocolMessage) +} + +func (rpccs *RPCConsumerServer) ParseRelay( + ctx context.Context, + url string, + req string, + connectionType string, + dappID string, + consumerIp string, + analytics *metrics.RelayMetrics, + metadata []pairingtypes.Metadata, +) (protocolMessage chainlib.ProtocolMessage, err error) { // gets the relay request data from the ChainListener // parses the request into an APIMessage, and validating it corresponds to the spec currently in use // construct the common data for a relay message, common data is identical across multiple sends and data reliability - // sends a relay message to a provider - // compares the result with other providers if defined so - // compares the response with other consumer wallets if defined so - // asynchronously sends data reliability if necessary // remove lava directive headers metadata, directiveHeaders := rpccs.LavaDirectiveHeaders(metadata) - relaySentTime := time.Now() chainMessage, err := rpccs.chainParser.ParseMsg(url, []byte(req), connectionType, metadata, rpccs.getExtensionsFromDirectiveHeaders(directiveHeaders)) if err != nil { return nil, err } - // temporarily disable subscriptions - isSubscription := chainlib.IsSubscription(chainMessage) - if isSubscription { - return &common.RelayResult{ProviderInfo: common.ProviderInfo{ProviderAddress: ""}}, utils.LavaFormatError("Subscriptions are not supported at the moment", nil) - } rpccs.HandleDirectiveHeadersForMessage(chainMessage, directiveHeaders) + // do this in a loop with retry attempts, configurable via a flag, limited by the number of providers in CSM reqBlock, _ := chainMessage.RequestedBlock() seenBlock, _ := rpccs.consumerConsistency.GetSeenBlock(dappID, consumerIp) if seenBlock < 0 { seenBlock = 0 } + relayRequestData := lavaprotocol.NewRelayData(ctx, connectionType, url, []byte(req), seenBlock, reqBlock, rpccs.listenEndpoint.ApiInterface, chainMessage.GetRPCMessage().GetHeaders(), chainlib.GetAddon(chainMessage), common.GetExtensionNames(chainMessage.GetExtensions())) + protocolMessage = chainlib.NewProtocolMessage(chainMessage, directiveHeaders, relayRequestData) + return protocolMessage, nil +} + +func (rpccs *RPCConsumerServer) SendParsedRelay( + ctx context.Context, + dappID string, + consumerIp string, + analytics *metrics.RelayMetrics, + protocolMessage chainlib.ProtocolMessage, +) (relayResult *common.RelayResult, errRet error) { + // sends a relay message to a provider + // compares the result with other providers if defined so + // compares the response with other consumer wallets if defined so + // asynchronously sends data reliability if necessary - relayProcessor, err := rpccs.ProcessRelaySend(ctx, directiveHeaders, chainMessage, relayRequestData, dappID, consumerIp) + relaySentTime := time.Now() + relayProcessor, err := rpccs.ProcessRelaySend(ctx, protocolMessage, dappID, consumerIp, analytics) if err != nil && !relayProcessor.HasResults() { // we can't send anymore, and we don't have any responses utils.LavaFormatError("failed getting responses from providers", err, utils.Attribute{Key: "GUID", Value: ctx}, utils.LogAttr("endpoint", rpccs.listenEndpoint.Key()), utils.LogAttr("userIp", consumerIp), utils.LogAttr("relayProcessor", relayProcessor)) return nil, err } + // Handle Data Reliability enabled, dataReliabilityThreshold := rpccs.chainParser.DataReliabilityParams() // check if data reliability is enabled and relay processor allows us to perform data reliability @@ -313,18 +382,19 @@ func (rpccs *RPCConsumerServer) SendRelay( if found { dataReliabilityContext = utils.WithUniqueIdentifier(dataReliabilityContext, guid) } - go rpccs.sendDataReliabilityRelayIfApplicable(dataReliabilityContext, dappID, consumerIp, chainMessage, dataReliabilityThreshold, relayProcessor) // runs asynchronously + go rpccs.sendDataReliabilityRelayIfApplicable(dataReliabilityContext, dappID, consumerIp, protocolMessage, dataReliabilityThreshold, relayProcessor) // runs asynchronously } returnedResult, err := relayProcessor.ProcessingResult() - rpccs.appendHeadersToRelayResult(ctx, returnedResult, relayProcessor.ProtocolErrors(), relayProcessor, directiveHeaders) + rpccs.appendHeadersToRelayResult(ctx, returnedResult, relayProcessor.ProtocolErrors(), relayProcessor, protocolMessage.GetDirectiveHeaders()) if err != nil { return returnedResult, utils.LavaFormatError("failed processing responses from providers", err, utils.Attribute{Key: "GUID", Value: ctx}, utils.LogAttr("endpoint", rpccs.listenEndpoint.Key())) } + if analytics != nil { currentLatency := time.Since(relaySentTime) analytics.Latency = currentLatency.Milliseconds() - api := chainMessage.GetApi() + api := protocolMessage.GetApi() analytics.ComputeUnits = api.ComputeUnits analytics.ApiMethod = api.Name } @@ -332,19 +402,24 @@ func (rpccs *RPCConsumerServer) SendRelay( return returnedResult, nil } -func (rpccs *RPCConsumerServer) getChainIdAndApiInterface() (string, string) { +func (rpccs *RPCConsumerServer) GetChainIdAndApiInterface() (string, string) { return rpccs.listenEndpoint.ChainID, rpccs.listenEndpoint.ApiInterface } -func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, directiveHeaders map[string]string, chainMessage chainlib.ChainMessage, relayRequestData *pairingtypes.RelayPrivateData, dappID string, consumerIp string) (*RelayProcessor, error) { +func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, protocolMessage chainlib.ProtocolMessage, dappID string, consumerIp string, analytics *metrics.RelayMetrics) (*RelayProcessor, error) { // make sure all of the child contexts are cancelled when we exit ctx, cancel := context.WithCancel(ctx) defer cancel() - relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(directiveHeaders), rpccs.requiredResponses, chainMessage, rpccs.consumerConsistency, dappID, consumerIp, rpccs.debugRelays) + relayProcessor := NewRelayProcessor(ctx, lavasession.NewUsedProviders(protocolMessage), rpccs.requiredResponses, protocolMessage, rpccs.consumerConsistency, dappID, consumerIp, rpccs.debugRelays, rpccs.rpcConsumerLogs, rpccs, rpccs.disableNodeErrorRetry, rpccs.relayRetriesManager) var err error // try sending a relay 3 times. if failed return the error for retryFirstRelayAttempt := 0; retryFirstRelayAttempt < SendRelayAttempts; retryFirstRelayAttempt++ { - err = rpccs.sendRelayToProvider(ctx, chainMessage, relayRequestData, dappID, consumerIp, relayProcessor) + // record the relay analytics only on the first attempt. + if analytics != nil && retryFirstRelayAttempt > 0 { + analytics = nil + } + err = rpccs.sendRelayToProvider(ctx, protocolMessage, dappID, consumerIp, relayProcessor, analytics) + // check if we had an error. if we did, try again. if err == nil { break @@ -358,7 +433,7 @@ func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, directiveH // a channel to be notified processing was done, true means we have results and can return gotResults := make(chan bool) - processingTimeout, relayTimeout := rpccs.getProcessingTimeout(chainMessage) + processingTimeout, relayTimeout := rpccs.getProcessingTimeout(protocolMessage) if rpccs.debugRelays { utils.LavaFormatDebug("Relay initiated with the following timeout schedule", utils.LogAttr("processingTimeout", processingTimeout), utils.LogAttr("newRelayTimeout", relayTimeout)) } @@ -410,7 +485,7 @@ func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, directiveH return relayProcessor, nil } // otherwise continue sending another relay - err := rpccs.sendRelayToProvider(processingCtx, chainMessage, relayRequestData, dappID, consumerIp, relayProcessor) + err := rpccs.sendRelayToProvider(processingCtx, protocolMessage, dappID, consumerIp, relayProcessor, nil) go validateReturnCondition(err) go readResultsFromProcessor() // increase number of retries launched only if we still have pairing available, if we exhausted the list we don't want to break early @@ -423,10 +498,10 @@ func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, directiveH if relayProcessor.ShouldRetry(numberOfRetriesLaunched) { // limit the number of retries called from the new batch ticker flow. // if we pass the limit we just wait for the relays we sent to return. - err := rpccs.sendRelayToProvider(processingCtx, chainMessage, relayRequestData, dappID, consumerIp, relayProcessor) + err := rpccs.sendRelayToProvider(processingCtx, protocolMessage, dappID, consumerIp, relayProcessor, nil) go validateReturnCondition(err) // add ticker launch metrics - go rpccs.rpcConsumerLogs.SetRelaySentByNewBatchTickerMetric(rpccs.getChainIdAndApiInterface()) + go rpccs.rpcConsumerLogs.SetRelaySentByNewBatchTickerMetric(rpccs.GetChainIdAndApiInterface()) // increase number of retries launched only if we still have pairing available, if we exhausted the list we don't want to break early // so it will just wait for the entire duration of the relay if !lavasession.PairingListEmptyError.Is(err) { @@ -448,7 +523,7 @@ func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, directiveH utils.LogAttr("processingTimeout", processingTimeout), utils.LogAttr("dappId", dappID), utils.LogAttr("consumerIp", consumerIp), - utils.LogAttr("chainMessage.GetApi().Name", chainMessage.GetApi().Name), + utils.LogAttr("protocolMessage.GetApi().Name", protocolMessage.GetApi().Name), utils.LogAttr("GUID", ctx), utils.LogAttr("relayProcessor", relayProcessor), ) @@ -457,13 +532,31 @@ func (rpccs *RPCConsumerServer) ProcessRelaySend(ctx context.Context, directiveH } } +func (rpccs *RPCConsumerServer) CreateDappKey(dappID, consumerIp string) string { + return rpccs.consumerConsistency.Key(dappID, consumerIp) +} + +func (rpccs *RPCConsumerServer) CancelSubscriptionContext(subscriptionKey string) { + rpccs.connectedSubscriptionsLock.Lock() + defer rpccs.connectedSubscriptionsLock.Unlock() + + ctxHolder, ok := rpccs.connectedSubscriptionsContexts[subscriptionKey] + if ok { + utils.LavaFormatTrace("cancelling subscription context", utils.LogAttr("subscriptionID", subscriptionKey)) + ctxHolder.CancelFunc() + delete(rpccs.connectedSubscriptionsContexts, subscriptionKey) + } else { + utils.LavaFormatWarning("tried to cancel context for subscription ID that does not exist", nil, utils.LogAttr("subscriptionID", subscriptionKey)) + } +} + func (rpccs *RPCConsumerServer) sendRelayToProvider( ctx context.Context, - chainMessage chainlib.ChainMessage, - relayRequestData *pairingtypes.RelayPrivateData, + protocolMessage chainlib.ProtocolMessage, dappID string, consumerIp string, relayProcessor *RelayProcessor, + analytics *metrics.RelayMetrics, ) (errRet error) { // get a session for the relay from the ConsumerSessionManager // construct a relay message with lavaprotocol package, include QoS and jail providers @@ -476,104 +569,105 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( // if necessary send detection tx for hashes consensus mismatch // handle QoS updates // in case connection totally fails, update unresponsive providers in ConsumerSessionManager - isSubscription := chainlib.IsSubscription(chainMessage) var sharedStateId string // defaults to "", if shared state is disabled then no shared state will be used. if rpccs.sharedState { sharedStateId = rpccs.consumerConsistency.Key(dappID, consumerIp) // use same key as we use for consistency, (for better consistency :-D) } privKey := rpccs.privKey - chainId, apiInterface := rpccs.getChainIdAndApiInterface() + chainId, apiInterface := rpccs.GetChainIdAndApiInterface() lavaChainID := rpccs.lavaChainID // Get Session. we get session here so we can use the epoch in the callbacks - reqBlock, _ := chainMessage.RequestedBlock() + reqBlock, _ := protocolMessage.RequestedBlock() // try using cache before sending relay var cacheError error if rpccs.cache.CacheActive() { // use cache only if its defined. - if reqBlock != spectypes.NOT_APPLICABLE || !chainMessage.GetForceCacheRefresh() { - var cacheReply *pairingtypes.CacheRelayReply - hashKey, outputFormatter, err := chainlib.HashCacheRequest(relayRequestData, chainId) - if err != nil { - utils.LavaFormatError("sendRelayToProvider Failed getting Hash for cache request", err) - } else { - cacheCtx, cancel := context.WithTimeout(ctx, common.CacheTimeout) - cacheReply, cacheError = rpccs.cache.GetEntry(cacheCtx, &pairingtypes.RelayCacheGet{ - RequestHash: hashKey, - RequestedBlock: relayRequestData.RequestBlock, - ChainId: chainId, - BlockHash: nil, - Finalized: false, - SharedStateId: sharedStateId, - SeenBlock: relayRequestData.SeenBlock, - }) // caching in the portal doesn't care about hashes, and we don't have data on finalization yet - cancel() - reply := cacheReply.GetReply() - - // read seen block from cache even if we had a miss we still want to get the seen block so we can use it to get the right provider. - cacheSeenBlock := cacheReply.GetSeenBlock() - // check if the cache seen block is greater than my local seen block, this means the user requested this - // request spoke with another consumer instance and use that block for inter consumer consistency. - if rpccs.sharedState && cacheSeenBlock > relayRequestData.SeenBlock { - utils.LavaFormatDebug("shared state seen block is newer", utils.LogAttr("cache_seen_block", cacheSeenBlock), utils.LogAttr("local_seen_block", relayRequestData.SeenBlock)) - relayRequestData.SeenBlock = cacheSeenBlock - // setting the fetched seen block from the cache server to our local cache as well. - rpccs.consumerConsistency.SetSeenBlock(cacheSeenBlock, dappID, consumerIp) - } + if !protocolMessage.GetForceCacheRefresh() { // don't use cache if user specified + if reqBlock != spectypes.NOT_APPLICABLE { // don't use cache if requested block is not applicable + var cacheReply *pairingtypes.CacheRelayReply + hashKey, outputFormatter, err := protocolMessage.HashCacheRequest(chainId) + if err != nil { + utils.LavaFormatError("sendRelayToProvider Failed getting Hash for cache request", err) + } else { + cacheCtx, cancel := context.WithTimeout(ctx, common.CacheTimeout) + cacheReply, cacheError = rpccs.cache.GetEntry(cacheCtx, &pairingtypes.RelayCacheGet{ + RequestHash: hashKey, + RequestedBlock: reqBlock, + ChainId: chainId, + BlockHash: nil, + Finalized: false, + SharedStateId: sharedStateId, + SeenBlock: protocolMessage.RelayPrivateData().SeenBlock, + }) // caching in the portal doesn't care about hashes, and we don't have data on finalization yet + cancel() + reply := cacheReply.GetReply() + + // read seen block from cache even if we had a miss we still want to get the seen block so we can use it to get the right provider. + cacheSeenBlock := cacheReply.GetSeenBlock() + // check if the cache seen block is greater than my local seen block, this means the user requested this + // request spoke with another consumer instance and use that block for inter consumer consistency. + if rpccs.sharedState && cacheSeenBlock > protocolMessage.RelayPrivateData().SeenBlock { + utils.LavaFormatDebug("shared state seen block is newer", utils.LogAttr("cache_seen_block", cacheSeenBlock), utils.LogAttr("local_seen_block", protocolMessage.RelayPrivateData().SeenBlock)) + protocolMessage.RelayPrivateData().SeenBlock = cacheSeenBlock + // setting the fetched seen block from the cache server to our local cache as well. + rpccs.consumerConsistency.SetSeenBlock(cacheSeenBlock, dappID, consumerIp) + } - // handle cache reply - if cacheError == nil && reply != nil { - // Info was fetched from cache, so we don't need to change the state - // so we can return here, no need to update anything and calculate as this info was fetched from the cache - reply.Data = outputFormatter(reply.Data) - relayResult := common.RelayResult{ - Reply: reply, - Request: &pairingtypes.RelayRequest{ - RelayData: relayRequestData, - }, - Finalized: false, // set false to skip data reliability - StatusCode: 200, - ProviderInfo: common.ProviderInfo{ProviderAddress: ""}, + // handle cache reply + if cacheError == nil && reply != nil { + // Info was fetched from cache, so we don't need to change the state + // so we can return here, no need to update anything and calculate as this info was fetched from the cache + reply.Data = outputFormatter(reply.Data) + relayResult := common.RelayResult{ + Reply: reply, + Request: &pairingtypes.RelayRequest{ + RelayData: protocolMessage.RelayPrivateData(), + }, + Finalized: false, // set false to skip data reliability + StatusCode: 200, + ProviderInfo: common.ProviderInfo{ProviderAddress: ""}, + } + relayProcessor.SetResponse(&relayResponse{ + relayResult: relayResult, + err: nil, + }) + return nil + } + // cache failed, move on to regular relay + if performance.NotConnectedError.Is(cacheError) { + utils.LavaFormatDebug("cache not connected", utils.LogAttr("error", cacheError)) } - relayProcessor.SetResponse(&relayResponse{ - relayResult: relayResult, - err: nil, - }) - return nil - } - // cache failed, move on to regular relay - if performance.NotConnectedError.Is(cacheError) { - utils.LavaFormatDebug("cache not connected", utils.LogAttr("error", cacheError)) } + } else { + utils.LavaFormatDebug("skipping cache due to requested block being NOT_APPLICABLE", utils.Attribute{Key: "api name", Value: protocolMessage.GetApi().Name}) } - } else { - utils.LavaFormatDebug("skipping cache due to requested block being NOT_APPLICABLE", utils.Attribute{Key: "api name", Value: chainMessage.GetApi().Name}) } } - if reqBlock == spectypes.LATEST_BLOCK && relayRequestData.SeenBlock != 0 { + if reqBlock == spectypes.LATEST_BLOCK && protocolMessage.RelayPrivateData().SeenBlock != 0 { // make optimizer select a provider that is likely to have the latest seen block - reqBlock = relayRequestData.SeenBlock + reqBlock = protocolMessage.RelayPrivateData().SeenBlock } // consumerEmergencyTracker always use latest virtual epoch virtualEpoch := rpccs.consumerTxSender.GetLatestVirtualEpoch() - addon := chainlib.GetAddon(chainMessage) - extensions := chainMessage.GetExtensions() + addon := chainlib.GetAddon(protocolMessage) + extensions := protocolMessage.GetExtensions() usedProviders := relayProcessor.GetUsedProviders() - sessions, err := rpccs.consumerSessionManager.GetSessions(ctx, chainlib.GetComputeUnits(chainMessage), usedProviders, reqBlock, addon, extensions, chainlib.GetStateful(chainMessage), virtualEpoch) + sessions, err := rpccs.consumerSessionManager.GetSessions(ctx, chainlib.GetComputeUnits(protocolMessage), usedProviders, reqBlock, addon, extensions, chainlib.GetStateful(protocolMessage), virtualEpoch) if err != nil { if lavasession.PairingListEmptyError.Is(err) { if addon != "" { return utils.LavaFormatError("No Providers For Addon", err, utils.LogAttr("addon", addon), utils.LogAttr("extensions", extensions), utils.LogAttr("userIp", consumerIp)) } else if len(extensions) > 0 && relayProcessor.GetAllowSessionDegradation() { // if we have no providers for that extension, use a regular provider, otherwise return the extension results - sessions, err = rpccs.consumerSessionManager.GetSessions(ctx, chainlib.GetComputeUnits(chainMessage), usedProviders, reqBlock, addon, []*spectypes.Extension{}, chainlib.GetStateful(chainMessage), virtualEpoch) + sessions, err = rpccs.consumerSessionManager.GetSessions(ctx, chainlib.GetComputeUnits(protocolMessage), usedProviders, reqBlock, addon, []*spectypes.Extension{}, chainlib.GetStateful(protocolMessage), virtualEpoch) if err != nil { return err } - relayProcessor.setSkipDataReliability(true) // disabling data reliability when disabling extensions. - relayRequestData.Extensions = []string{} // reset request data extensions - extensions = []*spectypes.Extension{} // reset extensions too so we wont hit SetDisallowDegradation + relayProcessor.setSkipDataReliability(true) // disabling data reliability when disabling extensions. + protocolMessage.RelayPrivateData().Extensions = []string{} // reset request data extensions + extensions = []*spectypes.Extension{} // reset extensions too so we wont hit SetDisallowDegradation } else { return err } @@ -630,7 +724,7 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( goroutineCtxCancel() }() - localRelayRequestData := *relayRequestData + localRelayRequestData := *protocolMessage.RelayPrivateData() // Extract fields from the sessionInfo singleConsumerSession := sessionInfo.Session @@ -643,23 +737,49 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( return } localRelayResult.Request = relayRequest - endpointClient := *singleConsumerSession.Endpoint.Client + endpointClient := singleConsumerSession.EndpointConnection.Client - // add metrics (send and receive) + // set relay sent metric go rpccs.rpcConsumerLogs.SetRelaySentToProviderMetric(chainId, apiInterface) - defer func() { go rpccs.rpcConsumerLogs.SetRelayReturnedFromProviderMetric(chainId, apiInterface) }() - if isSubscription { - errResponse = rpccs.relaySubscriptionInner(goroutineCtx, endpointClient, singleConsumerSession, localRelayResult) - if errResponse != nil { - utils.LavaFormatError("Failed relaySubscriptionInner", errResponse, utils.LogAttr("Request data", localRelayRequestData)) + if chainlib.IsFunctionTagOfType(protocolMessage, spectypes.FUNCTION_TAG_SUBSCRIBE) { + utils.LavaFormatTrace("inside sendRelayToProvider, relay is subscription", utils.LogAttr("requestData", localRelayRequestData.Data)) + + params, err := json.Marshal(protocolMessage.GetRPCMessage().GetParams()) + if err != nil { + utils.LavaFormatError("could not marshal params", err) return } + + hashedParams := rpcclient.CreateHashFromParams(params) + cancellableCtx, cancelFunc := context.WithCancel(utils.WithUniqueIdentifier(context.Background(), utils.GenerateUniqueIdentifier())) + + ctxHolder := func() *CancelableContextHolder { + rpccs.connectedSubscriptionsLock.Lock() + defer rpccs.connectedSubscriptionsLock.Unlock() + + ctxHolder := &CancelableContextHolder{ + Ctx: cancellableCtx, + CancelFunc: cancelFunc, + } + rpccs.connectedSubscriptionsContexts[hashedParams] = ctxHolder + return ctxHolder + }() + + errResponse = rpccs.relaySubscriptionInner(ctxHolder.Ctx, hashedParams, endpointClient, singleConsumerSession, localRelayResult) + if errResponse != nil { + utils.LavaFormatError("Failed relaySubscriptionInner", errResponse, + utils.LogAttr("Request", localRelayRequestData), + utils.LogAttr("Request data", string(localRelayRequestData.Data)), + ) + } + + return } // unique per dappId and ip consumerToken := common.GetUniqueToken(dappID, consumerIp) - processingTimeout, expectedRelayTimeoutForQOS := rpccs.getProcessingTimeout(chainMessage) + processingTimeout, expectedRelayTimeoutForQOS := rpccs.getProcessingTimeout(protocolMessage) deadline, ok := ctx.Deadline() if ok { // we have ctx deadline. we cant go past it. processingTimeout = time.Until(deadline) @@ -674,7 +794,7 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( } } // send relay - relayLatency, errResponse, backoff := rpccs.relayInner(goroutineCtx, singleConsumerSession, localRelayResult, processingTimeout, chainMessage, consumerToken) + relayLatency, errResponse, backoff := rpccs.relayInner(goroutineCtx, singleConsumerSession, localRelayResult, processingTimeout, protocolMessage, consumerToken, analytics) if errResponse != nil { failRelaySession := func(origErr error, backoff_ bool) { backOffDuration := 0 * time.Second @@ -693,7 +813,7 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( } // get here only if performed a regular relay successfully - expectedBH, numOfProviders := rpccs.finalizationConsensus.ExpectedBlockHeight(rpccs.chainParser) + expectedBH, numOfProviders := rpccs.finalizationConsensus.GetExpectedBlockHeight(rpccs.chainParser) pairingAddressesLen := rpccs.consumerSessionManager.GetAtomicPairingAddressesLength() latestBlock := localRelayResult.Reply.LatestBlock if expectedBH-latestBlock > 1000 { @@ -703,7 +823,6 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( utils.Attribute{Key: "session_id", Value: singleConsumerSession.SessionId}, utils.Attribute{Key: "provider_address", Value: singleConsumerSession.Parent.PublicLavaAddress}, utils.Attribute{Key: "providersCount", Value: pairingAddressesLen}, - utils.Attribute{Key: "finalizationConsensus", Value: rpccs.finalizationConsensus.String()}, ) } if rpccs.debugRelays && singleConsumerSession.QoSInfo.LastQoSReport != nil && @@ -716,61 +835,59 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( utils.Attribute{Key: "provider_address", Value: singleConsumerSession.Parent.PublicLavaAddress}, utils.Attribute{Key: "providersCount", Value: pairingAddressesLen}, utils.Attribute{Key: "singleConsumerSession.QoSInfo", Value: singleConsumerSession.QoSInfo}, - utils.Attribute{Key: "finalizationConsensus", Value: rpccs.finalizationConsensus.String()}, ) } - errResponse = rpccs.consumerSessionManager.OnSessionDone(singleConsumerSession, latestBlock, chainlib.GetComputeUnits(chainMessage), relayLatency, singleConsumerSession.CalculateExpectedLatency(expectedRelayTimeoutForQOS), expectedBH, numOfProviders, pairingAddressesLen, chainMessage.GetApi().Category.HangingApi) // session done successfully + errResponse = rpccs.consumerSessionManager.OnSessionDone(singleConsumerSession, latestBlock, chainlib.GetComputeUnits(protocolMessage), relayLatency, singleConsumerSession.CalculateExpectedLatency(expectedRelayTimeoutForQOS), expectedBH, numOfProviders, pairingAddressesLen, protocolMessage.GetApi().Category.HangingApi) // session done successfully if rpccs.cache.CacheActive() && rpcclient.ValidateStatusCodes(localRelayResult.StatusCode, true) == nil { - // copy reply data so if it changes it doesn't panic mid async send - copyReply := &pairingtypes.RelayReply{} - copyReplyErr := protocopy.DeepCopyProtoObject(localRelayResult.Reply, copyReply) - // set cache in a non blocking call - statusCode := localRelayResult.StatusCode - requestedBlock := localRelayResult.Request.RelayData.RequestBlock // get requested block before removing it from the data - seenBlock := localRelayResult.Request.RelayData.SeenBlock // get seen block before removing it from the data - hashKey, _, hashErr := chainlib.HashCacheRequest(localRelayResult.Request.RelayData, chainId) // get the hash (this changes the data) - - go func() { - // deal with copying error. - if copyReplyErr != nil || hashErr != nil { - utils.LavaFormatError("Failed copying relay private data sendRelayToProvider", nil, - utils.LogAttr("copyReplyErr", copyReplyErr), - utils.LogAttr("hashErr", hashErr), - ) - return - } - chainMessageRequestedBlock, _ := chainMessage.RequestedBlock() - if chainMessageRequestedBlock == spectypes.NOT_APPLICABLE { - return - } - - new_ctx := context.Background() - new_ctx, cancel := context.WithTimeout(new_ctx, common.DataReliabilityTimeoutIncrease) - defer cancel() - _, averageBlockTime, _, _ := rpccs.chainParser.ChainBlockStats() - // we don't want to cache node errors for too long. what can happen is a finalized block gets an error - // and we cache it for a long period of time. - isNodeError, _ := chainMessage.CheckResponseError(copyReply.Data, statusCode) - - err2 := rpccs.cache.SetEntry(new_ctx, &pairingtypes.RelayCacheSet{ - RequestHash: hashKey, - ChainId: chainId, - RequestedBlock: requestedBlock, - SeenBlock: seenBlock, - BlockHash: nil, // consumer cache doesn't care about block hashes - Response: copyReply, - Finalized: localRelayResult.Finalized, - OptionalMetadata: nil, - SharedStateId: sharedStateId, - AverageBlockTime: int64(averageBlockTime), // by using average block time we can set longer TTL - IsNodeError: isNodeError, - }) - if err2 != nil { - utils.LavaFormatWarning("error updating cache with new entry", err2) - } - }() + isNodeError, _ := protocolMessage.CheckResponseError(localRelayResult.Reply.Data, localRelayResult.StatusCode) + // in case the error is a node error we don't want to cache + if !isNodeError { + // copy reply data so if it changes it doesn't panic mid async send + copyReply := &pairingtypes.RelayReply{} + copyReplyErr := protocopy.DeepCopyProtoObject(localRelayResult.Reply, copyReply) + // set cache in a non blocking call + requestedBlock := localRelayResult.Request.RelayData.RequestBlock // get requested block before removing it from the data + seenBlock := localRelayResult.Request.RelayData.SeenBlock // get seen block before removing it from the data + hashKey, _, hashErr := chainlib.HashCacheRequest(localRelayResult.Request.RelayData, chainId) // get the hash (this changes the data) + + go func() { + // deal with copying error. + if copyReplyErr != nil || hashErr != nil { + utils.LavaFormatError("Failed copying relay private data sendRelayToProvider", nil, + utils.LogAttr("copyReplyErr", copyReplyErr), + utils.LogAttr("hashErr", hashErr), + ) + return + } + chainMessageRequestedBlock, _ := protocolMessage.RequestedBlock() + if chainMessageRequestedBlock == spectypes.NOT_APPLICABLE { + return + } + + new_ctx := context.Background() + new_ctx, cancel := context.WithTimeout(new_ctx, common.DataReliabilityTimeoutIncrease) + defer cancel() + _, averageBlockTime, _, _ := rpccs.chainParser.ChainBlockStats() + err2 := rpccs.cache.SetEntry(new_ctx, &pairingtypes.RelayCacheSet{ + RequestHash: hashKey, + ChainId: chainId, + RequestedBlock: requestedBlock, + SeenBlock: seenBlock, + BlockHash: nil, // consumer cache doesn't care about block hashes + Response: copyReply, + Finalized: localRelayResult.Finalized, + OptionalMetadata: nil, + SharedStateId: sharedStateId, + AverageBlockTime: int64(averageBlockTime), // by using average block time we can set longer TTL + IsNodeError: isNodeError, + }) + if err2 != nil { + utils.LavaFormatWarning("error updating cache with new entry", err2) + } + }() + } } // localRelayResult is being sent on the relayProcessor by a deferred function }(providerPublicAddress, sessionInfo) @@ -779,30 +896,87 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( return nil } -func (rpccs *RPCConsumerServer) relayInner(ctx context.Context, singleConsumerSession *lavasession.SingleConsumerSession, relayResult *common.RelayResult, relayTimeout time.Duration, chainMessage chainlib.ChainMessage, consumerToken string) (relayLatency time.Duration, err error, needsBackoff bool) { +func (rpccs *RPCConsumerServer) relayInner(ctx context.Context, singleConsumerSession *lavasession.SingleConsumerSession, relayResult *common.RelayResult, relayTimeout time.Duration, chainMessage chainlib.ChainMessage, consumerToken string, analytics *metrics.RelayMetrics) (relayLatency time.Duration, err error, needsBackoff bool) { existingSessionLatestBlock := singleConsumerSession.LatestBlock // we read it now because singleConsumerSession is locked, and later it's not - endpointClient := *singleConsumerSession.Endpoint.Client + endpointClient := singleConsumerSession.EndpointConnection.Client providerPublicAddress := relayResult.ProviderInfo.ProviderAddress relayRequest := relayResult.Request if rpccs.debugRelays { - utils.LavaFormatDebug("Sending relay", utils.LogAttr("timeout", relayTimeout), utils.LogAttr("GUID", ctx), utils.LogAttr("provider", relayRequest.RelaySession.Provider)) + utils.LavaFormatDebug("Sending relay", utils.LogAttr("timeout", relayTimeout), utils.LogAttr("requestedBlock", relayRequest.RelayData.RequestBlock), utils.LogAttr("GUID", ctx), utils.LogAttr("provider", relayRequest.RelaySession.Provider)) } callRelay := func() (reply *pairingtypes.RelayReply, relayLatency time.Duration, err error, backoff bool) { - relaySentTime := time.Now() connectCtx, connectCtxCancel := context.WithTimeout(ctx, relayTimeout) - metadataAdd := metadata.New(map[string]string{common.IP_FORWARDING_HEADER_NAME: consumerToken}) + metadataAdd := metadata.New(map[string]string{ + common.IP_FORWARDING_HEADER_NAME: consumerToken, + common.LAVA_CONSUMER_PROCESS_GUID: rpccs.consumerProcessGuid, + common.LAVA_LB_UNIQUE_ID_HEADER: singleConsumerSession.EndpointConnection.GetLbUniqueId(), + }) + + utils.LavaFormatTrace("Sending relay to provider", + utils.LogAttr("GUID", ctx), + utils.LogAttr("lbUniqueId", singleConsumerSession.EndpointConnection.GetLbUniqueId()), + ) connectCtx = metadata.NewOutgoingContext(connectCtx, metadataAdd) defer connectCtxCancel() + + // add consumer processing timestamp before provider metric and start measuring time after the provider replied + rpccs.rpcConsumerLogs.AddMetricForProcessingLatencyBeforeProvider(analytics, rpccs.listenEndpoint.ChainID, rpccs.listenEndpoint.ApiInterface) + + if relayResult.ProviderTrailer == nil { + // if the provider trailer is nil, we need to initialize it + relayResult.ProviderTrailer = metadata.MD{} + } + + relaySentTime := time.Now() reply, err = endpointClient.Relay(connectCtx, relayRequest, grpc.Trailer(&relayResult.ProviderTrailer)) + relayLatency = time.Since(relaySentTime) + + providerUniqueId := relayResult.ProviderTrailer.Get(chainlib.RpcProviderUniqueIdHeader) + if len(providerUniqueId) > 0 { + if len(providerUniqueId) > 1 { + utils.LavaFormatInfo("Received more than one provider unique id in header, skipping", + utils.LogAttr("GUID", ctx), + utils.LogAttr("provider", relayRequest.RelaySession.Provider), + utils.LogAttr("providerUniqueId", providerUniqueId), + ) + } else if providerUniqueId[0] != "" { // Otherwise, the header is "" which is fine - it means the header is not set + utils.LavaFormatTrace("Received provider unique id", + utils.LogAttr("GUID", ctx), + utils.LogAttr("provider", relayRequest.RelaySession.Provider), + utils.LogAttr("providerUniqueId", providerUniqueId), + ) + + if !singleConsumerSession.VerifyProviderUniqueIdAndStoreIfFirstTime(providerUniqueId[0]) { + return reply, 0, utils.LavaFormatError("provider unique id mismatch", + errors.Join(lavasession.SessionOutOfSyncError, lavasession.BlockEndpointError), + utils.LogAttr("GUID", ctx), + utils.LogAttr("sessionId", relayRequest.RelaySession.SessionId), + utils.LogAttr("provider", relayRequest.RelaySession.Provider), + utils.LogAttr("providedProviderUniqueId", providerUniqueId), + utils.LogAttr("providerUniqueId", singleConsumerSession.GetProviderUniqueId()), + ), false + } else { + utils.LavaFormatTrace("Provider unique id match", + utils.LogAttr("GUID", ctx), + utils.LogAttr("sessionId", relayRequest.RelaySession.SessionId), + utils.LogAttr("provider", relayRequest.RelaySession.Provider), + utils.LogAttr("providerUniqueId", providerUniqueId), + ) + } + } + } + statuses := relayResult.ProviderTrailer.Get(common.StatusCodeMetadataKey) + if len(statuses) > 0 { codeNum, errStatus := strconv.Atoi(statuses[0]) if errStatus != nil { - utils.LavaFormatWarning("failed converting status code", errStatus) + utils.LavaFormatWarning("failed converting status code", errStatus, utils.LogAttr("statuses", statuses)) } + relayResult.StatusCode = codeNum } - relayLatency = time.Since(relaySentTime) + if rpccs.debugRelays { providerNodeHashes := relayResult.ProviderTrailer.Get(chainlib.RPCProviderNodeAddressHash) attributes := []utils.Attribute{ @@ -830,71 +1004,193 @@ func (rpccs *RPCConsumerServer) relayInner(ctx context.Context, singleConsumerSe } utils.LavaFormatDebug("sending relay to provider", attributes...) } + if err != nil { - backoff := false - if errors.Is(connectCtx.Err(), context.DeadlineExceeded) { - backoff = true - } + backoff := errors.Is(connectCtx.Err(), context.DeadlineExceeded) return reply, 0, err, backoff } + analytics.SetProcessingTimestampAfterRelay(time.Now()) + return reply, relayLatency, nil, false } + reply, relayLatency, err, backoff := callRelay() if err != nil { + // adding some error information for future debug + if relayRequest.RelayData.RequestBlock == 0 { + reqBlock, _ := chainMessage.RequestedBlock() + utils.LavaFormatWarning("Got Error, with requested block 0", err, + utils.LogAttr("relayRequest.RelayData.RequestBlock", relayRequest.RelayData.RequestBlock), + utils.LogAttr("chainMessage.RequestedBlock", reqBlock), + utils.LogAttr("existingSessionLatestBlock", existingSessionLatestBlock), + utils.LogAttr("SeenBlock", relayRequest.RelayData.SeenBlock), + utils.LogAttr("msg_api", relayRequest.RelayData.ApiUrl), + utils.LogAttr("msg_data", string(relayRequest.RelayData.Data)), + ) + } return 0, err, backoff } + relayResult.Reply = reply - lavaprotocol.UpdateRequestedBlock(relayRequest.RelayData, reply) // update relay request requestedBlock to the provided one in case it was arbitrary - _, _, blockDistanceForFinalizedData, _ := rpccs.chainParser.ChainBlockStats() - finalized := spectypes.IsFinalizedBlock(relayRequest.RelayData.RequestBlock, reply.LatestBlock, blockDistanceForFinalizedData) + + // Update relay request requestedBlock to the provided one in case it was arbitrary + lavaprotocol.UpdateRequestedBlock(relayRequest.RelayData, reply) + + _, _, blockDistanceForFinalizedData, blocksInFinalizationProof := rpccs.chainParser.ChainBlockStats() + isFinalized := spectypes.IsFinalizedBlock(relayRequest.RelayData.RequestBlock, reply.LatestBlock, int64(blockDistanceForFinalizedData)) + filteredHeaders, _, ignoredHeaders := rpccs.chainParser.HandleHeaders(reply.Metadata, chainMessage.GetApiCollection(), spectypes.Header_pass_reply) reply.Metadata = filteredHeaders - err = lavaprotocol.VerifyRelayReply(ctx, reply, relayRequest, providerPublicAddress) - if err != nil { - return 0, err, false + + // check the signature on the reply + if !singleConsumerSession.StaticProvider { + err = lavaprotocol.VerifyRelayReply(ctx, reply, relayRequest, providerPublicAddress) + if err != nil { + return 0, err, false + } } + reply.Metadata = append(reply.Metadata, ignoredHeaders...) + // TODO: response data sanity, check its under an expected format add that format to spec enabled, _ := rpccs.chainParser.DataReliabilityParams() - if enabled { - // TODO: DETECTION instead of existingSessionLatestBlock, we need proof of last reply to send the previous reply and the current reply - finalizedBlocks, finalizationConflict, err := lavaprotocol.VerifyFinalizationData(reply, relayRequest, providerPublicAddress, rpccs.ConsumerAddress, existingSessionLatestBlock, blockDistanceForFinalizedData) + if enabled && !singleConsumerSession.StaticProvider { + // TODO: allow static providers to detect hash mismatches, + // triggering conflict with them is impossible so we skip this for now, but this can be used to block malicious providers + finalizedBlocks, err := finalizationverification.VerifyFinalizationData(reply, relayRequest, providerPublicAddress, rpccs.ConsumerAddress, existingSessionLatestBlock, int64(blockDistanceForFinalizedData), int64(blocksInFinalizationProof)) if err != nil { - if sdkerrors.IsOf(err, lavaprotocol.ProviderFinzalizationDataAccountabilityError) && finalizationConflict != nil { - go rpccs.consumerTxSender.TxConflictDetection(ctx, finalizationConflict, nil, nil, singleConsumerSession.Parent) + if sdkerrors.IsOf(err, protocolerrors.ProviderFinalizationDataAccountabilityError) { + utils.LavaFormatInfo("provider finalization data accountability error", utils.LogAttr("provider", relayRequest.RelaySession.Provider)) } return 0, err, false } - finalizationConflict, err = rpccs.finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), providerPublicAddress, finalizedBlocks, relayRequest.RelaySession, reply) + finalizationAccountabilityError, err := rpccs.finalizationConsensus.UpdateFinalizedHashes(int64(blockDistanceForFinalizedData), rpccs.ConsumerAddress, providerPublicAddress, finalizedBlocks, relayRequest.RelaySession, reply) if err != nil { - go rpccs.consumerTxSender.TxConflictDetection(ctx, finalizationConflict, nil, nil, singleConsumerSession.Parent) + if finalizationAccountabilityError != nil { + go rpccs.consumerTxSender.TxConflictDetection(ctx, finalizationAccountabilityError, nil, singleConsumerSession.Parent) + } return 0, err, false } } - relayResult.Finalized = finalized + relayResult.Finalized = isFinalized return relayLatency, nil, false } -func (rpccs *RPCConsumerServer) relaySubscriptionInner(ctx context.Context, endpointClient pairingtypes.RelayerClient, singleConsumerSession *lavasession.SingleConsumerSession, relayResult *common.RelayResult) (err error) { - // relaySentTime := time.Now() +func (rpccs *RPCConsumerServer) relaySubscriptionInner(ctx context.Context, hashedParams string, endpointClient pairingtypes.RelayerClient, singleConsumerSession *lavasession.SingleConsumerSession, relayResult *common.RelayResult) (err error) { + // add consumer guid to relay request. + ctx = metadata.AppendToOutgoingContext(ctx, + common.LAVA_LB_UNIQUE_ID_HEADER, singleConsumerSession.EndpointConnection.GetLbUniqueId(), + common.LAVA_CONSUMER_PROCESS_GUID, rpccs.consumerProcessGuid, + ) + replyServer, err := endpointClient.RelaySubscribe(ctx, relayResult.Request) - // relayLatency := time.Since(relaySentTime) // TODO: use subscription QoS if err != nil { errReport := rpccs.consumerSessionManager.OnSessionFailure(singleConsumerSession, err) if errReport != nil { - return utils.LavaFormatError("subscribe relay failed onSessionFailure errored", errReport, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "original error", Value: err.Error()}) + return utils.LavaFormatError("subscribe relay failed onSessionFailure errored", errReport, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("originalError", err.Error()), + ) + } + + return err + } + + reply, err := rpccs.getFirstSubscriptionReply(ctx, hashedParams, replyServer) + if err != nil { + errReport := rpccs.consumerSessionManager.OnSessionFailure(singleConsumerSession, err) + if errReport != nil { + return utils.LavaFormatError("subscribe relay failed onSessionFailure errored", errReport, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("originalError", err.Error()), + ) } return err } - // TODO: need to check that if provider fails and returns error, this is reflected here and we run onSessionDone - // my thoughts are that this fails if the grpc fails not if the provider fails, and if the provider returns an error this is reflected by the Recv function on the chainListener calling us here - // and this is too late - relayResult.ReplyServer = &replyServer - err = rpccs.consumerSessionManager.OnSessionDoneIncreaseCUOnly(singleConsumerSession) + + utils.LavaFormatTrace("subscribe relay succeeded", + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + + relayResult.ReplyServer = replyServer + relayResult.Reply = reply + latestBlock := relayResult.Reply.LatestBlock + err = rpccs.consumerSessionManager.OnSessionDoneIncreaseCUOnly(singleConsumerSession, latestBlock) return err } +func (rpccs *RPCConsumerServer) getFirstSubscriptionReply(ctx context.Context, hashedParams string, replyServer pairingtypes.Relayer_RelaySubscribeClient) (*pairingtypes.RelayReply, error) { + var reply pairingtypes.RelayReply + gotFirstReplyChanOrErr := make(chan struct{}) + + // Cancel the context after SubscriptionFirstReplyTimeout duration, so we won't hang forever + go func() { + for { + select { + case <-time.After(common.SubscriptionFirstReplyTimeout): + if reply.Data == nil { + utils.LavaFormatError("Timeout exceeded when waiting for first reply message from subscription, cancelling the context with the provider", nil, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + rpccs.CancelSubscriptionContext(hashedParams) // Cancel the context with the provider, which will trigger the replyServer's context to be cancelled + } + case <-gotFirstReplyChanOrErr: + return + } + } + }() + + select { + case <-replyServer.Context().Done(): // Make sure the reply server is open + return nil, utils.LavaFormatError("reply server context canceled before first time read", nil, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + default: + err := replyServer.RecvMsg(&reply) + gotFirstReplyChanOrErr <- struct{}{} + if err != nil { + return nil, utils.LavaFormatError("Could not read reply from reply server", err, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + ) + } + } + + utils.LavaFormatTrace("successfully got first reply", + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("reply", string(reply.Data)), + ) + + // Make sure we can parse the reply + var replyJson rpcclient.JsonrpcMessage + err := json.Unmarshal(reply.Data, &replyJson) + if err != nil { + return nil, utils.LavaFormatError("could not parse reply into json", err, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("reply", reply.Data), + ) + } + + if replyJson.Error != nil { + // Node error, subscription was not initialized, triggering OnSessionFailure + return nil, utils.LavaFormatError("error in reply from subscription", nil, + utils.LogAttr("GUID", ctx), + utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)), + utils.LogAttr("reply", replyJson), + ) + } + + return &reply, nil +} + func (rpccs *RPCConsumerServer) sendDataReliabilityRelayIfApplicable(ctx context.Context, dappID string, consumerIp string, chainMessage chainlib.ChainMessage, dataReliabilityThreshold uint32, relayProcessor *RelayProcessor) error { processingTimeout, expectedRelayTimeout := rpccs.getProcessingTimeout(chainMessage) // Wait another relayTimeout duration to maybe get additional relay results @@ -936,8 +1232,9 @@ func (rpccs *RPCConsumerServer) sendDataReliabilityRelayIfApplicable(ctx context relayResult := results[0] if len(results) < 2 { relayRequestData := lavaprotocol.NewRelayData(ctx, relayResult.Request.RelayData.ConnectionType, relayResult.Request.RelayData.ApiUrl, relayResult.Request.RelayData.Data, relayResult.Request.RelayData.SeenBlock, reqBlock, relayResult.Request.RelayData.ApiInterface, chainMessage.GetRPCMessage().GetHeaders(), relayResult.Request.RelayData.Addon, relayResult.Request.RelayData.Extensions) - relayProcessorDataReliability := NewRelayProcessor(ctx, relayProcessor.usedProviders, 1, chainMessage, rpccs.consumerConsistency, dappID, consumerIp, rpccs.debugRelays) - err := rpccs.sendRelayToProvider(ctx, chainMessage, relayRequestData, dappID, consumerIp, relayProcessorDataReliability) + protocolMessage := chainlib.NewProtocolMessage(chainMessage, nil, relayRequestData) + relayProcessorDataReliability := NewRelayProcessor(ctx, relayProcessor.usedProviders, 1, chainMessage, rpccs.consumerConsistency, dappID, consumerIp, rpccs.debugRelays, rpccs.rpcConsumerLogs, rpccs, rpccs.disableNodeErrorRetry, rpccs.relayRetriesManager) + err := rpccs.sendRelayToProvider(ctx, protocolMessage, dappID, consumerIp, relayProcessorDataReliability, nil) if err != nil { return utils.LavaFormatWarning("failed data reliability relay to provider", err, utils.LogAttr("relayProcessorDataReliability", relayProcessorDataReliability)) } @@ -968,7 +1265,7 @@ func (rpccs *RPCConsumerServer) sendDataReliabilityRelayIfApplicable(ctx context if conflict != nil { // TODO: remove this check when we fix the missing extensions information on conflict detection transaction if len(chainMessage.GetExtensions()) == 0 { - err := rpccs.consumerTxSender.TxConflictDetection(ctx, nil, conflict, nil, relayResultDataReliability.ConflictHandler) + err := rpccs.consumerTxSender.TxConflictDetection(ctx, nil, conflict, relayResultDataReliability.ConflictHandler) if err != nil { utils.LavaFormatError("could not send detection Transaction", err, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "conflict", Value: conflict}) } @@ -996,14 +1293,9 @@ func (rpccs *RPCConsumerServer) LavaDirectiveHeaders(metadata []pairingtypes.Met headerDirectives := map[string]string{} for _, metaElement := range metadata { name := strings.ToLower(metaElement.Name) - switch name { - case common.BLOCK_PROVIDERS_ADDRESSES_HEADER_NAME: - case common.RELAY_TIMEOUT_HEADER_NAME: - case common.EXTENSION_OVERRIDE_HEADER_NAME: - case common.FORCE_CACHE_REFRESH_HEADER_NAME: - case common.LAVA_DEBUG_RELAY: + if _, found := common.SPECIAL_LAVA_DIRECTIVE_HEADERS[name]; found { headerDirectives[name] = metaElement.Value - default: + } else { metadataRet = append(metadataRet, metaElement) } } diff --git a/protocol/rpcconsumer/rpcconsumer_server_test.go b/protocol/rpcconsumer/rpcconsumer_server_test.go new file mode 100644 index 0000000000..91ddaf5e94 --- /dev/null +++ b/protocol/rpcconsumer/rpcconsumer_server_test.go @@ -0,0 +1,181 @@ +package rpcconsumer + +import ( + "context" + "net/http" + "testing" + + btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" + "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + grpc "google.golang.org/grpc" +) + +func createRpcConsumer(t *testing.T, ctrl *gomock.Controller, ctx context.Context, consumeSK *btcSecp256k1.PrivateKey, consumerAccount types.AccAddress, providerPublicAddress string, relayer pairingtypes.RelayerClient, specId string, apiInterface string, epoch uint64, requiredResponses int, lavaChainID string) (*RPCConsumerServer, chainlib.ChainParser) { + serverHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Handle the incoming request and provide the desired response + w.WriteHeader(http.StatusOK) + }) + chainParser, _, chainFetcher, _, _, err := chainlib.CreateChainLibMocks(ctx, specId, apiInterface, serverHandler, nil, "../../", nil) + require.NoError(t, err) + require.NotNil(t, chainParser) + require.NotNil(t, chainFetcher) + + rpcConsumerServer := &RPCConsumerServer{} + rpcEndpoint := &lavasession.RPCEndpoint{ + NetworkAddress: "127.0.0.1:54321", + ChainID: specId, + ApiInterface: apiInterface, + TLSEnabled: false, + HealthCheckPath: "", + Geolocation: 1, + } + + consumerStateTracker := NewMockConsumerStateTrackerInf(ctrl) + consumerStateTracker. + EXPECT(). + GetLatestVirtualEpoch(). + Return(uint64(0)). + AnyTimes() + + finalizationConsensus := finalizationconsensus.NewFinalizationConsensus(rpcEndpoint.ChainID) + _, averageBlockTime, _, _ := chainParser.ChainBlockStats() + baseLatency := common.AverageWorldLatency / 2 + optimizer := provideroptimizer.NewProviderOptimizer(provideroptimizer.STRATEGY_BALANCED, averageBlockTime, baseLatency, 2) + consumerSessionManager := lavasession.NewConsumerSessionManager(rpcEndpoint, optimizer, nil, nil, "test", lavasession.NewActiveSubscriptionProvidersStorage()) + consumerSessionManager.UpdateAllProviders(epoch, map[uint64]*lavasession.ConsumerSessionsWithProvider{ + epoch: { + PublicLavaAddress: providerPublicAddress, + PairingEpoch: epoch, + Endpoints: []*lavasession.Endpoint{{Connections: []*lavasession.EndpointConnection{{Client: relayer}}}}, + }, + }) + + consumerConsistency := NewConsumerConsistency(specId) + consumerCmdFlags := common.ConsumerCmdFlags{ + RelaysHealthEnableFlag: false, + } + rpcsonumerLogs, err := metrics.NewRPCConsumerLogs(nil, nil) + require.NoError(t, err) + err = rpcConsumerServer.ServeRPCRequests(ctx, rpcEndpoint, consumerStateTracker, chainParser, finalizationConsensus, consumerSessionManager, requiredResponses, consumeSK, lavaChainID, nil, rpcsonumerLogs, consumerAccount, consumerConsistency, nil, consumerCmdFlags, false, nil, nil, nil) + require.NoError(t, err) + + return rpcConsumerServer, chainParser +} + +func handleRelay(t *testing.T, request *pairingtypes.RelayRequest, providerSK *btcSecp256k1.PrivateKey, consumerAccount types.AccAddress) *pairingtypes.RelayReply { + relayReply := &pairingtypes.RelayReply{ + Data: []byte(`{"jsonrpc":"2.0","result":{}, "id":1}`), + FinalizedBlocksHashes: []byte(`{"0":"hash0"}`), + } + + relayExchange := &pairingtypes.RelayExchange{ + Request: *request, + Reply: *relayReply, + } + + sig, err := sigs.Sign(providerSK, *relayExchange) + + require.NoError(t, err) + relayReply.Sig = sig + + sigBlocks, err := sigs.Sign(providerSK, conflicttypes.NewRelayFinalizationFromRelaySessionAndRelayReply(request.RelaySession, relayReply, consumerAccount)) + + require.NoError(t, err) + relayReply.SigBlocks = sigBlocks + + return relayReply +} + +func TestRelayInnerProviderUniqueIdFlow(t *testing.T) { + rand.InitRandomSeed() + + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + providerSK, providerAccount := sigs.GenerateFloatingKey() + providerPublicAddress := providerAccount.String() + consumeSK, consumerAccount := sigs.GenerateFloatingKey() + + providerUniqueId := "foobar" + + relayerMock := NewMockRelayerClient(ctrl) + relayerMock. + EXPECT(). + Relay(gomock.Any(), gomock.Any(), gomock.Any()). + DoAndReturn(func(ctx context.Context, in *pairingtypes.RelayRequest, opts ...grpc.CallOption) (*pairingtypes.RelayReply, error) { + if len(opts) == 1 { + trailerCallOption, ok := opts[0].(grpc.TrailerCallOption) + require.True(t, ok) + require.NotNil(t, trailerCallOption) + + trailerCallOption.TrailerAddr.Set(chainlib.RpcProviderUniqueIdHeader, providerUniqueId) + } + return handleRelay(t, in, providerSK, consumerAccount), nil + }). + AnyTimes() + + // Create the RPC consumer server + rpcConsumerServer, chainParser := createRpcConsumer(t, ctrl, context.Background(), consumeSK, consumerAccount, providerPublicAddress, relayerMock, "LAV1", spectypes.APIInterfaceTendermintRPC, 100, 1, "lava") + require.NotNil(t, rpcConsumerServer) + require.NotNil(t, chainParser) + + // Create a chain message + chainMsg, err := chainParser.ParseMsg("", []byte(`{"jsonrpc":"2.0","method":"status","params":[],"id":1}`), "", nil, extensionslib.ExtensionInfo{}) + require.NoError(t, err) + + // Create single consumer session + singleConsumerSession := &lavasession.SingleConsumerSession{EndpointConnection: &lavasession.EndpointConnection{Client: relayerMock}} + + // Create RelayResult + relayResult := &common.RelayResult{ + ProviderInfo: common.ProviderInfo{ + ProviderAddress: providerPublicAddress, + }, + Request: &pairingtypes.RelayRequest{ + RelayData: &pairingtypes.RelayPrivateData{RequestBlock: 0}, + RelaySession: &pairingtypes.RelaySession{ + SessionId: 1, + Epoch: 100, + RelayNum: 1, + }, + }, + } + + callRelayInner := func() error { + _, err, _ := rpcConsumerServer.relayInner(context.Background(), singleConsumerSession, relayResult, 1, chainMsg, "", nil) + return err + } + + t.Run("TestRelayInnerProviderUniqueIdFlow", func(t *testing.T) { + // Setting the first provider unique id + require.NoError(t, callRelayInner()) + + // It's still the same, should pass + require.NoError(t, callRelayInner()) + + oldProviderUniqueId := providerUniqueId + providerUniqueId = "barfoo" + + // Now the providerUniqueId has changed, should fail + require.Error(t, callRelayInner()) + + providerUniqueId = oldProviderUniqueId + + // Back to the correct providerUniqueId, should pass + require.NoError(t, callRelayInner()) + }) +} diff --git a/protocol/rpcconsumer/testing.go b/protocol/rpcconsumer/testing.go index c62bf01eba..7560dd6b99 100644 --- a/protocol/rpcconsumer/testing.go +++ b/protocol/rpcconsumer/testing.go @@ -10,15 +10,15 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chaintracker" - commonlib "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/rpcprovider" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chaintracker" + commonlib "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/rpcprovider" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/protocol/rpcprovider/chain_tackers.go b/protocol/rpcprovider/chain_tackers.go index 6348726745..39c49db789 100644 --- a/protocol/rpcprovider/chain_tackers.go +++ b/protocol/rpcprovider/chain_tackers.go @@ -3,8 +3,8 @@ package rpcprovider import ( "sync" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/utils" ) type ChainTrackers struct { diff --git a/protocol/rpcprovider/cors_test.go b/protocol/rpcprovider/cors_test.go index 83ba1ee1cf..69f4e16e3f 100644 --- a/protocol/rpcprovider/cors_test.go +++ b/protocol/rpcprovider/cors_test.go @@ -16,7 +16,7 @@ import ( "testing" "time" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/provider_listener.go b/protocol/rpcprovider/provider_listener.go index 0817c2a3af..65a7ccb358 100644 --- a/protocol/rpcprovider/provider_listener.go +++ b/protocol/rpcprovider/provider_listener.go @@ -3,17 +3,19 @@ package rpcprovider import ( "context" "errors" + "fmt" "net/http" "strings" "sync" "github.com/gogo/status" "github.com/improbable-eng/grpc-web/go/grpcweb" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" grpc "google.golang.org/grpc" @@ -70,7 +72,7 @@ func NewProviderListener(ctx context.Context, networkAddress lavasession.Network handler := func(resp http.ResponseWriter, req *http.Request) { // Set CORS headers resp.Header().Set("Access-Control-Allow-Origin", "*") - resp.Header().Set("Access-Control-Allow-Headers", "Content-Type, x-grpc-web, lava-sdk-relay-timeout") + resp.Header().Set("Access-Control-Allow-Headers", fmt.Sprintf("Content-Type, x-grpc-web, lava-sdk-relay-timeout, %s", common.LAVA_CONSUMER_PROCESS_GUID)) if req.URL.Path == healthCheckPath && req.Method == http.MethodGet { resp.WriteHeader(http.StatusOK) @@ -165,12 +167,12 @@ func (rs *relayServer) findReceiver(apiInterface string, specID string) (RelayRe for k := range rs.relayReceivers { keys = append(keys, k) } - err := utils.LavaFormatError("got called with unhandled relay receiver", lavaprotocol.UnhandledRelayReceiverError, utils.Attribute{Key: "requested_receiver", Value: endpoint.Key()}, utils.Attribute{Key: "handled_receivers", Value: strings.Join(keys, ",")}) - return nil, status.Error(codes.Code(lavaprotocol.UnhandledRelayReceiverError.ABCICode()), err.Error()) + err := utils.LavaFormatError("got called with unhandled relay receiver", protocolerrors.UnhandledRelayReceiverError, utils.Attribute{Key: "requested_receiver", Value: endpoint.Key()}, utils.Attribute{Key: "handled_receivers", Value: strings.Join(keys, ",")}) + return nil, status.Error(codes.Code(protocolerrors.UnhandledRelayReceiverError.ABCICode()), err.Error()) } if !relayReceiver.enabled { - err := utils.LavaFormatError("relayReceiver is disabled", lavaprotocol.DisabledRelayReceiverError, utils.Attribute{Key: "relayReceiver", Value: endpoint.Key()}) - return nil, status.Error(codes.Code(lavaprotocol.DisabledRelayReceiverError.ABCICode()), err.Error()) + err := utils.LavaFormatError("relayReceiver is disabled", protocolerrors.DisabledRelayReceiverError, utils.Attribute{Key: "relayReceiver", Value: endpoint.Key()}) + return nil, status.Error(codes.Code(protocolerrors.DisabledRelayReceiverError.ABCICode()), err.Error()) } return *relayReceiver.relayReceiver, nil } diff --git a/protocol/rpcprovider/provider_listener_mock.go b/protocol/rpcprovider/provider_listener_mock.go index e6f9255856..504a056858 100644 --- a/protocol/rpcprovider/provider_listener_mock.go +++ b/protocol/rpcprovider/provider_listener_mock.go @@ -12,7 +12,7 @@ import ( context "context" reflect "reflect" - types "github.com/lavanet/lava/x/pairing/types" + types "github.com/lavanet/lava/v2/x/pairing/types" gomock "go.uber.org/mock/gomock" ) diff --git a/protocol/rpcprovider/reliabilitymanager/reliability_manager.go b/protocol/rpcprovider/reliabilitymanager/reliability_manager.go index 88674405ad..77f22dbecd 100644 --- a/protocol/rpcprovider/reliabilitymanager/reliability_manager.go +++ b/protocol/rpcprovider/reliabilitymanager/reliability_manager.go @@ -10,15 +10,15 @@ import ( "github.com/goccy/go-json" terderminttypes "github.com/cometbft/cometbft/abci/types" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "golang.org/x/exp/slices" ) diff --git a/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go b/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go index 771149d6aa..a6c5a0edda 100644 --- a/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go +++ b/protocol/rpcprovider/reliabilitymanager/reliability_manager_test.go @@ -10,19 +10,20 @@ import ( terderminttypes "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/protocol/statetracker" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationverification" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v2/protocol/statetracker" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -44,26 +45,26 @@ func TestFullFlowReliabilityCompare(t *testing.T) { specId := "LAV1" epoch := int64(100) singleConsumerSession := &lavasession.SingleConsumerSession{ - CuSum: 20, - LatestRelayCu: 10, // set by GetSessions cuNeededForSession - QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, - SessionId: 123, - Parent: nil, - RelayNum: 1, - LatestBlock: epoch, - Endpoint: nil, - BlockListed: false, // if session lost sync we blacklist it. + CuSum: 20, + LatestRelayCu: 10, // set by GetSessions cuNeededForSession + QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, + SessionId: 123, + Parent: nil, + RelayNum: 1, + LatestBlock: epoch, + EndpointConnection: nil, + BlockListed: false, // if session lost sync we blacklist it. } singleConsumerSession2 := &lavasession.SingleConsumerSession{ - CuSum: 200, - LatestRelayCu: 100, // set by GetSessions cuNeededForSession - QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, - SessionId: 456, - Parent: nil, - RelayNum: 5, - LatestBlock: epoch, - Endpoint: nil, - BlockListed: false, // if session lost sync we blacklist it. + CuSum: 200, + LatestRelayCu: 100, // set by GetSessions cuNeededForSession + QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, + SessionId: 456, + Parent: nil, + RelayNum: 5, + LatestBlock: epoch, + EndpointConnection: nil, + BlockListed: false, // if session lost sync we blacklist it. } metadataValue := make([]pairingtypes.Metadata, 1) metadataValue[0] = pairingtypes.Metadata{ @@ -93,7 +94,7 @@ func TestFullFlowReliabilityCompare(t *testing.T) { require.NoError(t, err) err = lavaprotocol.VerifyRelayReply(ctx, reply, relay, provider_address.String()) require.NoError(t, err) - _, _, err = lavaprotocol.VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0) + _, err = finalizationverification.VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0, 1) require.NoError(t, err) relayResult := &common.RelayResult{ @@ -126,7 +127,7 @@ func TestFullFlowReliabilityCompare(t *testing.T) { require.NoError(t, err) err = lavaprotocol.VerifyRelayReply(ctx, replyDR, relayDR, providerDR_address.String()) require.NoError(t, err) - _, _, err = lavaprotocol.VerifyFinalizationData(replyDR, relayDR, providerDR_address.String(), consumer_address, int64(0), 0) + _, err = finalizationverification.VerifyFinalizationData(replyDR, relayDR, providerDR_address.String(), consumer_address, int64(0), 0, 1) require.NoError(t, err) relayResultDR := &common.RelayResult{ Request: relayDR, @@ -160,7 +161,7 @@ type txSenderMock struct { cb func() error } -func (tsm *txSenderMock) TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict) error { +func (tsm *txSenderMock) TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict) error { if tsm.cb == nil { return fmt.Errorf("No cb") } @@ -185,43 +186,46 @@ func TestFullFlowReliabilityConflict(t *testing.T) { w.WriteHeader(http.StatusOK) fmt.Fprint(w, string(replyDataBuf)) }) - chainParser, chainProxy, chainFetcher, closeServer, _, err := chainlib.CreateChainLibMocks(ts.Ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../../", nil) + chainParser, chainProxy, chainFetcher, closeServer, _, err := chainlib.CreateChainLibMocks(ts.Ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../../", nil) if closeServer != nil { defer closeServer() } + require.NoError(t, err) require.NotNil(t, chainParser) require.NotNil(t, chainProxy) require.NotNil(t, chainFetcher) - consumerSesssionWithProvider := &lavasession.ConsumerSessionsWithProvider{} + consumerSessionWithProvider := &lavasession.ConsumerSessionsWithProvider{} singleConsumerSession := &lavasession.SingleConsumerSession{ - CuSum: 20, - LatestRelayCu: 10, // set by GetSessions cuNeededForSession - QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, - SessionId: 123, - Parent: nil, - RelayNum: 1, - LatestBlock: epoch, - Endpoint: nil, - BlockListed: false, // if session lost sync we blacklist it. + CuSum: 20, + LatestRelayCu: 10, // set by GetSessions cuNeededForSession + QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, + SessionId: 123, + Parent: nil, + RelayNum: 1, + LatestBlock: epoch, + EndpointConnection: nil, + BlockListed: false, // if session lost sync we blacklist it. } + singleConsumerSession2 := &lavasession.SingleConsumerSession{ - CuSum: 200, - LatestRelayCu: 100, // set by GetSessions cuNeededForSession - QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, - SessionId: 456, - Parent: consumerSesssionWithProvider, - RelayNum: 5, - LatestBlock: epoch, - Endpoint: nil, - BlockListed: false, // if session lost sync we blacklist it. + CuSum: 200, + LatestRelayCu: 100, // set by GetSessions cuNeededForSession + QoSInfo: lavasession.QoSReport{LastQoSReport: &pairingtypes.QualityOfServiceReport{}}, + SessionId: 456, + Parent: consumerSessionWithProvider, + RelayNum: 5, + LatestBlock: epoch, + EndpointConnection: nil, + BlockListed: false, // if session lost sync we blacklist it. } - metadataValue := make([]pairingtypes.Metadata, 1) - metadataValue[0] = pairingtypes.Metadata{ + + metadataValue := []pairingtypes.Metadata{{ Name: "banana", Value: "55", - } + }} + chainMessage, err := chainParser.ParseMsg("/cosmos/base/tendermint/v1beta1/blocks/latest", []byte{}, "GET", metadataValue, extensionslib.ExtensionInfo{LatestBlock: 0}) require.NoError(t, err) reqBlock, _ := chainMessage.RequestedBlock() @@ -248,7 +252,7 @@ func TestFullFlowReliabilityConflict(t *testing.T) { require.NoError(t, err) err = lavaprotocol.VerifyRelayReply(ts.Ctx, reply, relay, provider_address.String()) require.NoError(t, err) - _, _, err = lavaprotocol.VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0) + _, err = finalizationverification.VerifyFinalizationData(reply, relay, provider_address.String(), consumer_address, int64(0), 0, 1) require.NoError(t, err) relayResult := &common.RelayResult{ @@ -274,19 +278,25 @@ func TestFullFlowReliabilityConflict(t *testing.T) { require.Equal(t, extractedConsumerAddress, consumer_address) require.True(t, bytes.Equal(relayDR.RelaySession.ContentHash, sigs.HashMsg(relayDR.RelayData.GetContentHashData()))) latestBlock = int64(123) + // provider handling the response finalizedBlockHashes = map[int64]interface{}{latestBlock: "AAA"} maliciousReply := []byte("Gimme-your-lava") replyDR := &pairingtypes.RelayReply{Data: maliciousReply} + jsonStr, err = json.Marshal(finalizedBlockHashes) require.NoError(t, err) + replyDR.FinalizedBlocksHashes = jsonStr replyDR.LatestBlock = latestBlock + replyDR, err = lavaprotocol.SignRelayResponse(extractedConsumerAddress, *relayDR, providerDR_sk, replyDR, true) require.NoError(t, err) + err = lavaprotocol.VerifyRelayReply(ts.Ctx, replyDR, relayDR, providerDR_address.String()) require.NoError(t, err) - _, _, err = lavaprotocol.VerifyFinalizationData(replyDR, relayDR, providerDR_address.String(), consumer_address, int64(0), 0) + + _, err = finalizationverification.VerifyFinalizationData(replyDR, relayDR, providerDR_address.String(), consumer_address, int64(0), 0, 1) require.NoError(t, err) relayResultDR := &common.RelayResult{ Request: relayDR, @@ -298,18 +308,21 @@ func TestFullFlowReliabilityConflict(t *testing.T) { conflict := lavaprotocol.VerifyReliabilityResults(ts.Ctx, relayResult, relayResultDR, chainMessage.GetApiCollection(), chainParser) require.NotNil(t, conflict) - msg := conflicttypes.NewMsgDetection(consumer_address.String(), nil, conflict, nil) + msg := conflicttypes.NewMsgDetection(consumer_address.String()) + msg.SetResponseConflict(conflict) cb := func() error { _, err = ts.Servers.ConflictServer.Detection(ts.Ctx, msg) require.NoError(t, err) return err } + txm := &txSenderMock{cb: cb} + consumerStateTracker := &statetracker.ConsumerStateTracker{ConsumerTxSenderInf: txm} - err = consumerStateTracker.TxConflictDetection(ts.Ctx, nil, conflict, nil, singleConsumerSession2.Parent) // report first time + err = consumerStateTracker.TxConflictDetection(ts.Ctx, nil, conflict, singleConsumerSession2.Parent) // report first time require.NoError(t, err) - err = consumerStateTracker.TxConflictDetection(ts.Ctx, nil, conflict, nil, singleConsumerSession2.Parent) // make sure we dont report 2nd time + err = consumerStateTracker.TxConflictDetection(ts.Ctx, nil, conflict, singleConsumerSession2.Parent) // make sure we dont report 2nd time require.NoError(t, err) _, err = ts.Servers.ConflictServer.Detection(ts.Ctx, msg) // validate reporting 2nd time returns an error. diff --git a/protocol/rpcprovider/rewardserver/reward_db.go b/protocol/rpcprovider/rewardserver/reward_db.go index 874db284e6..609310b802 100644 --- a/protocol/rpcprovider/rewardserver/reward_db.go +++ b/protocol/rpcprovider/rewardserver/reward_db.go @@ -9,11 +9,14 @@ import ( "github.com/goccy/go-json" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) -const keySeparator = "." +const ( + keySeparator = "." + batchSize = 1000 +) type DB interface { Key() string @@ -77,6 +80,20 @@ func (rs *RewardDB) BatchSave(rewardEntities []*RewardEntity) (err error) { err = db.BatchSave(rewards) if err != nil { + if len(rewards) > batchSize { + // possible rewards is too big, try to save it in chunks + for i := 0; i < len(rewards); i += batchSize { + end := i + batchSize + if len(rewards) < i+batchSize { + end = len(rewards) + } + chunk := rewards[i:end] + err = db.BatchSave(chunk) + if err != nil { + return err + } + } + } return err } } diff --git a/protocol/rpcprovider/rewardserver/reward_db_test.go b/protocol/rpcprovider/rewardserver/reward_db_test.go index 6b2916f714..3cea3e9341 100644 --- a/protocol/rpcprovider/rewardserver/reward_db_test.go +++ b/protocol/rpcprovider/rewardserver/reward_db_test.go @@ -7,9 +7,9 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/protocol/rpcprovider/rewardserver/reward_server.go b/protocol/rpcprovider/rewardserver/reward_server.go index b9e6005842..292b4f4649 100644 --- a/protocol/rpcprovider/rewardserver/reward_server.go +++ b/protocol/rpcprovider/rewardserver/reward_server.go @@ -11,14 +11,14 @@ import ( terderminttypes "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) const ( @@ -34,7 +34,6 @@ const ( MaxPaymentRequestsRetiresForSession = 3 RewardServerMaxRelayRetires = 3 splitRewardsIntoChunksSize = 500 // if the reward array is larger than this it will split it into chunks and send multiple requests instead of a huge one - debug = false ) type PaymentRequest struct { @@ -85,6 +84,21 @@ type PaymentConfiguration struct { shouldAddExpectedPayment bool } +// used to disable provider rewards claiming +type DisabledRewardServer struct{} + +func (rws *DisabledRewardServer) SendNewProof(ctx context.Context, proof *pairingtypes.RelaySession, epoch uint64, consumerAddr string, apiInterface string) (existingCU uint64, updatedWithProof bool) { + return 0, true +} + +func (rws *DisabledRewardServer) SubscribeStarted(consumer string, epoch uint64, subscribeID string) { + // TODO: hold off reward claims for subscription while this is still active +} + +func (rws *DisabledRewardServer) SubscribeEnded(consumer string, epoch uint64, subscribeID string) { + // TODO: can collect now +} + type RewardServer struct { rewardsTxSender RewardsTxSender lock sync.RWMutex @@ -304,9 +318,15 @@ func (rws *RewardServer) sendRewardsClaim(ctx context.Context, epoch uint64) err rws.addExpectedPayment(expectedPay) rws.updateCUServiced(relay.CuSum) specs[relay.SpecId] = struct{}{} - if debug { - utils.LavaFormatDebug("Adding Payment for Spec", utils.LogAttr("spec", relay.SpecId), utils.LogAttr("Cu Sum", relay.CuSum), utils.LogAttr("epoch", relay.Epoch), utils.LogAttr("consumerAddr", consumerAddr), utils.LogAttr("number_of_relays_served", relay.RelayNum), utils.LogAttr("sessionId", relay.SessionId)) - } + + utils.LavaFormatTrace("Adding Payment for Spec", + utils.LogAttr("spec", relay.SpecId), + utils.LogAttr("Cu Sum", relay.CuSum), + utils.LogAttr("epoch", relay.Epoch), + utils.LogAttr("consumerAddr", consumerAddr), + utils.LogAttr("number_of_relays_served", relay.RelayNum), + utils.LogAttr("sessionId", relay.SessionId), + ) } } else { // just add the specs for _, relay := range failedRewardRequestsToRetry { @@ -459,6 +479,9 @@ func (rws *RewardServer) updateCUPaid(cu uint64) { } func (rws *RewardServer) AddDataBase(specId string, providerPublicAddress string, shardID uint) { + if rws == nil { + return + } // the db itself doesn't need locks. as it self manages locks inside. // but opening a db can race. (NewLocalDB) so we lock this method. // Also, we construct the in-memory rewards from the DB, so that needs a lock as well @@ -472,6 +495,9 @@ func (rws *RewardServer) AddDataBase(specId string, providerPublicAddress string } func (rws *RewardServer) CloseAllDataBases() error { + if rws == nil { + return nil + } return rws.rewardDB.Close() } diff --git a/protocol/rpcprovider/rewardserver/reward_server_test.go b/protocol/rpcprovider/rewardserver/reward_server_test.go index 9ebbedcef4..b495d368b1 100644 --- a/protocol/rpcprovider/rewardserver/reward_server_test.go +++ b/protocol/rpcprovider/rewardserver/reward_server_test.go @@ -7,16 +7,16 @@ import ( "testing" "time" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" "golang.org/x/net/context" terderminttypes "github.com/cometbft/cometbft/abci/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) @@ -46,7 +46,7 @@ func stubPaymentEvents(num int, specId string, sessionId uint64) (tos []map[stri QoS, _ := relay.QosReport.ComputeQoS() rewardCoins, _ := sdk.ParseCoinNormalized("50ulava") burnAmount, _ := sdk.ParseCoinNormalized("40ulava") - from := map[string]string{"chainID": fmt.Sprintf(relay.SpecId), "client": clientAddr.String(), "provider": providerAddr.String(), "CU": strconv.FormatUint(relay.CuSum, 10), "BasePay": rewardCoins.String(), "totalCUInEpoch": strconv.FormatUint(700, 10), "uniqueIdentifier": strconv.FormatUint(relay.SessionId, 10), "descriptionString": "banana"} + from := map[string]string{"chainID": relay.SpecId, "client": clientAddr.String(), "provider": providerAddr.String(), "CU": strconv.FormatUint(relay.CuSum, 10), "BasePay": rewardCoins.String(), "totalCUInEpoch": strconv.FormatUint(700, 10), "uniqueIdentifier": strconv.FormatUint(relay.SessionId, 10), "descriptionString": "banana"} from["QoSReport"] = "Latency: " + relay.QosReport.Latency.String() + ", Availability: " + relay.QosReport.Availability.String() + ", Sync: " + relay.QosReport.Sync.String() from["QoSLatency"] = relay.QosReport.Latency.String() from["QoSAvailability"] = relay.QosReport.Availability.String() diff --git a/protocol/rpcprovider/rpcprovider.go b/protocol/rpcprovider/rpcprovider.go index 4bd1f39645..225f175d57 100644 --- a/protocol/rpcprovider/rpcprovider.go +++ b/protocol/rpcprovider/rpcprovider.go @@ -10,31 +10,32 @@ import ( "sync" "time" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/performance" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/protocol/statetracker" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/protocol/upgrade" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - epochstorage "github.com/lavanet/lava/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/performance" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v2/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v2/protocol/statetracker" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/protocol/upgrade" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + epochstorage "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -107,6 +108,7 @@ type rpcProviderStartOptions struct { rewardsSnapshotThreshold uint rewardsSnapshotTimeoutSec uint healthCheckMetricsOptions *rpcProviderHealthCheckMetricsOptions + staticProvider bool } type rpcProviderHealthCheckMetricsOptions struct { @@ -135,6 +137,8 @@ type RPCProvider struct { relaysHealthCheckEnabled bool relaysHealthCheckInterval time.Duration grpcHealthCheckEndpoint string + providerUniqueId string + staticProvider bool } func (rpcp *RPCProvider) Start(options *rpcProviderStartOptions) (err error) { @@ -145,6 +149,7 @@ func (rpcp *RPCProvider) Start(options *rpcProviderStartOptions) (err error) { signal.Stop(signalChan) cancel() }() + rpcp.providerUniqueId = strconv.FormatUint(utils.GenerateUniqueIdentifier(), 10) rpcp.chainTrackers = &ChainTrackers{} rpcp.parallelConnections = options.parallelConnections rpcp.cache = options.cache @@ -156,6 +161,7 @@ func (rpcp *RPCProvider) Start(options *rpcProviderStartOptions) (err error) { rpcp.relaysHealthCheckInterval = options.healthCheckMetricsOptions.relaysHealthIntervalFlag rpcp.relaysMonitorAggregator = metrics.NewRelaysMonitorAggregator(rpcp.relaysHealthCheckInterval, rpcp.providerMetricsManager) rpcp.grpcHealthCheckEndpoint = options.healthCheckMetricsOptions.grpcHealthCheckEndpoint + rpcp.staticProvider = options.staticProvider // single state tracker lavaChainFetcher := chainlib.NewLavaChainFetcher(ctx, options.clientCtx) providerStateTracker, err := statetracker.NewProviderStateTracker(ctx, options.txFactory, options.clientCtx, lavaChainFetcher, rpcp.providerMetricsManager) @@ -173,10 +179,12 @@ func (rpcp *RPCProvider) Start(options *rpcProviderStartOptions) (err error) { rpcp.providerStateTracker.RegisterForVersionUpdates(ctx, version.Version, &upgrade.ProtocolVersion{}) // single reward server - rewardDB := rewardserver.NewRewardDBWithTTL(options.rewardTTL) - rpcp.rewardServer = rewardserver.NewRewardServer(providerStateTracker, rpcp.providerMetricsManager, rewardDB, options.rewardStoragePath, options.rewardsSnapshotThreshold, options.rewardsSnapshotTimeoutSec, rpcp.chainTrackers) - rpcp.providerStateTracker.RegisterForEpochUpdates(ctx, rpcp.rewardServer) - rpcp.providerStateTracker.RegisterPaymentUpdatableForPayments(ctx, rpcp.rewardServer) + if !options.staticProvider { + rewardDB := rewardserver.NewRewardDBWithTTL(options.rewardTTL) + rpcp.rewardServer = rewardserver.NewRewardServer(providerStateTracker, rpcp.providerMetricsManager, rewardDB, options.rewardStoragePath, options.rewardsSnapshotThreshold, options.rewardsSnapshotTimeoutSec, rpcp.chainTrackers) + rpcp.providerStateTracker.RegisterForEpochUpdates(ctx, rpcp.rewardServer) + rpcp.providerStateTracker.RegisterPaymentUpdatableForPayments(ctx, rpcp.rewardServer) + } keyName, err := sigs.GetKeyName(options.clientCtx) if err != nil { utils.LavaFormatFatal("failed getting key name from clientCtx", err) @@ -215,6 +223,7 @@ func (rpcp *RPCProvider) Start(options *rpcProviderStartOptions) (err error) { } specValidator := NewSpecValidator() + utils.LavaFormatTrace("Running setup for RPCProvider endpoints", utils.LogAttr("endpoints", options.rpcProviderEndpoints)) disabledEndpointsList := rpcp.SetupProviderEndpoints(options.rpcProviderEndpoints, specValidator, true) rpcp.relaysMonitorAggregator.StartMonitoring(ctx) specValidator.Start(ctx) @@ -373,6 +382,7 @@ func (rpcp *RPCProvider) SetupEndpoint(ctx context.Context, rpcProviderEndpoint }, ) } else { + utils.LavaFormatDebug("verifications only ChainFetcher for spec", utils.LogAttr("chainId", rpcEndpoint.ChainID)) chainFetcher = chainlib.NewVerificationsOnlyChainFetcher(ctx, chainRouter, chainParser, rpcProviderEndpoint) } @@ -454,8 +464,15 @@ func (rpcp *RPCProvider) SetupEndpoint(ctx context.Context, rpcProviderEndpoint rpcp.providerMetricsManager.RegisterRelaysMonitor(chainID, apiInterface, relaysMonitor) } - rpcProviderServer := &RPCProviderServer{} - rpcProviderServer.ServeRPCRequests(ctx, rpcProviderEndpoint, chainParser, rpcp.rewardServer, providerSessionManager, reliabilityManager, rpcp.privKey, rpcp.cache, chainRouter, rpcp.providerStateTracker, rpcp.addr, rpcp.lavaChainID, DEFAULT_ALLOWED_MISSING_CU, providerMetrics, relaysMonitor) + rpcProviderServer := &RPCProviderServer{providerUniqueId: rpcp.providerUniqueId} + + var providerNodeSubscriptionManager *chainlib.ProviderNodeSubscriptionManager + if rpcProviderEndpoint.ApiInterface == spectypes.APIInterfaceTendermintRPC || rpcProviderEndpoint.ApiInterface == spectypes.APIInterfaceJsonRPC { + utils.LavaFormatTrace("Creating provider node subscription manager", utils.LogAttr("rpcProviderEndpoint", rpcProviderEndpoint)) + providerNodeSubscriptionManager = chainlib.NewProviderNodeSubscriptionManager(chainRouter, chainParser, rpcProviderServer, rpcp.privKey) + } + + rpcProviderServer.ServeRPCRequests(ctx, rpcProviderEndpoint, chainParser, rpcp.rewardServer, providerSessionManager, reliabilityManager, rpcp.privKey, rpcp.cache, chainRouter, rpcp.providerStateTracker, rpcp.addr, rpcp.lavaChainID, DEFAULT_ALLOWED_MISSING_CU, providerMetrics, relaysMonitor, providerNodeSubscriptionManager, rpcp.staticProvider) // set up grpc listener var listener *ProviderListener func() { @@ -470,13 +487,16 @@ func (rpcp *RPCProvider) SetupEndpoint(ctx context.Context, rpcProviderEndpoint rpcp.rpcProviderListeners[rpcProviderEndpoint.NetworkAddress.Address] = listener } }() + if listener == nil { utils.LavaFormatFatal("listener not defined, cant register RPCProviderServer", nil, utils.Attribute{Key: "RPCProviderEndpoint", Value: rpcProviderEndpoint.String()}) } + err = listener.RegisterReceiver(rpcProviderServer, rpcProviderEndpoint) if err != nil { utils.LavaFormatError("error in register receiver", err) } + utils.LavaFormatDebug("provider finished setting up endpoint", utils.Attribute{Key: "endpoint", Value: rpcProviderEndpoint.Key()}) // prevents these objects form being overrun later chainParser.Activate() @@ -485,8 +505,8 @@ func (rpcp *RPCProvider) SetupEndpoint(ctx context.Context, rpcProviderEndpoint return nil } -func ParseEndpoints(viper_endpoints *viper.Viper, geolocation uint64) (endpoints []*lavasession.RPCProviderEndpoint, err error) { - err = viper_endpoints.UnmarshalKey(common.EndpointsConfigName, &endpoints) +func ParseEndpointsCustomName(viper_endpoints *viper.Viper, endpointsConfigName string, geolocation uint64) (endpoints []*lavasession.RPCProviderEndpoint, err error) { + err = viper_endpoints.UnmarshalKey(endpointsConfigName, &endpoints) if err != nil { utils.LavaFormatFatal("could not unmarshal endpoints", err, utils.Attribute{Key: "viper_endpoints", Value: viper_endpoints.AllSettings()}) } @@ -496,6 +516,10 @@ func ParseEndpoints(viper_endpoints *viper.Viper, geolocation uint64) (endpoints return } +func ParseEndpoints(viper_endpoints *viper.Viper, geolocation uint64) (endpoints []*lavasession.RPCProviderEndpoint, err error) { + return ParseEndpointsCustomName(viper_endpoints, common.EndpointsConfigName, geolocation) +} + func CreateRPCProviderCobraCommand() *cobra.Command { cmdRPCProvider := &cobra.Command{ Use: `rpcprovider [config-file] | { {listen-ip:listen-port spec-chain-id api-interface "comma-separated-node-urls"} ... } --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE`, @@ -613,7 +637,13 @@ rpcprovider 127.0.0.1:3333 OSMOSIS tendermintrpc "wss://www.node-path.com:80,htt if err != nil { utils.LavaFormatFatal("failed to create tx factory", err) } + gasPricesStr := viper.GetString(flags.FlagGasPrices) + if gasPricesStr == "" { + gasPricesStr = statetracker.DefaultGasPrice + } + txFactory = txFactory.WithGasPrices(statetracker.DefaultGasPrice) txFactory = txFactory.WithGasAdjustment(viper.GetFloat64(flags.FlagGasAdjustment)) + utils.LavaFormatInfo("Setting gas for tx Factory", utils.LogAttr("gas-prices", gasPricesStr), utils.LogAttr("gas-adjustment", txFactory.GasAdjustment())) logLevel, err := cmd.Flags().GetString(flags.FlagLogLevel) if err != nil { @@ -669,6 +699,11 @@ rpcprovider 127.0.0.1:3333 OSMOSIS tendermintrpc "wss://www.node-path.com:80,htt enableRelaysHealth := viper.GetBool(common.RelaysHealthEnableFlag) relaysHealthInterval := viper.GetDuration(common.RelayHealthIntervalFlag) healthCheckURLPath := viper.GetString(HealthCheckURLPathFlagName) + staticProvider := viper.GetBool(common.StaticProvidersConfigName) + + if staticProvider { + utils.LavaFormatWarning("Running in static provider mode, skipping rewards and allowing requests from anyone", nil) + } rpcProviderHealthCheckMetricsOptions := rpcProviderHealthCheckMetricsOptions{ enableRelaysHealth, @@ -690,6 +725,7 @@ rpcprovider 127.0.0.1:3333 OSMOSIS tendermintrpc "wss://www.node-path.com:80,htt rewardsSnapshotThreshold, rewardsSnapshotTimeoutSec, &rpcProviderHealthCheckMetricsOptions, + staticProvider, } rpcProvider := RPCProvider{} @@ -701,6 +737,7 @@ rpcprovider 127.0.0.1:3333 OSMOSIS tendermintrpc "wss://www.node-path.com:80,htt // RPCProvider command flags flags.AddTxFlagsToCmd(cmdRPCProvider) cmdRPCProvider.MarkFlagRequired(flags.FlagFrom) + cmdRPCProvider.Flags().Bool(common.StaticProvidersConfigName, false, "set the provider as static, allowing it to get requests from anyone, and skipping rewards, can be used for local tests") cmdRPCProvider.Flags().Bool(common.SaveConfigFlagName, false, "save cmd args to a config file") cmdRPCProvider.Flags().Uint64(common.GeolocationFlag, 0, "geolocation to run from") cmdRPCProvider.MarkFlagRequired(common.GeolocationFlag) @@ -722,6 +759,7 @@ rpcprovider 127.0.0.1:3333 OSMOSIS tendermintrpc "wss://www.node-path.com:80,htt cmdRPCProvider.Flags().Duration(common.RelayHealthIntervalFlag, RelayHealthIntervalFlagDefault, "interval between relay health checks") cmdRPCProvider.Flags().String(HealthCheckURLPathFlagName, HealthCheckURLPathFlagDefault, "the url path for the provider's grpc health check") cmdRPCProvider.Flags().DurationVar(&updaters.TimeOutForFetchingLavaBlocks, common.TimeOutForFetchingLavaBlocksFlag, time.Second*5, "setting the timeout for fetching lava blocks") + cmdRPCProvider.Flags().BoolVar(&chainlib.IgnoreSubscriptionNotConfiguredError, chainlib.IgnoreSubscriptionNotConfiguredErrorFlag, chainlib.IgnoreSubscriptionNotConfiguredError, "ignore webSocket node url not configured error, when subscription is enabled in spec") common.AddRollingLogConfig(cmdRPCProvider) return cmdRPCProvider diff --git a/protocol/rpcprovider/rpcprovider_server.go b/protocol/rpcprovider/rpcprovider_server.go index b635518405..4de897dd9b 100644 --- a/protocol/rpcprovider/rpcprovider_server.go +++ b/protocol/rpcprovider/rpcprovider_server.go @@ -3,34 +3,36 @@ package rpcprovider import ( "bytes" "context" + "errors" "strconv" "strings" + "sync" "time" "github.com/goccy/go-json" sdkerrors "cosmossdk.io/errors" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gogo/status" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" - "github.com/lavanet/lava/protocol/chainlib/extensionslib" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/performance" - "github.com/lavanet/lava/protocol/provideroptimizer" - "github.com/lavanet/lava/protocol/upgrade" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/protocopy" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chainlib/extensionslib" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/protocolerrors" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/performance" + "github.com/lavanet/lava/v2/protocol/provideroptimizer" + rewardserver "github.com/lavanet/lava/v2/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v2/protocol/upgrade" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/protocopy" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" grpc "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -48,20 +50,23 @@ const ( ) type RPCProviderServer struct { - cache *performance.Cache - chainRouter chainlib.ChainRouter - privKey *btcec.PrivateKey - reliabilityManager ReliabilityManagerInf - providerSessionManager *lavasession.ProviderSessionManager - rewardServer RewardServerInf - chainParser chainlib.ChainParser - rpcProviderEndpoint *lavasession.RPCProviderEndpoint - stateTracker StateTrackerInf - providerAddress sdk.AccAddress - lavaChainID string - allowedMissingCUThreshold float64 - metrics *metrics.ProviderMetrics - relaysMonitor *metrics.RelaysMonitor + cache *performance.Cache + chainRouter chainlib.ChainRouter + privKey *btcec.PrivateKey + reliabilityManager ReliabilityManagerInf + providerSessionManager *lavasession.ProviderSessionManager + rewardServer RewardServerInf + chainParser chainlib.ChainParser + rpcProviderEndpoint *lavasession.RPCProviderEndpoint + stateTracker StateTrackerInf + providerAddress sdk.AccAddress + lavaChainID string + allowedMissingCUThreshold float64 + metrics *metrics.ProviderMetrics + relaysMonitor *metrics.RelaysMonitor + providerNodeSubscriptionManager *chainlib.ProviderNodeSubscriptionManager + providerUniqueId string + StaticProvider bool } type ReliabilityManagerInf interface { @@ -82,6 +87,10 @@ type StateTrackerInf interface { GetVirtualEpoch(epoch uint64) uint64 } +func (rpcps *RPCProviderServer) SetProviderUniqueId(uniqueId string) { + rpcps.providerUniqueId = uniqueId +} + func (rpcps *RPCProviderServer) ServeRPCRequests( ctx context.Context, rpcProviderEndpoint *lavasession.RPCProviderEndpoint, chainParser chainlib.ChainParser, @@ -97,12 +106,19 @@ func (rpcps *RPCProviderServer) ServeRPCRequests( allowedMissingCUThreshold float64, providerMetrics *metrics.ProviderMetrics, relaysMonitor *metrics.RelaysMonitor, + providerNodeSubscriptionManager *chainlib.ProviderNodeSubscriptionManager, + staticProvider bool, ) { rpcps.cache = cache rpcps.chainRouter = chainRouter rpcps.privKey = privKey rpcps.providerSessionManager = providerSessionManager rpcps.reliabilityManager = reliabilityManager + if rewardServer == nil { + utils.LavaFormatError("disabled rewards for provider, reward server not defined", nil) + rewardServer = &rewardserver.DisabledRewardServer{} + } + rpcps.StaticProvider = staticProvider rpcps.rewardServer = rewardServer rpcps.chainParser = chainParser rpcps.rpcProviderEndpoint = rpcProviderEndpoint @@ -112,6 +128,7 @@ func (rpcps *RPCProviderServer) ServeRPCRequests( rpcps.allowedMissingCUThreshold = allowedMissingCUThreshold rpcps.metrics = providerMetrics rpcps.relaysMonitor = relaysMonitor + rpcps.providerNodeSubscriptionManager = providerNodeSubscriptionManager rpcps.initRelaysMonitor(ctx) } @@ -135,13 +152,14 @@ func (rpcps *RPCProviderServer) initRelaysMonitor(ctx context.Context) { } func (rpcps *RPCProviderServer) craftChainMessage() (chainMessage chainlib.ChainMessage, err error) { - parsing, collectionData, ok := rpcps.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) + parsing, apiCollection, ok := rpcps.chainParser.GetParsingByTag(spectypes.FUNCTION_TAG_GET_BLOCKNUM) if !ok { return nil, utils.LavaFormatWarning("did not send initial relays because the spec does not contain "+spectypes.FUNCTION_TAG_GET_BLOCKNUM.String(), nil, utils.LogAttr("chainID", rpcps.rpcProviderEndpoint.ChainID), utils.LogAttr("APIInterface", rpcps.rpcProviderEndpoint.ApiInterface), ) } + collectionData := apiCollection.CollectionData path := parsing.ApiName data := []byte(parsing.FunctionTemplate) @@ -157,6 +175,7 @@ func (rpcps *RPCProviderServer) craftChainMessage() (chainMessage chainlib.Chain // function used to handle relay requests from a consumer, it is called by a provider_listener by calling RegisterReceiver func (rpcps *RPCProviderServer) Relay(ctx context.Context, request *pairingtypes.RelayRequest) (*pairingtypes.RelayReply, error) { + grpc.SetTrailer(ctx, metadata.Pairs(chainlib.RpcProviderUniqueIdHeader, rpcps.providerUniqueId)) if request.RelayData == nil || request.RelaySession == nil { return nil, utils.LavaFormatWarning("invalid relay request, internal fields are nil", nil) } @@ -188,11 +207,31 @@ func (rpcps *RPCProviderServer) Relay(ctx context.Context, request *pairingtypes // Init relay relaySession, consumerAddress, chainMessage, err := rpcps.initRelay(ctx, request) if err != nil { + utils.LavaFormatDebug("got error from init relay", utils.LogAttr("error", err)) return nil, rpcps.handleRelayErrorStatus(err) } - // Try sending relay - reply, err := rpcps.TryRelay(ctx, request, consumerAddress, chainMessage) + // Check that this is not subscription related messages + if chainlib.IsFunctionTagOfType(chainMessage, spectypes.FUNCTION_TAG_SUBSCRIBE) { + return nil, errors.New("subscribe method is not supported through Relay") + } + + if chainlib.IsFunctionTagOfType(chainMessage, spectypes.FUNCTION_TAG_UNSUBSCRIBE_ALL) { + return nil, errors.New("unsubscribe_all method is not supported through Relay") + } + + var reply *pairingtypes.RelayReply + if chainlib.IsFunctionTagOfType(chainMessage, spectypes.FUNCTION_TAG_UNSUBSCRIBE) { + reply, err = rpcps.TryRelayUnsubscribe(ctx, request, consumerAddress, chainMessage) + } else { + // Try sending relay + reply, err = rpcps.TryRelay(ctx, request, consumerAddress, chainMessage) + } + + // static provider doesnt handle sessions, so just return the response + if rpcps.StaticProvider { + return reply, rpcps.handleRelayErrorStatus(err) + } if err != nil || common.ContextOutOfTime(ctx) { // failed to send relay. we need to adjust session state. cuSum and relayNumber. @@ -202,7 +241,7 @@ func (rpcps *RPCProviderServer) Relay(ctx context.Context, request *pairingtypes if err != nil { extraInfo = err.Error() } - err = sdkerrors.Wrapf(relayFailureError, "On relay failure: "+extraInfo) + err = sdkerrors.Wrapf(relayFailureError, "On relay failure: %s", extraInfo) } err = utils.LavaFormatError("TryRelay Failed", err, utils.Attribute{Key: "request.SessionId", Value: request.RelaySession.SessionId}, @@ -248,17 +287,18 @@ func (rpcps *RPCProviderServer) Relay(ctx context.Context, request *pairingtypes } func (rpcps *RPCProviderServer) initRelay(ctx context.Context, request *pairingtypes.RelayRequest) (relaySession *lavasession.SingleProviderSession, consumerAddress sdk.AccAddress, chainMessage chainlib.ChainMessage, err error) { - relaySession, consumerAddress, err = rpcps.verifyRelaySession(ctx, request) - if err != nil { - return nil, nil, nil, err - } - defer func(relaySession *lavasession.SingleProviderSession) { - // if we error in here until PrepareSessionForUsage was called successfully we can't call OnSessionFailure + if !rpcps.StaticProvider { + relaySession, consumerAddress, err = rpcps.verifyRelaySession(ctx, request) if err != nil { - relaySession.DisbandSession() + return nil, nil, nil, err } - }(relaySession) // lock in the session address - + defer func(relaySession *lavasession.SingleProviderSession) { + // if we error in here until PrepareSessionForUsage was called successfully we can't call OnSessionFailure + if err != nil { + relaySession.DisbandSession() + } + }(relaySession) // lock in the session address + } extensionInfo := extensionslib.ExtensionInfo{LatestBlock: 0, ExtensionOverride: request.RelayData.Extensions} if extensionInfo.ExtensionOverride == nil { // in case consumer did not set an extension, we skip the extension parsing and we are sending it to the regular url extensionInfo.ExtensionOverride = []string{} @@ -268,6 +308,10 @@ func (rpcps *RPCProviderServer) initRelay(ctx context.Context, request *pairingt if err != nil { return nil, nil, nil, err } + // we only need the chainMessage for a static provider + if rpcps.StaticProvider { + return nil, nil, chainMessage, nil + } relayCU := chainMessage.GetApi().ComputeUnits virtualEpoch := rpcps.stateTracker.GetVirtualEpoch(uint64(request.RelaySession.Epoch)) err = relaySession.PrepareSessionForUsage(ctx, relayCU, request.RelaySession.CuSum, rpcps.allowedMissingCUThreshold, virtualEpoch) @@ -323,7 +367,18 @@ func (rpcps *RPCProviderServer) ValidateRequest(chainMessage chainlib.ChainMessa utils.Attribute{Key: "provider_requested_block", Value: reqBlock}, utils.Attribute{Key: "consumer_requested_block", Value: request.RelayData.RequestBlock}, utils.Attribute{Key: "GUID", Value: ctx}) - return utils.LavaFormatError("requested block mismatch between consumer and provider", nil, utils.LogAttr("method", chainMessage.GetApi().Name), utils.Attribute{Key: "provider_parsed_block_pre_update", Value: providerRequestedBlockPreUpdate}, utils.Attribute{Key: "provider_requested_block", Value: reqBlock}, utils.Attribute{Key: "consumer_requested_block", Value: request.RelayData.RequestBlock}, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "metadata", Value: request.RelayData.Metadata}) + // TODO, we need to return an error here, this was disabled so relays will pass, but it will cause data reliability issues. + // once we understand the issue return the error. + utils.LavaFormatError("requested block mismatch between consumer and provider", nil, + utils.LogAttr("request data", string(request.RelayData.Data)), + utils.LogAttr("request path", request.RelayData.ApiUrl), + utils.LogAttr("method", chainMessage.GetApi().Name), + utils.Attribute{Key: "provider_parsed_block_pre_update", Value: providerRequestedBlockPreUpdate}, + utils.Attribute{Key: "provider_requested_block", Value: reqBlock}, + utils.Attribute{Key: "consumer_requested_block", Value: request.RelayData.RequestBlock}, + utils.Attribute{Key: "GUID", Value: ctx}, + utils.Attribute{Key: "metadata", Value: request.RelayData.Metadata}, + ) } } return nil @@ -333,38 +388,38 @@ func (rpcps *RPCProviderServer) RelaySubscribe(request *pairingtypes.RelayReques if request.RelayData == nil || request.RelaySession == nil { return utils.LavaFormatError("invalid relay subscribe request, internal fields are nil", nil) } + ctx := utils.AppendUniqueIdentifier(context.Background(), lavaprotocol.GetSalt(request.RelayData)) utils.LavaFormatDebug("Provider got relay subscribe request", - utils.Attribute{Key: "request.SessionId", Value: request.RelaySession.SessionId}, - utils.Attribute{Key: "request.relayNumber", Value: request.RelaySession.RelayNum}, - utils.Attribute{Key: "request.cu", Value: request.RelaySession.CuSum}, - utils.Attribute{Key: "GUID", Value: ctx}, + utils.LogAttr("request.SessionId", request.RelaySession.SessionId), + utils.LogAttr("request.relayNumber", request.RelaySession.RelayNum), + utils.LogAttr("request.cu", request.RelaySession.CuSum), + utils.LogAttr("GUID", ctx), ) + relaySession, consumerAddress, chainMessage, err := rpcps.initRelay(ctx, request) if err != nil { + utils.LavaFormatDebug("got error from init relay", utils.LogAttr("error", err)) return rpcps.handleRelayErrorStatus(err) } - subscribed, err := rpcps.TryRelaySubscribe(ctx, uint64(request.RelaySession.Epoch), srv, chainMessage, consumerAddress, relaySession, request.RelaySession.RelayNum) // this function does not return until subscription ends + + // TryRelaySubscribe is blocking until subscription ends + subscribed, err := rpcps.TryRelaySubscribe(ctx, uint64(request.RelaySession.Epoch), request, srv, chainMessage, consumerAddress, relaySession, request.RelaySession.RelayNum) if subscribed { - // meaning we created a subscription and used it for at least a message - pairingEpoch := relaySession.PairingEpoch - // no need to perform on session done as we did it in try relay subscribe - go rpcps.SendProof(ctx, pairingEpoch, request, consumerAddress, chainMessage.GetApiCollection().CollectionData.ApiInterface) utils.LavaFormatDebug("Provider Finished Relay Successfully", - utils.Attribute{Key: "request.SessionId", Value: request.RelaySession.SessionId}, - utils.Attribute{Key: "request.relayNumber", Value: request.RelaySession.RelayNum}, - utils.Attribute{Key: "GUID", Value: ctx}, + utils.LogAttr("request.SessionId", request.RelaySession.SessionId), + utils.LogAttr("request.relayNumber", request.RelaySession.RelayNum), + utils.LogAttr("GUID", ctx), ) err = nil // we don't want to return an error here } else { // we didn't even manage to subscribe - relayFailureError := rpcps.providerSessionManager.OnSessionFailure(relaySession, request.RelaySession.RelayNum) - if relayFailureError != nil { - err = utils.LavaFormatError("failed subscribing", lavasession.SubscriptionInitiationError, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "onSessionFailureError", Value: relayFailureError.Error()}, utils.Attribute{Key: "error", Value: err}) - } else { - err = utils.LavaFormatError("failed subscribing", lavasession.SubscriptionInitiationError, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "error", Value: err}) - } + err = utils.LavaFormatError("failed subscribing", lavasession.SubscriptionInitiationError, + utils.LogAttr("GUID", ctx), + utils.LogAttr("error", err), + ) } + return rpcps.handleRelayErrorStatus(err) } @@ -378,91 +433,101 @@ func (rpcps *RPCProviderServer) SendProof(ctx context.Context, epoch uint64, req return nil } -func (rpcps *RPCProviderServer) TryRelaySubscribe(ctx context.Context, requestBlockHeight uint64, srv pairingtypes.Relayer_RelaySubscribeServer, chainMessage chainlib.ChainMessage, consumerAddress sdk.AccAddress, relaySession *lavasession.SingleProviderSession, relayNumber uint64) (subscribed bool, errRet error) { - var reply *pairingtypes.RelayReply - var clientSub *rpcclient.ClientSubscription - var subscriptionID string - subscribeRepliesChan := make(chan interface{}) - replyWrapper, subscriptionID, clientSub, _, _, err := rpcps.chainRouter.SendNodeMsg(ctx, subscribeRepliesChan, chainMessage, nil) - if err != nil { - return false, utils.LavaFormatError("Subscription failed", err, utils.Attribute{Key: "GUID", Value: ctx}) - } - if replyWrapper == nil || replyWrapper.RelayReply == nil { - return false, utils.LavaFormatError("Subscription failed, relayWrapper or RelayReply are nil", nil, utils.Attribute{Key: "GUID", Value: ctx}) - } - reply = replyWrapper.RelayReply - reply.Metadata, _, _ = rpcps.chainParser.HandleHeaders(reply.Metadata, chainMessage.GetApiCollection(), spectypes.Header_pass_reply) - if clientSub == nil { - // failed subscription, but not an error. (probably a node error) - // return the response to the user, and close the session. - relayError := rpcps.providerSessionManager.OnSessionDone(relaySession, relayNumber) // subscription failed due to node error mark session as done and return - if relayError != nil { - utils.LavaFormatError("Error OnSessionDone", relayError) - } - err = srv.Send(reply) // this reply contains the error to the subscription - if err != nil { - utils.LavaFormatError("Error returning response", err) - } - return true, nil // we already returned the error to the user so no need to return another error. +func (rpcps *RPCProviderServer) TryRelaySubscribe(ctx context.Context, requestBlockHeight uint64, request *pairingtypes.RelayRequest, srv pairingtypes.Relayer_RelaySubscribeServer, chainMessage chainlib.ChainMessage, consumerAddress sdk.AccAddress, relaySession *lavasession.SingleProviderSession, relayNumber uint64) (subscribedSuccessfully bool, errRet error) { + subscribeRepliesChan := make(chan *pairingtypes.RelayReply) + ctx, cancel := context.WithCancel(ctx) + defer cancel() + consumerProcessGuid, found := rpcps.fetchConsumerProcessGuidFromContext(srv.Context()) + if !found { + return false, utils.LavaFormatWarning("Could not find consumer process GUID in context, which is required for subscription relays", nil) } - // if we got a node error clientSub will be nil and also err will be nil. in that case we need to check for clientSub - subscription := &lavasession.RPCSubscription{ - Id: subscriptionID, - Sub: clientSub, - SubscribeRepliesChan: subscribeRepliesChan, - } - err = rpcps.providerSessionManager.ReleaseSessionAndCreateSubscription(relaySession, subscription, consumerAddress.String(), requestBlockHeight, relayNumber) - if err != nil { - return false, err - } - rpcps.rewardServer.SubscribeStarted(consumerAddress.String(), requestBlockHeight, subscriptionID) - processSubscribeMessages := func() (subscribed bool, errRet error) { - err = srv.Send(reply) // this reply contains the RPC ID - if err != nil { - utils.LavaFormatError("Error getting RPC ID", err, utils.Attribute{Key: "GUID", Value: ctx}) - } else { - subscribed = true - } + // The reasons that we have a wait group here, and we pass it to the go routine is because we want to start the channel read before calling AddConsumer, + // because it might stuck on writing to the channel if we don't do that, which will create a deadlock. + // But, we still want to wait the go routine to finish before we return (because the gRPC stream will close on return), so we use a wait group to wait for the go routine to finish. + wg := sync.WaitGroup{} + wg.Add(1) + + // Process subscription messages + go func() { + defer wg.Done() for { select { - case <-clientSub.Err(): - utils.LavaFormatError("client sub", err, utils.Attribute{Key: "GUID", Value: ctx}) - // delete this connection from the subs map + case <-ctx.Done(): + case <-srv.Context().Done(): + utils.LavaFormatTrace("ctx or relay server context closed", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddress), + ) - return subscribed, err - case subscribeReply := <-subscribeRepliesChan: - data, err := json.Marshal(subscribeReply) + err := rpcps.providerNodeSubscriptionManager.RemoveConsumer(ctx, chainMessage, consumerAddress, true, consumerProcessGuid) if err != nil { - return subscribed, utils.LavaFormatError("client sub unmarshal", err, utils.Attribute{Key: "GUID", Value: ctx}) + errRet = utils.LavaFormatError("Error RemoveConsumer", err, utils.LogAttr("GUID", ctx)) + } + return + case subscribeReply, ok := <-subscribeRepliesChan: + if !ok { // channel is closed + errRet = utils.LavaFormatTrace("subscribeRepliesChan closed", + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddress), + ) + err := rpcps.providerNodeSubscriptionManager.RemoveConsumer(ctx, chainMessage, consumerAddress, false, consumerProcessGuid) // false because the channel is already closed + if err != nil { + errRet = utils.LavaFormatError("Error RemoveConsumer", err, utils.LogAttr("GUID", ctx)) + } + return } - err = srv.Send( - &pairingtypes.RelayReply{ - Data: data, - }, - ) - if err != nil { + errRet = srv.Send(subscribeReply) + + if errRet != nil { // usually triggered when client closes connection - if strings.Contains(err.Error(), "Canceled desc = context canceled") { - err = utils.LavaFormatWarning("Client closed connection", err, utils.Attribute{Key: "GUID", Value: ctx}) + if strings.Contains(errRet.Error(), "Canceled desc = context canceled") { + errRet = utils.LavaFormatWarning("Client closed connection", errRet, utils.Attribute{Key: "GUID", Value: ctx}) } else { - err = utils.LavaFormatError("srv.Send", err, utils.Attribute{Key: "GUID", Value: ctx}) + errRet = utils.LavaFormatError("Got error from srv.Send()", errRet, utils.Attribute{Key: "GUID", Value: ctx}) } - return subscribed, err - } else { - subscribed = true + + return } - utils.LavaFormatDebug("Sending data", utils.Attribute{Key: "data", Value: string(data)}, utils.Attribute{Key: "GUID", Value: ctx}) + subscribedSuccessfully = true + utils.LavaFormatTrace("Sending data to consumer", + utils.LogAttr("GUID", ctx), + utils.LogAttr("data", subscribeReply.Data), + utils.LogAttr("consumerAddr", consumerAddress), + ) } } + }() + + subscriptionId, err := rpcps.providerNodeSubscriptionManager.AddConsumer(ctx, request, chainMessage, consumerAddress, subscribeRepliesChan, consumerProcessGuid) + if err != nil { + // Subscription failed due to node error mark session as done and return + relayError := rpcps.providerSessionManager.OnSessionFailure(relaySession, relayNumber) + if relayError != nil { + utils.LavaFormatError("Error OnSessionDone", relayError) + } + + return false, utils.LavaFormatWarning("RPCProviderServer: Subscription failed", err, + utils.LogAttr("GUID", ctx), + utils.LogAttr("consumerAddr", consumerAddress), + ) + } + + relayError := rpcps.providerSessionManager.OnSessionDone(relaySession, relayNumber) + if relayError != nil { + utils.LavaFormatError("Error OnSessionDone", relayError) } - subscribed, errRet = processSubscribeMessages() - rpcps.providerSessionManager.SubscriptionEnded(consumerAddress.String(), requestBlockHeight, subscriptionID) - rpcps.rewardServer.SubscribeEnded(consumerAddress.String(), requestBlockHeight, subscriptionID) - return subscribed, errRet + + go rpcps.SendProof(ctx, relaySession.PairingEpoch, request, consumerAddress, chainMessage.GetApiCollection().CollectionData.ApiInterface) + + rpcps.rewardServer.SubscribeStarted(consumerAddress.String(), requestBlockHeight, subscriptionId) + wg.Wait() // Block until subscription is done + + rpcps.rewardServer.SubscribeEnded(consumerAddress.String(), requestBlockHeight, subscriptionId) + return subscribedSuccessfully, errRet } // verifies basic relay fields, and gets a provider session @@ -666,214 +731,321 @@ func (rpcps *RPCProviderServer) TryRelay(ctx context.Context, request *pairingty if errV != nil { return nil, errV } - // Send - var reqMsg *rpcInterfaceMessages.JsonrpcMessage - var reqParams interface{} - switch msg := chainMsg.GetRPCMessage().(type) { - case *rpcInterfaceMessages.JsonrpcMessage: - reqMsg = msg - reqParams = reqMsg.Params - default: - reqMsg = nil - } - var requestedBlockHash []byte = nil - finalized := false - dataReliabilityEnabled, _ := rpcps.chainParser.DataReliabilityParams() + var latestBlock int64 + var requestedBlockHash []byte var requestedHashes []*chaintracker.BlockStore var modifiedReqBlock int64 - var blocksInFinalizationData uint32 - var blockDistanceToFinalization uint32 - var averageBlockTime time.Duration + + finalized := false updatedChainMessage := false - var blockLagForQosSync int64 - blockLagForQosSync, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData = rpcps.chainParser.ChainBlockStats() + + dataReliabilityEnabled, _ := rpcps.chainParser.DataReliabilityParams() + blockLagForQosSync, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData := rpcps.chainParser.ChainBlockStats() relayTimeout := chainlib.GetRelayTimeout(chainMsg, averageBlockTime) + if dataReliabilityEnabled { var err error - specificBlock := request.RelayData.RequestBlock - if specificBlock < spectypes.LATEST_BLOCK { - // cases of EARLIEST, FINALIZED, SAFE - // GetLatestBlockData only supports latest relative queries or specific block numbers - specificBlock = spectypes.NOT_APPLICABLE - } - - // handle consistency, if the consumer requested information we do not have in the state tracker - - latestBlock, requestedHashes, _, err = rpcps.handleConsistency(ctx, relayTimeout, request.RelayData.GetSeenBlock(), request.RelayData.GetRequestBlock(), averageBlockTime, blockLagForQosSync, blockDistanceToFinalization, blocksInFinalizationData) + latestBlock, requestedBlockHash, requestedHashes, modifiedReqBlock, finalized, updatedChainMessage, err = rpcps.GetParametersForRelayDataReliability(ctx, request, chainMsg, relayTimeout, blockLagForQosSync, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData) if err != nil { return nil, err } - // get specific block data for caching - _, specificRequestedHashes, _, err := rpcps.reliabilityManager.GetLatestBlockData(spectypes.NOT_APPLICABLE, spectypes.NOT_APPLICABLE, specificBlock) - if err == nil && len(specificRequestedHashes) == 1 { - requestedBlockHash = []byte(specificRequestedHashes[0].Hash) - } - - // TODO: take latestBlock and lastSeenBlock and put the greater one of them - updatedChainMessage = chainMsg.UpdateLatestBlockInMessage(latestBlock, true) - - modifiedReqBlock = lavaprotocol.ReplaceRequestedBlock(request.RelayData.RequestBlock, latestBlock) - if modifiedReqBlock != request.RelayData.RequestBlock { - request.RelayData.RequestBlock = modifiedReqBlock - updatedChainMessage = true // meaning we can't bring a newer proof - } - // requestedBlockHash, finalizedBlockHashes = chaintracker.FindRequestedBlockHash(requestedHashes, request.RelayData.RequestBlock, toBlock, fromBlock, finalizedBlockHashes) - finalized = spectypes.IsFinalizedBlock(modifiedReqBlock, latestBlock, blockDistanceToFinalization) - if !finalized && requestedBlockHash == nil && modifiedReqBlock != spectypes.NOT_APPLICABLE { - // avoid using cache, but can still service - utils.LavaFormatWarning("no hash data for requested block", nil, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "requestedBlock", Value: request.RelayData.RequestBlock}, utils.Attribute{Key: "latestBlock", Value: latestBlock}, utils.Attribute{Key: "modifiedReqBlock", Value: modifiedReqBlock}, utils.Attribute{Key: "specificBlock", Value: specificBlock}) - } } - cache := rpcps.cache + // TODO: handle cache on fork for dataReliability = false - var reply *pairingtypes.RelayReply = nil - var err error = nil - ignoredMetadata := []pairingtypes.Metadata{} - if requestedBlockHash != nil || finalized { - var cacheReply *pairingtypes.CacheRelayReply - - hashKey, outPutFormatter, hashErr := chainlib.HashCacheRequest(request.RelayData, rpcps.rpcProviderEndpoint.ChainID) - if hashErr != nil { - utils.LavaFormatError("TryRelay Failed computing hash for cache request", hashErr) - } else { - cacheCtx, cancel := context.WithTimeout(ctx, common.CacheTimeout) - cacheReply, err = cache.GetEntry(cacheCtx, &pairingtypes.RelayCacheGet{ - RequestHash: hashKey, - RequestedBlock: request.RelayData.RequestBlock, - ChainId: rpcps.rpcProviderEndpoint.ChainID, - BlockHash: requestedBlockHash, - Finalized: finalized, - SeenBlock: request.RelayData.SeenBlock, - }) - cancel() - reply = cacheReply.GetReply() - if reply != nil { - reply.Data = outPutFormatter(reply.Data) // setting request id back to reply. - } - ignoredMetadata = cacheReply.GetOptionalMetadata() - if err != nil && performance.NotConnectedError.Is(err) { - utils.LavaFormatDebug("cache not connected", utils.LogAttr("err", err), utils.Attribute{Key: "GUID", Value: ctx}) - } - } + var reply *pairingtypes.RelayReply + var ignoredMetadata []pairingtypes.Metadata + var err error + if requestedBlockHash != nil || finalized { // try get reply from cache + reply, ignoredMetadata, err = rpcps.tryGetRelayReplyFromCache(ctx, request, requestedBlockHash, finalized) } + if err != nil || reply == nil { // we need to send relay, cache miss or invalid - sendTime := time.Now() - if debugLatency { - utils.LavaFormatDebug("sending relay to node", utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) - } - // add stickiness header - chainMsg.AppendHeader([]pairingtypes.Metadata{{Name: RPCProviderStickinessHeaderName, Value: common.GetUniqueToken(consumerAddr.String(), common.GetTokenFromGrpcContext(ctx))}}) - chainMsg.AppendHeader([]pairingtypes.Metadata{{Name: RPCProviderAddressHeader, Value: rpcps.providerAddress.String()}}) - if debugConsistency { - utils.LavaFormatDebug("adding stickiness header", utils.LogAttr("tokenFromContext", common.GetTokenFromGrpcContext(ctx)), utils.LogAttr("unique_token", common.GetUniqueToken(consumerAddr.String(), common.GetIpFromGrpcContext(ctx)))) - } var replyWrapper *chainlib.RelayReplyWrapper - replyWrapper, _, _, _, _, err = rpcps.chainRouter.SendNodeMsg(ctx, nil, chainMsg, request.RelayData.Extensions) + replyWrapper, err = rpcps.sendRelayMessageToNode(ctx, request, chainMsg, consumerAddr) if err != nil { - return nil, utils.LavaFormatError("Sending chainMsg failed", err, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) - } - if replyWrapper == nil || replyWrapper.RelayReply == nil { - return nil, utils.LavaFormatError("Relay Wrapper returned nil without an error", nil, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) + return nil, err } reply = replyWrapper.RelayReply - if debugLatency { - utils.LavaFormatDebug("node reply received", utils.Attribute{Key: "timeTaken", Value: time.Since(sendTime)}, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) - } + reply.Metadata, _, ignoredMetadata = rpcps.chainParser.HandleHeaders(reply.Metadata, chainMsg.GetApiCollection(), spectypes.Header_pass_reply) // TODO: use overwriteReqBlock on the reply metadata to set the correct latest block - if cache.CacheActive() && (requestedBlockHash != nil || finalized) { - // copy request and reply as they change later on and we call SetEntry in a routine. - requestedBlock := request.RelayData.RequestBlock // get requested block before removing it from the data - hashKey, _, hashErr := chainlib.HashCacheRequest(request.RelayData, rpcps.rpcProviderEndpoint.ChainID) // get the hash (this changes the data) - copyReply := &pairingtypes.RelayReply{} - copyReplyErr := protocopy.DeepCopyProtoObject(reply, copyReply) - - // get status code to decide if its a node error - statusCode := replyWrapper.StatusCode - go func() { - if hashErr != nil || copyReplyErr != nil { - utils.LavaFormatError("Failed copying relay private data on TryRelay", nil, utils.LogAttr("copyReplyErr", copyReplyErr), utils.LogAttr("hashErr", hashErr)) - return - } - new_ctx := context.Background() - new_ctx, cancel := context.WithTimeout(new_ctx, common.DataReliabilityTimeoutIncrease) - defer cancel() - if err != nil { - utils.LavaFormatError("TryRelay failed calculating hash for cach.SetEntry", err) - return - } - // in case the error is a node error we don't want to cache the response for a long period of time - // so users wont get errors if the error was temporary - isNodeError, _ := chainMsg.CheckResponseError(copyReply.Data, statusCode) - - err = cache.SetEntry(new_ctx, &pairingtypes.RelayCacheSet{ - RequestHash: hashKey, - RequestedBlock: requestedBlock, - BlockHash: requestedBlockHash, - ChainId: rpcps.rpcProviderEndpoint.ChainID, - Response: copyReply, - Finalized: finalized, - OptionalMetadata: ignoredMetadata, - AverageBlockTime: int64(averageBlockTime), - SeenBlock: latestBlock, - IsNodeError: isNodeError, - }) - if err != nil && request.RelaySession.Epoch != spectypes.NOT_APPLICABLE { - utils.LavaFormatWarning("error updating cache with new entry", err, utils.Attribute{Key: "GUID", Value: ctx}) - } - }() + if rpcps.cache.CacheActive() && (requestedBlockHash != nil || finalized) { + rpcps.trySetRelayReplyInCache(ctx, request, chainMsg, replyWrapper, latestBlock, averageBlockTime, requestedBlockHash, finalized, ignoredMetadata) } } - apiName := chainMsg.GetApi().Name - if reqMsg != nil && strings.Contains(apiName, "unsubscribe") { - err := rpcps.processUnsubscribe(ctx, apiName, consumerAddr, reqParams, uint64(request.RelayData.RequestBlock)) + if dataReliabilityEnabled { + err := rpcps.BuildRelayFinalizedBlockHashes(ctx, request, reply, latestBlock, requestedHashes, updatedChainMessage, relayTimeout, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData, modifiedReqBlock) if err != nil { return nil, err } } - if dataReliabilityEnabled { - // now we need to provide the proof for the response - proofBlock := latestBlock - if !updatedChainMessage || len(requestedHashes) == 0 { - // we can fetch a more advanced finalization proof, than we fetched previously - proofBlock, requestedHashes, _, err = rpcps.GetLatestBlockData(ctx, blockDistanceToFinalization, blocksInFinalizationData) - if err != nil { - return nil, err - } - } // else: we updated the chain message to request the specific latestBlock we fetched earlier, so use the previously fetched latest block and hashes - if proofBlock < modifiedReqBlock && proofBlock < request.RelayData.SeenBlock { - // we requested with a newer block, but don't necessarily have the finaliziation proof, chaintracker might be behind - proofBlock = lavaslices.Min([]int64{modifiedReqBlock, request.RelayData.SeenBlock}) - proofBlock, requestedHashes, err = rpcps.GetBlockDataForOptimisticFetch(ctx, relayTimeout, proofBlock, blockDistanceToFinalization, blocksInFinalizationData, averageBlockTime) - if err != nil { - return nil, utils.LavaFormatError("error getting block range for finalization proof", err) + // utils.LavaFormatDebug("response signing", utils.LogAttr("request block", request.RelayData.RequestBlock), utils.LogAttr("GUID", ctx), utils.LogAttr("latestBlock", reply.LatestBlock)) + reply, err = lavaprotocol.SignRelayResponse(consumerAddr, *request, rpcps.privKey, reply, dataReliabilityEnabled) + if err != nil { + return nil, err + } + + reply.Metadata = append(reply.Metadata, ignoredMetadata...) // appended here only after signing + + // return reply to user + return reply, nil +} + +func (rpcps *RPCProviderServer) tryGetRelayReplyFromCache(ctx context.Context, request *pairingtypes.RelayRequest, requestedBlockHash []byte, finalized bool) (*pairingtypes.RelayReply, []pairingtypes.Metadata, error) { + cache := rpcps.cache + hashKey, outPutFormatter, hashErr := chainlib.HashCacheRequest(request.RelayData, rpcps.rpcProviderEndpoint.ChainID) + if hashErr != nil { + utils.LavaFormatError("TryRelay Failed computing hash for cache request", hashErr) + return nil, nil, nil + } + cacheCtx, cancel := context.WithTimeout(ctx, common.CacheTimeout) + cacheReply, err := cache.GetEntry(cacheCtx, &pairingtypes.RelayCacheGet{ + RequestHash: hashKey, + RequestedBlock: request.RelayData.RequestBlock, + ChainId: rpcps.rpcProviderEndpoint.ChainID, + BlockHash: requestedBlockHash, + Finalized: finalized, + SeenBlock: request.RelayData.SeenBlock, + }) + cancel() + + if err != nil && performance.NotConnectedError.Is(err) { + utils.LavaFormatDebug("cache not connected", utils.LogAttr("err", err), utils.Attribute{Key: "GUID", Value: ctx}) + return nil, nil, err + } + + reply := cacheReply.GetReply() + if reply != nil { + reply.Data = outPutFormatter(reply.Data) // setting request id back to reply. + } + + ignoredMetadata := cacheReply.GetOptionalMetadata() + + return reply, ignoredMetadata, err +} + +func (rpcps *RPCProviderServer) trySetRelayReplyInCache(ctx context.Context, request *pairingtypes.RelayRequest, chainMsg chainlib.ChainMessage, replyWrapper *chainlib.RelayReplyWrapper, latestBlock int64, averageBlockTime time.Duration, requestedBlockHash []byte, finalized bool, ignoredMetadata []pairingtypes.Metadata) { + cache := rpcps.cache + reply := replyWrapper.RelayReply + + isNodeError, _ := chainMsg.CheckResponseError(reply.Data, replyWrapper.StatusCode) + // in case the error is a node error we don't want to cache + if !isNodeError { + // copy request and reply as they change later on and we call SetEntry in a routine. + requestedBlock := request.RelayData.RequestBlock // get requested block before removing it from the data + hashKey, _, hashErr := chainlib.HashCacheRequest(request.RelayData, rpcps.rpcProviderEndpoint.ChainID) // get the hash (this changes the data) + copyReply := &pairingtypes.RelayReply{} + copyReplyErr := protocopy.DeepCopyProtoObject(reply, copyReply) + go func() { + if hashErr != nil || copyReplyErr != nil { + utils.LavaFormatError("Failed copying relay private data on TryRelay", nil, utils.LogAttr("copyReplyErr", copyReplyErr), utils.LogAttr("hashErr", hashErr)) + return + } + new_ctx := context.Background() + new_ctx, cancel := context.WithTimeout(new_ctx, common.DataReliabilityTimeoutIncrease) + defer cancel() + err := cache.SetEntry(new_ctx, &pairingtypes.RelayCacheSet{ + RequestHash: hashKey, + RequestedBlock: requestedBlock, + BlockHash: requestedBlockHash, + ChainId: rpcps.rpcProviderEndpoint.ChainID, + Response: copyReply, + Finalized: finalized, + OptionalMetadata: ignoredMetadata, + AverageBlockTime: int64(averageBlockTime), + SeenBlock: latestBlock, + IsNodeError: isNodeError, + }) + if err != nil && request.RelaySession.Epoch != spectypes.NOT_APPLICABLE { + utils.LavaFormatWarning("error updating cache with new entry", err, utils.Attribute{Key: "GUID", Value: ctx}) } + }() + } +} + +func (rpcps *RPCProviderServer) sendRelayMessageToNode(ctx context.Context, request *pairingtypes.RelayRequest, chainMsg chainlib.ChainMessage, consumerAddr sdk.AccAddress) (*chainlib.RelayReplyWrapper, error) { + sendTime := time.Now() + if debugLatency { + utils.LavaFormatDebug("sending relay to node", utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) + } + // add stickiness header + chainMsg.AppendHeader([]pairingtypes.Metadata{{Name: RPCProviderStickinessHeaderName, Value: common.GetUniqueToken(consumerAddr.String(), common.GetTokenFromGrpcContext(ctx))}}) + chainMsg.AppendHeader([]pairingtypes.Metadata{{Name: RPCProviderAddressHeader, Value: rpcps.providerAddress.String()}}) + if debugConsistency { + utils.LavaFormatDebug("adding stickiness header", utils.LogAttr("tokenFromContext", common.GetTokenFromGrpcContext(ctx)), utils.LogAttr("unique_token", common.GetUniqueToken(consumerAddr.String(), common.GetIpFromGrpcContext(ctx)))) + } + + replyWrapper, _, _, _, _, err := rpcps.chainRouter.SendNodeMsg(ctx, nil, chainMsg, request.RelayData.Extensions) + if err != nil { + return nil, utils.LavaFormatError("Sending chainMsg failed", err, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) + } + + if replyWrapper == nil || replyWrapper.RelayReply == nil { + return nil, utils.LavaFormatError("Relay Wrapper returned nil without an error", nil, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) + } + + if debugLatency { + utils.LavaFormatDebug("node reply received", utils.Attribute{Key: "timeTaken", Value: time.Since(sendTime)}, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) + } + + return replyWrapper, nil +} + +func (rpcps *RPCProviderServer) TryRelayUnsubscribe(ctx context.Context, request *pairingtypes.RelayRequest, consumerAddress sdk.AccAddress, chainMessage chainlib.ChainMessage) (*pairingtypes.RelayReply, error) { + errV := rpcps.ValidateRequest(chainMessage, request, ctx) + if errV != nil { + return nil, errV + } + + utils.LavaFormatDebug("Provider got unsubscribe request", utils.LogAttr("GUID", ctx)) + + consumerProcessGuid, found := rpcps.fetchConsumerProcessGuidFromContext(ctx) + if !found { + return nil, utils.LavaFormatWarning("Could not find consumer process GUID in context, which is required for unsubscribe relays", nil) + } + + // Remove the consumer from the connected consumers list of the subscription + err := rpcps.providerNodeSubscriptionManager.RemoveConsumer(ctx, chainMessage, consumerAddress, true, consumerProcessGuid) + if err != nil { + return nil, err + } + + rpcResponse, err := lavaprotocol.CraftEmptyRPCResponseFromGenericMessage(chainMessage.GetRPCMessage()) + if err != nil { + return nil, utils.LavaFormatError("failed crafting empty rpc response", err) + } + + dataToSend, err := json.Marshal(rpcResponse) + if err != nil { + return nil, utils.LavaFormatError("failed marshaling json response", err) + } + + reply := &pairingtypes.RelayReply{ + Data: dataToSend, + } + + dataReliabilityEnabled, _ := rpcps.chainParser.DataReliabilityParams() + if dataReliabilityEnabled { + blockLagForQosSync, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData := rpcps.chainParser.ChainBlockStats() + relayTimeout := chainlib.GetRelayTimeout(chainMessage, averageBlockTime) + latestBlock, _, requestedHashes, modifiedReqBlock, _, updatedChainMessage, err := rpcps.GetParametersForRelayDataReliability(ctx, request, chainMessage, relayTimeout, blockLagForQosSync, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData) + if err != nil { + return nil, err } - finalizedBlockHashes := chaintracker.BuildProofFromBlocks(requestedHashes) - jsonStr, err := json.Marshal(finalizedBlockHashes) + err = rpcps.BuildRelayFinalizedBlockHashes(ctx, request, reply, latestBlock, requestedHashes, updatedChainMessage, relayTimeout, averageBlockTime, blockDistanceToFinalization, blocksInFinalizationData, modifiedReqBlock) if err != nil { - return nil, utils.LavaFormatError("failed unmarshaling finalizedBlockHashes", err, utils.Attribute{Key: "GUID", Value: ctx}, - utils.Attribute{Key: "finalizedBlockHashes", Value: finalizedBlockHashes}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) + return nil, err } - reply.FinalizedBlocksHashes = jsonStr - reply.LatestBlock = proofBlock } - // utils.LavaFormatDebug("response signing", utils.LogAttr("request block", request.RelayData.RequestBlock), utils.LogAttr("GUID", ctx), utils.LogAttr("latestBlock", reply.LatestBlock)) - reply, err = lavaprotocol.SignRelayResponse(consumerAddr, *request, rpcps.privKey, reply, dataReliabilityEnabled) + + var ignoredMetadata []pairingtypes.Metadata + reply.Metadata, _, ignoredMetadata = rpcps.chainParser.HandleHeaders(reply.Metadata, chainMessage.GetApiCollection(), spectypes.Header_pass_reply) + reply, err = lavaprotocol.SignRelayResponse(consumerAddress, *request, rpcps.privKey, reply, dataReliabilityEnabled) if err != nil { return nil, err } reply.Metadata = append(reply.Metadata, ignoredMetadata...) // appended here only after signing - // return reply to user + return reply, nil } +func (rpcps *RPCProviderServer) GetParametersForRelayDataReliability( + ctx context.Context, + request *pairingtypes.RelayRequest, + chainMsg chainlib.ChainMessage, + relayTimeout time.Duration, + blockLagForQosSync int64, + averageBlockTime time.Duration, + blockDistanceToFinalization, + blocksInFinalizationData uint32, +) (latestBlock int64, requestedBlockHash []byte, requestedHashes []*chaintracker.BlockStore, modifiedReqBlock int64, finalized, updatedChainMessage bool, err error) { + specificBlock := request.RelayData.RequestBlock + if specificBlock < spectypes.LATEST_BLOCK { + // cases of EARLIEST, FINALIZED, SAFE + // GetLatestBlockData only supports latest relative queries or specific block numbers + specificBlock = spectypes.NOT_APPLICABLE + } + + // handle consistency, if the consumer requested information we do not have in the state tracker + + latestBlock, requestedHashes, _, err = rpcps.handleConsistency(ctx, relayTimeout, request.RelayData.GetSeenBlock(), request.RelayData.GetRequestBlock(), averageBlockTime, blockLagForQosSync, blockDistanceToFinalization, blocksInFinalizationData) + if err != nil { + return 0, nil, nil, 0, false, false, err + } + + // get specific block data for caching + _, specificRequestedHashes, _, getLatestBlockErr := rpcps.reliabilityManager.GetLatestBlockData(spectypes.NOT_APPLICABLE, spectypes.NOT_APPLICABLE, specificBlock) + if getLatestBlockErr == nil && len(specificRequestedHashes) == 1 { + requestedBlockHash = []byte(specificRequestedHashes[0].Hash) + } + + // TODO: take latestBlock and lastSeenBlock and put the greater one of them + updatedChainMessage = chainMsg.UpdateLatestBlockInMessage(latestBlock, true) + + modifiedReqBlock = lavaprotocol.ReplaceRequestedBlock(request.RelayData.RequestBlock, latestBlock) + if modifiedReqBlock != request.RelayData.RequestBlock { + request.RelayData.RequestBlock = modifiedReqBlock + updatedChainMessage = true // meaning we can't bring a newer proof + } + // requestedBlockHash, finalizedBlockHashes = chaintracker.FindRequestedBlockHash(requestedHashes, request.RelayData.RequestBlock, toBlock, fromBlock, finalizedBlockHashes) + finalized = spectypes.IsFinalizedBlock(modifiedReqBlock, latestBlock, int64(blockDistanceToFinalization)) + if !finalized && requestedBlockHash == nil && modifiedReqBlock != spectypes.NOT_APPLICABLE { + // avoid using cache, but can still service + utils.LavaFormatWarning("no hash data for requested block", nil, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "requestedBlock", Value: request.RelayData.RequestBlock}, utils.Attribute{Key: "latestBlock", Value: latestBlock}, utils.Attribute{Key: "modifiedReqBlock", Value: modifiedReqBlock}, utils.Attribute{Key: "specificBlock", Value: specificBlock}) + } + + return latestBlock, requestedBlockHash, requestedHashes, modifiedReqBlock, finalized, updatedChainMessage, nil +} + +func (rpcps *RPCProviderServer) BuildRelayFinalizedBlockHashes( + ctx context.Context, + request *pairingtypes.RelayRequest, + reply *pairingtypes.RelayReply, + latestBlock int64, + requestedHashes []*chaintracker.BlockStore, + updatedChainMessage bool, + relayTimeout time.Duration, + averageBlockTime time.Duration, + blockDistanceToFinalization uint32, + blocksInFinalizationData uint32, + modifiedReqBlock int64, +) (err error) { + // now we need to provide the proof for the response + proofBlock := latestBlock + if !updatedChainMessage || len(requestedHashes) == 0 { + // we can fetch a more advanced finalization proof, than we fetched previously + proofBlock, requestedHashes, _, err = rpcps.GetLatestBlockData(ctx, blockDistanceToFinalization, blocksInFinalizationData) + if err != nil { + return err + } + } // else: we updated the chain message to request the specific latestBlock we fetched earlier, so use the previously fetched latest block and hashes + if proofBlock < modifiedReqBlock && proofBlock < request.RelayData.SeenBlock { + // we requested with a newer block, but don't necessarily have the finaliziation proof, chaintracker might be behind + proofBlock = lavaslices.Min([]int64{modifiedReqBlock, request.RelayData.SeenBlock}) + + proofBlock, requestedHashes, err = rpcps.GetBlockDataForOptimisticFetch(ctx, relayTimeout, proofBlock, blockDistanceToFinalization, blocksInFinalizationData, averageBlockTime) + if err != nil { + return utils.LavaFormatError("error getting block range for finalization proof", err) + } + } + + finalizedBlockHashes := chaintracker.BuildProofFromBlocks(requestedHashes) + jsonStr, err := json.Marshal(finalizedBlockHashes) + if err != nil { + return utils.LavaFormatError("failed unmarshaling finalizedBlockHashes", err, utils.Attribute{Key: "GUID", Value: ctx}, + utils.Attribute{Key: "finalizedBlockHashes", Value: finalizedBlockHashes}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID}) + } + reply.FinalizedBlocksHashes = jsonStr + reply.LatestBlock = proofBlock + return nil +} + func (rpcps *RPCProviderServer) GetBlockDataForOptimisticFetch(ctx context.Context, relayBaseTimeout time.Duration, requiredProofBlock int64, blockDistanceToFinalization uint32, blocksInFinalizationData uint32, averageBlockTime time.Duration) (latestBlock int64, requestedHashes []*chaintracker.BlockStore, err error) { utils.LavaFormatDebug("getting new blockData for optimistic fetch", utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "requiredProofBlock", Value: requiredProofBlock}) proofBlock := requiredProofBlock @@ -955,7 +1127,7 @@ func (rpcps *RPCProviderServer) handleConsistency(ctx context.Context, baseRelay } // we only bail if there is no chance for the provider to get to the requested block and the consumer has already got a response from a different provider with that block if (blockGap > blockLagForQosSync*2 || (blockGap > 1 && probabilityBlockError > 0.4)) && (seenBlock >= latestBlock) { - return latestBlock, requestedHashes, 0, utils.LavaFormatWarning("Requested a block that is too new", lavaprotocol.ConsistencyError, utils.Attribute{Key: "blockGap", Value: blockGap}, utils.Attribute{Key: "probabilityBlockError", Value: probabilityBlockError}, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "seenBlock", Value: seenBlock}, utils.Attribute{Key: "requestedBlock", Value: requestBlock}, utils.Attribute{Key: "latestBlock", Value: latestBlock}, utils.Attribute{Key: "chainID", Value: rpcps.rpcProviderEndpoint.ChainID}) + return latestBlock, requestedHashes, 0, utils.LavaFormatWarning("Requested a block that is too new", protocolerrors.ConsistencyError, utils.Attribute{Key: "blockGap", Value: blockGap}, utils.Attribute{Key: "probabilityBlockError", Value: probabilityBlockError}, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "seenBlock", Value: seenBlock}, utils.Attribute{Key: "requestedBlock", Value: requestBlock}, utils.Attribute{Key: "latestBlock", Value: latestBlock}, utils.Attribute{Key: "chainID", Value: rpcps.rpcProviderEndpoint.ChainID}) } if !ok { @@ -1031,27 +1203,6 @@ func (rpcps *RPCProviderServer) GetLatestBlockData(ctx context.Context, blockDis return } -func (rpcps *RPCProviderServer) processUnsubscribe(ctx context.Context, apiName string, consumerAddr sdk.AccAddress, reqParams interface{}, epoch uint64) error { - var subscriptionID string - switch reqParamsCasted := reqParams.(type) { - case []interface{}: - var ok bool - subscriptionID, ok = reqParamsCasted[0].(string) - if !ok { - return utils.LavaFormatError("processUnsubscribe - p[0].(string) - type assertion failed", nil, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "type", Value: reqParamsCasted[0]}) - } - case map[string]interface{}: - if apiName == "unsubscribe" { - var ok bool - subscriptionID, ok = reqParamsCasted["query"].(string) - if !ok { - return utils.LavaFormatError("processUnsubscribe - p['query'].(string) - type assertion failed", nil, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "type", Value: reqParamsCasted["query"]}) - } - } - } - return rpcps.providerSessionManager.ProcessUnsubscribe(apiName, subscriptionID, consumerAddr.String(), epoch) -} - func (rpcps *RPCProviderServer) Probe(ctx context.Context, probeReq *pairingtypes.ProbeRequest) (*pairingtypes.ProbeReply, error) { latestB, _ := rpcps.reliabilityManager.GetLatestBlockNum() probeReply := &pairingtypes.ProbeReply{ @@ -1062,10 +1213,28 @@ func (rpcps *RPCProviderServer) Probe(ctx context.Context, probeReq *pairingtype LavaLatestBlock: uint64(rpcps.stateTracker.LatestBlock()), } trailer := metadata.Pairs(common.VersionMetadataKey, upgrade.GetCurrentVersion().ProviderVersion) + trailer.Append(chainlib.RpcProviderUniqueIdHeader, rpcps.providerUniqueId) grpc.SetTrailer(ctx, trailer) // we ignore this error here since this code can be triggered not from grpc return probeReply, nil } +func (rpcps *RPCProviderServer) fetchConsumerProcessGuidFromContext(ctx context.Context) (string, bool) { + incomingMetaData, found := metadata.FromIncomingContext(ctx) + if !found { + utils.LavaFormatDebug("fetchConsumerProcessGuidFromContext: no incoming meta found in context") + return "", false + } + for key, value := range incomingMetaData { + if key == common.LAVA_CONSUMER_PROCESS_GUID { + for _, metaDataValue := range value { + return metaDataValue, true + } + } + } + utils.LavaFormatDebug("incoming meta data does not contain process guid", utils.LogAttr("incoming_meta_data", incomingMetaData)) + return "", false +} + func (rpcps *RPCProviderServer) tryGetTimeoutFromRequest(ctx context.Context) (time.Duration, bool, error) { incomingMetaData, found := metadata.FromIncomingContext(ctx) if !found { diff --git a/protocol/rpcprovider/rpcprovider_server_test.go b/protocol/rpcprovider/rpcprovider_server_test.go index 092c46339c..cde8d9263b 100644 --- a/protocol/rpcprovider/rpcprovider_server_test.go +++ b/protocol/rpcprovider/rpcprovider_server_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -222,7 +222,7 @@ func TestHandleConsistency(t *testing.T) { w.WriteHeader(http.StatusOK) fmt.Fprint(w, string(replyDataBuf)) }) - chainParser, chainProxy, _, closeServer, _, err := chainlib.CreateChainLibMocks(ts.Ctx, specId, spectypes.APIInterfaceRest, serverHandler, "../../", nil) + chainParser, chainProxy, _, closeServer, _, err := chainlib.CreateChainLibMocks(ts.Ctx, specId, spectypes.APIInterfaceRest, serverHandler, nil, "../../", nil) if closeServer != nil { defer closeServer() } @@ -253,7 +253,11 @@ func TestHandleConsistency(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), play.timeout) latestBlock, _, timeSlept, err := rpcproviderServer.handleConsistency(ctx, play.timeout, seenBlock, requestBlock, averageBlockTime, blockLagForQosSync, blocksInFinalizationData, blockDistanceToFinalization) cancel() - require.Equal(t, play.err == nil, err == nil, strconv.Itoa(calls)) + if play.err != nil { + require.Error(t, err, strconv.Itoa(calls)) + } else { + require.NoError(t, err, strconv.Itoa(calls)) + } require.Less(t, timeSlept, play.timeout) if play.sleep { require.NotZero(t, timeSlept) diff --git a/protocol/rpcprovider/spec_validator.go b/protocol/rpcprovider/spec_validator.go index 8e6b309269..d0582e895b 100644 --- a/protocol/rpcprovider/spec_validator.go +++ b/protocol/rpcprovider/spec_validator.go @@ -5,10 +5,10 @@ import ( "sync" "time" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( diff --git a/protocol/rpcprovider/spec_validator_test.go b/protocol/rpcprovider/spec_validator_test.go index 9fec678f71..b486be576c 100644 --- a/protocol/rpcprovider/spec_validator_test.go +++ b/protocol/rpcprovider/spec_validator_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/lavasession" - testcommon "github.com/lavanet/lava/testutil/common" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/lavasession" + testcommon "github.com/lavanet/lava/v2/testutil/common" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ) diff --git a/protocol/rpcprovider/testing.go b/protocol/rpcprovider/testing.go index 9b6cc4c949..0dc2b8fabc 100644 --- a/protocol/rpcprovider/testing.go +++ b/protocol/rpcprovider/testing.go @@ -15,18 +15,18 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" "github.com/gogo/status" - lvutil "github.com/lavanet/lava/ecosystem/lavavisor/pkg/util" - "github.com/lavanet/lava/protocol/chainlib/chainproxy" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingcli "github.com/lavanet/lava/x/pairing/client/cli" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - spectypes "github.com/lavanet/lava/x/spec/types" + lvutil "github.com/lavanet/lava/v2/ecosystem/lavavisor/pkg/util" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingcli "github.com/lavanet/lava/v2/x/pairing/client/cli" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" "github.com/spf13/viper" "golang.org/x/exp/slices" @@ -131,7 +131,7 @@ func startTesting(ctx context.Context, clientCtx client.Context, providerEntries } var conn *grpc.ClientConn var err error - var relayerClientPt *pairingtypes.RelayerClient + var relayerClient pairingtypes.RelayerClient if plainTextConnection { utils.LavaFormatWarning("You are using plain text connection (disabled tls), no consumer can connect to it as all consumers use tls. this should be used for testing purposes only", nil) @@ -139,10 +139,9 @@ func startTesting(ctx context.Context, clientCtx client.Context, providerEntries if err != nil { return 0, "", 0, utils.LavaFormatError("failed connecting to provider endpoint", err, utils.Attribute{Key: "apiInterface", Value: apiInterface}, utils.Attribute{Key: "addon", Value: addon}, utils.Attribute{Key: "chainID", Value: providerEntry.Chain}, utils.Attribute{Key: "network address", Value: endpoint.IPPORT}) } - relayerClient := pairingtypes.NewRelayerClient(conn) - relayerClientPt = &relayerClient + relayerClient = pairingtypes.NewRelayerClient(conn) } else { - relayerClientPt, conn, err = cswp.ConnectRawClientWithTimeout(ctx, endpoint.IPPORT) + relayerClient, conn, err = cswp.ConnectRawClientWithTimeout(ctx, endpoint.IPPORT) if err != nil { if !lavasession.AllowInsecureConnectionToProviders { // lets try insecure see if this is the reason @@ -158,7 +157,6 @@ func startTesting(ctx context.Context, clientCtx client.Context, providerEntries } defer conn.Close() - relayerClient := *relayerClientPt guid := uint64(rand.Int63()) relaySentTime := time.Now() probeReq := &pairingtypes.ProbeRequest{ diff --git a/protocol/statetracker/consumer_state_tracker.go b/protocol/statetracker/consumer_state_tracker.go index 184ede2a97..d074602ec9 100644 --- a/protocol/statetracker/consumer_state_tracker.go +++ b/protocol/statetracker/consumer_state_tracker.go @@ -6,20 +6,20 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - updaters "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - plantypes "github.com/lavanet/lava/x/plans/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + updaters "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) type ConsumerTxSenderInf interface { - TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict) error + TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict) error } // ConsumerStateTracker CSTis a class for tracking consumer data from the lava blockchain, such as epoch changes. @@ -54,7 +54,7 @@ func NewConsumerStateTracker(ctx context.Context, txFactory tx.Factory, clientCt return cst, err } -func (cst *ConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager) { +func (cst *ConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager, staticProvidersList []*lavasession.RPCProviderEndpoint) { // register this CSM to get the updated pairing list when a new epoch starts pairingUpdater := updaters.NewPairingUpdater(cst.stateQuery, consumerSessionManager.RPCEndpoint().ChainID) pairingUpdaterRaw := cst.StateTracker.RegisterForUpdates(ctx, pairingUpdater) @@ -63,7 +63,7 @@ func (cst *ConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates utils.LavaFormatFatal("invalid updater type returned from RegisterForUpdates", nil, utils.Attribute{Key: "updater", Value: pairingUpdaterRaw}) } - err := pairingUpdater.RegisterPairing(ctx, consumerSessionManager) + err := pairingUpdater.RegisterPairing(ctx, consumerSessionManager, staticProvidersList) if err != nil { // if failed registering pairing, continue trying asynchronously go func() { @@ -71,7 +71,7 @@ func (cst *ConsumerStateTracker) RegisterConsumerSessionManagerForPairingUpdates for { utils.LavaFormatError("Failed retry RegisterPairing", err, utils.LogAttr("attempt", numberOfAttempts), utils.Attribute{Key: "data", Value: consumerSessionManager.RPCEndpoint()}) time.Sleep(5 * time.Second) // sleep so we don't spam get pairing for no reason - err := pairingUpdater.RegisterPairing(ctx, consumerSessionManager) + err := pairingUpdater.RegisterPairing(ctx, consumerSessionManager, staticProvidersList) if err == nil { break } @@ -93,7 +93,7 @@ func (cst *ConsumerStateTracker) RegisterForPairingUpdates(ctx context.Context, } } -func (cst *ConsumerStateTracker) RegisterFinalizationConsensusForUpdates(ctx context.Context, finalizationConsensus *lavaprotocol.FinalizationConsensus) { +func (cst *ConsumerStateTracker) RegisterFinalizationConsensusForUpdates(ctx context.Context, finalizationConsensus *finalizationconsensus.FinalizationConsensus) { finalizationConsensusUpdater := updaters.NewFinalizationConsensusUpdater(cst.stateQuery, finalizationConsensus.SpecId) finalizationConsensusUpdaterRaw := cst.StateTracker.RegisterForUpdates(ctx, finalizationConsensusUpdater) finalizationConsensusUpdater, ok := finalizationConsensusUpdaterRaw.(*updaters.FinalizationConsensusUpdater) @@ -103,7 +103,7 @@ func (cst *ConsumerStateTracker) RegisterFinalizationConsensusForUpdates(ctx con finalizationConsensusUpdater.RegisterFinalizationConsensus(finalizationConsensus) } -func (cst *ConsumerStateTracker) TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict, conflictHandler common.ConflictHandlerInterface) error { +func (cst *ConsumerStateTracker) TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, conflictHandler common.ConflictHandlerInterface) error { if cst.disableConflictTransactions { utils.LavaFormatInfo("found Conflict, but transactions are disabled, returning") return nil @@ -111,7 +111,7 @@ func (cst *ConsumerStateTracker) TxConflictDetection(ctx context.Context, finali if conflictHandler.ConflictAlreadyReported() { return nil // already reported } - err := cst.TxSenderConflictDetection(ctx, finalizationConflict, responseConflict, sameProviderConflict) + err := cst.TxSenderConflictDetection(ctx, finalizationConflict, responseConflict) if err == nil { // if conflict report succeeded, we can set this provider as reported, so we wont need to report again. conflictHandler.StoreConflictReported() } diff --git a/protocol/statetracker/emergency_tracker.go b/protocol/statetracker/emergency_tracker.go index 0f0b916c0e..bd9af8ed7d 100644 --- a/protocol/statetracker/emergency_tracker.go +++ b/protocol/statetracker/emergency_tracker.go @@ -4,8 +4,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/utils" - downtimev1 "github.com/lavanet/lava/x/downtime/v1" + "github.com/lavanet/lava/v2/utils" + downtimev1 "github.com/lavanet/lava/v2/x/downtime/v1" ) const maxEpochsToStore = 3 diff --git a/protocol/statetracker/emergency_tracker_test.go b/protocol/statetracker/emergency_tracker_test.go index 909766af9e..d21d3a7577 100644 --- a/protocol/statetracker/emergency_tracker_test.go +++ b/protocol/statetracker/emergency_tracker_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - downtimev1 "github.com/lavanet/lava/x/downtime/v1" + downtimev1 "github.com/lavanet/lava/v2/x/downtime/v1" "github.com/stretchr/testify/require" ) diff --git a/protocol/statetracker/events.go b/protocol/statetracker/events.go index 365e295e54..4cba2764bc 100644 --- a/protocol/statetracker/events.go +++ b/protocol/statetracker/events.go @@ -21,15 +21,15 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/version" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/rpcprovider/rewardserver" - updaters "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/rpcprovider/rewardserver" + updaters "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) @@ -303,9 +303,8 @@ func paymentsLookup(ctx context.Context, clientCtx client.Context, blockStart, b utils.LavaFormatError("failed relay_payment_event parsing", err, utils.Attribute{Key: "event", Value: event}, utils.Attribute{Key: "block", Value: block}) continue } - if debug { - utils.LavaFormatDebug("relay_payment_event", utils.Attribute{Key: "payment", Value: paymentList}) - } + + utils.LavaFormatTrace("relay_payment_event", utils.Attribute{Key: "payment", Value: paymentList}) payments = append(payments, paymentList...) } } diff --git a/protocol/statetracker/provider_state_tracker.go b/protocol/statetracker/provider_state_tracker.go index b0781e6ecb..c3839b8979 100644 --- a/protocol/statetracker/provider_state_tracker.go +++ b/protocol/statetracker/provider_state_tracker.go @@ -6,14 +6,14 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/protocol/chaintracker" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/metrics" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - updaters "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/protocol/chaintracker" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/metrics" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + updaters "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) // ProviderStateTracker PST is a class for tracking provider data from the lava blockchain, such as epoch changes. diff --git a/protocol/statetracker/state_tracker.go b/protocol/statetracker/state_tracker.go index d751050fba..3799402773 100644 --- a/protocol/statetracker/state_tracker.go +++ b/protocol/statetracker/state_tracker.go @@ -7,16 +7,21 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/protocol/chaintracker" - updaters "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/chaintracker" + updaters "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( BlocksToSaveLavaChainTracker = 1 // we only need the latest block TendermintConsensusParamsQuery = "consensus_params" - debug = false +) + +var ( + lavaSpecName = "" + // TODO: add a governance param change that indicates what spec id belongs to lava. + lavaSpecOptions = []string{"LAV1", "LAVA"} ) // ConsumerStateTracker CSTis a class for tracking consumer data from the lava blockchain, such as epoch changes. @@ -35,6 +40,35 @@ type Updater interface { UpdaterKey() string } +func GetLavaSpecWithRetry(ctx context.Context, specQueryClient spectypes.QueryClient) (*spectypes.QueryGetSpecResponse, error) { + var specResponse *spectypes.QueryGetSpecResponse + var err error + for i := 0; i < updaters.BlockResultRetry; i++ { + if lavaSpecName == "" { // spec name is not initialized, try fetching specs. + for _, specId := range lavaSpecOptions { + specResponse, err = specQueryClient.Spec(ctx, &spectypes.QueryGetSpecRequest{ + ChainID: specId, + }) + if err != nil { + continue + } + utils.LavaFormatInfo("Lava Spec found on chain", utils.LogAttr("SpecId", specId)) + lavaSpecName = specId + break + } + } else { + specResponse, err = specQueryClient.Spec(ctx, &spectypes.QueryGetSpecRequest{ + ChainID: lavaSpecName, + }) + } + if err == nil { + break + } + time.Sleep(20 * time.Millisecond) + } + return specResponse, err +} + func NewStateTracker(ctx context.Context, txFactory tx.Factory, clientCtx client.Context, chainFetcher chaintracker.ChainFetcher, blockNotFoundCallback func(latestBlockTime time.Time)) (ret *StateTracker, err error) { // validate chainId status, err := clientCtx.Client.Status(ctx) @@ -57,26 +91,18 @@ func NewStateTracker(ctx context.Context, txFactory tx.Factory, clientCtx client return nil, utils.LavaFormatError("failed getting blockResults after retries", err) } specQueryClient := spectypes.NewQueryClient(clientCtx) - var specResponse *spectypes.QueryGetSpecResponse - for i := 0; i < updaters.BlockResultRetry; i++ { - specResponse, err = specQueryClient.Spec(ctx, &spectypes.QueryGetSpecRequest{ - ChainID: "LAV1", - }) - if err == nil { - break - } - time.Sleep(20 * time.Millisecond) - } + specResponse, err := GetLavaSpecWithRetry(ctx, specQueryClient) if err != nil { utils.LavaFormatFatal("failed querying lava spec for state tracker", err) } cst := &StateTracker{newLavaBlockUpdaters: map[string]Updater{}, EventTracker: eventTracker} chainTrackerConfig := chaintracker.ChainTrackerConfig{ - NewLatestCallback: cst.newLavaBlock, - OldBlockCallback: blockNotFoundCallback, - BlocksToSave: BlocksToSaveLavaChainTracker, - AverageBlockTime: time.Duration(specResponse.Spec.AverageBlockTime) * time.Millisecond, - ServerBlockMemory: 25 + BlocksToSaveLavaChainTracker, + NewLatestCallback: cst.newLavaBlock, + OldBlockCallback: blockNotFoundCallback, + BlocksToSave: BlocksToSaveLavaChainTracker, + AverageBlockTime: time.Duration(specResponse.Spec.AverageBlockTime) * time.Millisecond, + ServerBlockMemory: 25 + BlocksToSaveLavaChainTracker, + PollingTimeMultiplier: chaintracker.LavaPollingMultiplierFrequency, } cst.AverageBlockTime = chainTrackerConfig.AverageBlockTime cst.chainTracker, err = chaintracker.NewChainTracker(ctx, chainFetcher, chainTrackerConfig) diff --git a/protocol/statetracker/tx_sender.go b/protocol/statetracker/tx_sender.go index 7436fd87d6..ba411a3674 100644 --- a/protocol/statetracker/tx_sender.go +++ b/protocol/statetracker/tx_sender.go @@ -18,18 +18,18 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" typestx "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/x/feegrant" - "github.com/lavanet/lava/protocol/common" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - updaters "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + updaters "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) const ( - defaultGasPrice = "0.000000001" + commontypes.TokenDenom - DefaultGasAdjustment = "1000.0" + DefaultGasPrice = "0.00002" + commontypes.TokenDenom + DefaultGasAdjustment = "3.0" // same account can continue failing the more providers you have under the same account // for example if you have a provider staked at 20 chains you will ask for 20 payments per epoch. // therefore currently our best solution is to continue retrying increasing sequence number until successful @@ -81,7 +81,7 @@ func (ts *TxSender) checkProfitability(simResult *typestx.SimulateResponse, gasU } func (ts *TxSender) SimulateAndBroadCastTxWithRetryOnSeqMismatch(ctx context.Context, msg sdk.Msg, checkProfitability bool, feeGranter sdk.AccAddress) error { - txfactory := ts.txFactory.WithGasPrices(defaultGasPrice) + txfactory := ts.txFactory if feeGranter != nil { txfactory = ts.txFactory.WithFeeGranter(feeGranter) } @@ -101,7 +101,7 @@ func (ts *TxSender) SimulateAndBroadCastTxWithRetryOnSeqMismatch(ctx context.Con latestResult := common.TxResultData{} var gasUsed uint64 for ; idx < RETRY_INCORRECT_SEQUENCE && !success; idx++ { - utils.LavaFormatDebug("Attempting to send relay payment transaction", utils.LogAttr("index", idx+1)) + utils.LavaFormatDebug("Attempting to send transaction", utils.LogAttr("index", idx+1)) txfactory, gasUsed, err = ts.simulateTxWithRetry(clientCtx, txfactory, msg) if err != nil { return utils.LavaFormatError("Failed Simulating transaction", err) @@ -162,7 +162,7 @@ func (ts *TxSender) parseTxErrorsAndTryGettingANewFactory(txResultString string, } else if strings.Contains(txResultString, "insufficient fees; got:") { // handle a case where node minimum gas fees is misconfigured return ts.txFactory, parseInsufficientFeesError(txResultString, gasUsed) } - return txfactory, fmt.Errorf(txResultString) + return txfactory, fmt.Errorf("%s", txResultString) } func (ts *TxSender) simulateTxWithRetry(clientCtx client.Context, txfactory tx.Factory, msg sdk.Msg) (tx.Factory, uint64, error) { @@ -201,9 +201,9 @@ func (ts *TxSender) SendTxAndVerifyCommit(txfactory tx.Factory, msg sdk.Msg) (pa return common.TxResultData{}, utils.LavaFormatInfo("Failed unmarshaling transaction results", utils.Attribute{Key: "transactionResult", Value: myWriter.String()}) } myWriter.Reset() - if debug { - utils.LavaFormatDebug("transaction results", utils.Attribute{Key: "jsonParsedResult", Value: jsonParsedResult}) - } + + utils.LavaFormatTrace("transaction results", utils.LogAttr("jsonParsedResult", jsonParsedResult)) + resultData, err := common.ParseTransactionResult(jsonParsedResult) utils.LavaFormatInfo("Sent Transaction", utils.LogAttr("Hash", hex.EncodeToString(resultData.Txhash))) if err != nil { @@ -240,7 +240,7 @@ func (ts *TxSender) waitForTxCommit(resultData common.TxResultData) (common.TxRe return } utils.LavaFormatDebug("Keep Waiting tx results...", utils.LogAttr("reason", err)) - if debug { + if utils.IsTraceLogLevelEnabled() { utils.LavaFormatWarning("Tx query got error", err, utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "resultData", Value: resultData}) } } @@ -306,8 +306,16 @@ func NewConsumerTxSender(ctx context.Context, clientCtx client.Context, txFactor return ts, nil } -func (ts *ConsumerTxSender) TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict) error { - msg := conflicttypes.NewMsgDetection(ts.clientCtx.FromAddress.String(), finalizationConflict, responseConflict, sameProviderConflict) +func (ts *ConsumerTxSender) TxSenderConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict) error { + msg := conflicttypes.NewMsgDetection(ts.clientCtx.FromAddress.String()) + if finalizationConflict != nil { + msg.SetFinalizationConflict(finalizationConflict) + } else if responseConflict != nil { + msg.SetResponseConflict(responseConflict) + } else { + return utils.LavaFormatError("discrepancyChecker - TxSenderConflictDetection - no conflict provided", nil) + } + err := ts.SimulateAndBroadCastTxWithRetryOnSeqMismatch(ctx, msg, false, nil) if err != nil { return utils.LavaFormatError("discrepancyChecker - SimulateAndBroadCastTx Failed", err) @@ -472,7 +480,7 @@ func parseInsufficientFeesError(msg string, gasUsed uint64) error { } minimumGasPricesGot := (float64(gasUsed) / float64(required)) return utils.LavaFormatError("Bad Lava Node Configuration detected, Gas fees inconsistencies can be related to the app.toml configuration of the lava node you are using under 'minimum-gas-prices', Please remove the field or set it to the required amount or change rpc to a different lava node", nil, - utils.Attribute{Key: "Required Minimum Gas Prices", Value: defaultGasPrice}, + utils.Attribute{Key: "Required Minimum Gas Prices", Value: DefaultGasPrice}, utils.Attribute{Key: "Current (estimated) Minimum Gas Prices", Value: strconv.FormatFloat(minimumGasPricesGot, 'f', -1, 64) + commontypes.TokenDenom}, ) } diff --git a/protocol/statetracker/updaters/downtime_params_updater.go b/protocol/statetracker/updaters/downtime_params_updater.go index 53f3937e6f..06018e54c3 100644 --- a/protocol/statetracker/updaters/downtime_params_updater.go +++ b/protocol/statetracker/updaters/downtime_params_updater.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/utils" - downtimev1 "github.com/lavanet/lava/x/downtime/v1" + "github.com/lavanet/lava/v2/utils" + downtimev1 "github.com/lavanet/lava/v2/x/downtime/v1" ) const ( diff --git a/protocol/statetracker/updaters/epoch_updater.go b/protocol/statetracker/updaters/epoch_updater.go index a2f874a453..d82f8181de 100644 --- a/protocol/statetracker/updaters/epoch_updater.go +++ b/protocol/statetracker/updaters/epoch_updater.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "golang.org/x/net/context" ) diff --git a/protocol/statetracker/updaters/event_tracker.go b/protocol/statetracker/updaters/event_tracker.go index e606962a2a..15bcae168f 100644 --- a/protocol/statetracker/updaters/event_tracker.go +++ b/protocol/statetracker/updaters/event_tracker.go @@ -10,16 +10,15 @@ import ( ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/utils" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v2/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v2/utils" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( - debug = false BlockResultRetry = 20 ) @@ -53,7 +52,7 @@ func (et *EventTracker) UpdateBlockResults(latestBlock int64) (err error) { brp, err := TryIntoTendermintRPC(et.ClientCtx.Client) if err != nil { - return utils.LavaFormatError("could not get block result provider", err) + return utils.LavaFormatError("failed converting client.TendermintRPC to tendermintRPC", err) } var blockResults *ctypes.ResultBlockResults for i := 0; i < BlockResultRetry; i++ { @@ -63,10 +62,10 @@ func (et *EventTracker) UpdateBlockResults(latestBlock int64) (err error) { if err == nil { break } - time.Sleep(50 * time.Millisecond * time.Duration(i+1)) // need this so it doesnt just spam the attempts, and tendermint fails getting block results pretty often + time.Sleep(100 * time.Millisecond * time.Duration(i+1)) // need this so it doesn't just spam the attempts, and tendermint fails getting block results pretty often } if err != nil { - return utils.LavaFormatError("could not get block result", err) + return utils.LavaFormatError("could not get block result", err, utils.LogAttr("block_requested", latestBlock)) } // lock for update after successful block result query et.lock.Lock() @@ -92,9 +91,9 @@ func (et *EventTracker) getLatestPaymentEvents() (payments []*rewardserver.Payme if err != nil { return nil, utils.LavaFormatError("failed relay_payment_event parsing", err, utils.Attribute{Key: "event", Value: event}) } - if debug { - utils.LavaFormatDebug("relay_payment_event", utils.Attribute{Key: "payment", Value: paymentList}) - } + + utils.LavaFormatTrace("relay_payment_event", utils.LogAttr("payment", paymentList)) + payments = append(payments, paymentList...) } } diff --git a/protocol/statetracker/updaters/finalization_consensus_updater.go b/protocol/statetracker/updaters/finalization_consensus_updater.go index 8c1b63dc56..384829df76 100644 --- a/protocol/statetracker/updaters/finalization_consensus_updater.go +++ b/protocol/statetracker/updaters/finalization_consensus_updater.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/protocol/lavaprotocol" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/lavaprotocol/finalizationconsensus" + "github.com/lavanet/lava/v2/utils" ) const ( @@ -15,17 +15,17 @@ const ( type FinalizationConsensusUpdater struct { lock sync.RWMutex - registeredFinalizationConsensuses []*lavaprotocol.FinalizationConsensus + registeredFinalizationConsensuses []*finalizationconsensus.FinalizationConsensus nextBlockForUpdate uint64 stateQuery *ConsumerStateQuery specId string } func NewFinalizationConsensusUpdater(stateQuery *ConsumerStateQuery, specId string) *FinalizationConsensusUpdater { - return &FinalizationConsensusUpdater{registeredFinalizationConsensuses: []*lavaprotocol.FinalizationConsensus{}, stateQuery: stateQuery, specId: specId} + return &FinalizationConsensusUpdater{registeredFinalizationConsensuses: []*finalizationconsensus.FinalizationConsensus{}, stateQuery: stateQuery, specId: specId} } -func (fcu *FinalizationConsensusUpdater) RegisterFinalizationConsensus(finalizationConsensus *lavaprotocol.FinalizationConsensus) { +func (fcu *FinalizationConsensusUpdater) RegisterFinalizationConsensus(finalizationConsensus *finalizationconsensus.FinalizationConsensus) { // TODO: also update here for the first time fcu.lock.Lock() defer fcu.lock.Unlock() diff --git a/protocol/statetracker/updaters/pairing_updater.go b/protocol/statetracker/updaters/pairing_updater.go index f5cdff4e9f..ba8f65603e 100644 --- a/protocol/statetracker/updaters/pairing_updater.go +++ b/protocol/statetracker/updaters/pairing_updater.go @@ -1,13 +1,16 @@ package updaters import ( + "math" + "strconv" "sync" "time" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "golang.org/x/net/context" ) @@ -19,20 +22,43 @@ type PairingUpdatable interface { UpdateEpoch(epoch uint64) } +type ConsumerStateQueryInf interface { + GetPairing(ctx context.Context, chainID string, blockHeight int64) ([]epochstoragetypes.StakeEntry, uint64, uint64, error) + GetMaxCUForUser(ctx context.Context, chainID string, epoch uint64) (uint64, error) +} + +type ConsumerSessionManagerInf interface { + RPCEndpoint() lavasession.RPCEndpoint + UpdateAllProviders(epoch uint64, pairingList map[uint64]*lavasession.ConsumerSessionsWithProvider) error +} + type PairingUpdater struct { lock sync.RWMutex - consumerSessionManagersMap map[string][]*lavasession.ConsumerSessionManager // key is chainID so we don;t run getPairing more than once per chain + consumerSessionManagersMap map[string][]ConsumerSessionManagerInf // key is chainID so we don;t run getPairing more than once per chain nextBlockForUpdate uint64 - stateQuery *ConsumerStateQuery + stateQuery ConsumerStateQueryInf pairingUpdatables []*PairingUpdatable specId string + staticProviders []*lavasession.RPCProviderEndpoint +} + +func NewPairingUpdater(stateQuery ConsumerStateQueryInf, specId string) *PairingUpdater { + return &PairingUpdater{consumerSessionManagersMap: map[string][]ConsumerSessionManagerInf{}, stateQuery: stateQuery, specId: specId, staticProviders: []*lavasession.RPCProviderEndpoint{}} } -func NewPairingUpdater(stateQuery *ConsumerStateQuery, specId string) *PairingUpdater { - return &PairingUpdater{consumerSessionManagersMap: map[string][]*lavasession.ConsumerSessionManager{}, stateQuery: stateQuery, specId: specId} +func (pu *PairingUpdater) updateStaticProviders(staticProviders []*lavasession.RPCProviderEndpoint) { + pu.lock.Lock() + defer pu.lock.Unlock() + if len(staticProviders) > 0 && len(pu.staticProviders) == 0 { + for _, staticProvider := range staticProviders { + if staticProvider.ChainID == pu.specId { + pu.staticProviders = append(pu.staticProviders, staticProvider) + } + } + } } -func (pu *PairingUpdater) RegisterPairing(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager) error { +func (pu *PairingUpdater) RegisterPairing(ctx context.Context, consumerSessionManager ConsumerSessionManagerInf, staticProviders []*lavasession.RPCProviderEndpoint) error { chainID := consumerSessionManager.RPCEndpoint().ChainID timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() @@ -40,6 +66,7 @@ func (pu *PairingUpdater) RegisterPairing(ctx context.Context, consumerSessionMa if err != nil { return err } + pu.updateStaticProviders(staticProviders) pu.updateConsumerSessionManager(ctx, pairingList, consumerSessionManager, epoch) if nextBlockForUpdate > pu.nextBlockForUpdate { // make sure we don't update twice, this updates pu.nextBlockForUpdate @@ -49,7 +76,7 @@ func (pu *PairingUpdater) RegisterPairing(ctx context.Context, consumerSessionMa defer pu.lock.Unlock() consumerSessionsManagersList, ok := pu.consumerSessionManagersMap[chainID] if !ok { - pu.consumerSessionManagersMap[chainID] = []*lavasession.ConsumerSessionManager{consumerSessionManager} + pu.consumerSessionManagersMap[chainID] = []ConsumerSessionManagerInf{consumerSessionManager} return nil } pu.consumerSessionManagersMap[chainID] = append(consumerSessionsManagersList, consumerSessionManager) @@ -134,39 +161,69 @@ func (pu *PairingUpdater) Update(latestBlock int64) { pu.updateInner(latestBlock) } -func (pu *PairingUpdater) updateConsumerSessionManager(ctx context.Context, pairingList []epochstoragetypes.StakeEntry, consumerSessionManager *lavasession.ConsumerSessionManager, epoch uint64) (err error) { +func (pu *PairingUpdater) updateConsumerSessionManager(ctx context.Context, pairingList []epochstoragetypes.StakeEntry, consumerSessionManager ConsumerSessionManagerInf, epoch uint64) (err error) { pairingListForThisCSM, err := pu.filterPairingListByEndpoint(ctx, planstypes.Geolocation(consumerSessionManager.RPCEndpoint().Geolocation), pairingList, consumerSessionManager.RPCEndpoint(), epoch) if err != nil { return err } + if len(pu.staticProviders) > 0 { + pairingListForThisCSM = pu.addStaticProvidersToPairingList(pairingListForThisCSM, consumerSessionManager.RPCEndpoint(), epoch) + } err = consumerSessionManager.UpdateAllProviders(epoch, pairingListForThisCSM) return } +func (pu *PairingUpdater) addStaticProvidersToPairingList(pairingList map[uint64]*lavasession.ConsumerSessionsWithProvider, rpcEndpoint lavasession.RPCEndpoint, epoch uint64) map[uint64]*lavasession.ConsumerSessionsWithProvider { + startIdx := uint64(0) + for key := range pairingList { + if key >= startIdx { + startIdx = key + 1 + } + } + for idx, provider := range pu.staticProviders { + // only take the provider entries relevant for this apiInterface + if provider.ApiInterface != rpcEndpoint.ApiInterface { + continue + } + endpoints := []*lavasession.Endpoint{} + for _, url := range provider.NodeUrls { + extensions := map[string]struct{}{} + for _, extension := range url.Addons { + extensions[extension] = struct{}{} + } + endpoint := &lavasession.Endpoint{ + NetworkAddress: url.Url, + Enabled: true, + Addons: map[string]struct{}{}, // TODO: does not support addons, if required need to add the functionality to differentiate the two + Extensions: extensions, + Connections: []*lavasession.EndpointConnection{}, + } + endpoints = append(endpoints, endpoint) + } + staticProviderEntry := lavasession.NewConsumerSessionWithProvider( + "StaticProvider_"+strconv.Itoa(idx), + endpoints, + math.MaxUint64/2, + epoch, + sdk.NewInt64Coin("ulava", 1000000000000000), // 1b LAVA + ) + staticProviderEntry.StaticProvider = true + pairingList[startIdx+uint64(idx)] = staticProviderEntry + } + return pairingList +} + func (pu *PairingUpdater) filterPairingListByEndpoint(ctx context.Context, currentGeo planstypes.Geolocation, pairingList []epochstoragetypes.StakeEntry, rpcEndpoint lavasession.RPCEndpoint, epoch uint64) (filteredList map[uint64]*lavasession.ConsumerSessionsWithProvider, err error) { // go over stake entries, and filter endpoints that match geolocation and api interface pairing := map[uint64]*lavasession.ConsumerSessionsWithProvider{} for providerIdx, provider := range pairingList { // // Sanity - providerEndpoints := provider.GetEndpoints() - if len(providerEndpoints) == 0 { - utils.LavaFormatError("skipping provider with no endoints", nil, utils.Attribute{Key: "Address", Value: provider.Address}, utils.Attribute{Key: "ChainID", Value: provider.Chain}) - continue - } - - relevantEndpoints := []epochstoragetypes.Endpoint{} - for _, endpoint := range providerEndpoints { - // only take into account endpoints that use the same api interface and the same geolocation - for _, endpointApiInterface := range endpoint.ApiInterfaces { - if endpointApiInterface == rpcEndpoint.ApiInterface { // we take all geolocations provided by the chain. the provider optimizer will prioritize the relevant ones - relevantEndpoints = append(relevantEndpoints, endpoint) - break - } - } - } + // only take into account endpoints that use the same api interface and the same geolocation + // we take all geolocations provided by the chain. the provider optimizer will prioritize the relevant ones + relevantEndpoints := getRelevantEndpointsFromProvider(provider, rpcEndpoint) if len(relevantEndpoints) == 0 { - utils.LavaFormatError("skipping provider, No relevant endpoints for apiInterface", nil, utils.Attribute{Key: "Address", Value: provider.Address}, utils.Attribute{Key: "ChainID", Value: provider.Chain}, utils.Attribute{Key: "apiInterface", Value: rpcEndpoint.ApiInterface}, utils.Attribute{Key: "Endpoints", Value: providerEndpoints}) + utils.LavaFormatError("skipping provider, No relevant endpoints for apiInterface", nil, utils.Attribute{Key: "Address", Value: provider.Address}, utils.Attribute{Key: "ChainID", Value: provider.Chain}, utils.Attribute{Key: "apiInterface", Value: rpcEndpoint.ApiInterface}, utils.Attribute{Key: "Endpoints", Value: provider.GetEndpoints()}) continue } @@ -186,7 +243,7 @@ func (pu *PairingUpdater) filterPairingListByEndpoint(ctx context.Context, curre extensions[extension] = struct{}{} } - endp := &lavasession.Endpoint{Geolocation: planstypes.Geolocation(relevantEndpoint.Geolocation), NetworkAddress: relevantEndpoint.IPPORT, Enabled: true, Client: nil, ConnectionRefusals: 0, Addons: addons, Extensions: extensions} + endp := &lavasession.Endpoint{Connections: []*lavasession.EndpointConnection{}, Geolocation: planstypes.Geolocation(relevantEndpoint.Geolocation), NetworkAddress: relevantEndpoint.IPPORT, Enabled: true, ConnectionRefusals: 0, Addons: addons, Extensions: extensions} pairingEndpoints[idx] = endp } lavasession.SortByGeolocations(pairingEndpoints, currentGeo) @@ -204,3 +261,22 @@ func (pu *PairingUpdater) filterPairingListByEndpoint(ctx context.Context, curre // replace previous pairing with new providers return pairing, nil } + +func getRelevantEndpointsFromProvider(provider epochstoragetypes.StakeEntry, rpcEndpoint lavasession.RPCEndpoint) []epochstoragetypes.Endpoint { + providerEndpoints := provider.GetEndpoints() + if len(providerEndpoints) == 0 { + utils.LavaFormatError("skipping provider with no endoints", nil, utils.Attribute{Key: "Address", Value: provider.Address}, utils.Attribute{Key: "ChainID", Value: provider.Chain}) + return nil + } + + relevantEndpoints := []epochstoragetypes.Endpoint{} + for _, endpoint := range providerEndpoints { + for _, endpointApiInterface := range endpoint.ApiInterfaces { + if endpointApiInterface == rpcEndpoint.ApiInterface { + relevantEndpoints = append(relevantEndpoints, endpoint) + break + } + } + } + return relevantEndpoints +} diff --git a/protocol/statetracker/updaters/pairing_updater_test.go b/protocol/statetracker/updaters/pairing_updater_test.go new file mode 100644 index 0000000000..fb4f574512 --- /dev/null +++ b/protocol/statetracker/updaters/pairing_updater_test.go @@ -0,0 +1,204 @@ +package updaters + +import ( + "context" + "testing" + + "github.com/golang/mock/gomock" + "github.com/lavanet/lava/v2/protocol/common" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils/rand" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/stretchr/testify/require" +) + +type matcher struct { + expected map[uint64]*lavasession.ConsumerSessionsWithProvider +} + +func (m matcher) Matches(arg interface{}) bool { + actual, ok := arg.(map[uint64]*lavasession.ConsumerSessionsWithProvider) + if !ok { + return false + } + if len(actual) != len(m.expected) { + return false + } + for k, v := range m.expected { + if actual[k].StaticProvider != v.StaticProvider { + return false + } + } + return true +} + +func (m matcher) String() string { + return "" +} + +func TestPairingUpdater(t *testing.T) { + rand.InitRandomSeed() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + specID := "test-spec" + apiInterface := "test-inf" + initialPairingList := []epochstoragetypes.StakeEntry{ + { + Address: "initial2", + Endpoints: []epochstoragetypes.Endpoint{ + { + IPPORT: "1234567", + Geolocation: 1, + Addons: []string{}, + ApiInterfaces: []string{"banana"}, + Extensions: []string{}, + }, + }, + Geolocation: 1, + Chain: specID, + }, + { + Address: "initial0", + Endpoints: []epochstoragetypes.Endpoint{ + { + IPPORT: "123", + Geolocation: 0, + Addons: []string{}, + ApiInterfaces: []string{apiInterface}, + Extensions: []string{}, + }, + }, + Geolocation: 0, + Chain: specID, + }, + { + Address: "initial1", + Endpoints: []epochstoragetypes.Endpoint{ + { + IPPORT: "1234", + Geolocation: 0, + Addons: []string{}, + ApiInterfaces: []string{apiInterface}, + Extensions: []string{}, + }, + }, + Geolocation: 0, + Chain: specID, + }, + } + // Create a new mock object + stateQuery := NewMockConsumerStateQueryInf(ctrl) + stateQuery.EXPECT().GetPairing(gomock.Any(), gomock.Any(), gomock.Any()).Return(initialPairingList, uint64(0), uint64(0), nil).AnyTimes() + stateQuery.EXPECT().GetMaxCUForUser(gomock.Any(), gomock.Any(), gomock.Any()).Return(uint64(999999999), nil).AnyTimes() + + t.Run("UpdateStaticProviders", func(t *testing.T) { + pu := NewPairingUpdater(stateQuery, specID) + staticProviders := []*lavasession.RPCProviderEndpoint{ + { + ChainID: specID, + ApiInterface: apiInterface, + Geolocation: 0, + NodeUrls: []common.NodeUrl{ + { + Url: "0123", + }, + }, + }, + { + ChainID: "banana", + ApiInterface: apiInterface, + Geolocation: 0, + NodeUrls: []common.NodeUrl{ + { + Url: "01234", + }, + }, + }, + { + ChainID: "specID", + ApiInterface: "wrong", + Geolocation: 0, + NodeUrls: []common.NodeUrl{ + { + Url: "01235", + }, + }, + }, + } + + pu.updateStaticProviders(staticProviders) + + // only one of the specs is relevant + require.Len(t, pu.staticProviders, 1) + + staticProviders = []*lavasession.RPCProviderEndpoint{ + { + ChainID: specID, + ApiInterface: apiInterface, + Geolocation: 0, + NodeUrls: []common.NodeUrl{ + { + Url: "01236", + }, + }, + }, + { + ChainID: "banana", + ApiInterface: apiInterface, + Geolocation: 0, + NodeUrls: []common.NodeUrl{ + { + Url: "01237", + }, + }, + }, + } + + pu.updateStaticProviders(staticProviders) + + // can only update them once + require.Len(t, pu.staticProviders, 1) + }) + + t.Run("RegisterPairing", func(t *testing.T) { + pu := NewPairingUpdater(stateQuery, specID) + consumerSessionManager := NewMockConsumerSessionManagerInf(ctrl) + consumerSessionManager.EXPECT().RPCEndpoint().Return(lavasession.RPCEndpoint{ + ChainID: specID, + ApiInterface: apiInterface, + Geolocation: 0, + }).AnyTimes() + + staticProviders := []*lavasession.RPCProviderEndpoint{ + { + ChainID: specID, + ApiInterface: apiInterface, + Geolocation: 0, + NodeUrls: []common.NodeUrl{ + { + Url: "00123", + }, + }, + }, + } + pairingMatcher := matcher{ + expected: map[uint64]*lavasession.ConsumerSessionsWithProvider{ + 1: {}, + 2: {}, + 3: {StaticProvider: true}, + }, + } + consumerSessionManager.EXPECT().UpdateAllProviders(gomock.Any(), pairingMatcher).Times(1).Return(nil) + err := pu.RegisterPairing(context.Background(), consumerSessionManager, staticProviders) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + + if len(pu.consumerSessionManagersMap) != 1 { + t.Errorf("Expected 1 consumer session manager, got %d", len(pu.consumerSessionManagersMap)) + } + + consumerSessionManager.EXPECT().UpdateAllProviders(gomock.Any(), pairingMatcher).Times(1).Return(nil) + pu.Update(20) + }) +} diff --git a/protocol/statetracker/updaters/payment_updater.go b/protocol/statetracker/updaters/payment_updater.go index db14a8afec..edda32ca1e 100644 --- a/protocol/statetracker/updaters/payment_updater.go +++ b/protocol/statetracker/updaters/payment_updater.go @@ -3,8 +3,8 @@ package updaters import ( "sync" - "github.com/lavanet/lava/protocol/rpcprovider/rewardserver" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/rpcprovider/rewardserver" + "github.com/lavanet/lava/v2/utils" "golang.org/x/net/context" ) diff --git a/protocol/statetracker/updaters/policy_updater.go b/protocol/statetracker/updaters/policy_updater.go index 5d87a1418c..7a356d0298 100644 --- a/protocol/statetracker/updaters/policy_updater.go +++ b/protocol/statetracker/updaters/policy_updater.go @@ -5,10 +5,10 @@ import ( "sync" "time" - chainlib "github.com/lavanet/lava/protocol/chainlib" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - plantypes "github.com/lavanet/lava/x/plans/types" + chainlib "github.com/lavanet/lava/v2/protocol/chainlib" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + plantypes "github.com/lavanet/lava/v2/x/plans/types" ) const ( diff --git a/protocol/statetracker/updaters/spec_updater.go b/protocol/statetracker/updaters/spec_updater.go index cd0e7dbcba..453f9f3f5b 100644 --- a/protocol/statetracker/updaters/spec_updater.go +++ b/protocol/statetracker/updaters/spec_updater.go @@ -7,9 +7,9 @@ import ( "sync/atomic" "time" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/utils" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/utils" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( diff --git a/protocol/statetracker/updaters/state_query.go b/protocol/statetracker/updaters/state_query.go index 9d39452c15..31b1fb7206 100644 --- a/protocol/statetracker/updaters/state_query.go +++ b/protocol/statetracker/updaters/state_query.go @@ -6,18 +6,18 @@ import ( "strconv" "time" - downtimev1 "github.com/lavanet/lava/x/downtime/v1" + downtimev1 "github.com/lavanet/lava/v2/x/downtime/v1" "github.com/cosmos/cosmos-sdk/client" "github.com/dgraph-io/ristretto" - reliabilitymanager "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/utils" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - plantypes "github.com/lavanet/lava/x/plans/types" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - spectypes "github.com/lavanet/lava/x/spec/types" + reliabilitymanager "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v2/utils" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -161,12 +161,34 @@ func (csq *ConsumerStateQuery) GetPairing(ctx context.Context, chainID string, l } func (csq *ConsumerStateQuery) GetMaxCUForUser(ctx context.Context, chainID string, epoch uint64) (maxCu uint64, err error) { - address := csq.clientCtx.FromAddress.String() - UserEntryRes, err := csq.PairingQueryClient.UserEntry(ctx, &pairingtypes.QueryUserEntryRequest{ChainID: chainID, Address: address, Block: epoch}) - if err != nil { - return 0, utils.LavaFormatError("failed querying StakeEntry for consumer", err, utils.Attribute{Key: "chainID", Value: chainID}, utils.Attribute{Key: "address", Value: address}, utils.Attribute{Key: "block", Value: epoch}) + var userEntryRes *pairingtypes.QueryUserEntryResponse = nil + + key := csq.entryKey(chainID, epoch) + cachedInterface, found := csq.ResponsesCache.Get(key) + + if found && cachedInterface != nil { + if cachedResp, ok := cachedInterface.(*pairingtypes.QueryUserEntryResponse); ok { + userEntryRes = cachedResp + } else { + utils.LavaFormatError("invalid cache entry - failed casting response", nil, utils.Attribute{Key: "castingType", Value: "*pairingtypes.QueryUserEntryResponse"}, utils.Attribute{Key: "type", Value: fmt.Sprintf("%T", cachedInterface)}) + } } - return UserEntryRes.GetMaxCU(), nil + + if userEntryRes == nil { + address := csq.clientCtx.FromAddress.String() + userEntryRes, err = csq.PairingQueryClient.UserEntry(ctx, &pairingtypes.QueryUserEntryRequest{ChainID: chainID, Address: address, Block: epoch}) + if err != nil { + return 0, utils.LavaFormatError("failed querying StakeEntry for consumer", err, utils.Attribute{Key: "chainID", Value: chainID}, utils.Attribute{Key: "address", Value: address}, utils.Attribute{Key: "block", Value: epoch}) + } + + csq.ResponsesCache.SetWithTTL(key, userEntryRes, 1, DefaultTimeToLiveExpiration) + } + + return userEntryRes.GetMaxCU(), nil +} + +func (csq *ConsumerStateQuery) entryKey(chainID string, epoch uint64) string { + return MaxCuResponseKey + chainID + strconv.FormatUint(epoch, 10) } type EpochStateQuery struct { @@ -301,7 +323,12 @@ func (psq *ProviderStateQuery) VerifyPairing(ctx context.Context, consumerAddres psq.ResponsesCache.SetWithTTL(VerifyPairingRespKey+key, verifyResponse, 1, DefaultTimeToLiveExpiration) } if !verifyResponse.Valid { - return false, 0, "", utils.LavaFormatError("invalid self pairing with consumer", nil, utils.Attribute{Key: "provider", Value: providerAddress}, utils.Attribute{Key: "consumer address", Value: consumerAddress}, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "from_cache", Value: extractedResultFromCache}) + return false, 0, "", utils.LavaFormatError("invalid self pairing with consumer", nil, + utils.LogAttr("provider", providerAddress), + utils.LogAttr("consumer_address", consumerAddress), + utils.LogAttr("epoch", epoch), + utils.LogAttr("from_cache", extractedResultFromCache), + ) } return verifyResponse.Valid, int64(verifyResponse.GetPairedProviders()), verifyResponse.ProjectId, nil } diff --git a/protocol/statetracker/updaters/updaters_mock.go b/protocol/statetracker/updaters/updaters_mock.go new file mode 100644 index 0000000000..002299d90b --- /dev/null +++ b/protocol/statetracker/updaters/updaters_mock.go @@ -0,0 +1,155 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: protocol/statetracker/updaters/pairing_updater.go + +// Package updaters is a generated GoMock package. +package updaters + +import ( + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + lavasession "github.com/lavanet/lava/v2/protocol/lavasession" + types "github.com/lavanet/lava/v2/x/epochstorage/types" + context "golang.org/x/net/context" +) + +// MockPairingUpdatable is a mock of PairingUpdatable interface. +type MockPairingUpdatable struct { + ctrl *gomock.Controller + recorder *MockPairingUpdatableMockRecorder +} + +// MockPairingUpdatableMockRecorder is the mock recorder for MockPairingUpdatable. +type MockPairingUpdatableMockRecorder struct { + mock *MockPairingUpdatable +} + +// NewMockPairingUpdatable creates a new mock instance. +func NewMockPairingUpdatable(ctrl *gomock.Controller) *MockPairingUpdatable { + mock := &MockPairingUpdatable{ctrl: ctrl} + mock.recorder = &MockPairingUpdatableMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPairingUpdatable) EXPECT() *MockPairingUpdatableMockRecorder { + return m.recorder +} + +// UpdateEpoch mocks base method. +func (m *MockPairingUpdatable) UpdateEpoch(epoch uint64) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "UpdateEpoch", epoch) +} + +// UpdateEpoch indicates an expected call of UpdateEpoch. +func (mr *MockPairingUpdatableMockRecorder) UpdateEpoch(epoch interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateEpoch", reflect.TypeOf((*MockPairingUpdatable)(nil).UpdateEpoch), epoch) +} + +// MockConsumerStateQueryInf is a mock of ConsumerStateQueryInf interface. +type MockConsumerStateQueryInf struct { + ctrl *gomock.Controller + recorder *MockConsumerStateQueryInfMockRecorder +} + +// MockConsumerStateQueryInfMockRecorder is the mock recorder for MockConsumerStateQueryInf. +type MockConsumerStateQueryInfMockRecorder struct { + mock *MockConsumerStateQueryInf +} + +// NewMockConsumerStateQueryInf creates a new mock instance. +func NewMockConsumerStateQueryInf(ctrl *gomock.Controller) *MockConsumerStateQueryInf { + mock := &MockConsumerStateQueryInf{ctrl: ctrl} + mock.recorder = &MockConsumerStateQueryInfMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConsumerStateQueryInf) EXPECT() *MockConsumerStateQueryInfMockRecorder { + return m.recorder +} + +// GetMaxCUForUser mocks base method. +func (m *MockConsumerStateQueryInf) GetMaxCUForUser(ctx context.Context, chainID string, epoch uint64) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMaxCUForUser", ctx, chainID, epoch) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMaxCUForUser indicates an expected call of GetMaxCUForUser. +func (mr *MockConsumerStateQueryInfMockRecorder) GetMaxCUForUser(ctx, chainID, epoch interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMaxCUForUser", reflect.TypeOf((*MockConsumerStateQueryInf)(nil).GetMaxCUForUser), ctx, chainID, epoch) +} + +// GetPairing mocks base method. +func (m *MockConsumerStateQueryInf) GetPairing(ctx context.Context, chainID string, blockHeight int64) ([]types.StakeEntry, uint64, uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPairing", ctx, chainID, blockHeight) + ret0, _ := ret[0].([]types.StakeEntry) + ret1, _ := ret[1].(uint64) + ret2, _ := ret[2].(uint64) + ret3, _ := ret[3].(error) + return ret0, ret1, ret2, ret3 +} + +// GetPairing indicates an expected call of GetPairing. +func (mr *MockConsumerStateQueryInfMockRecorder) GetPairing(ctx, chainID, blockHeight interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPairing", reflect.TypeOf((*MockConsumerStateQueryInf)(nil).GetPairing), ctx, chainID, blockHeight) +} + +// MockConsumerSessionManagerInf is a mock of ConsumerSessionManagerInf interface. +type MockConsumerSessionManagerInf struct { + ctrl *gomock.Controller + recorder *MockConsumerSessionManagerInfMockRecorder +} + +// MockConsumerSessionManagerInfMockRecorder is the mock recorder for MockConsumerSessionManagerInf. +type MockConsumerSessionManagerInfMockRecorder struct { + mock *MockConsumerSessionManagerInf +} + +// NewMockConsumerSessionManagerInf creates a new mock instance. +func NewMockConsumerSessionManagerInf(ctrl *gomock.Controller) *MockConsumerSessionManagerInf { + mock := &MockConsumerSessionManagerInf{ctrl: ctrl} + mock.recorder = &MockConsumerSessionManagerInfMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConsumerSessionManagerInf) EXPECT() *MockConsumerSessionManagerInfMockRecorder { + return m.recorder +} + +// RPCEndpoint mocks base method. +func (m *MockConsumerSessionManagerInf) RPCEndpoint() lavasession.RPCEndpoint { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RPCEndpoint") + ret0, _ := ret[0].(lavasession.RPCEndpoint) + return ret0 +} + +// RPCEndpoint indicates an expected call of RPCEndpoint. +func (mr *MockConsumerSessionManagerInfMockRecorder) RPCEndpoint() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RPCEndpoint", reflect.TypeOf((*MockConsumerSessionManagerInf)(nil).RPCEndpoint)) +} + +// UpdateAllProviders mocks base method. +func (m *MockConsumerSessionManagerInf) UpdateAllProviders(epoch uint64, pairingList map[uint64]*lavasession.ConsumerSessionsWithProvider) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateAllProviders", epoch, pairingList) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateAllProviders indicates an expected call of UpdateAllProviders. +func (mr *MockConsumerSessionManagerInfMockRecorder) UpdateAllProviders(epoch, pairingList interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAllProviders", reflect.TypeOf((*MockConsumerSessionManagerInf)(nil).UpdateAllProviders), epoch, pairingList) +} diff --git a/protocol/statetracker/updaters/version_updater.go b/protocol/statetracker/updaters/version_updater.go index f38c5bc053..14826f71ef 100644 --- a/protocol/statetracker/updaters/version_updater.go +++ b/protocol/statetracker/updaters/version_updater.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) const ( diff --git a/protocol/statetracker/updaters/vote_updater.go b/protocol/statetracker/updaters/vote_updater.go index f9560bc7b2..4a68c2ad14 100644 --- a/protocol/statetracker/updaters/vote_updater.go +++ b/protocol/statetracker/updaters/vote_updater.go @@ -3,9 +3,9 @@ package updaters import ( "sync" - "github.com/lavanet/lava/protocol/lavasession" - "github.com/lavanet/lava/protocol/rpcprovider/reliabilitymanager" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/protocol/lavasession" + "github.com/lavanet/lava/v2/protocol/rpcprovider/reliabilitymanager" + "github.com/lavanet/lava/v2/utils" "golang.org/x/net/context" ) diff --git a/protocol/upgrade/protocol_version.go b/protocol/upgrade/protocol_version.go index 21dd1e3785..1982bb8a9a 100644 --- a/protocol/upgrade/protocol_version.go +++ b/protocol/upgrade/protocol_version.go @@ -4,9 +4,9 @@ import ( "strconv" "strings" - "github.com/lavanet/lava/protocol/statetracker/updaters" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/protocol/statetracker/updaters" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" ) type ProtocolVersion struct { diff --git a/scripts/automation_scripts/update_cosmos_spec_from_grpc.py b/scripts/automation_scripts/update_cosmos_spec_from_grpc.py index 0be8f32fa3..8c373d8e37 100644 --- a/scripts/automation_scripts/update_cosmos_spec_from_grpc.py +++ b/scripts/automation_scripts/update_cosmos_spec_from_grpc.py @@ -48,7 +48,7 @@ def parse_endpoints_from_grpcurl(grpc_url: str) -> dict[str, list[str]]: ) rpc_pattern = re.compile(r"rpc (\w+) \(") - rest_pattern = re.compile(r'option \(.*?\) = {.*?get: "(.*?)"', re.DOTALL) + rest_pattern = re.compile(r'option\s*\(\s*.*?\s*\)\s*=\s*{\s*get:\s*"(.*?)"\s*}', re.DOTALL) # Finding all services that start with 'lavanet' for service_match in grpc_pattern.finditer(content): diff --git a/scripts/init_chain.sh b/scripts/init_chain.sh index 99f555f9f7..756c77f702 100755 --- a/scripts/init_chain.sh +++ b/scripts/init_chain.sh @@ -73,16 +73,15 @@ echo $(cat "$path$genesis") os_name=$(uname) case "$(uname)" in Darwin) - SED_INLINE="-i ''" ;; + SED_INLINE=(-i '') ;; Linux) - SED_INLINE="-i" ;; + SED_INLINE=(-i) ;; *) echo "unknown system: $(uname)" exit 1 ;; esac - -sed $SED_INLINE \ +sed "${SED_INLINE[@]}" \ -e 's/timeout_propose = .*/timeout_propose = "1s"/' \ -e 's/timeout_propose_delta = .*/timeout_propose_delta = "500ms"/' \ -e 's/timeout_prevote = .*/timeout_prevote = "1s"/' \ @@ -93,9 +92,8 @@ sed $SED_INLINE \ -e 's/skip_timeout_commit = .*/skip_timeout_commit = false/' "$path$config" # Edit app.toml file -sed $SED_INLINE -e "s/enable = .*/enable = true/" "$path$app" -sed $SED_INLINE -e "/Enable defines if the Rosetta API server should be enabled.*/{n;s/enable = .*/enable = false/}" "$path$app" - +sed "${SED_INLINE[@]}" -e "s/enable = .*/enable = true/" "$path$app" +sed "${SED_INLINE[@]}" -e "/Enable defines if the Rosetta API server should be enabled.*/{n;s/enable = .*/enable = false/;}" "$path$app" # Add users users=("alice" "bob" "user1" "user2" "user3" "user4" "user5" "servicer1" "servicer2" "servicer3" "servicer4" "servicer5" "servicer6" "servicer7" "servicer8" "servicer9" "servicer10") diff --git a/scripts/init_chain_commands.sh b/scripts/init_chain_commands.sh index 391e834e86..6e3e5b7d84 100755 --- a/scripts/init_chain_commands.sh +++ b/scripts/init_chain_commands.sh @@ -6,7 +6,7 @@ source $__dir/useful_commands.sh echo "current vote number $(latest_vote)" killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" echo; echo "#### Sending proposal for specs ####" cd ./cookbook/specs/ diff --git a/scripts/pre_setups/init_aptos_only_test.sh b/scripts/pre_setups/init_aptos_only_test.sh index b1ae63b9b6..f3f22557e5 100755 --- a/scripts/pre_setups/init_aptos_only_test.sh +++ b/scripts/pre_setups/init_aptos_only_test.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_arbitrum_only_test.sh b/scripts/pre_setups/init_arbitrum_only_test.sh index 89d73f4998..ac7cb42319 100755 --- a/scripts/pre_setups/init_arbitrum_only_test.sh +++ b/scripts/pre_setups/init_arbitrum_only_test.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_avalanch_only.sh b/scripts/pre_setups/init_avalanch_only.sh index d2f2324800..e5f25d9aa2 100755 --- a/scripts/pre_setups/init_avalanch_only.sh +++ b/scripts/pre_setups/init_avalanch_only.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_axelar_only_with_node.sh b/scripts/pre_setups/init_axelar_only_with_node.sh index b39055253e..8c9a219149 100755 --- a/scripts/pre_setups/init_axelar_only_with_node.sh +++ b/scripts/pre_setups/init_axelar_only_with_node.sh @@ -20,7 +20,7 @@ echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enou sleep 5 wait_for_lava_node_to_start -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_canto_only_test.sh b/scripts/pre_setups/init_canto_only_test.sh index f7b86fa47d..1c36e6bcbb 100755 --- a/scripts/pre_setups/init_canto_only_test.sh +++ b/scripts/pre_setups/init_canto_only_test.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_eth_archive_mix.sh b/scripts/pre_setups/init_eth_archive_mix.sh index 8b61564ab0..0bd1fd6e96 100755 --- a/scripts/pre_setups/init_eth_archive_mix.sh +++ b/scripts/pre_setups/init_eth_archive_mix.sh @@ -10,7 +10,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" PROVIDER1_LISTENER="127.0.0.1:2221" PROVIDER2_LISTENER="127.0.0.1:2222" PROVIDER3_LISTENER="127.0.0.1:2223" diff --git a/scripts/pre_setups/init_evmos_only_test.sh b/scripts/pre_setups/init_evmos_only_test.sh index 6cc9d952c8..3fab94eb62 100755 --- a/scripts/pre_setups/init_evmos_only_test.sh +++ b/scripts/pre_setups/init_evmos_only_test.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_evmos_only_with_node.sh b/scripts/pre_setups/init_evmos_only_with_node.sh index 97086cc0f0..b4c1d7a7b2 100755 --- a/scripts/pre_setups/init_evmos_only_with_node.sh +++ b/scripts/pre_setups/init_evmos_only_with_node.sh @@ -20,7 +20,7 @@ echo "[Test Setup] waiting blocks to start progressing" sleep 3 wait_for_lava_node_to_start -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_fvm_only_test.sh b/scripts/pre_setups/init_fvm_only_test.sh index 75f8fa467f..612d114dd2 100755 --- a/scripts/pre_setups/init_fvm_only_test.sh +++ b/scripts/pre_setups/init_fvm_only_test.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_lava_only_test.sh b/scripts/pre_setups/init_lava_only_test.sh index c921cdb126..f7160e2561 100755 --- a/scripts/pre_setups/init_lava_only_test.sh +++ b/scripts/pre_setups/init_lava_only_test.sh @@ -19,7 +19,7 @@ screen -ls echo "[Lavavisor Setup] sleeping 20 seconds for node to finish setup (if its not enough increase timeout)" sleep 20 -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_lava_only_test_5.sh b/scripts/pre_setups/init_lava_only_test_5.sh index fb0a55e01b..dc3f0062a0 100755 --- a/scripts/pre_setups/init_lava_only_test_5.sh +++ b/scripts/pre_setups/init_lava_only_test_5.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_lava_only_test_with_badge.sh b/scripts/pre_setups/init_lava_only_test_with_badge.sh index 63b5a6c455..d6d4f8b222 100755 --- a/scripts/pre_setups/init_lava_only_test_with_badge.sh +++ b/scripts/pre_setups/init_lava_only_test_with_badge.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_lava_only_with_node.sh b/scripts/pre_setups/init_lava_only_with_node.sh index 1346e91427..4a5c91f227 100755 --- a/scripts/pre_setups/init_lava_only_with_node.sh +++ b/scripts/pre_setups/init_lava_only_with_node.sh @@ -20,7 +20,7 @@ echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enou sleep 5 wait_for_lava_node_to_start -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block @@ -49,15 +49,15 @@ wait_next_block screen -d -m -S provider1 bash -c "source ~/.bashrc; lavap rpcprovider \ $PROVIDER1_LISTENER LAV1 rest '$LAVA_REST' \ -$PROVIDER1_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC' \ +$PROVIDER1_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC_WS' \ $PROVIDER1_LISTENER LAV1 grpc '$LAVA_GRPC' \ -$EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer1 --chain-id lava --metrics-listen-address ":7776" 2>&1 | tee $LOGS_DIR/PROVIDER1.log" && sleep 0.25 +$EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level trace --from servicer1 --chain-id lava --metrics-listen-address ":7776" 2>&1 | tee $LOGS_DIR/PROVIDER1.log" && sleep 0.25 wait_next_block screen -d -m -S consumers bash -c "source ~/.bashrc; lavap rpcconsumer \ 127.0.0.1:3360 LAV1 rest 127.0.0.1:3361 LAV1 tendermintrpc 127.0.0.1:3362 LAV1 grpc \ -$EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 --chain-id lava --add-api-method-metrics --allow-insecure-provider-dialing --metrics-listen-address ":7779" 2>&1 | tee $LOGS_DIR/CONSUMERS.log" && sleep 0.25 +$EXTRA_PORTAL_FLAGS --geolocation 1 --log_level trace --from user1 --chain-id lava --add-api-method-metrics --allow-insecure-provider-dialing --metrics-listen-address ":7779" 2>&1 | tee $LOGS_DIR/CONSUMERS.log" && sleep 0.25 echo "--- setting up screens done ---" screen -ls \ No newline at end of file diff --git a/scripts/pre_setups/init_lava_only_with_node_protocol_only.sh b/scripts/pre_setups/init_lava_only_with_node_protocol_only.sh new file mode 100755 index 0000000000..8080e9dd93 --- /dev/null +++ b/scripts/pre_setups/init_lava_only_with_node_protocol_only.sh @@ -0,0 +1,36 @@ +#!/bin/bash +__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source "$__dir"/../useful_commands.sh +. "${__dir}"/../vars/variables.sh + +LOGS_DIR=${__dir}/../../testutil/debugging/logs +mkdir -p $LOGS_DIR +rm $LOGS_DIR/*.log +echo "[Test Setup] killing lavap" +killall lavap +sleep 1 + +echo "[Test Setup] installing all binaries" +make install-all + +GASPRICE="0.000000001ulava" + +CLIENTSTAKE="500000000000ulava" +PROVIDERSTAKE="500000000000ulava" + +PROVIDER1_LISTENER="127.0.0.1:2220" + +screen -d -m -S provider1 bash -c "source ~/.bashrc; lavap rpcprovider \ +$PROVIDER1_LISTENER LAV1 rest '$LAVA_REST' \ +$PROVIDER1_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC_WS' \ +$PROVIDER1_LISTENER LAV1 grpc '$LAVA_GRPC' \ +$EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level trace --from servicer1 --chain-id lava --metrics-listen-address ":7776" 2>&1 | tee $LOGS_DIR/PROVIDER1.log" && sleep 0.25 + +wait_next_block + +screen -d -m -S consumers bash -c "source ~/.bashrc; lavap rpcconsumer \ +127.0.0.1:3360 LAV1 rest 127.0.0.1:3361 LAV1 tendermintrpc 127.0.0.1:3362 LAV1 grpc \ +$EXTRA_PORTAL_FLAGS --geolocation 1 --log_level trace --from user1 --chain-id lava --add-api-method-metrics --allow-insecure-provider-dialing --metrics-listen-address ":7779" 2>&1 | tee $LOGS_DIR/CONSUMERS.log" && sleep 0.25 + +echo "--- setting up screens done ---" +screen -ls \ No newline at end of file diff --git a/scripts/pre_setups/init_lava_only_with_node_three_providers.sh b/scripts/pre_setups/init_lava_only_with_node_three_providers.sh index f4c3ea1f59..4d622866e4 100755 --- a/scripts/pre_setups/init_lava_only_with_node_three_providers.sh +++ b/scripts/pre_setups/init_lava_only_with_node_three_providers.sh @@ -20,7 +20,7 @@ echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enou sleep 5 wait_for_lava_node_to_start -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block @@ -57,7 +57,7 @@ echo "[Chaning Epoch Storage Params] submitting param change vote" lavad tx gov submit-legacy-proposal param-change ./cookbook/param_changes/param_change_epoch_params.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE; wait_next_block wait_next_block -lavad tx gov vote 3 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.000000001ulava; +lavad tx gov vote 3 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.00002ulava; screen -d -m -S provider1 bash -c "source ~/.bashrc; lavap rpcprovider \ $PROVIDER1_LISTENER LAV1 rest '$LAVA_REST' \ diff --git a/scripts/pre_setups/init_lava_only_with_node_two_consumers.sh b/scripts/pre_setups/init_lava_only_with_node_two_consumers.sh new file mode 100755 index 0000000000..96f47d65dc --- /dev/null +++ b/scripts/pre_setups/init_lava_only_with_node_two_consumers.sh @@ -0,0 +1,69 @@ +#!/bin/bash +__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source "$__dir"/../useful_commands.sh +. "${__dir}"/../vars/variables.sh + +LOGS_DIR=${__dir}/../../testutil/debugging/logs +mkdir -p $LOGS_DIR +rm $LOGS_DIR/*.log + +killall screen +screen -wipe + +echo "[Test Setup] installing all binaries" +make install-all + +echo "[Test Setup] setting up a new lava node" +screen -d -m -S node bash -c "./scripts/start_env_dev.sh" +screen -ls +echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enough increase timeout)" +sleep 5 +wait_for_lava_node_to_start + +GASPRICE="0.000000001ulava" +lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & +wait_next_block +wait_next_block +lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +sleep 4 + +# Plans proposal +lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json,./cookbook/plans/test_plans/temporary-add.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +wait_next_block +wait_next_block +lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +sleep 4 + +CLIENTSTAKE="500000000000ulava" +PROVIDERSTAKE="500000000000ulava" + +PROVIDER1_LISTENER="127.0.0.1:2220" + +lavad tx subscription buy DefaultPlan $(lavad keys show user1 -a) -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +wait_next_block +lavad tx subscription buy DefaultPlan $(lavad keys show user2 -a) -y --from user2 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +wait_next_block +lavad tx pairing stake-provider "LAV1" $PROVIDERSTAKE "$PROVIDER1_LISTENER,1" 1 $(operator_address) -y --from servicer1 --delegate-limit 1000ulava --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +sleep_until_next_epoch +wait_next_block + +screen -d -m -S provider1 bash -c "source ~/.bashrc; lavap rpcprovider \ +$PROVIDER1_LISTENER LAV1 rest '$LAVA_REST' \ +$PROVIDER1_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC_WS' \ +$PROVIDER1_LISTENER LAV1 grpc '$LAVA_GRPC' \ +$EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level trace --from servicer1 --chain-id lava --metrics-listen-address ":7776" 2>&1 | tee $LOGS_DIR/PROVIDER1.log" && sleep 0.25 + +wait_next_block + +screen -d -m -S consumers bash -c "source ~/.bashrc; lavap rpcconsumer \ +127.0.0.1:3360 LAV1 rest 127.0.0.1:3361 LAV1 tendermintrpc 127.0.0.1:3362 LAV1 grpc \ +$EXTRA_PORTAL_FLAGS --geolocation 1 --log_level trace --from user1 --chain-id lava --add-api-method-metrics --allow-insecure-provider-dialing --metrics-listen-address ":7779" 2>&1 | tee $LOGS_DIR/CONSUMERS.log" && sleep 0.25 + +screen -d -m -S consumers2 bash -c "source ~/.bashrc; lavap rpcconsumer \ +127.0.0.1:3350 LAV1 rest 127.0.0.1:3351 LAV1 tendermintrpc 127.0.0.1:3352 LAV1 grpc \ +$EXTRA_PORTAL_FLAGS --geolocation 1 --log_level trace --from user2 --chain-id lava --add-api-method-metrics --allow-insecure-provider-dialing --metrics-listen-address ":7773" 2>&1 | tee $LOGS_DIR/CONSUMERS2.log" && sleep 0.25 + +echo "--- setting up screens done ---" +screen -ls \ No newline at end of file diff --git a/scripts/pre_setups/init_lava_only_with_node_with_cache.sh b/scripts/pre_setups/init_lava_only_with_node_with_cache.sh index cb195f52ed..366d2d7697 100755 --- a/scripts/pre_setups/init_lava_only_with_node_with_cache.sh +++ b/scripts/pre_setups/init_lava_only_with_node_with_cache.sh @@ -20,7 +20,7 @@ echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enou sleep 5 wait_for_lava_node_to_start -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block @@ -38,15 +38,18 @@ sleep 4 CLIENTSTAKE="500000000000ulava" PROVIDERSTAKE="500000000000ulava" -PROVIDER1_LISTENER="127.0.0.1:2220" +PROVIDER1_LISTENER="127.0.0.1:2221" +PROVIDER2_LISTENER="127.0.0.1:2220" lavad tx subscription buy DefaultPlan $(lavad keys show user1 -a) -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE wait_next_block lavad tx pairing stake-provider "LAV1" $PROVIDERSTAKE "$PROVIDER1_LISTENER,1" 1 $(operator_address) -y --delegate-limit 1000ulava --from servicer1 --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "LAV1" $PROVIDERSTAKE "$PROVIDER2_LISTENER,1,tendermintrpc,rest,grpc,archive" 1 $(operator_address) -y --delegate-limit 1000ulava --from servicer2 --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +lavad tx project set-policy $(lavad keys show user1 -a)-admin ./cookbook/projects/policy_all_chains_with_extension.yml -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE wait_next_block sleep_until_next_epoch - screen -d -m -S cache_consumer bash -c "source ~/.bashrc; lavap cache \ 127.0.0.1:20100 --metrics_address 0.0.0.0:20200 --log_level debug 2>&1 | tee $LOGS_DIR/CACHE_CONSUMER.log" && sleep 0.25 sleep 2; @@ -60,6 +63,9 @@ $PROVIDER1_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC' \ $PROVIDER1_LISTENER LAV1 grpc '$LAVA_GRPC' \ $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer1 --chain-id lava --cache-be 127.0.0.1:20101 --metrics-listen-address ":7776" 2>&1 | tee $LOGS_DIR/PROVIDER1.log" && sleep 0.25 +screen -d -m -S provider2 bash -c "source ~/.bashrc; lavap rpcprovider config/provider_examples/lava_example_archive.yml \ +$EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer2 --chain-id lava --metrics-listen-address ":7777" 2>&1 | tee $LOGS_DIR/PROVIDER2.log" && sleep 0.25 + screen -d -m -S consumers bash -c "source ~/.bashrc; lavap rpcconsumer \ 127.0.0.1:3360 LAV1 rest 127.0.0.1:3361 LAV1 tendermintrpc 127.0.0.1:3362 LAV1 grpc \ $EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 --shared-state --chain-id lava --cache-be 127.0.0.1:20100 --allow-insecure-provider-dialing --metrics-listen-address ":7779" 2>&1 | tee $LOGS_DIR/CONSUMERS.log" && sleep 0.25 diff --git a/scripts/pre_setups/init_lava_only_with_node_with_relayserver.sh b/scripts/pre_setups/init_lava_only_with_node_with_relayserver.sh index 5cdc48075f..a0bbb8a6af 100755 --- a/scripts/pre_setups/init_lava_only_with_node_with_relayserver.sh +++ b/scripts/pre_setups/init_lava_only_with_node_with_relayserver.sh @@ -19,7 +19,7 @@ screen -ls echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enough increase timeout)" sleep 20 -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_lava_static_provider.sh b/scripts/pre_setups/init_lava_static_provider.sh new file mode 100755 index 0000000000..c3e1b57ab3 --- /dev/null +++ b/scripts/pre_setups/init_lava_static_provider.sh @@ -0,0 +1,57 @@ +#!/bin/bash +__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source "$__dir"/../useful_commands.sh +. "${__dir}"/../vars/variables.sh + +LOGS_DIR=${__dir}/../../testutil/debugging/logs +mkdir -p $LOGS_DIR +rm $LOGS_DIR/*.log + +killall screen +screen -wipe + +echo "[Test Setup] installing all binaries" +make install-all + +echo "[Test Setup] setting up a new lava node" +screen -d -m -S node bash -c "./scripts/start_env_dev.sh" +screen -ls +echo "[Lavavisor Setup] sleeping 20 seconds for node to finish setup (if its not enough increase timeout)" +sleep 20 + +GASPRICE="0.00002ulava" +lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & +wait_next_block +wait_next_block +lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +sleep 4 + +# Plans proposal +lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json,./cookbook/plans/test_plans/temporary-add.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +wait_next_block +wait_next_block +lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +sleep 4 + +CLIENTSTAKE="500000000000ulava" +PROVIDERSTAKE="500000000000ulava" + +PROVIDER1_LISTENER="127.0.0.1:2221" +# static configuration +PROVIDER4_LISTENER="127.0.0.1:2220" + +lavad tx subscription buy DefaultPlan $(lavad keys show user1 -a) -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +wait_next_block +lavad tx pairing stake-provider "LAV1" $PROVIDERSTAKE "$PROVIDER1_LISTENER,1" --delegate-limit 0ulava 1 $(operator_address) -y --from servicer1 --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +sleep_until_next_epoch + +screen -d -m -S provider4 bash -c "source ~/.bashrc; lavap rpcprovider provider_examples/lava_example.yml\ +$EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer4 --static-providers --chain-id lava 2>&1 | tee $LOGS_DIR/PROVIDER4.log" && sleep 0.25 + +screen -d -m -S consumers bash -c "source ~/.bashrc; lavap rpcconsumer consumer_examples/lava_consumer_static_peers.yml \ +$EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 --chain-id lava --allow-insecure-provider-dialing --metrics-listen-address ":7779" 2>&1 | tee $LOGS_DIR/CONSUMERS.log" && sleep 0.25 + +echo "--- setting up screens done ---" +screen -ls \ No newline at end of file diff --git a/scripts/pre_setups/init_moralis_only.sh b/scripts/pre_setups/init_moralis_only.sh index 417df0f002..c6be7159cb 100755 --- a/scripts/pre_setups/init_moralis_only.sh +++ b/scripts/pre_setups/init_moralis_only.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/moralis.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_near_only_with_node.sh b/scripts/pre_setups/init_near_only_with_node.sh index 871b65f17b..396bebb672 100755 --- a/scripts/pre_setups/init_near_only_with_node.sh +++ b/scripts/pre_setups/init_near_only_with_node.sh @@ -20,7 +20,7 @@ echo "[Test Setup] sleeping 20 seconds for node to finish setup (if its not enou sleep 5 wait_for_lava_node_to_start -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/near.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_osmosis_only.sh b/scripts/pre_setups/init_osmosis_only.sh index 29ca60443a..cdf41357cf 100755 --- a/scripts/pre_setups/init_osmosis_only.sh +++ b/scripts/pre_setups/init_osmosis_only.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_solana_only.sh b/scripts/pre_setups/init_solana_only.sh index b8bee1b7db..88d94eb70e 100755 --- a/scripts/pre_setups/init_solana_only.sh +++ b/scripts/pre_setups/init_solana_only.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/pre_setups/init_sqdsubgraph_only.sh b/scripts/pre_setups/init_sqdsubgraph_only.sh index c608ca4190..8b467330e2 100755 --- a/scripts/pre_setups/init_sqdsubgraph_only.sh +++ b/scripts/pre_setups/init_sqdsubgraph_only.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/sqdsubgraph.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/init_starknet_addons_only_with_node.sh b/scripts/pre_setups/init_starknet_addons_only_with_node.sh index 3e252e8ad0..00350a01e7 100755 --- a/scripts/pre_setups/init_starknet_addons_only_with_node.sh +++ b/scripts/pre_setups/init_starknet_addons_only_with_node.sh @@ -20,7 +20,7 @@ echo "[Test Setup] waiting lava node to start" sleep 3 wait_for_lava_node_to_start -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block wait_next_block diff --git a/scripts/pre_setups/setup_lavavisor_dev_test.sh b/scripts/pre_setups/setup_lavavisor_dev_test.sh index d9dbf71d29..d13f228c6a 100755 --- a/scripts/pre_setups/setup_lavavisor_dev_test.sh +++ b/scripts/pre_setups/setup_lavavisor_dev_test.sh @@ -31,10 +31,10 @@ lavavisor create-service provider ./config/provider_examples/lava_example.yml -- echo "[Lavavisor Setup] finished creating service files for lavavisor" echo "[Lavavisor Setup] submitting spec proposal" -lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.000000001ulava & +lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.00002ulava & wait_next_block wait_next_block -lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.000000001ulava; +lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.00002ulava; echo "[Lavavisor Setup] adding lavavisor screen" screen -d -m -S lavavisor bash -c "lavavisor start --auto-download 2>&1 | tee $LOGS_DIR/LAVAVISOR.log"; @@ -43,7 +43,7 @@ echo "[Lavavisor Setup] sleeping 10 seconds for lavavisor to finish setup (if it sleep 10 echo "[Lavavisor Setup] submitting param change vote" -lavad tx gov submit-legacy-proposal param-change ./cookbook/param_changes/param_change_version_upgrade.json --from alice -y --gas-adjustment 1.5 --gas auto --gas-prices 0.000000001ulava; +lavad tx gov submit-legacy-proposal param-change ./cookbook/param_changes/param_change_version_upgrade.json --from alice -y --gas-adjustment 1.5 --gas auto --gas-prices 0.00002ulava; wait_next_block wait_next_block -lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.000000001ulava; +lavad tx gov vote 2 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices 0.00002ulava; diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 99de6972ad..3ad976e766 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env /bin/sh +#!/bin/bash + __dir=$(dirname "$0") . $__dir/useful_commands.sh @@ -32,5 +33,5 @@ done cd .. # move proto files to the right places -cp -r github.com/lavanet/lava/* ./ +cp -r github.com/lavanet/lava/v2/* ./ rm -rf github.com diff --git a/scripts/setup_providers.sh b/scripts/setup_providers.sh index d4c0f35c75..a3b5fa9b0d 100755 --- a/scripts/setup_providers.sh +++ b/scripts/setup_providers.sh @@ -1,6 +1,7 @@ #!/bin/bash __dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) . ${__dir}/vars/variables.sh +source $__dir/useful_commands.sh LOGS_DIR=${__dir}/../testutil/debugging/logs mkdir -p $LOGS_DIR rm $LOGS_DIR/*.log @@ -44,7 +45,7 @@ $PROVIDER1_LISTENER OSMOSIS rest '$OSMO_REST' \ $PROVIDER1_LISTENER OSMOSIS tendermintrpc '$OSMO_RPC,$OSMO_RPC' \ $PROVIDER1_LISTENER OSMOSIS grpc '$OSMO_GRPC' \ $PROVIDER1_LISTENER LAV1 rest '$LAVA_REST' \ -$PROVIDER1_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC' \ +$PROVIDER1_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC_WS' \ $PROVIDER1_LISTENER LAV1 grpc '$LAVA_GRPC' \ $PROVIDER1_LISTENER COSMOSHUB rest '$GAIA_REST' \ $PROVIDER1_LISTENER COSMOSHUB tendermintrpc '$GAIA_RPC,$GAIA_RPC' \ @@ -84,7 +85,7 @@ echo; echo "#### Starting provider 2 ####" screen -d -m -S provider2 bash -c "source ~/.bashrc; lavap rpcprovider \ $PROVIDER2_LISTENER ETH1 jsonrpc '$ETH_RPC_WS' \ $PROVIDER2_LISTENER LAV1 rest '$LAVA_REST' \ -$PROVIDER2_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC' \ +$PROVIDER2_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC_WS' \ $PROVIDER2_LISTENER LAV1 grpc '$LAVA_GRPC' \ $EXTRA_PROVIDER_FLAGS --geolocation "$GEOLOCATION" --log_level debug --from servicer2 --chain-id lava 2>&1 | tee $LOGS_DIR/PROVIDER2.log" && sleep 0.25 # $PROVIDER2_LISTENER MANTLE jsonrpc '$MANTLE_JRPC' \ @@ -93,7 +94,7 @@ echo; echo "#### Starting provider 3 ####" screen -d -m -S provider3 bash -c "source ~/.bashrc; lavap rpcprovider \ $PROVIDER3_LISTENER ETH1 jsonrpc '$ETH_RPC_WS' \ $PROVIDER3_LISTENER LAV1 rest '$LAVA_REST' \ -$PROVIDER3_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC' \ +$PROVIDER3_LISTENER LAV1 tendermintrpc '$LAVA_RPC,$LAVA_RPC_WS' \ $PROVIDER3_LISTENER LAV1 grpc '$LAVA_GRPC' \ $EXTRA_PROVIDER_FLAGS --geolocation "$GEOLOCATION" --log_level debug --from servicer3 --chain-id lava 2>&1 | tee $LOGS_DIR/PROVIDER3.log" && sleep 0.25 # $PROVIDER3_LISTENER MANTLE jsonrpc '$MANTLE_JRPC' \ @@ -107,4 +108,6 @@ $EXTRA_PORTAL_FLAGS --cache-be "127.0.0.1:7778" --geolocation "$GEOLOCATION" --d echo "--- setting up screens done ---" screen -ls echo "ETH1 listening on 127.0.0.1:3333" -echo "LAV1 listening on 127.0.0.1:3360 - rest 127.0.0.1:3361 - tendermintpc 127.0.0.1:3362 - grpc" \ No newline at end of file +echo "LAV1 listening on 127.0.0.1:3360 - rest 127.0.0.1:3361 - tendermintpc 127.0.0.1:3362 - grpc" + +validate_env \ No newline at end of file diff --git a/scripts/test/add_validator.sh b/scripts/test/add_validator.sh index a5ab223b49..860c00b849 100755 --- a/scripts/test/add_validator.sh +++ b/scripts/test/add_validator.sh @@ -44,7 +44,7 @@ sed $SED_INLINE \ -e 's/localhost:9091/localhost:8091/' "$path$app" -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" lavad tx bank send $(lavad keys show alice -a) $(lavad keys show validator2 -a --home $home) 10000000000001ulava -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE sleep 3 diff --git a/scripts/test/cli_test.sh b/scripts/test/cli_test.sh index d64f74c32d..90d59fbb18 100755 --- a/scripts/test/cli_test.sh +++ b/scripts/test/cli_test.sh @@ -10,7 +10,7 @@ trace() { ) } -txoptions="-y --from alice --gas-adjustment 1.5 --gas auto --gas-prices 0.000000001ulava" +txoptions="-y --from alice --gas-adjustment 1.5 --gas auto --gas-prices 0.00002ulava" # run the chain echo "setting up lava chain" diff --git a/scripts/test/inich_100_providers.sh b/scripts/test/inich_100_providers.sh new file mode 100755 index 0000000000..367f87df2d --- /dev/null +++ b/scripts/test/inich_100_providers.sh @@ -0,0 +1,131 @@ +#!/bin/bash +__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source $__dir/../useful_commands.sh +. ${__dir}/vars/variables.sh +# Making sure old screens are not running +echo "current vote number $(latest_vote)" +killall screen +screen -wipe +GASPRICE="0.000000001ulava" + +echo; echo "#### Sending proposal for specs ####" +cd ./cookbook/specs/ || exit +lavad tx gov submit-legacy-proposal spec-add ./ibc.json,./tendermint.json,./cosmoswasm.json,./cosmossdk.json,./cosmossdk_45.json,./cosmossdk_full.json,./ethermint.json,./ethereum.json,./cosmoshub.json,./lava.json,./osmosis.json,./fantom.json,./celo.json,./optimism.json,./arbitrum.json,./starknet.json,./aptos.json,./juno.json,./polygon.json,./evmos.json,./base.json,./canto.json,./sui.json,./solana.json,./bsc.json,./axelar.json,./avalanche.json,./fvm.json,./near.json,./sqdsubgraph.json,./agoric.json,./koii.json,./stargaze.json,./blast.json,./secret.json,./celestia.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +cd ../../ || exit +echo; echo "#### Waiting 2 blocks ####" +wait_count_blocks 2 + +echo; echo "#### Voting on specs proposal ####" +lavad tx gov vote "$(latest_vote)" yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 4 blocks ####" +wait_count_blocks 4 +sleep 4 + +echo; echo "#### Sending proposal for test plans add ####" +lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/test_plans/default.json,./cookbook/plans/test_plans/temporary-add.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 2 blocks ####" +wait_count_blocks 2 + +echo; echo "#### Voting on plans test add proposal ####" +lavad tx gov vote "$(latest_vote)" yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 4 blocks ####" +wait_count_blocks 2 + +echo; echo "#### Sending proposal for plans add ####" +lavad tx gov submit-legacy-proposal plans-add ./cookbook/plans/explorer.json,./cookbook/plans/adventurer.json,./cookbook/plans/whale.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 2 blocks ####" +wait_count_blocks 2 + +echo; echo "#### Voting on plans add proposal ####" +lavad tx gov vote "$(latest_vote)" yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 4 blocks ####" +wait_count_blocks 4 + +PROVIDERSTAKE="500000000000ulava" + +PROVIDER1_LISTENER="127.0.0.1:2221" +PROVIDER2_LISTENER="127.0.0.1:2222" +PROVIDER3_LISTENER="127.0.0.1:2223" + +sleep 4 + +echo; echo "#### Sending proposal for plans del ####" +lavad tx gov submit-legacy-proposal plans-del ./cookbook/plans/test_plans/temporary-del.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 2 blocks ####" +wait_count_blocks 2 + +echo; echo "#### Voting on plans del proposal ####" +lavad tx gov vote "$(latest_vote)" yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Sending proposal for plans del ####" +lavad tx subscription buy DefaultPlan "$(lavad keys show user1 -a)" --enable-auto-renewal -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +# wait_count_blocks 2 +# lavad tx project set-policy $(lavad keys show user1 -a)-admin ./cookbook/projects/policy_all_chains_with_addon.yml -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +# MANTLE +CHAINS="ETH1,SEP1,HOL1,OSMOSIS,FTM250,CELO,LAV1,OSMOSIST,ALFAJORES,ARB1,ARBN,APT1,STRK,JUN1,COSMOSHUB,POLYGON1,EVMOS,OPTM,BASES,CANTO,SUIT,SOLANA,BSC,AXELAR,AVAX,FVM,NEAR,SQDSUBGRAPH,AGR,AGRT,KOIIT,AVAXT,CELESTIATM" +BASE_CHAINS="ETH1,LAV1" +# stake providers on all chains +echo; echo "#### Staking provider 1 ####" +lavad tx pairing bulk-stake-provider $CHAINS $PROVIDERSTAKE "$PROVIDER1_LISTENER,1" 1 "$(operator_address)" -y --delegate-commission 50 --delegate-limit $PROVIDERSTAKE --from servicer1 --provider-moniker "servicer1" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Staking provider 2 ####" +lavad tx pairing bulk-stake-provider $BASE_CHAINS $PROVIDERSTAKE "$PROVIDER2_LISTENER,1" 1 "$(operator_address)" -y --delegate-commission 50 --delegate-limit $PROVIDERSTAKE --from servicer2 --provider-moniker "servicer2" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Staking provider 3 ####" +lavad tx pairing bulk-stake-provider $BASE_CHAINS $PROVIDERSTAKE "$PROVIDER3_LISTENER,1" 1 "$(operator_address)" -y --delegate-commission 50 --delegate-limit $PROVIDERSTAKE --from servicer3 --provider-moniker "servicer3" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Staking 100 providers ####" +users=() +for i in $(seq 1 100); do + users+=("useroren$i") +done + +for user in "${users[@]}"; do + lavad tx pairing stake-provider ETH1 600000000000ulava "127.0.0.1:2221,EU" EU "$(operator_address)" --from $user -y --provider-moniker $user --gas-adjustment "1.5" --gas "auto" --gas-prices 0.000000001ulava --delegate-limit 0ulava +done + +echo; echo "#### Waiting 1 block ####" +wait_count_blocks 1 + +echo; echo "#### Delegating provider 1 ####" +lavad tx dualstaking delegate "$(lavad keys show servicer1 -a)" ETH1 "$(operator_address)" $PROVIDERSTAKE -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 1 block ####" +wait_count_blocks 1 + +echo; echo "#### Delegating provider 2 ####" +lavad tx dualstaking delegate "$(lavad keys show servicer2 -a)" ETH1 "$(operator_address)" $PROVIDERSTAKE -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +echo; echo "#### Waiting 1 block ####" +wait_count_blocks 1 + +echo; echo "#### Delegating provider 3 ####" +lavad tx dualstaking delegate "$(lavad keys show servicer3 -a)" ETH1 "$(operator_address)" $PROVIDERSTAKE -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +# we need to wait for the next epoch for the stake to take action. +echo; echo "#### Waiting 1 epoch ####" +sleep_until_next_epoch + +HEALTH_FILE="config/health_examples/health_template.yml" +create_health_config $HEALTH_FILE "$(lavad keys show user1 -a)" "$(lavad keys show servicer2 -a)" "$(lavad keys show servicer3 -a)" + +lavad tx gov submit-legacy-proposal set-iprpc-data 1000000000ulava --min-cost 100ulava --add-subscriptions "$(lavad keys show -a user1)" --from alice -y +wait_count_blocks 1 +lavad tx gov vote "$(latest_vote)" yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE + +for user in "${users[@]}"; do + lavad tx pairing stake-provider ETH1 600000000000ulava "127.0.0.1:2221,EU" EU "$(operator_address)" --from $user -y --provider-moniker $user --gas-adjustment "1.5" --gas "auto" --gas-prices 0.000000001ulava --delegate-limit 0ulava +done + +wait_count_blocks 1 + +for user in "${users[@]}"; do + lavad q pairing get-pairing ETH1 user1 +done \ No newline at end of file diff --git a/scripts/test/init_chain_100_providers.sh b/scripts/test/init_chain_100_providers.sh new file mode 100755 index 0000000000..403faf6fa5 --- /dev/null +++ b/scripts/test/init_chain_100_providers.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# make install-all +killall -9 lavad +__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source $__dir/../useful_commands.sh + +# Check if jq is not installed +if ! command_exists jq; then + echo "jq not found. Please install jq using the init_install.sh script or manually." + exit 1 +fi + +rm -rf ~/.lava +chainID="lava" +lavad init validator --chain-id $chainID +lavad config broadcast-mode sync +lavad config keyring-backend test + +# Specify the file path, field to edit, and new value +path="$HOME/.lava/config/" +genesis='genesis.json' +config='config.toml' +app='app.toml' + +# Edit genesis file +if [ "$1" == "debug" ]; then + # Edit genesis file with additional line + data=$(cat "$path$genesis" \ + | jq '.app_state.gov.params.min_deposit[0].denom = "ulava"' \ + | jq '.app_state.gov.params.min_deposit[0].amount = "100"' \ + | jq '.app_state.gov.params.voting_period = "4s"' \ + | jq '.app_state.gov.params.expedited_voting_period = "3s"' \ + | jq '.app_state.gov.params.expedited_min_deposit[0].denom = "ulava"' \ + | jq '.app_state.gov.params.expedited_min_deposit[0].amount = "200"' \ + | jq '.app_state.gov.params.expedited_threshold = "0.67"' \ + | jq '.app_state.mint.params.mint_denom = "ulava"' \ + | jq '.app_state.staking.params.bond_denom = "ulava"' \ + | jq '.app_state.crisis.constant_fee.denom = "ulava"' \ + | jq '.app_state.epochstorage.params.epochsToSave = "5"' \ + | jq '.app_state.epochstorage.params.epochBlocks = "4"' \ + | jq '.app_state.distribution.params.community_tax = "0"' \ + | jq '.app_state.rewards.params.validators_subscription_participation = "0"' \ + | jq '.app_state.downtime.params.downtime_duration = "1s"' \ + ) +else + # Edit genesis file without the additional line + data=$(cat "$path$genesis" \ + | jq '.app_state.gov.params.min_deposit[0].denom = "ulava"' \ + | jq '.app_state.gov.params.min_deposit[0].amount = "100"' \ + | jq '.app_state.gov.params.voting_period = "4s"' \ + | jq '.app_state.gov.params.expedited_voting_period = "3s"' \ + | jq '.app_state.gov.params.expedited_min_deposit[0].denom = "ulava"' \ + | jq '.app_state.gov.params.expedited_min_deposit[0].amount = "200"' \ + | jq '.app_state.gov.params.expedited_threshold = "0.67"' \ + | jq '.app_state.mint.params.mint_denom = "ulava"' \ + | jq '.app_state.mint.params.mint_denom = "ulava"' \ + | jq '.app_state.staking.params.bond_denom = "ulava"' \ + | jq '.app_state.crisis.constant_fee.denom = "ulava"' \ + | jq '.app_state.downtime.params.downtime_duration = "6s"' \ + | jq '.app_state.downtime.params.epoch_duration = "10s"' \ + | jq '.app_state.epochstorage.params.epochsToSave = "8"' \ + | jq '.app_state.epochstorage.params.epochBlocks = "20"' \ + | jq '.app_state.pairing.params.recommendedEpochNumToCollectPayment = "2"' \ + ) +fi + +echo -n "$data" > "$path$genesis" + +echo "using genesis file" +echo "$(cat "$path$genesis")" + +# Determine OS +case "$(uname)" in + Darwin) + SED_INLINE="-i ''" ;; + Linux) + SED_INLINE="-i" ;; + *) + echo "unknown system: $(uname)" + exit 1 ;; +esac + + +sed $SED_INLINE \ +-e 's/timeout_propose = .*/timeout_propose = "1s"/' \ +-e 's/timeout_propose_delta = .*/timeout_propose_delta = "500ms"/' \ +-e 's/timeout_prevote = .*/timeout_prevote = "1s"/' \ +-e 's/timeout_prevote_delta = .*/timeout_prevote_delta = "500ms"/' \ +-e 's/timeout_precommit = .*/timeout_precommit = "500ms"/' \ +-e 's/timeout_precommit_delta = .*/timeout_precommit_delta = "1s"/' \ +-e 's/timeout_commit = .*/timeout_commit = "1s"/' \ +-e 's/skip_timeout_commit = .*/skip_timeout_commit = false/' "$path$config" + +# Edit app.toml file +sed $SED_INLINE -e "s/enable = .*/enable = true/" "$path$app" +sed $SED_INLINE -e "/Enable defines if the Rosetta API server should be enabled.*/{n;s/enable = .*/enable = false/}" "$path$app" + +# Add users +users=("alice" "bob" "user1" "user2" "user3" "user4" "user5" "servicer1" "servicer2" "servicer3" "servicer4" "servicer5" "servicer6" "servicer7" "servicer8" "servicer9" "servicer10" "useroren1" "useroren2" "useroren3" "useroren4" "useroren5" "useroren6" "useroren7" "useroren8" "useroren9" "useroren10" "useroren11" "useroren12" "useroren13" "useroren14" "useroren15" "useroren16" "useroren17" "useroren18" "useroren19" "useroren20" "useroren21" "useroren22" "useroren23" "useroren24" "useroren25" "useroren26" "useroren27" "useroren28" "useroren29" "useroren30" "useroren31" "useroren32" "useroren33" "useroren34" "useroren35" "useroren36" "useroren37" "useroren38" "useroren39" "useroren40" "useroren41" "useroren42" "useroren43" "useroren44" "useroren45" "useroren46" "useroren47" "useroren48" "useroren49" "useroren50" "useroren51" "useroren52" "useroren53" "useroren54" "useroren55" "useroren56" "useroren57" "useroren58" "useroren59" "useroren60" "useroren61" "useroren62" "useroren63" "useroren64" "useroren65" "useroren66" "useroren67" "useroren68" "useroren69" "useroren70" "useroren71" "useroren72" "useroren73" "useroren74" "useroren75" "useroren76" "useroren77" "useroren78" "useroren79" "useroren80" "useroren81" "useroren82" "useroren83" "useroren84" "useroren85" "useroren86" "useroren87" "useroren88" "useroren89" "useroren90" "useroren91" "useroren92" "useroren93" "useroren94" "useroren95" "useroren96" "useroren97" "useroren98" "useroren99" "useroren100") + +for user in "${users[@]}"; do + lavad keys add "$user" --keyring-backend test + lavad add-genesis-account "$user" 50000000000000ulava --keyring-backend test +done + +# add validators_allocation_pool for validators block rewards +# its total balance is 3% from the total tokens amount: 10^9 * 10^6 ulava +lavad add-genesis-account validators_rewards_allocation_pool 30000000000000ulava --module-account +if [ "$1" == "debug" ]; then + lavad add-genesis-account providers_rewards_allocation_pool 0ulava --module-account +else + lavad add-genesis-account providers_rewards_allocation_pool 30000000000000ulava --module-account +fi +lavad add-genesis-account iprpc_pool 0ulava --module-account +lavad gentx alice 10000000000000ulava --chain-id $chainID --keyring-backend test +lavad collect-gentxs +lavad start --pruning=nothing \ No newline at end of file diff --git a/scripts/test/init_e2e.sh b/scripts/test/init_e2e.sh index c6af810a8e..4a1eb1c861 100755 --- a/scripts/test/init_e2e.sh +++ b/scripts/test/init_e2e.sh @@ -5,7 +5,7 @@ set -e __dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $__dir/../useful_commands.sh -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" # Specs proposal echo ---- Specs proposal ---- @@ -31,18 +31,18 @@ wait_next_block lavad tx gov vote 3 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE STAKE="500000000000ulava" -lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2221,1,archive,debug" 1 $(operator_address) -y --from servicer1 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2222,1" 1 $(operator_address) -y --from servicer2 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2223,1" 1 $(operator_address) -y --from servicer3 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2224,1" 1 $(operator_address) -y --from servicer4 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2225,1" 1 $(operator_address) -y --from servicer5 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2221,1,archive,debug" 1 $(operator_address) -y --from servicer1 --delegate-limit $STAKE --provider-moniker "servicer1" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2222,1" 1 $(operator_address) -y --from servicer2 --delegate-limit $STAKE --provider-moniker "servicer2" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2223,1" 1 $(operator_address) -y --from servicer3 --delegate-limit $STAKE --provider-moniker "servicer3" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2224,1" 1 $(operator_address) -y --from servicer4 --delegate-limit $STAKE --provider-moniker "servicer4" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "ETH1" $STAKE "127.0.0.1:2225,1" 1 $(operator_address) -y --from servicer5 --delegate-limit $STAKE --provider-moniker "servicer5" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE # Lava tendermint/rest providers -lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2261,1" 1 $(operator_address) -y --from servicer6 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2262,1" 1 $(operator_address) -y --from servicer7 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2263,1" 1 $(operator_address) -y --from servicer8 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2264,1" 1 $(operator_address) -y --from servicer9 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE -lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2265,1" 1 $(operator_address) -y --from servicer10 --delegate-limit $STAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2261,1" 1 $(operator_address) -y --from servicer6 --delegate-limit $STAKE --provider-moniker "servicer6" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2262,1" 1 $(operator_address) -y --from servicer7 --delegate-limit $STAKE --provider-moniker "servicer7" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2263,1" 1 $(operator_address) -y --from servicer8 --delegate-limit $STAKE --provider-moniker "servicer8" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2264,1" 1 $(operator_address) -y --from servicer9 --delegate-limit $STAKE --provider-moniker "servicer9" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx pairing stake-provider "LAV1" $STAKE "127.0.0.1:2265,1" 1 $(operator_address) -y --from servicer10 --delegate-limit $STAKE --provider-moniker "servicer10" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE # subscribed clients # (actually, only user1 is used in testutils/e2e/e2e.go, but having same count @@ -72,7 +72,7 @@ if [ "$plan_index" != "DefaultPlan" ]; then "echo subscription ${user1addr}: wro user3addr=$(lavad keys show user3 -a) # add debug addons and archive wait_next_block -lavad tx project set-policy $(lavad keys show user1 -a)-admin ./testutil/e2e/e2eProviderConfigs/consumer_policy.yml -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE +lavad tx project set-policy $(lavad keys show user1 -a)-admin ./testutil/e2e/e2eConfigs/policies/consumer_policy.yml -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE wait_next_block lavad tx subscription add-project "myproject1" -y --from user3 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE wait_next_block diff --git a/scripts/test/init_e2e_lava_over_lava.sh b/scripts/test/init_e2e_lava_over_lava.sh index c40dcbd8e2..2c0697c24d 100755 --- a/scripts/test/init_e2e_lava_over_lava.sh +++ b/scripts/test/init_e2e_lava_over_lava.sh @@ -3,7 +3,7 @@ __dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $__dir/../useful_commands.sh set -e -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" NODE="http://127.0.0.1:3340/1" STAKE="500000000000ulava" diff --git a/scripts/test/init_payment_e2e.sh b/scripts/test/init_payment_e2e.sh index 35f72d0c67..4e0d5293c3 100755 --- a/scripts/test/init_payment_e2e.sh +++ b/scripts/test/init_payment_e2e.sh @@ -5,7 +5,7 @@ set -e __dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $__dir/../useful_commands.sh -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" # Specs proposal lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/cosmoswasm.json,./cookbook/specs/ibc.json,./cookbook/specs/tendermint.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/lava.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE diff --git a/scripts/test/jail_provider_test.sh b/scripts/test/jail_provider_test.sh index db0863ce93..878754b542 100755 --- a/scripts/test/jail_provider_test.sh +++ b/scripts/test/jail_provider_test.sh @@ -9,7 +9,7 @@ rm $LOGS_DIR/*.log echo "current vote number $(latest_vote)" killall screen screen -wipe -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" # ,./cookbook/specs/mantle.json lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_45.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/lava.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & diff --git a/scripts/test/unstake_100_providers.sh b/scripts/test/unstake_100_providers.sh new file mode 100755 index 0000000000..6f629dc9ed --- /dev/null +++ b/scripts/test/unstake_100_providers.sh @@ -0,0 +1,18 @@ +#!/bin/bash +__dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source $__dir/../useful_commands.sh +. ${__dir}/vars/variables.sh +# Making sure old screens are not running +echo "current vote number $(latest_vote)" +killall screen +screen -wipe +GASPRICE="0.000000001ulava" + +for i in $(seq 1 100); do + users+=("useroren$i") +done + +for user in "${users[@]}"; do + lavad tx pairing unstake-provider ETH1 "$(operator_address)" --from $user -y --gas-adjustment "1.5" --gas "auto" --gas-prices "$GASPRICE" + echo "Unstake failed for user: $user" >&2 +done \ No newline at end of file diff --git a/scripts/test_spec_full.sh b/scripts/test_spec_full.sh index 621c00647d..795fe4581e 100755 --- a/scripts/test_spec_full.sh +++ b/scripts/test_spec_full.sh @@ -66,7 +66,7 @@ if [ "$dry" = false ]; then sleep 5 wait_for_lava_node_to_start - GASPRICE="0.000000001ulava" + GASPRICE="0.00002ulava" # add all existing specs so inheritance works lavad tx gov submit-legacy-proposal spec-add ${__dir}/../cookbook/specs/ibc.json,${__dir}/../cookbook/specs/cosmoswasm.json,${__dir}/../cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,${__dir}/../cookbook/specs/cosmossdk_45.json,${__dir}/../cookbook/specs/cosmossdk_full.json,${__dir}/../cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,${__dir}/../cookbook/specs/cosmoshub.json,${__dir}/../cookbook/specs/lava.json,${__dir}/../cookbook/specs/osmosis.json,${__dir}/../cookbook/specs/fantom.json,${__dir}/../cookbook/specs/celo.json,${__dir}/../cookbook/specs/optimism.json,${__dir}/../cookbook/specs/arbitrum.json,${__dir}/../cookbook/specs/starknet.json,${__dir}/../cookbook/specs/aptos.json,${__dir}/../cookbook/specs/juno.json,${__dir}/../cookbook/specs/polygon.json,${__dir}/../cookbook/specs/evmos.json,${__dir}/../cookbook/specs/base.json,${__dir}/../cookbook/specs/canto.json,${__dir}/../cookbook/specs/sui.json,${__dir}/../cookbook/specs/solana.json,${__dir}/../cookbook/specs/bsc.json,${__dir}/../cookbook/specs/axelar.json,${__dir}/../cookbook/specs/avalanche.json,${__dir}/../cookbook/specs/fvm.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE & wait_next_block @@ -122,7 +122,7 @@ fi ## Handle Provider ## -input_yaml="${__dir}/../config/provider_examples/test_spec_template.yml" +input_yaml="${__dir}/../config/provider_examples/test_spec_template.yml" #if testing archive change to test_spec_template_archive.yml output_yaml="${LOGS_DIR}/provider.yml" line_numbers=() @@ -135,7 +135,7 @@ copy_content() { local end_line="$2" local index="$3" local url="$4" - awk -v s="$start_line" -v e="$end_line" -v idx="$index" -v url="$url" 'NR >= s && NR <= e {sub("RELACE_THIS_URL", url, $0);sub("INDEX_RELACE_THIS", idx, $0);print}' "$input_yaml" >> "$output_yaml" + awk -v s="$start_line" -v e="$end_line" -v idx="$index" -v url="$url" 'NR >= s && NR <= e {sub("REPLACE_THIS_URL", url, $0);sub("INDEX_REPLACE_THIS", idx, $0);print}' "$input_yaml" >> "$output_yaml" } head -n 1 "$input_yaml" >> "$output_yaml" diff --git a/scripts/upgrade_proposal.sh b/scripts/upgrade_proposal.sh index 7a062600db..3950365168 100755 --- a/scripts/upgrade_proposal.sh +++ b/scripts/upgrade_proposal.sh @@ -3,7 +3,7 @@ __dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $__dir/useful_commands.sh . ${__dir}/vars/variables.sh -GASPRICE="0.000000001ulava" +GASPRICE="0.00002ulava" if [ -z "$1" ]; then versionName="vtest" @@ -24,7 +24,7 @@ lavad tx gov submit-legacy-proposal software-upgrade $versionName \ --from alice \ --description "lala" \ --keyring-backend "test" \ ---gas-prices "0.000000001ulava" \ +--gas-prices "0.00002ulava" \ --gas-adjustment "1.5" \ --deposit 10000000ulava \ --yes diff --git a/scripts/useful_commands.sh b/scripts/useful_commands.sh index 2b8ba5c026..e6ac07bbbf 100755 --- a/scripts/useful_commands.sh +++ b/scripts/useful_commands.sh @@ -138,4 +138,34 @@ wait_for_lava_node_to_start() { operator_address() { lavad q staking validators -o json | jq -r '.validators[0].operator_address' +} + + +validate_env() { +# Array of variables to check +required_vars=( + ETH_RPC_WS SEP_RPC_WS HOL_RPC_WS FTM_RPC_HTTP CELO_HTTP + CELO_ALFAJORES_HTTP ARB1_HTTP APTOS_REST STARKNET_RPC POLYGON_MAINNET_RPC + OPTIMISM_RPC BASE_RPC BSC_RPC SOLANA_RPC SUI_RPC OSMO_REST OSMO_RPC OSMO_GRPC + LAVA_REST LAVA_RPC LAVA_RPC_WS LAVA_GRPC GAIA_REST GAIA_RPC GAIA_GRPC JUNO_REST + JUNO_RPC JUNO_GRPC EVMOS_RPC EVMOS_TENDERMINTRPC EVMOS_REST EVMOS_GRPC CANTO_RPC + CANTO_TENDERMINT CANTO_REST CANTO_GRPC AXELAR_RPC_HTTP AXELAR_REST AXELAR_GRPC + AVALANCH_PJRPC AVALANCHT_PJRPC FVM_JRPC NEAR_JRPC AGORIC_REST AGORIC_GRPC + KOIITRPC AGORIC_RPC AGORIC_TEST_REST AGORIC_TEST_GRPC AGORIC_TEST_RPC + STARGAZE_RPC_HTTP STARGAZE_REST STARGAZE_GRPC +) + +echo "" +echo "---------------------------------------------" +echo "- ENV Validation -" +echo "---------------------------------------------" +# Check each variable and print a warning if not set +for var in "${required_vars[@]}"; do + if [ -z "${!var}" ]; then + echo "Warning: Variable '$var' is not set or is empty." + fi +done +echo "---------------------------------------------" +echo "- ENV Validation Done -" +echo "---------------------------------------------" } \ No newline at end of file diff --git a/testutil/common/common.go b/testutil/common/common.go index b84f0c9ee7..cf4fb2f074 100644 --- a/testutil/common/common.go +++ b/testutil/common/common.go @@ -2,18 +2,19 @@ package common import ( "context" + "encoding/json" "testing" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - conflictconstruct "github.com/lavanet/lava/x/conflict/types/construct" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + conflictconstruct "github.com/lavanet/lava/v2/x/conflict/types/construct" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) @@ -30,7 +31,19 @@ func StakeAccount(t *testing.T, ctx context.Context, keepers testkeeper.Keepers, for _, collection := range spec.ApiCollections { endpoints = append(endpoints, epochstoragetypes.Endpoint{IPPORT: "123", ApiInterfaces: []string{collection.CollectionData.ApiInterface}, Geolocation: 1}) } - _, err := servers.PairingServer.StakeProvider(ctx, &types.MsgStakeProvider{Creator: acc.Addr.String(), Address: acc.Addr.String(), ChainID: spec.Index, Amount: sdk.NewCoin(keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)), sdk.NewInt(stake)), Geolocation: 1, Endpoints: endpoints, DelegateLimit: sdk.NewCoin(keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)), sdk.ZeroInt()), DelegateCommission: 100, Validator: sdk.ValAddress(validator.Addr).String(), Description: MockDescription()}) + + _, err := servers.PairingServer.StakeProvider(ctx, &pairingtypes.MsgStakeProvider{ + Creator: acc.Addr.String(), + Address: acc.Addr.String(), + ChainID: spec.Index, + Amount: sdk.NewCoin(keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)), sdk.NewInt(stake)), + Geolocation: 1, + Endpoints: endpoints, + DelegateLimit: sdk.NewCoin(keepers.StakingKeeper.BondDenom(sdk.UnwrapSDKContext(ctx)), sdk.ZeroInt()), + DelegateCommission: 100, + Validator: sdk.ValAddress(validator.Addr).String(), + Description: MockDescription(), + }) require.NoError(t, err) } @@ -42,16 +55,16 @@ func MockDescription() stakingtypes.Description { return stakingtypes.NewDescription("prov", "iden", "web", "sec", "details") } -func BuildRelayRequest(ctx context.Context, provider string, contentHash []byte, cuSum uint64, spec string, qos *types.QualityOfServiceReport) *types.RelaySession { +func BuildRelayRequest(ctx context.Context, provider string, contentHash []byte, cuSum uint64, spec string, qos *pairingtypes.QualityOfServiceReport) *pairingtypes.RelaySession { return BuildRelayRequestWithBadge(ctx, provider, contentHash, uint64(1), cuSum, spec, qos, nil) } -func BuildRelayRequestWithSession(ctx context.Context, provider string, contentHash []byte, sessionId uint64, cuSum uint64, spec string, qos *types.QualityOfServiceReport) *types.RelaySession { +func BuildRelayRequestWithSession(ctx context.Context, provider string, contentHash []byte, sessionId uint64, cuSum uint64, spec string, qos *pairingtypes.QualityOfServiceReport) *pairingtypes.RelaySession { return BuildRelayRequestWithBadge(ctx, provider, contentHash, sessionId, cuSum, spec, qos, nil) } -func BuildRelayRequestWithBadge(ctx context.Context, provider string, contentHash []byte, sessionId uint64, cuSum uint64, spec string, qos *types.QualityOfServiceReport, badge *types.Badge) *types.RelaySession { - relaySession := &types.RelaySession{ +func BuildRelayRequestWithBadge(ctx context.Context, provider string, contentHash []byte, sessionId uint64, cuSum uint64, spec string, qos *pairingtypes.QualityOfServiceReport, badge *pairingtypes.Badge) *pairingtypes.RelaySession { + relaySession := &pairingtypes.RelaySession{ Provider: provider, ContentHash: contentHash, SessionId: sessionId, @@ -69,12 +82,70 @@ func BuildRelayRequestWithBadge(ctx context.Context, provider string, contentHas return relaySession } -func CreateMsgDetectionTest(ctx context.Context, consumer, provider0, provider1 sigs.Account, spec spectypes.Spec) (detectionMsg *conflicttypes.MsgDetection, reply1, reply2 *types.RelayReply, errRet error) { - msg := &conflicttypes.MsgDetection{} - msg.Creator = consumer.Addr.String() - // request 0 - msg.ResponseConflict = &conflicttypes.ResponseConflict{ConflictRelayData0: &conflicttypes.ConflictRelayData{Request: &types.RelayRequest{}, Reply: &conflicttypes.ReplyMetadata{}}, ConflictRelayData1: &conflicttypes.ConflictRelayData{Request: &types.RelayRequest{}, Reply: &conflicttypes.ReplyMetadata{}}} - msg.ResponseConflict.ConflictRelayData0.Request.RelayData = &types.RelayPrivateData{ +func CreateResponseConflictMsgDetectionForTest(ctx context.Context, consumer, provider0, provider1 sigs.Account, spec *spectypes.Spec) (detectionMsg *conflicttypes.MsgDetection, reply1, reply2 *pairingtypes.RelayReply, errRet error) { + detectionMsg = &conflicttypes.MsgDetection{ + Creator: consumer.Addr.String(), + Conflict: &conflicttypes.MsgDetection_ResponseConflict{ + ResponseConflict: &conflicttypes.ResponseConflict{ + ConflictRelayData0: initConflictRelayData(), + ConflictRelayData1: initConflictRelayData(), + }, + }, + } + + responseConflict := detectionMsg.GetResponseConflict() + // Prepare request and session for provider0. + prepareRelayData(ctx, responseConflict.ConflictRelayData0, provider0, spec) + // Sign the session data with the consumer's private key. + if err := signSessionData(consumer, responseConflict.ConflictRelayData0.Request.RelaySession); err != nil { + return detectionMsg, nil, nil, err + } + + // Duplicate the request for provider1 and update provider-specific fields. + duplicateRequestForProvider(responseConflict, provider1, consumer) + // Sign the session data with the consumer's private key. + if err := signSessionData(consumer, responseConflict.ConflictRelayData1.Request.RelaySession); err != nil { + return detectionMsg, nil, nil, err + } + + // Create and sign replies for both providers. + reply1, err := createAndSignReply(provider0, responseConflict.ConflictRelayData0.Request, spec, false) + if err != nil { + return detectionMsg, nil, nil, err + } + + reply2, err = createAndSignReply(provider1, responseConflict.ConflictRelayData1.Request, spec, true) + if err != nil { + return detectionMsg, nil, nil, err + } + + // Construct final conflict relay data with the replies. + conflictRelayData0, err := finalizeConflictRelayData(consumer, provider0, responseConflict.ConflictRelayData0, reply1) + if err != nil { + return detectionMsg, nil, nil, err + } + conflictRelayData1, err := finalizeConflictRelayData(consumer, provider1, responseConflict.ConflictRelayData1, reply2) + if err != nil { + return detectionMsg, nil, nil, err + } + + responseConflict.ConflictRelayData0 = conflictRelayData0 + responseConflict.ConflictRelayData1 = conflictRelayData1 + + return detectionMsg, reply1, reply2, nil +} + +// initConflictRelayData initializes the structure for holding relay conflict data. +func initConflictRelayData() *conflicttypes.ConflictRelayData { + return &conflicttypes.ConflictRelayData{ + Request: &pairingtypes.RelayRequest{}, + Reply: &conflicttypes.ReplyMetadata{}, + } +} + +// prepareRelayData prepares relay data for a given provider. +func prepareRelayData(ctx context.Context, conflictData *conflicttypes.ConflictRelayData, provider sigs.Account, spec *spectypes.Spec) { + relayData := &pairingtypes.RelayPrivateData{ ConnectionType: "", ApiUrl: "", Data: []byte("DUMMYREQUEST"), @@ -83,75 +154,104 @@ func CreateMsgDetectionTest(ctx context.Context, consumer, provider0, provider1 Salt: []byte{1}, } - msg.ResponseConflict.ConflictRelayData0.Request.RelaySession = &types.RelaySession{ - Provider: provider0.Addr.String(), - ContentHash: sigs.HashMsg(msg.ResponseConflict.ConflictRelayData0.Request.RelayData.GetContentHashData()), + conflictData.Request.RelayData = relayData + conflictData.Request.RelaySession = &pairingtypes.RelaySession{ + Provider: provider.Addr.String(), + ContentHash: sigs.HashMsg(relayData.GetContentHashData()), SessionId: uint64(1), SpecId: spec.Index, CuSum: 0, Epoch: sdk.UnwrapSDKContext(ctx).BlockHeight(), RelayNum: 0, - QosReport: &types.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, + QosReport: &pairingtypes.QualityOfServiceReport{Latency: sdk.OneDec(), Availability: sdk.OneDec(), Sync: sdk.OneDec()}, } +} - sig, err := sigs.Sign(consumer.SK, *msg.ResponseConflict.ConflictRelayData0.Request.RelaySession) +// signSessionData signs the session data with the consumer's private key. +func signSessionData(consumer sigs.Account, relaySession *pairingtypes.RelaySession) error { + sig, err := sigs.Sign(consumer.SK, *relaySession) if err != nil { - return msg, nil, nil, err + return err } - msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Sig = sig + relaySession.Sig = sig + return nil +} + +// duplicateRequestForProvider duplicates request data for another provider and signs it. +func duplicateRequestForProvider(conflict *conflicttypes.ResponseConflict, provider, consumer sigs.Account) { + // Clone request data + temp, _ := conflict.ConflictRelayData0.Request.Marshal() + conflict.ConflictRelayData1.Request.Unmarshal(temp) - // request 1 - temp, _ := msg.ResponseConflict.ConflictRelayData0.Request.Marshal() - msg.ResponseConflict.ConflictRelayData1.Request.Unmarshal(temp) - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider = provider1.Addr.String() - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Sig = []byte{} - sig, err = sigs.Sign(consumer.SK, *msg.ResponseConflict.ConflictRelayData1.Request.RelaySession) - if err != nil { - return msg, nil, nil, err + conflict.ConflictRelayData1.Request.RelaySession.Provider = provider.Addr.String() + conflict.ConflictRelayData1.Request.RelaySession.Sig = []byte{} +} + +// createAndSignReply creates a reply for a provider and signs it. +func createAndSignReply(provider sigs.Account, request *pairingtypes.RelayRequest, spec *spectypes.Spec, addDiffData bool) (*pairingtypes.RelayReply, error) { + reply := &pairingtypes.RelayReply{ + Data: []byte("DUMMYREPLY"), + Sig: request.RelaySession.Sig, + LatestBlock: request.RelayData.RequestBlock + int64(spec.BlockDistanceForFinalizedData), } - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Sig = sig - // reply 0 - reply := &types.RelayReply{ - Data: []byte("DUMMYREPLY"), - Sig: sig, - LatestBlock: msg.ResponseConflict.ConflictRelayData0.Request.RelayData.RequestBlock + int64(spec.BlockDistanceForFinalizedData), - FinalizedBlocksHashes: []byte{}, - SigBlocks: sig, - Metadata: []types.Metadata{}, + if addDiffData { + reply.Data = append(reply.Data, []byte("DIFF")...) } - relayExchange := types.NewRelayExchange(*msg.ResponseConflict.ConflictRelayData0.Request, *reply) - sig, err = sigs.Sign(provider0.SK, relayExchange) + + relayExchange := pairingtypes.NewRelayExchange(*request, *reply) + sig, err := sigs.Sign(provider.SK, relayExchange) if err != nil { - return msg, nil, nil, err + return reply, err } + reply.Sig = sig - relayFinalization := types.NewRelayFinalization(types.NewRelayExchange(*msg.ResponseConflict.ConflictRelayData0.Request, *reply), consumer.Addr) - sigBlocks, err := sigs.Sign(provider0.SK, relayFinalization) + return reply, nil +} + +// finalizeConflictRelayData updates the conflict relay data with the reply information. +func finalizeConflictRelayData(consumer, provider sigs.Account, conflictData *conflicttypes.ConflictRelayData, reply *pairingtypes.RelayReply) (*conflicttypes.ConflictRelayData, error) { + relayFinalization := conflicttypes.NewRelayFinalizationFromRelaySessionAndRelayReply(conflictData.Request.RelaySession, reply, consumer.Addr) + sigBlocks, err := sigs.Sign(provider.SK, relayFinalization) if err != nil { - return msg, nil, nil, err + return nil, err } + reply.SigBlocks = sigBlocks - msg.ResponseConflict.ConflictRelayData0 = conflictconstruct.ConstructConflictRelayData(reply, msg.ResponseConflict.ConflictRelayData0.Request) - // reply 1 - temp, _ = reply.Marshal() - reply2 = &types.RelayReply{} - reply2.Unmarshal(temp) - reply2.Data = append(reply2.Data, []byte("DIFF")...) - relayExchange2 := types.NewRelayExchange(*msg.ResponseConflict.ConflictRelayData1.Request, *reply2) - sig, err = sigs.Sign(provider1.SK, relayExchange2) + + conflictRelayData := conflictconstruct.ConstructConflictRelayData(reply, conflictData.Request) + return conflictRelayData, nil +} + +func CreateRelayFinalizationForTest(ctx context.Context, consumer, provider sigs.Account, latestBlock int64, finalizationBlockHashes map[int64]string, spec *spectypes.Spec) (*conflicttypes.RelayFinalization, error) { + relayFinalization := &conflicttypes.RelayFinalization{ + LatestBlock: latestBlock, + ConsumerAddress: consumer.Addr.String(), + } + + conflictData := initConflictRelayData() + prepareRelayData(ctx, conflictData, provider, spec) + if err := signSessionData(consumer, conflictData.Request.RelaySession); err != nil { + return relayFinalization, err + } + + relayFinalization.RelaySession = conflictData.Request.RelaySession + + jsonStr, err := json.Marshal(finalizationBlockHashes) if err != nil { - return msg, nil, nil, err + return relayFinalization, err } - reply2.Sig = sig - relayFinalization2 := types.NewRelayFinalization(types.NewRelayExchange(*msg.ResponseConflict.ConflictRelayData1.Request, *reply2), consumer.Addr) - sigBlocks, err = sigs.Sign(provider1.SK, relayFinalization2) + + relayFinalization.FinalizedBlocksHashes = jsonStr + + // Sign relay reply for provider + sig0, err := sigs.Sign(provider.SK, relayFinalization) if err != nil { - return msg, nil, nil, err + return relayFinalization, err } - reply2.SigBlocks = sigBlocks - msg.ResponseConflict.ConflictRelayData1 = conflictconstruct.ConstructConflictRelayData(reply2, msg.ResponseConflict.ConflictRelayData1.Request) - return msg, reply, reply2, err + relayFinalization.SigBlocks = sig0 + + return relayFinalization, nil } diff --git a/testutil/common/mock.go b/testutil/common/mock.go index 57de685454..0a5f9a1bdc 100644 --- a/testutil/common/mock.go +++ b/testutil/common/mock.go @@ -2,9 +2,9 @@ package common import ( sdk "github.com/cosmos/cosmos-sdk/types" - commonconsts "github.com/lavanet/lava/testutil/common/consts" - plantypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + commonconsts "github.com/lavanet/lava/v2/testutil/common/consts" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) func CreateMockSpec() spectypes.Spec { diff --git a/testutil/common/tester.go b/testutil/common/tester.go index f00b67e9cc..d6437ac909 100644 --- a/testutil/common/tester.go +++ b/testutil/common/tester.go @@ -14,20 +14,21 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - dualstakingante "github.com/lavanet/lava/x/dualstaking/ante" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/x/fixationstore/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - rewardstypes "github.com/lavanet/lava/x/rewards/types" - spectypes "github.com/lavanet/lava/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/utils" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + dualstakingante "github.com/lavanet/lava/v2/x/dualstaking/ante" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v2/x/fixationstore/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) @@ -984,11 +985,6 @@ func (ts *Tester) QueryRewardsIprpcSpecReward(spec string) (*rewardstypes.QueryI } // block/epoch helpers -// QueryRewardsProviderReward implements 'q rewards provider-reward' -func (ts *Tester) QueryRewardsProviderReward(chainID string, provider string) (*rewardstypes.QueryProviderRewardResponse, error) { - msg := &rewardstypes.QueryProviderRewardRequest{ChainId: chainID, Provider: provider} - return ts.Keepers.Rewards.ProviderReward(ts.GoCtx, msg) -} // block/epoch helpers func (ts *Tester) BlockHeight() uint64 { return uint64(ts.Ctx.BlockHeight()) @@ -1132,7 +1128,7 @@ func (ts *Tester) SetupForTests(getToTopMostPath string, specId string, validato } sdkContext := sdk.UnwrapSDKContext(ts.Ctx) - spec, err := testkeeper.GetASpec(specId, getToTopMostPath, &sdkContext, &ts.Keepers.Spec) + spec, err := specutils.GetASpec(specId, getToTopMostPath, &sdkContext, &ts.Keepers.Spec) if err != nil { return err } diff --git a/testutil/e2e/e2eConfigs/badgeserver1/badgeserver.yml b/testutil/e2e/e2eConfigs/badgeserver1/badgeserver.yml new file mode 100644 index 0000000000..f85f01b37c --- /dev/null +++ b/testutil/e2e/e2eConfigs/badgeserver1/badgeserver.yml @@ -0,0 +1,11 @@ +projects-data: + 1: + default: + epochs-max-cu: 3333333333 + 2: + default: + epochs-max-cu: 3333333333 + +default-geolocation: 1 +countries-file-path: "" +ip-file-path: "" diff --git a/testutil/e2e/e2eConfigs/badgeserver2/badgeserver.yml b/testutil/e2e/e2eConfigs/badgeserver2/badgeserver.yml new file mode 100644 index 0000000000..0b8dc7140c --- /dev/null +++ b/testutil/e2e/e2eConfigs/badgeserver2/badgeserver.yml @@ -0,0 +1,11 @@ +projects-data: + 1: + default: + epochs-max-cu: 60 + 2: + default: + epochs-max-cu: 60 + +default-geolocation: 1 +countries-file-path: "" +ip-file-path: "" diff --git a/testutil/e2e/e2eProviderConfigs/ethConsumer1.yml b/testutil/e2e/e2eConfigs/consumer/ethConsumer1.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/ethConsumer1.yml rename to testutil/e2e/e2eConfigs/consumer/ethConsumer1.yml diff --git a/testutil/e2e/e2eProviderConfigs/ethConsumer2.yml b/testutil/e2e/e2eConfigs/consumer/ethConsumer2.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/ethConsumer2.yml rename to testutil/e2e/e2eConfigs/consumer/ethConsumer2.yml diff --git a/testutil/e2e/e2eProviderConfigs/lavaConsumer1.yml b/testutil/e2e/e2eConfigs/consumer/lavaConsumer1.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaConsumer1.yml rename to testutil/e2e/e2eConfigs/consumer/lavaConsumer1.yml diff --git a/testutil/e2e/e2eProviderConfigs/lavaConsumer2.yml b/testutil/e2e/e2eConfigs/consumer/lavaConsumer2.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaConsumer2.yml rename to testutil/e2e/e2eConfigs/consumer/lavaConsumer2.yml diff --git a/testutil/e2e/e2eProviderConfigs/lavaConsumerEmergency1.yml b/testutil/e2e/e2eConfigs/consumer/lavaConsumerEmergency1.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaConsumerEmergency1.yml rename to testutil/e2e/e2eConfigs/consumer/lavaConsumerEmergency1.yml diff --git a/testutil/e2e/e2eProviderConfigs/consumer_policy.yml b/testutil/e2e/e2eConfigs/policies/consumer_policy.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/consumer_policy.yml rename to testutil/e2e/e2eConfigs/policies/consumer_policy.yml diff --git a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider1.yml b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider1.yml similarity index 59% rename from testutil/e2e/e2eProviderConfigs/jsonrpcProvider1.yml rename to testutil/e2e/e2eConfigs/provider/jsonrpcProvider1.yml index 801cc178a9..b68e6c812c 100644 --- a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider1.yml +++ b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider1.yml @@ -7,6 +7,12 @@ endpoints: - url: http://127.0.0.1:1111 Addons: - debug + - url: ws://127.0.0.1:1111/ws + Addons: + - debug - url: http://127.0.0.1:1111 Addons: - - archive + - archive + - url: ws://127.0.0.1:1111/ws + Addons: + - archive diff --git a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider2.yml b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider2.yml similarity index 81% rename from testutil/e2e/e2eProviderConfigs/jsonrpcProvider2.yml rename to testutil/e2e/e2eConfigs/provider/jsonrpcProvider2.yml index 41f3992d6f..b3429ed76c 100644 --- a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider2.yml +++ b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider2.yml @@ -5,3 +5,4 @@ endpoints: address: 127.0.0.1:2222 node-urls: - url: http://127.0.0.1:1111 + - url: ws://127.0.0.1:1111/ws diff --git a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider3.yml b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider3.yml similarity index 81% rename from testutil/e2e/e2eProviderConfigs/jsonrpcProvider3.yml rename to testutil/e2e/e2eConfigs/provider/jsonrpcProvider3.yml index ca4553b9db..78f216c720 100644 --- a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider3.yml +++ b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider3.yml @@ -5,3 +5,4 @@ endpoints: address: 127.0.0.1:2223 node-urls: - url: http://127.0.0.1:1111 + - url: ws://127.0.0.1:1111/ws diff --git a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider4.yml b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider4.yml similarity index 81% rename from testutil/e2e/e2eProviderConfigs/jsonrpcProvider4.yml rename to testutil/e2e/e2eConfigs/provider/jsonrpcProvider4.yml index 54f7cf46b0..f95f7081fd 100644 --- a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider4.yml +++ b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider4.yml @@ -5,3 +5,4 @@ endpoints: address: 127.0.0.1:2224 node-urls: - url: http://127.0.0.1:1111 + - url: ws://127.0.0.1:1111/ws diff --git a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider5.yml b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider5.yml similarity index 81% rename from testutil/e2e/e2eProviderConfigs/jsonrpcProvider5.yml rename to testutil/e2e/e2eConfigs/provider/jsonrpcProvider5.yml index 8b9a0c76ce..09585aef14 100644 --- a/testutil/e2e/e2eProviderConfigs/jsonrpcProvider5.yml +++ b/testutil/e2e/e2eConfigs/provider/jsonrpcProvider5.yml @@ -5,3 +5,4 @@ endpoints: address: 127.0.0.1:2225 node-urls: - url: http://127.0.0.1:1111 + - url: ws://127.0.0.1:1111/ws diff --git a/testutil/e2e/e2eProviderConfigs/lavaProvider10.yml b/testutil/e2e/e2eConfigs/provider/lavaProvider10.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaProvider10.yml rename to testutil/e2e/e2eConfigs/provider/lavaProvider10.yml diff --git a/testutil/e2e/e2eProviderConfigs/lavaProvider6.yml b/testutil/e2e/e2eConfigs/provider/lavaProvider6.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaProvider6.yml rename to testutil/e2e/e2eConfigs/provider/lavaProvider6.yml diff --git a/testutil/e2e/e2eProviderConfigs/lavaProvider7.yml b/testutil/e2e/e2eConfigs/provider/lavaProvider7.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaProvider7.yml rename to testutil/e2e/e2eConfigs/provider/lavaProvider7.yml diff --git a/testutil/e2e/e2eProviderConfigs/lavaProvider8.yml b/testutil/e2e/e2eConfigs/provider/lavaProvider8.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaProvider8.yml rename to testutil/e2e/e2eConfigs/provider/lavaProvider8.yml diff --git a/testutil/e2e/e2eProviderConfigs/lavaProvider9.yml b/testutil/e2e/e2eConfigs/provider/lavaProvider9.yml similarity index 100% rename from testutil/e2e/e2eProviderConfigs/lavaProvider9.yml rename to testutil/e2e/e2eConfigs/provider/lavaProvider9.yml diff --git a/testutil/e2e/paymentE2E.go b/testutil/e2e/paymentE2E.go index 5d5c0cb617..08ac04495f 100644 --- a/testutil/e2e/paymentE2E.go +++ b/testutil/e2e/paymentE2E.go @@ -13,14 +13,14 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/cmd/lavad/cmd" - commonconsts "github.com/lavanet/lava/testutil/common/consts" - e2esdk "github.com/lavanet/lava/testutil/e2e/sdk" - "github.com/lavanet/lava/utils" - dualstakingTypes "github.com/lavanet/lava/x/dualstaking/types" - epochStorageTypes "github.com/lavanet/lava/x/epochstorage/types" - pairingTypes "github.com/lavanet/lava/x/pairing/types" - subscriptionTypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/cmd/lavad/cmd" + commonconsts "github.com/lavanet/lava/v2/testutil/common/consts" + e2esdk "github.com/lavanet/lava/v2/testutil/e2e/sdk" + "github.com/lavanet/lava/v2/utils" + dualstakingTypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochStorageTypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingTypes "github.com/lavanet/lava/v2/x/pairing/types" + subscriptionTypes "github.com/lavanet/lava/v2/x/subscription/types" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -49,7 +49,7 @@ func (lt *lavaTest) startLavaProvidersForPayment(ctx context.Context) { for idx := 1; idx <= 2; idx++ { command := fmt.Sprintf( "%s rpcprovider %s/lavaProvider%d --chain-id=lava --from servicer%d %s", - lt.protocolPath, configFolder, idx+5, idx, lt.lavadArgs, + lt.protocolPath, providerConfigsFolder, idx+5, idx, lt.lavadArgs, ) logName := "05_LavaProvider_" + fmt.Sprintf("%02d", idx) funcName := fmt.Sprintf("startLavaProvidersForPayment (provider %02d)", idx) @@ -68,7 +68,7 @@ func (lt *lavaTest) startLavaConsumerForPayment(ctx context.Context) { for idx, u := range []string{"user1"} { command := fmt.Sprintf( "%s rpcconsumer %s/lavaConsumer%d.yml --chain-id=lava --from %s %s --concurrent-providers 1", - lt.protocolPath, configFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, + lt.protocolPath, consumerConfigsFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, ) logName := "06_RPCConsumer_" + fmt.Sprintf("%02d", idx+1) funcName := fmt.Sprintf("startLavaConsumerForPayment (consumer %02d)", idx+1) diff --git a/testutil/e2e/protocolE2E.go b/testutil/e2e/protocolE2E.go index c666f37c9e..d4cc6f00b5 100644 --- a/testutil/e2e/protocolE2E.go +++ b/testutil/e2e/protocolE2E.go @@ -20,6 +20,7 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "time" tmclient "github.com/cometbft/cometbft/rpc/client/http" @@ -28,14 +29,15 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" - commonconsts "github.com/lavanet/lava/testutil/common/consts" - "github.com/lavanet/lava/testutil/e2e/sdk" - "github.com/lavanet/lava/utils" - epochStorageTypes "github.com/lavanet/lava/x/epochstorage/types" - pairingTypes "github.com/lavanet/lava/x/pairing/types" - planTypes "github.com/lavanet/lava/x/plans/types" - specTypes "github.com/lavanet/lava/x/spec/types" - subscriptionTypes "github.com/lavanet/lava/x/subscription/types" + "github.com/gorilla/websocket" + commonconsts "github.com/lavanet/lava/v2/testutil/common/consts" + "github.com/lavanet/lava/v2/testutil/e2e/sdk" + "github.com/lavanet/lava/v2/utils" + epochStorageTypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingTypes "github.com/lavanet/lava/v2/x/pairing/types" + planTypes "github.com/lavanet/lava/v2/x/plans/types" + specTypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptionTypes "github.com/lavanet/lava/v2/x/subscription/types" "golang.org/x/exp/slices" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -44,7 +46,11 @@ import ( const ( protocolLogsFolder = "./testutil/e2e/protocolLogs/" - configFolder = "./testutil/e2e/e2eProviderConfigs" + configFolder = "./testutil/e2e/e2eConfigs/" + providerConfigsFolder = configFolder + "provider" + consumerConfigsFolder = configFolder + "consumer" + policiesFolder = configFolder + "policies" + badgeserverConfigFolder = configFolder + "badgeserver" EmergencyModeStartLine = "+++++++++++ EMERGENCY MODE START ++++++++++" EmergencyModeEndLine = "+++++++++++ EMERGENCY MODE END ++++++++++" NumberOfSpecsExpectedInE2E = 10 @@ -334,7 +340,7 @@ func (lt *lavaTest) startJSONRPCProvider(ctx context.Context) { for idx := 1; idx <= 5; idx++ { command := fmt.Sprintf( "%s rpcprovider %s/jsonrpcProvider%d.yml --chain-id=lava --from servicer%d %s", - lt.protocolPath, configFolder, idx, idx, lt.lavadArgs, + lt.protocolPath, providerConfigsFolder, idx, idx, lt.lavadArgs, ) logName := "03_EthProvider_" + fmt.Sprintf("%02d", idx) funcName := fmt.Sprintf("startJSONRPCProvider (provider %02d)", idx) @@ -353,7 +359,7 @@ func (lt *lavaTest) startJSONRPCConsumer(ctx context.Context) { for idx, u := range []string{"user1"} { command := fmt.Sprintf( "%s rpcconsumer %s/ethConsumer%d.yml --chain-id=lava --from %s %s", - lt.protocolPath, configFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, + lt.protocolPath, consumerConfigsFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, ) logName := "04_jsonConsumer_" + fmt.Sprintf("%02d", idx+1) funcName := fmt.Sprintf("startJSONRPCConsumer (consumer %02d)", idx+1) @@ -518,7 +524,7 @@ func jsonrpcTests(rpcURL string, testDuration time.Duration) error { } if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil @@ -528,7 +534,7 @@ func (lt *lavaTest) startLavaProviders(ctx context.Context) { for idx := 6; idx <= 10; idx++ { command := fmt.Sprintf( "%s rpcprovider %s/lavaProvider%d --chain-id=lava --from servicer%d %s", - lt.protocolPath, configFolder, idx, idx, lt.lavadArgs, + lt.protocolPath, providerConfigsFolder, idx, idx, lt.lavadArgs, ) logName := "05_LavaProvider_" + fmt.Sprintf("%02d", idx-5) funcName := fmt.Sprintf("startLavaProviders (provider %02d)", idx-5) @@ -547,7 +553,7 @@ func (lt *lavaTest) startLavaConsumer(ctx context.Context) { for idx, u := range []string{"user3"} { command := fmt.Sprintf( "%s rpcconsumer %s/lavaConsumer%d.yml --chain-id=lava --from %s %s", - lt.protocolPath, configFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, + lt.protocolPath, consumerConfigsFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, ) logName := "06_RPCConsumer_" + fmt.Sprintf("%02d", idx+1) funcName := fmt.Sprintf("startRPCConsumer (consumer %02d)", idx+1) @@ -560,7 +566,7 @@ func (lt *lavaTest) startLavaEmergencyConsumer(ctx context.Context) { for idx, u := range []string{"user5"} { command := fmt.Sprintf( "%s rpcconsumer %s/lavaConsumerEmergency%d.yml --chain-id=lava --from %s %s", - lt.protocolPath, configFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, + lt.protocolPath, consumerConfigsFolder, idx+1, u, lt.lavadArgs+lt.consumerArgs, ) logName := "11_RPCEmergencyConsumer_" + fmt.Sprintf("%02d", idx+1) funcName := fmt.Sprintf("startRPCEmergencyConsumer (consumer %02d)", idx+1) @@ -605,7 +611,7 @@ func tendermintTests(rpcURL string, testDuration time.Duration) error { } } if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil } @@ -632,7 +638,7 @@ func tendermintURITests(rpcURL string, testDuration time.Duration) error { } if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil } @@ -688,7 +694,7 @@ func restTests(rpcURL string, testDuration time.Duration) error { } if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil } @@ -705,7 +711,7 @@ func restRelayTest(rpcURL string) error { } if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil } @@ -771,7 +777,7 @@ func grpcTests(rpcURL string, testDuration time.Duration) error { } } if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil } @@ -800,9 +806,22 @@ func (lt *lavaTest) saveLogs() { panic(err) } writer := bufio.NewWriter(file) - writer.Write(logBuffer.Bytes()) - writer.Flush() - utils.LavaFormatDebug("writing file", []utils.Attribute{{Key: "fileName", Value: fileName}, {Key: "lines", Value: len(logBuffer.Bytes())}}...) + var bytesWritten int + bytesWritten, err = writer.Write(logBuffer.Bytes()) + if err != nil { + utils.LavaFormatError("Error writing to file", err) + } else { + err = writer.Flush() + if err != nil { + utils.LavaFormatError("Error flushing writer", err) + } else { + utils.LavaFormatDebug("success writing to file", + utils.LogAttr("fileName", fileName), + utils.LogAttr("bytesWritten", bytesWritten), + utils.LogAttr("lines", len(logBuffer.Bytes())), + ) + } + } file.Close() lines := strings.Split(logBuffer.String(), "\n") @@ -964,7 +983,7 @@ func (lt *lavaTest) checkQoS() error { utils.LavaFormatInfo("QOS CHECK OK") if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil } @@ -1172,7 +1191,7 @@ func (lt *lavaTest) checkResponse(tendermintConsumerURL string, restConsumerURL } if len(errors) > 0 { - return fmt.Errorf(strings.Join(errors, ",\n")) + return fmt.Errorf("%s", strings.Join(errors, ",\n")) } return nil } @@ -1188,6 +1207,168 @@ func (lt *lavaTest) getKeyAddress(key string) string { return string(output) } +func (lt *lavaTest) runWebSocketSubscriptionTest(tendermintConsumerWebSocketURL string) { + utils.LavaFormatInfo("Starting WebSocket Subscription Test") + + subscriptionsCount := 5 + + createWebSocketClient := func() *websocket.Conn { + websocketDialer := websocket.Dialer{ + ReadBufferSize: 1024, + WriteBufferSize: 1024, + } + + header := make(http.Header) + + webSocketClient, resp, err := websocketDialer.DialContext(context.Background(), tendermintConsumerWebSocketURL, header) + if err != nil { + panic(err) + } + utils.LavaFormatDebug("Dialed WebSocket Successful", + utils.LogAttr("url", tendermintConsumerWebSocketURL), + utils.LogAttr("response", resp), + ) + + return webSocketClient + } + + const ( + SUBSCRIBE = "subscribe" + UNSUBSCRIBE = "unsubscribe" + ) + + createSubscriptionJsonRpcMessage := func(method string) map[string]interface{} { + return map[string]interface{}{ + "jsonrpc": "2.0", + "method": method, + "id": 1, + "params": map[string]interface{}{ + "query": "tm.event = 'NewBlock'", + }, + } + } + + subscribeToNewBlockEvents := func(webSocketClient *websocket.Conn) { + msgData := createSubscriptionJsonRpcMessage(SUBSCRIBE) + err := webSocketClient.WriteJSON(msgData) + if err != nil { + panic(err) + } + } + + webSocketShouldListen := true + defer func() { + webSocketShouldListen = false + }() + + type subscriptionContainer struct { + newBlockMessageCount int32 + webSocketClient *websocket.Conn + } + + incrementNewBlockMessageCount := func(sc *subscriptionContainer) { + atomic.AddInt32(&sc.newBlockMessageCount, 1) + } + + readNewBlockMessageCount := func(subscriptionContainer *subscriptionContainer) int32 { + return atomic.LoadInt32(&subscriptionContainer.newBlockMessageCount) + } + + startWebSocketReader := func(webSocketName string, webSocketClient *websocket.Conn, subscriptionContainer *subscriptionContainer) { + for { + _, message, err := webSocketClient.ReadMessage() + if err != nil { + if webSocketShouldListen { + panic(err) + } + + // Once the test is done, we can safely ignore the error + return + } + + if strings.Contains(string(message), "NewBlock") { + incrementNewBlockMessageCount(subscriptionContainer) + } + } + } + + startSubscriptions := func(count int) []*subscriptionContainer { + subscriptionContainers := []*subscriptionContainer{} + // Start a websocket clients and connect them to tendermint consumer endpoint + for i := 0; i < count; i++ { + utils.LavaFormatInfo("Setting up web socket client " + strconv.Itoa(i+1)) + webSocketClient := createWebSocketClient() + + subscriptionContainer := &subscriptionContainer{ + webSocketClient: webSocketClient, + newBlockMessageCount: 0, + } + + // Start a reader for each client to count the number of NewBlock messages received + utils.LavaFormatInfo("Start listening for NewBlock messages on web socket " + strconv.Itoa(i+1)) + + go startWebSocketReader("webSocketClient"+strconv.Itoa(i+1), webSocketClient, subscriptionContainer) + + // Subscribe to new block events + utils.LavaFormatInfo("Subscribing to NewBlock events on web socket " + strconv.Itoa(i+1)) + + subscribeToNewBlockEvents(webSocketClient) + subscriptionContainers = append(subscriptionContainers, subscriptionContainer) + } + + return subscriptionContainers + } + + subscriptions := startSubscriptions(subscriptionsCount) + + // Wait for 10 blocks + utils.LavaFormatInfo("Sleeping for 12 seconds to receive blocks") + time.Sleep(12 * time.Second) + + utils.LavaFormatDebug("Looping through subscription containers", + utils.LogAttr("subscriptionContainers", subscriptions), + ) + // Check the all web socket clients received at least 10 blocks + for i := 0; i < subscriptionsCount; i++ { + utils.LavaFormatInfo("Making sure both clients received at least 10 blocks") + if subscriptions[i] == nil { + panic("subscriptionContainers[" + strconv.Itoa(i+1) + "] is nil") + } + newBlockMessageCount := readNewBlockMessageCount(subscriptions[i]) + if newBlockMessageCount < 10 { + panic(fmt.Sprintf("subscription should have received at least 10 blocks, got: %d", newBlockMessageCount)) + } + } + + // Unsubscribe one client + utils.LavaFormatInfo("Unsubscribing from NewBlock events on web socket 1") + msgData := createSubscriptionJsonRpcMessage(UNSUBSCRIBE) + err := subscriptions[0].webSocketClient.WriteJSON(msgData) + if err != nil { + panic(err) + } + + // Make sure that the unsubscribed client stops receiving blocks + webSocketClient1NewBlockMsgCountAfterUnsubscribe := readNewBlockMessageCount(subscriptions[0]) + + utils.LavaFormatInfo("Sleeping for 7 seconds to make sure unsubscribed client stops receiving blocks") + time.Sleep(7 * time.Second) + + if readNewBlockMessageCount(subscriptions[0]) != webSocketClient1NewBlockMsgCountAfterUnsubscribe { + panic("unsubscribed client should not receive new blocks") + } + + webSocketShouldListen = false + + // Disconnect all websocket clients + for i := 0; i < subscriptionsCount; i++ { + utils.LavaFormatInfo("Closing web socket " + strconv.Itoa(i+1)) + subscriptions[i].webSocketClient.Close() + } + + utils.LavaFormatInfo("WebSocket Subscription Test OK") +} + func calculateProviderCU(pairingClient pairingTypes.QueryClient) (map[string]uint64, error) { providerCU := make(map[string]uint64) res, err := pairingClient.ProvidersEpochCu(context.Background(), &pairingTypes.QueryProvidersEpochCuRequest{}) @@ -1344,6 +1525,8 @@ func runProtocolE2E(timeout time.Duration) { lt.checkResponse("http://127.0.0.1:3340", "http://127.0.0.1:3341", "127.0.0.1:3342") + lt.runWebSocketSubscriptionTest("ws://127.0.0.1:3340/websocket") + lt.checkQoS() utils.LavaFormatInfo("Sleeping Until All Rewards are collected") diff --git a/testutil/e2e/proxy/helper.go b/testutil/e2e/proxy/helper.go index 1537783a30..071945786d 100644 --- a/testutil/e2e/proxy/helper.go +++ b/testutil/e2e/proxy/helper.go @@ -39,11 +39,11 @@ func createProxyRequest(req *http.Request, hostURL, body string) (proxyRequest * } reqUrlStr, err := url.QueryUnescape(reqUrl.String()) if err != nil { - return nil, fmt.Errorf(" ::: XXX ::: Could not QueryUnescape new request ::: " + reqUrl.Host + dotsStr + err.Error()) + return nil, fmt.Errorf(" ::: XXX ::: Could not QueryUnescape new request ::: %s%s%s", reqUrl.Host, dotsStr, err.Error()) } proxyReq, err := http.NewRequest(req.Method, scheme+":"+reqUrlStr, strings.NewReader(body)) if err != nil { - return nil, fmt.Errorf(" ::: XXX ::: Could not reproduce new request ::: " + reqUrl.Host + dotsStr + err.Error()) + return nil, fmt.Errorf(" ::: XXX ::: Could not reproduce new request ::: %s%s%s", reqUrl.Host, dotsStr, err.Error()) } proxyReq.Header.Set("Host", req.Host) proxyReq.Header.Set("X-Forwarded-For", req.RemoteAddr) diff --git a/testutil/e2e/proxy/proxy.go b/testutil/e2e/proxy/proxy.go index 5eceed7b7f..1ad6c09412 100644 --- a/testutil/e2e/proxy/proxy.go +++ b/testutil/e2e/proxy/proxy.go @@ -10,8 +10,9 @@ import ( "strings" "time" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcInterfaceMessages" - "github.com/lavanet/lava/protocol/chainlib/chainproxy/rpcclient" + "github.com/gorilla/websocket" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcInterfaceMessages" + "github.com/lavanet/lava/v2/protocol/chainlib/chainproxy/rpcclient" ) // var mockFolder string = "testutil/e2e/proxy/mockMaps/" @@ -143,6 +144,15 @@ func main(host, port *string) { startProxyProcess(process) } +// Define the upgrader +var upgrader = websocket.Upgrader{ + ReadBufferSize: 1024, + WriteBufferSize: 1024, + CheckOrigin: func(r *http.Request) bool { + return true + }, +} + func startProxyProcess(process proxyProcess) { process.mock.requests = jsonFileToMap(process.mockfile) if process.mock.requests == nil { @@ -168,7 +178,34 @@ func startProxyProcess(process proxyProcess) { fmt.Print(fmt.Sprintf(" ::: Proxy Started! ::: ID: %s", process.id) + "\n") fmt.Print(fmt.Sprintf(" ::: Listening On ::: %s", "http://0.0.0.0:"+process.port+"/") + "\n") + // Define the WebSocket handler + wsHandler := func(w http.ResponseWriter, r *http.Request) { + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + log.Println("Upgrade error:", err) + return + } + defer conn.Close() + + for { + // Read message from browser + msgType, msg, err := conn.ReadMessage() + if err != nil { + log.Println("Read error:", err) + break + } + // Print the message to the console + log.Printf("Received: %s\n", msg) + // Write message back to browser + if err = conn.WriteMessage(msgType, msg); err != nil { + log.Println("Write error:", err) + break + } + } + } + http.HandleFunc("/", process.handler) + http.HandleFunc("/ws", wsHandler) err := http.ListenAndServe(":"+process.port, nil) if err != nil { log.Fatal(err.Error()) @@ -243,12 +280,12 @@ func idInstertedResponse(val string, replyMessage *rpcInterfaceMessages.JsonrpcM const dotsStr = " ::: " -func (p proxyProcess) LavaTestProxy(rw http.ResponseWriter, req *http.Request) { +func (p proxyProcess) LavaTestProxy(responseWriter http.ResponseWriter, request *http.Request) { host := p.host mock := p.mock // Get request body - rawBody := getDataFromIORead(&req.Body, true) + rawBody := getDataFromIORead(&request.Body, true) // TODO: set all ids to 1 rawBodyS := string(rawBody) // sep := "id\":" @@ -261,7 +298,7 @@ func (p proxyProcess) LavaTestProxy(rw http.ResponseWriter, req *http.Request) { println(dotsStr+p.port+dotsStr+p.id+" ::: INCOMING PROXY MSG :::", rawBodyS) var respmsg rpcclient.JsonrpcMessage - if err := json.NewDecoder(req.Body).Decode(&respmsg); err != nil { + if err := json.NewDecoder(request.Body).Decode(&respmsg); err != nil { println(err.Error()) } replyMessage, err := rpcInterfaceMessages.ConvertJsonRPCMsg(&respmsg) @@ -275,8 +312,7 @@ func (p proxyProcess) LavaTestProxy(rw http.ResponseWriter, req *http.Request) { if fakeResponse && strings.Contains(rawBodyS, "blockNumber") { println("!!!!!!!!!!!!!! block number") - rw.WriteHeader(200) - rw.Write([]byte(fmt.Sprintf("{\"jsonrpc\":\"2.0\",\"id\":%s,\"result\":\"%s\"}", respId, getMockBlockNumber()))) + returnResponse(responseWriter, http.StatusOK, []byte(fmt.Sprintf("{\"jsonrpc\":\"2.0\",\"id\":%s,\"result\":\"%s\"}", respId, getMockBlockNumber()))) } else { // Return Cached data if found in history and fromCache is set on jStruct := &jsonStruct{} @@ -296,11 +332,10 @@ func (p proxyProcess) LavaTestProxy(rw http.ResponseWriter, req *http.Request) { fakeCount += 1 } time.Sleep(500 * time.Millisecond) - rw.WriteHeader(200) - rw.Write([]byte(orderedJSON)) + returnResponse(responseWriter, http.StatusOK, []byte(orderedJSON)) } else { // Recreating Request - proxyRequest, err := createProxyRequest(req, host, rawBodyS) + proxyRequest, err := createProxyRequest(request, host, rawBodyS) if err != nil { println(err.Error()) } else { @@ -327,7 +362,7 @@ func (p proxyProcess) LavaTestProxy(rw http.ResponseWriter, req *http.Request) { println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Got error in response - retrying request") // Recreating Request - proxyRequest, err = createProxyRequest(req, host, rawBodyS) + proxyRequest, err = createProxyRequest(request, host, rawBodyS) if err != nil { println(err.Error()) respBody = []byte(err.Error()) @@ -370,7 +405,7 @@ func (p proxyProcess) LavaTestProxy(rw http.ResponseWriter, req *http.Request) { respBody = []byte("error") } // time.Sleep(500 * time.Millisecond) - returnResponse(rw, status, respBody) + returnResponse(responseWriter, status, respBody) } } } diff --git a/testutil/e2e/sdk/e2e.go b/testutil/e2e/sdk/e2e.go index c136419320..934584f5b7 100644 --- a/testutil/e2e/sdk/e2e.go +++ b/testutil/e2e/sdk/e2e.go @@ -12,8 +12,8 @@ import ( "strings" "sync" - "github.com/lavanet/lava/utils" - pairingTypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingTypes "github.com/lavanet/lava/v2/x/pairing/types" "golang.org/x/exp/slices" "google.golang.org/grpc" ) diff --git a/testutil/e2e/sdk/tests/emergency_mode_badge.ts b/testutil/e2e/sdk/tests/emergency_mode_badge.ts index c01cc3e6e7..51d3164965 100644 --- a/testutil/e2e/sdk/tests/emergency_mode_badge.ts +++ b/testutil/e2e/sdk/tests/emergency_mode_badge.ts @@ -14,7 +14,7 @@ async function main() { allowInsecureTransport: true, logLevel: "debug", }).catch(e => { - throw new Error(" ERR failed initializing lava-sdk jsonrpc badge test"); + throw new Error(` ERR failed initializing lava-sdk jsonrpc badge test ${e.message}`); }); await delay(45000); diff --git a/testutil/e2e/sdk/tests/emergency_mode_badge_err.ts b/testutil/e2e/sdk/tests/emergency_mode_badge_err.ts index f802ec1ed2..22cbb37d0e 100644 --- a/testutil/e2e/sdk/tests/emergency_mode_badge_err.ts +++ b/testutil/e2e/sdk/tests/emergency_mode_badge_err.ts @@ -13,7 +13,7 @@ async function main() { allowInsecureTransport: true, logLevel: "debug", }).catch(e => { - throw new Error(" ERR failed initializing lava-sdk jsonrpc badge test"); + throw new Error(` ERR failed initializing lava-sdk jsonrpc badge test ${e.message}`); }); // Fetch chain id diff --git a/testutil/e2e/sdk/tests/jsonrpc_badge.ts b/testutil/e2e/sdk/tests/jsonrpc_badge.ts index 78d02bcf3a..59db9b5d90 100644 --- a/testutil/e2e/sdk/tests/jsonrpc_badge.ts +++ b/testutil/e2e/sdk/tests/jsonrpc_badge.ts @@ -13,7 +13,7 @@ async function main() { allowInsecureTransport: true, logLevel: "debug", }).catch(e => { - throw new Error(" ERR failed initializing lava-sdk jsonrpc badge test"); + throw new Error(` ERR failed initializing lava-sdk jsonrpc badge test ${e.message}`); }); let relayArray: any = []; diff --git a/testutil/e2e/sdk/tests/jsonrpc_chainId_fetch.ts b/testutil/e2e/sdk/tests/jsonrpc_chainId_fetch.ts index 8081e21319..ed14797b8c 100644 --- a/testutil/e2e/sdk/tests/jsonrpc_chainId_fetch.ts +++ b/testutil/e2e/sdk/tests/jsonrpc_chainId_fetch.ts @@ -10,7 +10,7 @@ async function main() { allowInsecureTransport: true, logLevel: "debug", }).catch(e => { - throw new Error(" ERR failed initializing lava-sdk jsonrpc test"); + throw new Error(`ERR failed initializing lava-sdk jsonrpc test ${e.message}`); }); let relayArray = []; diff --git a/testutil/e2e/sdk/tests/lava_js_buy_subscription_amino.ts b/testutil/e2e/sdk/tests/lava_js_buy_subscription_amino.ts new file mode 100644 index 0000000000..edb65c7995 --- /dev/null +++ b/testutil/e2e/sdk/tests/lava_js_buy_subscription_amino.ts @@ -0,0 +1,57 @@ +import { MsgSendEncodeObject, AminoMsgSend } from "@cosmjs/stargate"; +import { cosmos } from "../../../../ecosystem/lavajs/dist/codegen/cosmos/bundle"; +import { lavanet } from "../../../../ecosystem/lavajs/dist/codegen/lavanet/bundle"; +import { getSigningLavanetClient, } from "../../../../ecosystem/lavajs/dist/codegen/lavanet/client"; +import { DirectSecp256k1HdWallet, DirectSecp256k1Wallet } from '@cosmjs/proto-signing' +import { Secp256k1Wallet, encodeSecp256k1Signature, decodeSignature } from '@cosmjs/amino' +import { fromHex } from "@cosmjs/encoding"; +import { makeMultisignedTxBytes } from "@cosmjs/stargate"; +import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx"; +import { fromBase64 } from "@cosmjs/encoding"; +import { Tx } from "cosmjs-types/cosmos/tx/v1beta1/tx" + +const publicRpc = "http://127.0.0.1:26657" +const privKey = process.env.PRIVATE_KEY + +// sending queries specifically to lava +async function main() { + // let wallet = await DirectSecp256k1HdWallet.fromMnemonic("cool bag river filter labor develop census harbor deliver save idea draft flag rug month prize emotion february north report humor duty pond quarter", {prefix: "lava@"}) + let wallet = await Secp256k1Wallet.fromKey(Buffer.from(privKey, "hex"), "lava@") + const [firstAccount] = await wallet.getAccounts(); + let signingClient = await getSigningLavanetClient({ + rpcEndpoint: publicRpc, + signer: wallet, + defaultTypes: [] + }) + + console.log("[lavajs_tx] buying subscription to", firstAccount) + + const msg = lavanet.lava.subscription.MessageComposer.fromPartial.buy({ + creator: firstAccount.address, + consumer: firstAccount.address, + index: "DefaultPlan", + duration: BigInt(1), /* in months */ + autoRenewal: false, advancePurchase: false + }) + + const fee = { + amount: [], // Replace with the desired fee amount and token denomination + gas: "270422000", // Replace with the desired gas limit + } + + + let txRaw = await signingClient.sign(firstAccount.address, [msg], fee, "Buying subscription on Lava blockchain!") + const txRawBytes = Uint8Array.from(TxRaw.encode(txRaw).finish()); + let result = await signingClient.broadcastTx(txRawBytes) + console.log("tx, result", result) + +} + +(async () => { + try { + await main(); + } catch (error) { + console.error(" ERR [lavajs_tx_amino_subscription] "+error.message); + process.exit(1); + } +})(); \ No newline at end of file diff --git a/testutil/e2e/sdk/tests/lava_js_dualstaking_delegate_and_redelegate_amino.ts b/testutil/e2e/sdk/tests/lava_js_dualstaking_delegate_and_redelegate_amino.ts new file mode 100644 index 0000000000..48369dff5a --- /dev/null +++ b/testutil/e2e/sdk/tests/lava_js_dualstaking_delegate_and_redelegate_amino.ts @@ -0,0 +1,85 @@ +import { MsgSendEncodeObject, AminoMsgSend } from "@cosmjs/stargate"; +import { cosmos } from "../../../../ecosystem/lavajs/dist/codegen/cosmos/bundle"; +import { lavanet } from "../../../../ecosystem/lavajs/dist/codegen/lavanet/bundle"; +import { getSigningLavanetClient, } from "../../../../ecosystem/lavajs/dist/codegen/lavanet/client"; +import { DirectSecp256k1HdWallet, DirectSecp256k1Wallet } from '@cosmjs/proto-signing' +import { Secp256k1Wallet, encodeSecp256k1Signature, decodeSignature } from '@cosmjs/amino' +import { fromHex } from "@cosmjs/encoding"; +import { makeMultisignedTxBytes } from "@cosmjs/stargate"; +import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx"; +import { fromBase64 } from "@cosmjs/encoding"; +import { Tx } from "cosmjs-types/cosmos/tx/v1beta1/tx" + +const publicRpc = "http://127.0.0.1:26657" +const privKey = process.env.PRIVATE_KEY + +// sending queries specifically to lava +async function main() { + // let wallet = await DirectSecp256k1HdWallet.fromMnemonic("cool bag river filter labor develop census harbor deliver save idea draft flag rug month prize emotion february north report humor duty pond quarter", {prefix: "lava@"}) + let wallet = await Secp256k1Wallet.fromKey(Buffer.from(privKey, "hex"), "lava@") + const [firstAccount] = await wallet.getAccounts(); + let signingClient = await getSigningLavanetClient({ + rpcEndpoint: publicRpc, + signer: wallet, + defaultTypes: [] + }) + + let lava_client = await lavanet.ClientFactory.createRPCQueryClient({rpcEndpoint: publicRpc}) + let validators = await lava_client.cosmos.staking.v1beta1.validators({status: "BOND_STATUS_BONDED"}) + console.log("validators: ", validators.validators) + let validator_chosen = validators.validators[0] + + let providers = await lava_client.lavanet.lava.pairing.providers({chainID: "LAV1", showFrozen: true}) + console.log("providers: ", providers.stakeEntry) + let provider_chosen = providers.stakeEntry[0] + let provider_chosen2 = providers.stakeEntry[1] + + + const msg = lavanet.lava.dualstaking.MessageComposer.withTypeUrl.delegate({ + amount: {amount: "100", denom: "ulava"}, + chainID: "LAV1", + creator: firstAccount.address, + provider: provider_chosen.address, + validator: validator_chosen.operatorAddress, + }) + // console.log("[lavajs_tx] delegating msg", msg ) + + + const fee = { + amount: [], // Replace with the desired fee amount and token denomination + gas: "270422000", // Replace with the desired gas limit + } + + + let txRaw = await signingClient.sign(firstAccount.address, [msg], fee, "delegating!") + const txRawBytes = Uint8Array.from(TxRaw.encode(txRaw).finish()); + let result = await signingClient.broadcastTx(txRawBytes) + console.log("tx, result", result) + + // re-delegate + const msg2 = lavanet.lava.dualstaking.MessageComposer.withTypeUrl.redelegate({ + amount: {amount: "50", denom: "ulava"}, + fromChainID: "LAV1", + toChainID: "LAV1", + creator: firstAccount.address, + fromProvider: provider_chosen.address, + toProvider: provider_chosen2.address, + }) + console.log("[lavajs_tx] delegating msg", msg2 ) + + + let txRaw2 = await signingClient.sign(firstAccount.address, [msg2], fee, "redelegating!") + const txRawBytes2 = Uint8Array.from(TxRaw.encode(txRaw2).finish()); + let result2 = await signingClient.broadcastTx(txRawBytes2) + console.log("tx, result", result2) + +} + +(async () => { + try { + await main(); + } catch (error) { + console.error(" ERR [lavajs_tx_amino_delegating] "+error.message); + process.exit(1); + } +})(); \ No newline at end of file diff --git a/testutil/e2e/sdk/tests/lavajs_buy_subscription_code.ts b/testutil/e2e/sdk/tests/lavajs_buy_subscription_code.ts new file mode 100644 index 0000000000..0ce6fba6aa --- /dev/null +++ b/testutil/e2e/sdk/tests/lavajs_buy_subscription_code.ts @@ -0,0 +1,52 @@ +import { lavanet } from "../../../../ecosystem/lavajs/dist/codegen/lavanet/bundle"; +import { getSigningLavanetClient, } from "../../../../ecosystem/lavajs/dist/codegen/lavanet/client"; +import { DirectSecp256k1HdWallet, DirectSecp256k1Wallet } from '@cosmjs/proto-signing' +import { fromHex } from "@cosmjs/encoding"; + +const publicRpc = "http://127.0.0.1:26657" +const privKey = process.env.PRIVATE_KEY + +// console.log("[lavajs_test] sending queries for address", process.env.PUBLIC_KEY) + +// sending queries specifically to lava +async function main() { + // let wallet = await DirectSecp256k1HdWallet.fromMnemonic("cool bag river filter labor develop census harbor deliver save idea draft flag rug month prize emotion february north report humor duty pond quarter", {prefix: "lava@"}) + let wallet = await DirectSecp256k1Wallet.fromKey(Buffer.from(privKey, "hex"), "lava@") + const [firstAccount] = await wallet.getAccounts(); + let signingClient = await getSigningLavanetClient({ + rpcEndpoint: publicRpc, + signer: wallet, + defaultTypes: [] + }) + + console.log("[lavajs_tx] buying subscription to", firstAccount) + + const msg = lavanet.lava.subscription.MessageComposer.withTypeUrl.buy({ + creator: firstAccount.address, + consumer: firstAccount.address, + index: "DefaultPlan", + duration: BigInt(1), /* in months */ + autoRenewal: false, advancePurchase: false + }) + + const fee = { + amount: [{ amount: "1", denom: "ulava" }], // Replace with the desired fee amount and token denomination + gas: "50000000", // Replace with the desired gas limit + } + + let res = await signingClient.signAndBroadcast(firstAccount.address, [msg], fee, "Buying subscription on Lava blockchain!") + if (res.code != 0) { + console.error("ERR [lavajs_tx]", res) + throw new Error("ERR [lavajs_tx] Failed buying subscription") + } + console.log("[lavajs_tx] Successfully bought default subscription", res) +} + +(async () => { + try { + await main(); + } catch (error) { + console.error(" ERR [lavajs_tx] "+error.message); + process.exit(1); + } +})(); \ No newline at end of file diff --git a/testutil/e2e/sdk/tests/lavajs_test.ts b/testutil/e2e/sdk/tests/lavajs_test.ts index 858d0e1a57..752dd90fea 100644 --- a/testutil/e2e/sdk/tests/lavajs_test.ts +++ b/testutil/e2e/sdk/tests/lavajs_test.ts @@ -3,9 +3,9 @@ import { lavanet } from "../../../../ecosystem/lavajs/dist/codegen/lavanet/bundl async function main() { const client = await lavanet.ClientFactory.createRPCQueryClient({ rpcEndpoint: "http://127.0.0.1:26657" }) const lavaClient = client.lavanet.lava; - let specResult = await lavaClient.spec.spec({ ChainID: "LAV1" }) + let specResult = await lavaClient.spec.spec({ chainID: "LAV1" }) const cosmosClient = client.cosmos; - if (specResult.Spec.index != "LAV1") { + if (specResult.spec.index != "LAV1") { console.log(specResult) throw new Error("Failed validating Lava spec.") } diff --git a/testutil/e2e/sdk/tests/package.json b/testutil/e2e/sdk/tests/package.json index 1f7fc8d960..e219ef1df2 100644 --- a/testutil/e2e/sdk/tests/package.json +++ b/testutil/e2e/sdk/tests/package.json @@ -1,5 +1,8 @@ { "devDependencies": { - "@types/node": "^20.11.30" + "@types/node": "^20.14.9" + }, + "dependencies": { + "@cosmjs/stargate": "^0.32.4" } -} +} \ No newline at end of file diff --git a/testutil/e2e/sdk/tests/rest_chainId_fetch.ts b/testutil/e2e/sdk/tests/rest_chainId_fetch.ts index 472c372c41..e64b20472a 100644 --- a/testutil/e2e/sdk/tests/rest_chainId_fetch.ts +++ b/testutil/e2e/sdk/tests/rest_chainId_fetch.ts @@ -10,7 +10,7 @@ async function main() { allowInsecureTransport: true, logLevel: "debug", }).catch(e => { - throw new Error(" ERR [rest_chainId_fetch] failed initializing lava-sdk rest test"); + throw new Error(` ERR [rest_chainId_fetch] failed initializing lava-sdk rest test ${e.message}`); }); // Fetch chain id diff --git a/testutil/e2e/sdk/tests/rest_optional_params.ts b/testutil/e2e/sdk/tests/rest_optional_params.ts index c7fe20e2d2..0cf46340b2 100644 --- a/testutil/e2e/sdk/tests/rest_optional_params.ts +++ b/testutil/e2e/sdk/tests/rest_optional_params.ts @@ -10,7 +10,7 @@ async function main() { allowInsecureTransport: true, logLevel: "debug", }).catch(e => { - throw new Error(" ERR [rest_optional_params] failed initializing lava-sdk rest test"); + throw new Error(` ERR [rest_optional_params] failed initializing lava-sdk rest test ${e.message}`); }); // Fetch chain id diff --git a/testutil/e2e/sdk/tests/yarn.lock b/testutil/e2e/sdk/tests/yarn.lock new file mode 100644 index 0000000000..89a05f992a --- /dev/null +++ b/testutil/e2e/sdk/tests/yarn.lock @@ -0,0 +1,485 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@confio/ics23@^0.6.8": + version "0.6.8" + resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.8.tgz#2a6b4f1f2b7b20a35d9a0745bb5a446e72930b3d" + integrity sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w== + dependencies: + "@noble/hashes" "^1.0.0" + protobufjs "^6.8.8" + +"@cosmjs/amino@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.4.tgz#3908946c0394e6d431694c8992c5147079a1c860" + integrity sha512-zKYOt6hPy8obIFtLie/xtygCkH9ZROiQ12UHfKsOkWaZfPQUvVbtgmu6R4Kn1tFLI/SRkw7eqhaogmW/3NYu/Q== + dependencies: + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + +"@cosmjs/crypto@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.4.tgz#5d29633b661eaf092ddb3e7ea6299cfd6f4507a2" + integrity sha512-zicjGU051LF1V9v7bp8p7ovq+VyC91xlaHdsFOTo2oVry3KQikp8L/81RkXmUIT8FxMwdx1T7DmFwVQikcSDIw== + dependencies: + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers-sumo "^0.7.11" + +"@cosmjs/encoding@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.4.tgz#646e0e809f7f4f1414d8fa991fb0ffe6c633aede" + integrity sha512-tjvaEy6ZGxJchiizzTn7HVRiyTg1i4CObRRaTRPknm5EalE13SV+TCHq38gIDfyUeden4fCuaBVEdBR5+ti7Hw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + +"@cosmjs/json-rpc@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.4.tgz#be91eb89ea78bd5dc02d0a9fa184dd6790790f0b" + integrity sha512-/jt4mBl7nYzfJ2J/VJ+r19c92mUKF0Lt0JxM3MXEJl7wlwW5haHAWtzRujHkyYMXOwIR+gBqT2S0vntXVBRyhQ== + dependencies: + "@cosmjs/stream" "^0.32.4" + xstream "^11.14.0" + +"@cosmjs/math@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.4.tgz#87ac9eadc06696e30a30bdb562a495974bfd0a1a" + integrity sha512-++dqq2TJkoB8zsPVYCvrt88oJWsy1vMOuSOKcdlnXuOA/ASheTJuYy4+oZlTQ3Fr8eALDLGGPhJI02W2HyAQaw== + dependencies: + bn.js "^5.2.0" + +"@cosmjs/proto-signing@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.4.tgz#5a06e087c6d677439c8c9b25b5223d5e72c4cd93" + integrity sha512-QdyQDbezvdRI4xxSlyM1rSVBO2st5sqtbEIl3IX03uJ7YiZIQHyv6vaHVf1V4mapusCqguiHJzm4N4gsFdLBbQ== + dependencies: + "@cosmjs/amino" "^0.32.4" + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + cosmjs-types "^0.9.0" + +"@cosmjs/socket@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.4.tgz#86ab6adf3a442314774c0810b7a7cfcddf4f2082" + integrity sha512-davcyYziBhkzfXQTu1l5NrpDYv0K9GekZCC9apBRvL1dvMc9F/ygM7iemHjUA+z8tJkxKxrt/YPjJ6XNHzLrkw== + dependencies: + "@cosmjs/stream" "^0.32.4" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + +"@cosmjs/stargate@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.4.tgz#bd0e4d3bf613b629addbf5f875d3d3b50f640af1" + integrity sha512-usj08LxBSsPRq9sbpCeVdyLx2guEcOHfJS9mHGCLCXpdAPEIEQEtWLDpEUc0LEhWOx6+k/ChXTc5NpFkdrtGUQ== + dependencies: + "@confio/ics23" "^0.6.8" + "@cosmjs/amino" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/proto-signing" "^0.32.4" + "@cosmjs/stream" "^0.32.4" + "@cosmjs/tendermint-rpc" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + cosmjs-types "^0.9.0" + xstream "^11.14.0" + +"@cosmjs/stream@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.4.tgz#83e1f2285807467c56d9ea0e1113f79d9fa63802" + integrity sha512-Gih++NYHEiP+oyD4jNEUxU9antoC0pFSg+33Hpp0JlHwH0wXhtD3OOKnzSfDB7OIoEbrzLJUpEjOgpCp5Z+W3A== + dependencies: + xstream "^11.14.0" + +"@cosmjs/tendermint-rpc@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.4.tgz#b36f9ec657498e42c97e21bb7368798ef6279752" + integrity sha512-MWvUUno+4bCb/LmlMIErLypXxy7ckUuzEmpufYYYd9wgbdCXaTaO08SZzyFM5PI8UJ/0S2AmUrgWhldlbxO8mw== + dependencies: + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/json-rpc" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/socket" "^0.32.4" + "@cosmjs/stream" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + axios "^1.6.0" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/utils@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.4.tgz#a9a717c9fd7b1984d9cefdd0ef6c6f254060c671" + integrity sha512-D1Yc+Zy8oL/hkUkFUL/bwxvuDBzRGpc4cF7/SkdhxX4iHpSLgdOuTt1mhCh9+kl6NQREy9t7SYZ6xeW5gFe60w== + +"@noble/hashes@^1", "@noble/hashes@^1.0.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + +"@types/long@^4.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" + integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== + +"@types/node@>=13.7.0", "@types/node@^20.14.9": + version "20.14.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.10.tgz#a1a218290f1b6428682e3af044785e5874db469a" + integrity sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ== + dependencies: + undici-types "~5.26.4" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axios@^1.6.0: + version "1.7.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" + integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + +base64-js@^1.3.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bech32@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +cosmjs-types@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.9.0.tgz#c3bc482d28c7dfa25d1445093fdb2d9da1f6cfcc" + integrity sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ== + +define-data-property@^1.0.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + +define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +elliptic@^6.5.4: + version "6.5.5" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.5.tgz#c715e09f78b6923977610d4c2346d6ce22e6dded" + integrity sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + +globalthis@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== + dependencies: + define-properties "^1.2.1" + gopd "^1.0.1" + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + +has-property-descriptors@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hasown@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +libsodium-sumo@^0.7.14: + version "0.7.14" + resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.14.tgz#9a53e09944f092f603a1e1d4446414de0b3fb0fc" + integrity sha512-2nDge6qlAjcwyslAhWfVumlkeSNK5+WCfKa2/VEq9prvlT5vP2FR0m0o5hmKaYqfsZ4TQVj5czQsimZvXDB1CQ== + +libsodium-wrappers-sumo@^0.7.11: + version "0.7.14" + resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.14.tgz#86301f14b37a77d847eb0396f2b83cdb1c47c480" + integrity sha512-0lm7ZwN5a95J2yUi8R1rgQeeaVDIWnvNzgVmXmZswis4mC+bQtbDrB+QpJlL4qklaKx3hVpJjoc6ubzJFiv64Q== + dependencies: + libsodium-sumo "^0.7.14" + +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +protobufjs@^6.8.8: + version "6.11.4" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" + integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + +readonly-date@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/readonly-date/-/readonly-date-1.0.0.tgz#5af785464d8c7d7c40b9d738cbde8c646f97dcd9" + integrity sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ== + +symbol-observable@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a" + integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +ws@^7: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + +xstream@^11.14.0: + version "11.14.0" + resolved "https://registry.yarnpkg.com/xstream/-/xstream-11.14.0.tgz#2c071d26b18310523b6877e86b4e54df068a9ae5" + integrity sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw== + dependencies: + globalthis "^1.0.1" + symbol-observable "^2.0.3" diff --git a/testutil/e2e/sdkE2E.go b/testutil/e2e/sdkE2E.go index bcad1cef07..d3f66d350d 100644 --- a/testutil/e2e/sdkE2E.go +++ b/testutil/e2e/sdkE2E.go @@ -10,10 +10,10 @@ import ( "strings" "time" - commonconsts "github.com/lavanet/lava/testutil/common/consts" - "github.com/lavanet/lava/testutil/e2e/sdk" - "github.com/lavanet/lava/utils" - epochStorageTypes "github.com/lavanet/lava/x/epochstorage/types" + commonconsts "github.com/lavanet/lava/v2/testutil/common/consts" + "github.com/lavanet/lava/v2/testutil/e2e/sdk" + "github.com/lavanet/lava/v2/utils" + epochStorageTypes "github.com/lavanet/lava/v2/x/epochstorage/types" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) @@ -21,21 +21,15 @@ import ( const sdkLogsFolder = "./testutil/e2e/sdkLogs/" // startBadgeServer starts badge server -func (lt *lavaTest) startBadgeServer(ctx context.Context, privateKey, publicKey, port, maxCU string) { - badgeUserData := fmt.Sprintf(`{"1":{"default":{"project_public_key":"%s","private_key":"%s","epochs_max_cu":%s}},"2":{"default":{"project_public_key":"%s","private_key":"%s","epochs_max_cu":%s}}}`, publicKey, privateKey, maxCU, publicKey, privateKey, maxCU) - err := os.Setenv("BADGE_USER_DATA", badgeUserData) - if err != nil { - panic(err) - } +func (lt *lavaTest) startBadgeServer(ctx context.Context, walletName, port, configPath string) { + command := fmt.Sprintf( + "%s badgeserver %s --port %s --chain-id=lava --from %s --log_level debug", + lt.protocolPath, configPath, port, walletName, + ) - command := fmt.Sprintf("%s badgegenerator --port=%s --grpc-url=127.0.0.1:9090 --log_level=debug --chain-id lava", lt.protocolPath, port) - err = os.Setenv("BADGE_DEFAULT_GEOLOCATION", "1") - if err != nil { - panic(err) - } logName := "01_BadgeServer_" + port funcName := "startBadgeServer_" + port - lt.execCommandWithRetry(ctx, funcName, logName, command) + lt.execCommand(ctx, funcName, logName, command, false) lt.checkBadgeServerResponsive(ctx, fmt.Sprintf("127.0.0.1:%s", port), time.Minute) @@ -127,14 +121,10 @@ func runSDKE2E(timeout time.Duration) { utils.LavaFormatInfo("RUNNING TESTS") - // Export user1 private key - privateKey := exportUserPrivateKey(lt.lavadPath, "user1") - - // Export user1 public key - publicKey := exportUserPublicKey(lt.lavadPath, "user1") + userWallet := "user1" // Start Badge server - lt.startBadgeServer(ctx, privateKey, publicKey, "7070", "3333333333") + lt.startBadgeServer(ctx, userWallet, "7070", badgeserverConfigFolder+"1") // ETH1 flow lt.startJSONRPCProxy(ctx) @@ -146,6 +136,12 @@ func runSDKE2E(timeout time.Duration) { // Lava Flow lt.startLavaProviders(ctx) + // Export user private key + privateKey := exportUserPrivateKey(lt.lavadPath, userWallet) + + // Export user public key + publicKey := exportUserPublicKey(lt.lavadPath, userWallet) + // Test SDK lt.logs["01_sdkTest"] = &sdk.SafeBuffer{} sdk.RunSDKTests(ctx, grpcConn, privateKey, publicKey, lt.logs["01_sdkTest"], "7070") @@ -185,9 +181,14 @@ func runSDKE2E(timeout time.Duration) { // skip current epoch <-signalChannel - privateKey = exportUserPrivateKey(lt.lavadPath, "user5") - publicKey = exportUserPublicKey(lt.lavadPath, "user5") - lt.startBadgeServer(ctx, privateKey, publicKey, "5050", "60") + userWallet = "user5" + // Export user private key + privateKey = exportUserPrivateKey(lt.lavadPath, userWallet) + + // Export user public key + publicKey = exportUserPublicKey(lt.lavadPath, userWallet) + + lt.startBadgeServer(ctx, userWallet, "5050", badgeserverConfigFolder+"2") defer func() { // Delete the file directly without checking if it exists diff --git a/testutil/keeper/conflict.go b/testutil/keeper/conflict.go index d915d94edb..1387433e2e 100644 --- a/testutil/keeper/conflict.go +++ b/testutil/keeper/conflict.go @@ -10,9 +10,9 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/dualstaking.go b/testutil/keeper/dualstaking.go index 313ec888d1..f6d96801ca 100644 --- a/testutil/keeper/dualstaking.go +++ b/testutil/keeper/dualstaking.go @@ -12,12 +12,12 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" - epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - speckeeper "github.com/lavanet/lava/x/spec/keeper" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + speckeeper "github.com/lavanet/lava/v2/x/spec/keeper" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/epochstorage.go b/testutil/keeper/epochstorage.go index ab47cd5b17..8a0682cd86 100644 --- a/testutil/keeper/epochstorage.go +++ b/testutil/keeper/epochstorage.go @@ -12,8 +12,8 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/keepers_init.go b/testutil/keeper/keepers_init.go index 984c93689e..e1431d84f8 100644 --- a/testutil/keeper/keepers_init.go +++ b/testutil/keeper/keepers_init.go @@ -31,38 +31,38 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - commonconsts "github.com/lavanet/lava/testutil/common/consts" - "github.com/lavanet/lava/utils/sigs" - conflictkeeper "github.com/lavanet/lava/x/conflict/keeper" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - downtimekeeper "github.com/lavanet/lava/x/downtime/keeper" - downtimemoduletypes "github.com/lavanet/lava/x/downtime/types" - downtimev1 "github.com/lavanet/lava/x/downtime/v1" - dualstakingkeeper "github.com/lavanet/lava/x/dualstaking/keeper" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - "github.com/lavanet/lava/x/pairing" - pairingkeeper "github.com/lavanet/lava/x/pairing/keeper" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - "github.com/lavanet/lava/x/plans" - planskeeper "github.com/lavanet/lava/x/plans/keeper" - planstypes "github.com/lavanet/lava/x/plans/types" - projectskeeper "github.com/lavanet/lava/x/projects/keeper" - projectstypes "github.com/lavanet/lava/x/projects/types" - protocolkeeper "github.com/lavanet/lava/x/protocol/keeper" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - rewardskeeper "github.com/lavanet/lava/x/rewards/keeper" - rewardstypes "github.com/lavanet/lava/x/rewards/types" - "github.com/lavanet/lava/x/spec" - speckeeper "github.com/lavanet/lava/x/spec/keeper" - spectypes "github.com/lavanet/lava/x/spec/types" - subscriptionkeeper "github.com/lavanet/lava/x/subscription/keeper" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + commonconsts "github.com/lavanet/lava/v2/testutil/common/consts" + "github.com/lavanet/lava/v2/utils/sigs" + conflictkeeper "github.com/lavanet/lava/v2/x/conflict/keeper" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + downtimekeeper "github.com/lavanet/lava/v2/x/downtime/keeper" + downtimemoduletypes "github.com/lavanet/lava/v2/x/downtime/types" + downtimev1 "github.com/lavanet/lava/v2/x/downtime/v1" + dualstakingkeeper "github.com/lavanet/lava/v2/x/dualstaking/keeper" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/pairing" + pairingkeeper "github.com/lavanet/lava/v2/x/pairing/keeper" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + "github.com/lavanet/lava/v2/x/plans" + planskeeper "github.com/lavanet/lava/v2/x/plans/keeper" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectskeeper "github.com/lavanet/lava/v2/x/projects/keeper" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + protocolkeeper "github.com/lavanet/lava/v2/x/protocol/keeper" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + rewardskeeper "github.com/lavanet/lava/v2/x/rewards/keeper" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + "github.com/lavanet/lava/v2/x/spec" + speckeeper "github.com/lavanet/lava/v2/x/spec/keeper" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptionkeeper "github.com/lavanet/lava/v2/x/subscription/keeper" + subscriptiontypes "github.com/lavanet/lava/v2/x/subscription/types" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/stretchr/testify/require" ) @@ -265,7 +265,7 @@ func InitAllKeepers(t testing.TB) (*Servers, *Keepers, context.Context) { ks.Protocol = *protocolkeeper.NewKeeper(cdc, protocolStoreKey, protocolMemStoreKey, protocolparamsSubspace, authtypes.NewModuleAddress(govtypes.ModuleName).String()) ks.Downtime = downtimekeeper.NewKeeper(cdc, downtimeKey, downtimeParamsSubspace, ks.Epochstorage) ks.Rewards = *rewardskeeper.NewKeeper(cdc, rewardsStoreKey, rewardsMemStoreKey, rewardsparamsSubspace, ks.BankKeeper, ks.AccountKeeper, ks.Spec, ks.Epochstorage, ks.Downtime, ks.StakingKeeper, ks.Dualstaking, ks.Distribution, authtypes.FeeCollectorName, ks.TimerStoreKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - ks.Subscription = *subscriptionkeeper.NewKeeper(cdc, subscriptionStoreKey, subscriptionMemStoreKey, subscriptionparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, &ks.Epochstorage, ks.Projects, ks.Plans, ks.Dualstaking, ks.Rewards, ks.FixationStoreKeeper, ks.TimerStoreKeeper, ks.StakingKeeper) + ks.Subscription = *subscriptionkeeper.NewKeeper(cdc, subscriptionStoreKey, subscriptionMemStoreKey, subscriptionparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, &ks.Epochstorage, ks.Projects, ks.Plans, ks.Dualstaking, ks.Rewards, ks.Spec, ks.FixationStoreKeeper, ks.TimerStoreKeeper, ks.StakingKeeper) ks.Pairing = *pairingkeeper.NewKeeper(cdc, pairingStoreKey, pairingMemStoreKey, pairingparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, ks.Spec, &ks.Epochstorage, ks.Projects, ks.Subscription, ks.Plans, ks.Downtime, ks.Dualstaking, &ks.StakingKeeper, ks.FixationStoreKeeper, ks.TimerStoreKeeper) ks.ParamsKeeper = paramsKeeper ks.Conflict = *conflictkeeper.NewKeeper(cdc, conflictStoreKey, conflictMemStoreKey, conflictparamsSubspace, &ks.BankKeeper, &ks.AccountKeeper, ks.Pairing, ks.Epochstorage, ks.Spec, ks.StakingKeeper) diff --git a/testutil/keeper/pairing.go b/testutil/keeper/pairing.go index 1ce4f401d4..65da2b4408 100644 --- a/testutil/keeper/pairing.go +++ b/testutil/keeper/pairing.go @@ -12,13 +12,13 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - epochstoragemodule "github.com/lavanet/lava/x/epochstorage" - epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + epochstoragemodule "github.com/lavanet/lava/v2/x/epochstorage" + epochstoragekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/plan.go b/testutil/keeper/plan.go index d4714b2571..2ec763a51f 100644 --- a/testutil/keeper/plan.go +++ b/testutil/keeper/plan.go @@ -12,12 +12,12 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - "github.com/lavanet/lava/x/plans/keeper" - "github.com/lavanet/lava/x/plans/types" - speckeeper "github.com/lavanet/lava/x/spec/keeper" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + epochstoragekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + "github.com/lavanet/lava/v2/x/plans/keeper" + "github.com/lavanet/lava/v2/x/plans/types" + speckeeper "github.com/lavanet/lava/v2/x/spec/keeper" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/projects.go b/testutil/keeper/projects.go index 9d1cb191cb..e2030f74c1 100644 --- a/testutil/keeper/projects.go +++ b/testutil/keeper/projects.go @@ -12,11 +12,11 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + epochstoragekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/protocol.go b/testutil/keeper/protocol.go index c1bde2e2c2..40faf6bec3 100644 --- a/testutil/keeper/protocol.go +++ b/testutil/keeper/protocol.go @@ -14,8 +14,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/protocol/keeper" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/keeper" + "github.com/lavanet/lava/v2/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/rewards.go b/testutil/keeper/rewards.go index dcaf8a43d5..73b0a36ead 100644 --- a/testutil/keeper/rewards.go +++ b/testutil/keeper/rewards.go @@ -18,13 +18,13 @@ import ( typesparams "github.com/cosmos/cosmos-sdk/x/params/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - downtimekeeper "github.com/lavanet/lava/x/downtime/keeper" - downtimemoduletypes "github.com/lavanet/lava/x/downtime/types" - v1 "github.com/lavanet/lava/x/downtime/v1" - epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/rewards/keeper" - "github.com/lavanet/lava/x/rewards/types" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + downtimekeeper "github.com/lavanet/lava/v2/x/downtime/keeper" + downtimemoduletypes "github.com/lavanet/lava/v2/x/downtime/types" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" + epochstoragekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/rewards/keeper" + "github.com/lavanet/lava/v2/x/rewards/types" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" "github.com/stretchr/testify/require" ) diff --git a/testutil/keeper/subscription.go b/testutil/keeper/subscription.go index dfbecbfafc..bfcdacfef6 100644 --- a/testutil/keeper/subscription.go +++ b/testutil/keeper/subscription.go @@ -12,14 +12,14 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - dualstakingkeeper "github.com/lavanet/lava/x/dualstaking/keeper" - epochstoragekeeper "github.com/lavanet/lava/x/epochstorage/keeper" - fixationkeeper "github.com/lavanet/lava/x/fixationstore/keeper" - planskeeper "github.com/lavanet/lava/x/plans/keeper" - projectskeeper "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + dualstakingkeeper "github.com/lavanet/lava/v2/x/dualstaking/keeper" + epochstoragekeeper "github.com/lavanet/lava/v2/x/epochstorage/keeper" + fixationkeeper "github.com/lavanet/lava/v2/x/fixationstore/keeper" + planskeeper "github.com/lavanet/lava/v2/x/plans/keeper" + projectskeeper "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" "github.com/stretchr/testify/require" ) @@ -79,6 +79,7 @@ func SubscriptionKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { planskeeper.NewKeeper(cdc, nil, nil, paramsSubspacePlans, nil, nil, fsKeeper, nil), dualstakingkeeper.NewKeeper(cdc, nil, nil, paramsSubspace, nil, nil, mockAccountKeeper{}, nil, nil, fsKeeper), nil, + nil, fsKeeper, tsKeeper, nil, diff --git a/testutil/network/network.go b/testutil/network/network.go index 80d6f0cd82..329ec07a56 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -20,7 +20,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/lavanet/lava/app" + "github.com/lavanet/lava/v2/app" ) type ( diff --git a/utils/address.go b/utils/address.go index 9c27f4e5b7..9fe29d6aaa 100644 --- a/utils/address.go +++ b/utils/address.go @@ -3,6 +3,7 @@ package utils import ( "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) func IsBech32Address(addr string) bool { @@ -17,7 +18,7 @@ func ParseCLIAddress(clientCtx client.Context, address string) (string, error) { // empty address --> address = creator address = clientCtx.GetFromAddress().String() } else { - if IsBech32Address(address) { + if IsBech32Address(address) || address == commontypes.EMPTY_PROVIDER { return address, nil } diff --git a/utils/cli/multisend.go b/utils/cli/multisend.go new file mode 100644 index 0000000000..48c3af6de0 --- /dev/null +++ b/utils/cli/multisend.go @@ -0,0 +1,435 @@ +package cli + +import ( + "encoding/csv" + "encoding/json" + "fmt" + "os" + "strconv" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +const ( + HotWalletFlagName = "hot-wallet" + RPCRetriesFlagName = "rpc-retries" +) + +const ( + PRG_ready = iota + PRG_bank_send + PRG_bank_send_verified + PRG_multisend +) + +type Progress struct { + Index int `json:"Index"` + Progress int `json:"Progress"` + SequenceOrigin uint64 `json:"SequenceOrigin"` + SequenceHotWallet uint64 `json:"SequenceHotWallet"` + HotWallet string `json:"HotWallet"` +} + +// NewMultiSendTxCmd returns a CLI command handler for creating a MsgMultiSend transaction. +// For a better UX this command is limited to send funds from one account to two or more accounts. +func NewMultiSendTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "multi-send [file.csv] --from [address]", + Short: `Send funds from one account to two or more accounts as instructed in the csv file and divides to multiple messages.`, + Long: `Send funds from one account to two or more accounts as instructed in the csv file and divides to multiple messages. + expected csv is two columns, first column contains the address to send to, second colum is the amount to send in ulava`, + Example: `lavad test multi-send output.csv --from alice + lavad test multi-send output.csv --from alice --ledger --hot-wallet bob`, + Args: cobra.RangeArgs(1, 2), + RunE: func(cmd *cobra.Command, args []string) error { + MAX_ADDRESSES := 3000 + + clientCtxOrigin, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + authquerier := authtypes.NewQueryClient(clientCtxOrigin) + + homedir, _ := cmd.Flags().GetString("home") + progressFile := homedir + "/multi_send_progress.csv" + progress := loadProgress(progressFile) + + hotWallet, err := cmd.Flags().GetString(HotWalletFlagName) + clientCtxHotWallet := clientCtxOrigin + useHotWallet := false + if err != nil { + return err + } + if hotWallet != "" { + if progress.HotWallet != "" && progress.HotWallet != hotWallet { + return fmt.Errorf("using different hot wallet than saved in progress file") + } + useHotWallet = true + cmd.Flags().Set("from", hotWallet) + cmd.Flags().Set("ledger", "false") + clientCtxHotWallet, err = client.GetClientTxContext(cmd) + if err != nil { + return err + } + } + progress.HotWallet = hotWallet + + retries, _ := cmd.Flags().GetInt(RPCRetriesFlagName) + + // Open the CSV file + file, err := os.Open(args[0]) + if err != nil { + return err + } + defer file.Close() + + if len(args) == 2 { + index, err := strconv.Atoi(args[1]) + if err != nil { + return err + } + progress.Index = index - 1 + } + + feesStr, _ := cmd.Flags().GetString(flags.FlagFees) + fees, err := sdk.ParseCoinsNormalized(feesStr) + if err != nil { + panic(err) + } + + // Create a new CSV reader + reader := csv.NewReader(file) + + // Read all records + records, err := reader.ReadAll() + if err != nil { + return err + } + + getSequence := func(account string) (uint64, error) { + var err error + var res *authtypes.QueryAccountResponse + for i := 0; i < retries; i++ { + res, err = authquerier.Account(cmd.Context(), &authtypes.QueryAccountRequest{Address: account}) + if err == nil { + break + } + } + if err != nil { + return 0, err + } + + acc, ok := res.Account.GetCachedValue().(authtypes.AccountI) + if !ok { + return 0, fmt.Errorf("cant unmarshal") + } + + return acc.GetSequence(), err + } + + getResponse := func(account string, sequence uint64) bool { + tmEvents := []string{ + fmt.Sprintf("%s.%s='%s/%d'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, account, sequence), + } + + var err error + var txs *sdk.SearchTxsResult + for i := 0; i < retries; i++ { + txs, err = authtx.QueryTxsByEvents(clientCtxOrigin, tmEvents, query.DefaultPage, query.DefaultLimit, "") + if err == nil { + break + } + } + if err != nil { + fmt.Printf("failed to query tx %s\n", err) + return false + } + if len(txs.Txs) == 0 { + fmt.Println("found no txs matching given address and sequence combination") + return false + } + if len(txs.Txs) > 1 { + // This case means there's a bug somewhere else in the code. Should not happen. + fmt.Printf("found %d txs matching given address and sequence combination\n", len(txs.Txs)) + return false + } + + return txs.Txs[0].Code == 0 + } + + waitSequenceChange := func(account string, sequence uint64) error { + currentSequence, err := getSequence(account) + if err != nil { + return err + } + for currentSequence < sequence { + fmt.Printf("waiting for sequence number %d current %d \n", sequence, currentSequence) + time.Sleep(5 * time.Second) + + currentSequence, err = getSequence(account) + if err != nil { + return err + } + } + if !getResponse(account, sequence-1) { + return fmt.Errorf("transaction failed") + } + return nil + } + + if progress.SequenceOrigin == 0 { + progress.SequenceOrigin, err = getSequence(clientCtxOrigin.FromAddress.String()) + if err != nil { + return err + } + } + + if progress.SequenceHotWallet == 0 { + progress.SequenceHotWallet = progress.SequenceOrigin + if useHotWallet { + progress.SequenceHotWallet, err = getSequence(clientCtxHotWallet.FromAddress.String()) + if err != nil { + return err + } + } + } + + output := []banktypes.Output{} + totalAmount := sdk.Coins{} + for i := progress.Index; i < len(records); i++ { + coins, err := sdk.ParseCoinsNormalized(records[i][1]) + if err != nil { + fmt.Printf("failed decoding coins record %d\n", i) + return err + } + + if coins.IsZero() { + fmt.Printf("invalid coins record %d\n", i) + return fmt.Errorf("must send positive amount") + } + toAddr, err := sdk.AccAddressFromBech32(records[i][0]) + if err != nil { + fmt.Printf("failed sending records from %d to %d\n", progress.Index, i) + fmt.Printf("please run again with: multi-send [file.csv] %d\n", progress.Index) + return err + } + output = append(output, banktypes.NewOutput(toAddr, coins)) + totalAmount = totalAmount.Add(coins...) + + if (i+1)%MAX_ADDRESSES == 0 || (i+1) == len(records) { + if useHotWallet { + if progress.Progress == PRG_ready { + fmt.Printf("*********************sending from origin to hotwallet %s*******************\n", totalAmount.Add(fees...).String()) + currentSequence, err := getSequence(clientCtxOrigin.FromAddress.String()) + if err != nil { + return err + } + if currentSequence != progress.SequenceOrigin { + return fmt.Errorf("unexpected sequence for account %s, current %d, expected %d", clientCtxOrigin.FromAddress.String(), currentSequence, progress.SequenceOrigin) + } + msg := banktypes.NewMsgSend(clientCtxOrigin.FromAddress, clientCtxHotWallet.FromAddress, totalAmount.Add(fees...)) + err = tx.GenerateOrBroadcastTxCLI(clientCtxOrigin, cmd.Flags(), msg) + if err != nil { + fmt.Printf("failed sending records from %d to %d\n", progress.Index, i) + fmt.Printf("please run again with: multi-send [file.csv] %d\n", progress.Index) + return err + } + progress.Progress = PRG_bank_send + progress.SequenceOrigin++ + saveProgress(progress, progressFile) + } + if progress.Progress == PRG_bank_send { + fmt.Printf("*********************verifing bank send *******************\n") + err = waitSequenceChange(clientCtxOrigin.FromAddress.String(), progress.SequenceOrigin) + if err != nil { + fmt.Printf("failed sending records from %d to %d\n", progress.Index, i) + fmt.Printf("please run again with: multi-send [file.csv] %d\n", progress.Index) + return err + } + progress.Progress = PRG_bank_send_verified + saveProgress(progress, progressFile) + fmt.Printf("*********************verified bank send *******************\n") + } + } + + if progress.Progress == PRG_bank_send_verified || progress.Progress == PRG_ready { + msg := banktypes.NewMsgMultiSend([]banktypes.Input{banktypes.NewInput(clientCtxHotWallet.FromAddress, totalAmount)}, output) + fmt.Printf("*********************sending records from %d to %d, total tokens %s*******************\n", progress.Index, i, totalAmount.String()) + currentSequence, err := getSequence(clientCtxHotWallet.FromAddress.String()) + if err != nil { + return err + } + if currentSequence != progress.SequenceHotWallet { + return fmt.Errorf("unexpected sequence for account %s, current %d, expected %d", clientCtxHotWallet.FromAddress.String(), currentSequence, progress.SequenceHotWallet) + } + err = tx.GenerateOrBroadcastTxCLI(clientCtxHotWallet, cmd.Flags(), msg) + if err != nil { + fmt.Printf("failed sending records from %d to %d\n", progress.Index, i) + fmt.Printf("please run again with: multi-send [file.csv] %d\n", progress.Index) + return err + } + progress.Progress = PRG_multisend + progress.SequenceHotWallet++ + saveProgress(progress, progressFile) + } + + if progress.Progress == PRG_multisend { + fmt.Printf("*********************verifing multi send *******************\n") + err = waitSequenceChange(clientCtxHotWallet.FromAddress.String(), progress.SequenceHotWallet) + if err != nil { + fmt.Printf("failed sending records from %d to %d\n", progress.Index, i) + fmt.Printf("please run again with: multi-send [file.csv] %d\n", progress.Index) + return err + } + progress.Progress = PRG_ready + progress.Index = i + 1 + saveProgress(progress, progressFile) + fmt.Printf("*********************verified multi send *******************\n") + } + output = []banktypes.Output{} + totalAmount = sdk.Coins{} + } + } + + return nil + }, + } + + cmd.Flags().Int(RPCRetriesFlagName, 3, "number of retries on rpc error") + cmd.Flags().String(HotWalletFlagName, "", "optional, hot wallet to be used as a middle point") + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func saveProgress(progress Progress, filename string) { + data, err := json.MarshalIndent(progress, "", " ") + if err != nil { + fmt.Println("Error marshalling progress:", err) + return + } + + err = os.WriteFile(filename, data, 0o644) + if err != nil { + fmt.Println("Error writing file:", err) + return + } +} + +func loadProgress(filename string) Progress { + var progress Progress + + // Check if file exists + if _, err := os.Stat(filename); os.IsNotExist(err) { + fmt.Println("File does not exist, using default progress") + return Progress{Index: 0, Progress: PRG_ready} // Default values + } + + data, err := os.ReadFile(filename) + if err != nil { + fmt.Println("Error reading file:", err) + return progress + } + + err = json.Unmarshal(data, &progress) + if err != nil { + fmt.Println("Error unmarshalling progress:", err) + } + + return progress +} + +func NewQueryTotalGasCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-gas address chainid", + Short: `calculate the total gas used by a provider in 24H`, + Long: `calculate the total gas used by a provider in 24H`, + Example: "total-gas lava@... NEAR", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + authquerier := authtypes.NewQueryClient(clientCtx) + + account := args[0] + chainid := args[1] + + getSequence := func(account string) (uint64, error) { + res, err := authquerier.Account(cmd.Context(), &authtypes.QueryAccountRequest{Address: account}) + if err != nil { + return 0, err + } + + acc, ok := res.Account.GetCachedValue().(authtypes.AccountI) + if !ok { + return 0, fmt.Errorf("cant unmarshal") + } + + return acc.GetSequence(), err + } + + getResponse := func(account string, sequence uint64) *sdk.TxResponse { + tmEvents := []string{ + fmt.Sprintf("%s.%s='%s/%d'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, account, sequence), + } + txs, err := authtx.QueryTxsByEvents(clientCtx, tmEvents, query.DefaultPage, query.DefaultLimit, "") + if err != nil { + fmt.Printf("failed to query tx %s\n", err) + return nil + } + if len(txs.Txs) == 0 { + fmt.Println("found no txs matching given address and sequence combination") + return nil + } + if len(txs.Txs) > 1 { + // This case means there's a bug somewhere else in the code. Should not happen. + fmt.Printf("found %d txs matching given address and sequence combination\n", len(txs.Txs)) + return nil + } + + return txs.Txs[0] + } + + now := time.Now().UTC() + txtime := now + totalgas := int64(0) + sequence, _ := getSequence(account) + layout := time.RFC3339 + for now.Sub(txtime) < 24*time.Hour { + sequence-- + tx := getResponse(account, sequence) + + if strings.Contains(tx.RawLog, chainid) && strings.Contains(tx.RawLog, "MsgRelayPayment") { + totalgas += tx.GasUsed + } + // Parse the time string + txtime, err = time.Parse(layout, tx.Timestamp) + if err != nil { + return err + } + + fmt.Printf("sequence %d, totalgas %d txdiff %f sec\n", sequence, totalgas, now.Sub(txtime).Seconds()) + } + + return nil + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/utils/collcompat/collcompat.go b/utils/collcompat/collcompat.go new file mode 100644 index 0000000000..c2d4588166 --- /dev/null +++ b/utils/collcompat/collcompat.go @@ -0,0 +1,118 @@ +package utils + +import ( + "context" + + collcodec "cosmossdk.io/collections/codec" + "cosmossdk.io/core/store" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/gogo/protobuf/proto" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func NewKVStoreService(storeKey storetypes.StoreKey) store.KVStoreService { + return &kvStoreService{key: storeKey} +} + +type kvStoreService struct { + key storetypes.StoreKey +} + +func (k kvStoreService) OpenKVStore(ctx context.Context) store.KVStore { + return newKVStore(sdk.UnwrapSDKContext(ctx).KVStore(k.key)) +} + +// CoreKVStore is a wrapper of Core/Store kvstore interface +// Remove after https://github.com/cosmos/cosmos-sdk/issues/14714 is closed +type coreKVStore struct { + kvStore storetypes.KVStore +} + +// NewKVStore returns a wrapper of Core/Store kvstore interface +// Remove once store migrates to core/store kvstore interface +func newKVStore(store storetypes.KVStore) store.KVStore { + return coreKVStore{kvStore: store} +} + +// Get returns nil iff key doesn't exist. Errors on nil key. +func (store coreKVStore) Get(key []byte) ([]byte, error) { + return store.kvStore.Get(key), nil +} + +// Has checks if a key exists. Errors on nil key. +func (store coreKVStore) Has(key []byte) (bool, error) { + return store.kvStore.Has(key), nil +} + +// Set sets the key. Errors on nil key or value. +func (store coreKVStore) Set(key, value []byte) error { + store.kvStore.Set(key, value) + return nil +} + +// Delete deletes the key. Errors on nil key. +func (store coreKVStore) Delete(key []byte) error { + store.kvStore.Delete(key) + return nil +} + +// Iterator iterates over a domain of keys in ascending order. End is exclusive. +// Start must be less than end, or the Iterator is invalid. +// Iterator must be closed by caller. +// To iterate over entire domain, use store.Iterator(nil, nil) +// CONTRACT: No writes may happen within a domain while an iterator exists over it. +// Exceptionally allowed for cachekv.Store, safe to write in the modules. +func (store coreKVStore) Iterator(start, end []byte) (store.Iterator, error) { + return store.kvStore.Iterator(start, end), nil +} + +func (store coreKVStore) ReverseIterator(start, end []byte) (store.Iterator, error) { + return store.kvStore.ReverseIterator(start, end), nil +} + +type protoMessage[T any] interface { + *T + codec.ProtoMarshaler +} + +// ProtoValue inits a collections.ValueCodec for a generic gogo protobuf message. +func ProtoValue[T any, PT protoMessage[T]](cdc codec.BinaryCodec) collcodec.ValueCodec[T] { + c, ok := cdc.(codec.Codec) + if !ok { + return &collValue[T, PT]{} + } + return &collValue[T, PT]{c, proto.MessageName(PT(new(T)))} +} + +type collValue[T any, PT protoMessage[T]] struct { + cdc codec.Codec + messageName string +} + +func (c collValue[T, PT]) Encode(value T) ([]byte, error) { + return c.cdc.Marshal(PT(&value)) +} + +func (c collValue[T, PT]) Decode(b []byte) (value T, err error) { + err = c.cdc.Unmarshal(b, PT(&value)) + return value, err +} + +func (c collValue[T, PT]) EncodeJSON(value T) ([]byte, error) { + return c.cdc.MarshalJSON(PT(&value)) +} + +func (c collValue[T, PT]) DecodeJSON(b []byte) (value T, err error) { + err = c.cdc.UnmarshalJSON(b, PT(&value)) + return +} + +func (c collValue[T, PT]) Stringify(value T) string { + return PT(&value).String() +} + +func (c collValue[T, PT]) ValueType() string { + return "github.com/cosmos/gogoproto/" + c.messageName +} diff --git a/utils/common/types/ascii.go b/utils/common/types/ascii.go index d8c009fef8..75b4ac0fcf 100644 --- a/utils/common/types/ascii.go +++ b/utils/common/types/ascii.go @@ -52,7 +52,7 @@ func ValidateString(s string, restrictType charRestrictionEnum, disallowedChars return false } - if restrictType == DESCRIPTION_RESTRICTIONS && (len(s) == 0 || len(s) > MAX_LEN_DESCRIPTION) { + if restrictType == DESCRIPTION_RESTRICTIONS && len(s) > MAX_LEN_DESCRIPTION { return false } diff --git a/utils/common/types/ascii_test.go b/utils/common/types/ascii_test.go index 298207a776..47f35caa66 100644 --- a/utils/common/types/ascii_test.go +++ b/utils/common/types/ascii_test.go @@ -30,9 +30,9 @@ func TestStringValidation(t *testing.T) { {"valid_desc_with_underscore", "hel_lo", DESCRIPTION_RESTRICTIONS, nil, true}, {"valid_desc_with_digit", "hel2lo", DESCRIPTION_RESTRICTIONS, nil, true}, {"valid_desc_not_lowercase", "hEllo", DESCRIPTION_RESTRICTIONS, nil, true}, + {"valid_empty_desc", "", DESCRIPTION_RESTRICTIONS, nil, true}, {"invalid_desc_not_ascii", "heあllo", DESCRIPTION_RESTRICTIONS, nil, false}, {"invalid_desc_with_disallowed_char", "heallo", DESCRIPTION_RESTRICTIONS, []rune{'a'}, false}, - {"invalid_empty_desc", "", DESCRIPTION_RESTRICTIONS, nil, false}, // index restrictions tests {"valid_index", "hello", INDEX_RESTRICTIONS, nil, true}, diff --git a/utils/common/types/provider.go b/utils/common/types/provider.go new file mode 100644 index 0000000000..f83a43d723 --- /dev/null +++ b/utils/common/types/provider.go @@ -0,0 +1,8 @@ +package types + +// empty provider consts +const ( + EMPTY_PROVIDER = "empty_provider" + EMPTY_PROVIDER_CHAINID = "" + EMPTY_PROVIDER_CHAINID_STAR = "*" +) diff --git a/testutil/keeper/spec.go b/utils/keeper/spec.go similarity index 53% rename from testutil/keeper/spec.go rename to utils/keeper/spec.go index 6a0acc7e67..f76965c5a4 100644 --- a/testutil/keeper/spec.go +++ b/utils/keeper/spec.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "os" - "strings" "testing" tmdb "github.com/cometbft/cometbft-db" @@ -17,9 +16,9 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/spec/client/utils" - "github.com/lavanet/lava/x/spec/keeper" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/client/utils" + "github.com/lavanet/lava/v2/x/spec/keeper" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -67,7 +66,20 @@ func specKeeper() (*keeper.Keeper, sdk.Context, error) { return k, ctx, nil } -func GetASpec(specIndex, getToTopMostPath string, ctxArg *sdk.Context, keeper *keeper.Keeper) (specRet spectypes.Spec, err error) { +func decodeProposal(path string) (utils.SpecAddProposalJSON, error) { + proposal := utils.SpecAddProposalJSON{} + contents, err := os.ReadFile(path) + if err != nil { + return proposal, err + } + decoder := json.NewDecoder(bytes.NewReader(contents)) + decoder.DisallowUnknownFields() // This will make the unmarshal fail if there are unused fields + + err = decoder.Decode(&proposal) + return proposal, err +} + +func GetSpecFromPath(path string, specIndex string, ctxArg *sdk.Context, keeper *keeper.Keeper) (specRet spectypes.Spec, err error) { var ctx sdk.Context if keeper == nil || ctxArg == nil { keeper, ctx, err = specKeeper() @@ -77,31 +89,48 @@ func GetASpec(specIndex, getToTopMostPath string, ctxArg *sdk.Context, keeper *k } else { ctx = *ctxArg } - proposalFile := "./cookbook/specs/ibc.json,./cookbook/specs/cosmoswasm.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/cosmossdk_full.json,./cookbook/specs/ethereum.json,./cookbook/specs/cosmoshub.json,./cookbook/specs/lava.json,./cookbook/specs/osmosis.json,./cookbook/specs/fantom.json,./cookbook/specs/celo.json,./cookbook/specs/optimism.json,./cookbook/specs/arbitrum.json,./cookbook/specs/starknet.json,./cookbook/specs/aptos.json,./cookbook/specs/juno.json,./cookbook/specs/polygon.json,./cookbook/specs/evmos.json,./cookbook/specs/base.json,./cookbook/specs/canto.json,./cookbook/specs/sui.json,./cookbook/specs/solana.json,./cookbook/specs/bsc.json,./cookbook/specs/axelar.json,./cookbook/specs/avalanche.json,./cookbook/specs/fvm.json" - for _, fileName := range strings.Split(proposalFile, ",") { - proposal := utils.SpecAddProposalJSON{} - contents, err := os.ReadFile(getToTopMostPath + fileName) + proposal, err := decodeProposal(path) + if err != nil { + return spectypes.Spec{}, err + } + + for _, spec := range proposal.Proposal.Specs { + keeper.SetSpec(ctx, spec) + if specIndex != spec.Index { + continue + } + fullspec, err := keeper.ExpandSpec(ctx, spec) if err != nil { return spectypes.Spec{}, err } - decoder := json.NewDecoder(bytes.NewReader(contents)) - decoder.DisallowUnknownFields() // This will make the unmarshal fail if there are unused fields + return fullspec, nil + } + return spectypes.Spec{}, fmt.Errorf("spec not found %s", path) +} - if err := decoder.Decode(&proposal); err != nil { +func GetASpec(specIndex, getToTopMostPath string, ctxArg *sdk.Context, keeper *keeper.Keeper) (specRet spectypes.Spec, err error) { + var ctx sdk.Context + if keeper == nil || ctxArg == nil { + keeper, ctx, err = specKeeper() + if err != nil { return spectypes.Spec{}, err } - - for _, spec := range proposal.Proposal.Specs { - keeper.SetSpec(ctx, spec) - if specIndex != spec.Index { - continue - } - fullspec, err := keeper.ExpandSpec(ctx, spec) - if err != nil { - return spectypes.Spec{}, err - } - return fullspec, nil + } else { + ctx = *ctxArg + } + proposalDirectory := "cookbook/specs/" + proposalFiles := []string{ + "ibc.json", "cosmoswasm.json", "tendermint.json", "cosmossdk.json", "cosmossdk_full.json", + "ethereum.json", "cosmoshub.json", "lava.json", "osmosis.json", "fantom.json", "celo.json", + "optimism.json", "arbitrum.json", "starknet.json", "aptos.json", "juno.json", "polygon.json", + "evmos.json", "base.json", "canto.json", "sui.json", "solana.json", "bsc.json", "axelar.json", + "avalanche.json", "fvm.json", "near.json", + } + for _, fileName := range proposalFiles { + spec, err := GetSpecFromPath(getToTopMostPath+proposalDirectory+fileName, specIndex, &ctx, keeper) + if err == nil { + return spec, nil } } return spectypes.Spec{}, fmt.Errorf("spec not found %s", specIndex) diff --git a/utils/lavalog.go b/utils/lavalog.go index 870890e78c..5e7908d185 100644 --- a/utils/lavalog.go +++ b/utils/lavalog.go @@ -36,9 +36,9 @@ const ( var ( JsonFormat = false // if set to production, this will replace some errors to warning that can be caused by misuse instead of bugs - ExtendedLogLevel = "development" - rollingLogLogger = zerolog.New(os.Stderr).Level(zerolog.Disabled) // this is the singleton rolling logger. - globalLogLevel = zerolog.TraceLevel + ExtendedLogLevel = "development" + rollingLogLogger = zerolog.New(os.Stderr).Level(zerolog.Disabled) // this is the singleton rolling logger. + defaultGlobalLogLevel = zerolog.DebugLevel ) type Attribute struct { @@ -94,7 +94,7 @@ func getLogLevel(logLevel string) zerolog.Level { func SetGlobalLoggingLevel(logLevel string) { // setting global level prevents us from having two different levels for example one for stdout and one for rolling log. // zerolog.SetGlobalLevel(getLogLevel(logLevel)) - globalLogLevel = getLogLevel(logLevel) + defaultGlobalLogLevel = getLogLevel(logLevel) LavaFormatInfo("setting log level", Attribute{Key: "loglevel", Value: logLevel}) } @@ -198,6 +198,13 @@ func StrValue(val interface{}) string { st_val = strconv.FormatUint(value, 10) case error: st_val = value.Error() + case []error: + for _, err := range value { + if err == nil { + continue + } + st_val += err.Error() + ";" + } case []string: st_val = strings.Join(value, ",") // needs to come after stringer so byte inheriting objects will use their string method if implemented (like AccAddress) @@ -214,9 +221,9 @@ func StrValue(val interface{}) string { func LavaFormatLog(description string, err error, attributes []Attribute, severity uint) error { zerolog.TimeFieldFormat = zerolog.TimeFormatUnix if JsonFormat { - zerologlog.Logger = zerologlog.Output(os.Stderr).Level(globalLogLevel) + zerologlog.Logger = zerologlog.Output(os.Stderr).Level(defaultGlobalLogLevel) } else { - zerologlog.Logger = zerologlog.Output(zerolog.ConsoleWriter{Out: os.Stderr, NoColor: NoColor, TimeFormat: time.Stamp}).Level(globalLogLevel) + zerologlog.Logger = zerologlog.Output(zerolog.ConsoleWriter{Out: os.Stderr, NoColor: NoColor, TimeFormat: time.Stamp}).Level(defaultGlobalLogLevel) } var logEvent *zerolog.Event @@ -279,7 +286,7 @@ func LavaFormatLog(description string, err error, attributes []Attribute, severi // here we return the same type of the original error message, this handles nil case as well errRet := sdkerrors.Wrap(err, output) if errRet == nil { // we always want to return an error if lavaFormatError was called - return fmt.Errorf(output) + return fmt.Errorf("%s", output) } return errRet } @@ -326,6 +333,10 @@ func LavaFormatTrace(description string, attributes ...Attribute) error { return LavaFormatLog(description, nil, attributes, LAVA_LOG_TRACE) } +func IsTraceLogLevelEnabled() bool { + return defaultGlobalLogLevel == zerolog.TraceLevel +} + func FormatStringerList[T fmt.Stringer](description string, listToPrint []T, separator string) string { st := "" for _, printable := range listToPrint { @@ -343,3 +354,7 @@ func FormatLongString(msg string, maxCharacters int) string { } return msg } + +func ToHexString(hash string) string { + return fmt.Sprintf("%x", hash) +} diff --git a/utils/lavalog_test.go b/utils/lavalog_test.go index 28b77b82fe..ef47a89788 100644 --- a/utils/lavalog_test.go +++ b/utils/lavalog_test.go @@ -4,7 +4,7 @@ import ( "testing" sdkerrors "cosmossdk.io/errors" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" "github.com/stretchr/testify/require" ) diff --git a/utils/lavaslices/slices.go b/utils/lavaslices/slices.go index d93c41ee03..747b5fc3f0 100644 --- a/utils/lavaslices/slices.go +++ b/utils/lavaslices/slices.go @@ -79,7 +79,9 @@ func Median[T Number](slice []T) T { if data_len == 0 { return 0 } else if data_len%2 == 0 { - return ((slice[data_len/2-1] + slice[data_len/2]) / T(2)) + left := slice[data_len/2-1] + right := slice[data_len/2] + return (left + right) / 2 } else { return slice[(data_len-1)/2] } @@ -296,3 +298,19 @@ func SplitGenericSliceIntoChunks[T any](arr []T, chunkSize int) [][]T { return result } + +func SortStable[T constraints.Ordered](slice []T) { + slices.SortStableFunc(slice, func(i, j T) bool { return i < j }) +} + +// This function is used to check if the slice is consecutive. +// It returns the index of the first non-consecutive element or 0 if all elements are consecutive. +func IsSliceConsecutive[T constraints.Integer](slice []T) (int, bool) { + for index := range slice { + if index != 0 && slice[index]-1 != slice[index-1] { + return index, false + } + } + + return 0, true +} diff --git a/utils/lavaslices/slices_test.go b/utils/lavaslices/slices_test.go index 5101457b08..4a5880a8a2 100644 --- a/utils/lavaslices/slices_test.go +++ b/utils/lavaslices/slices_test.go @@ -106,7 +106,7 @@ func TestConcat(t *testing.T) { } } -func TestMedian(t *testing.T) { +func TestMedianInt(t *testing.T) { for _, tt := range []struct { name string slice []int @@ -130,6 +130,75 @@ func TestMedian(t *testing.T) { } } +func TestMedianInt64(t *testing.T) { + tests := []struct { + name string + slice []int64 + want int64 + }{ + {"empty slice", []int64{}, 0}, + {"single element", []int64{42}, 42}, + {"odd count", []int64{10, 20, 30}, 20}, + {"even count", []int64{10, 20, 30, 40}, 25}, + {"negative values", []int64{-30, -20, -10}, -20}, + {"mixed values", []int64{-10, 0, 10}, 0}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + median := Median(tt.slice) + require.Equal(t, tt.want, median) + }) + } +} + +func TestMedianFloat64(t *testing.T) { + tests := []struct { + name string + slice []float64 + want float64 + }{ + {"empty slice", []float64{}, 0}, + {"single element", []float64{42.0}, 42.0}, + {"odd count", []float64{1.1, 2.2, 3.3}, 2.2}, + {"even count", []float64{1.1, 2.2, 3.3, 4.4}, 2.75}, + {"negative values", []float64{-3.3, -2.2, -1.1}, -2.2}, + {"mixed values", []float64{-1.1, 0, 1.1}, 0}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + median := Median(tt.slice) + require.Equal(t, tt.want, median) + }) + } +} + +func TestMedianUint64(t *testing.T) { + tests := []struct { + name string + slice []uint64 + want uint64 + }{ + {"odd count", []uint64{10, 20, 30}, 20}, + {"even count", []uint64{10, 20, 30, 40}, 25}, + {"single element", []uint64{42}, 42}, + {"empty slice", []uint64{}, 0}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + median := Median(tt.slice) + require.Equal(t, tt.want, median) + }) + } +} + +func TestMedianPrecision(t *testing.T) { + t.Run("test large int64", func(t *testing.T) { + const largeInt = 9007199254740993 + median := Median([]int64{largeInt, largeInt}) + require.Equal(t, int64(largeInt), median) + }) +} + func TestPercentile(t *testing.T) { // test it equals median for _, tt := range []struct { diff --git a/utils/maps/maps.go b/utils/maps/maps.go index 35ed70e593..293646c458 100644 --- a/utils/maps/maps.go +++ b/utils/maps/maps.go @@ -1,5 +1,10 @@ package maps +import ( + "github.com/lavanet/lava/v2/utils/lavaslices" + "golang.org/x/exp/constraints" +) + func FindLargestIntValueInMap[K comparable](myMap map[K]int) (K, int) { var maxVal int var maxKey K @@ -15,3 +20,23 @@ func FindLargestIntValueInMap[K comparable](myMap map[K]int) (K, int) { return maxKey, maxVal } + +func StableSortedKeys[T constraints.Ordered, V any](m map[T]V) []T { + keys := make([]T, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + + lavaslices.SortStable(keys) + return keys +} + +func GetMaxKey[T constraints.Ordered, V any](m map[T]V) T { + var maxKey T + for k := range m { + if k > maxKey { + maxKey = k + } + } + return maxKey +} diff --git a/utils/protocopy/proto_copy.go b/utils/protocopy/proto_copy.go index 434912bc46..8e7dcf2727 100644 --- a/utils/protocopy/proto_copy.go +++ b/utils/protocopy/proto_copy.go @@ -1,7 +1,7 @@ package protocopy import ( - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type protoTypeOut interface { diff --git a/utils/protocopy/proto_copy_test.go b/utils/protocopy/proto_copy_test.go index 184b33e6e3..20ba5f4864 100644 --- a/utils/protocopy/proto_copy_test.go +++ b/utils/protocopy/proto_copy_test.go @@ -3,7 +3,7 @@ package protocopy import ( "testing" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/utils/rand/rand.go b/utils/rand/rand.go index 14eabd3732..21d159f7fb 100644 --- a/utils/rand/rand.go +++ b/utils/rand/rand.go @@ -91,30 +91,43 @@ func SetSpecificSeed(seed int64) { protocolRand = &threadSafeRand{rand: rand.New(rand.NewSource(seed))} } +func PanicIfProtocolRandNotInitialized() { + if protocolRand == nil { + panic("rand.InitRandomSeed() must be called before using the rand package") + } +} + func Intn(n int) int { + PanicIfProtocolRandNotInitialized() return protocolRand.Intn(n) } func Float64() float64 { + PanicIfProtocolRandNotInitialized() return protocolRand.Float64() } func Uint32() uint32 { + PanicIfProtocolRandNotInitialized() return protocolRand.Uint32() } func Uint64() uint64 { + PanicIfProtocolRandNotInitialized() return protocolRand.Uint64() } func Int63() int64 { + PanicIfProtocolRandNotInitialized() return protocolRand.Int63() } func Int63n(n int64) int64 { + PanicIfProtocolRandNotInitialized() return protocolRand.Int63n(n) } func NormFloat64() float64 { + PanicIfProtocolRandNotInitialized() return protocolRand.NormFloat64() } diff --git a/utils/score/decay_score.go b/utils/score/decay_score.go index 2337b896d7..5827ebee62 100644 --- a/utils/score/decay_score.go +++ b/utils/score/decay_score.go @@ -29,12 +29,15 @@ func NewScoreStore(num, denom float64, inpTime time.Time) ScoreStore { // where now is the current time. // // Note that the returned ScoreStore has a new Time field set to the current time. -func CalculateTimeDecayFunctionUpdate(oldScore, newScore ScoreStore, halfLife time.Duration, updateWeight float64, sampleTime time.Time) ScoreStore { +func CalculateTimeDecayFunctionUpdate(oldScore, newScore ScoreStore, halfLife time.Duration, updateWeight float64, sampleTime time.Time) (normalizedScoreStore ScoreStore, rawScoreStore ScoreStore) { oldDecayExponent := math.Ln2 * sampleTime.Sub(oldScore.Time).Seconds() / halfLife.Seconds() oldDecayFactor := math.Exp(-oldDecayExponent) newDecayExponent := math.Ln2 * sampleTime.Sub(newScore.Time).Seconds() / halfLife.Seconds() newDecayFactor := math.Exp(-newDecayExponent) updatedNum := oldScore.Num*oldDecayFactor + newScore.Num*newDecayFactor*updateWeight updatedDenom := oldScore.Denom*oldDecayFactor + newScore.Denom*newDecayFactor*updateWeight - return NewScoreStore(updatedNum, updatedDenom, sampleTime) + + // Raw denom = denom not divided by benchmark value (=denom of a new ScoreStore) + updatedRawDenom := oldDecayFactor + newDecayFactor*updateWeight // removed newScore.Denom from update to get raw data + return NewScoreStore(updatedNum, updatedDenom, sampleTime), NewScoreStore(updatedNum, updatedRawDenom, sampleTime) } diff --git a/utils/sigs/sigs.go b/utils/sigs/sigs.go index fe26af1ce6..b7e2bd39c6 100644 --- a/utils/sigs/sigs.go +++ b/utils/sigs/sigs.go @@ -10,15 +10,14 @@ package sigs import ( - "crypto/ecdsa" - "crypto/elliptic" "encoding/binary" "errors" "fmt" "io" "math/rand" - btcSecp256k1 "github.com/btcsuite/btcd/btcec" + btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" + btcSecp256k1Ecdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" tendermintcrypto "github.com/cometbft/cometbft/crypto" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto" @@ -26,7 +25,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) type Account struct { @@ -62,7 +61,7 @@ func Sign(pkey *btcSecp256k1.PrivateKey, data Signable) ([]byte, error) { msgData = HashMsg(msgData) } - sig, err := btcSecp256k1.SignCompact(btcSecp256k1.S256(), pkey, msgData, false) + sig, err := btcSecp256k1Ecdsa.SignCompact(pkey, msgData, false) if err != nil { return nil, err } @@ -95,7 +94,7 @@ func RecoverPubKey(data Signable) (secp256k1.PubKey, error) { } // Recover public key from signature - recPub, _, err := btcSecp256k1.RecoverCompact(btcSecp256k1.S256(), sig, msgData) + recPub, _, err := btcSecp256k1Ecdsa.RecoverCompact(sig, msgData) if err != nil { return secp256k1.PubKey{}, utils.LavaFormatError("RecoverCompact", err, utils.Attribute{Key: "sigLen", Value: len(sig)}, @@ -153,7 +152,7 @@ func GetPrivKey(clientCtx client.Context, keyName string) (*btcSecp256k1.Private return nil, errors.New("incompatible private key algorithm") } - priv, _ := btcSecp256k1.PrivKeyFromBytes(btcSecp256k1.S256(), privKey.Bytes()) + priv, _ := btcSecp256k1.PrivKeyFromBytes(privKey.Bytes()) return priv, nil } @@ -167,7 +166,7 @@ func GenerateFloatingKey() (secretKey *btcSecp256k1.PrivateKey, addr sdk.AccAddr sk := secp256k1.GenPrivKey() PubKey := sk.PubKey() addr = sdk.AccAddress(PubKey.Address()) - secretKey, _ = btcSecp256k1.PrivKeyFromBytes(btcSecp256k1.S256(), sk.Bytes()) + secretKey, _ = btcSecp256k1.PrivKeyFromBytes(sk.Bytes()) return } @@ -211,15 +210,7 @@ func GenerateDeterministicFloatingKey(rand io.Reader) (acc Account) { acc.PubKey = acc.sk.PubKey() acc.Addr = sdk.AccAddress(acc.PubKey.Address()) acc.ConsKey = ed25519.GenPrivKeyFromSecret(privkeySeed) - acc.SK, _ = btcSecp256k1.PrivKeyFromBytes(btcSecp256k1.S256(), acc.sk.Bytes()) + acc.SK, _ = btcSecp256k1.PrivKeyFromBytes(acc.sk.Bytes()) return } - -func DeterministicNewPrivateKey(curve elliptic.Curve, rand io.Reader) (*btcSecp256k1.PrivateKey, error) { - key, err := ecdsa.GenerateKey(curve, rand) - if err != nil { - return nil, err - } - return (*btcSecp256k1.PrivateKey)(key), nil -} diff --git a/vue/README.md b/vue/README.md deleted file mode 100644 index eb455d0cec..0000000000 --- a/vue/README.md +++ /dev/null @@ -1,25 +0,0 @@ -## App UI Template - -[Vue.js](https://vuejs.org/)-based web app template for your Cosmos SDK blockchain. Use the template to quickly bootstrap your app. To learn more, check out the components in `@starport/vue` and the [Starport documentation](https://docs.starport.network/). - -## Project setup - -``` -npm install -``` - -### Compiles and reloads the app on save for development - -``` -npm run dev -``` - -### Compiles and minifies for production - -``` -npm run build -``` - -### Customize configuration - -See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/vue/index.html b/vue/index.html deleted file mode 100644 index 3ec77752c0..0000000000 --- a/vue/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - -
- - - diff --git a/vue/package-lock.json b/vue/package-lock.json deleted file mode 100644 index bc20cdd758..0000000000 --- a/vue/package-lock.json +++ /dev/null @@ -1,2516 +0,0 @@ -{ - "name": "@starport/template", - "version": "0.3.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/parser": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.8.tgz", - "integrity": "sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw==" - }, - "@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==" - }, - "@confio/ics23": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.5.tgz", - "integrity": "sha512-1GdPMsaP/l8JSF4P4HWFLBhdcxHcJT8lS0nknBYNSZ1XrJOsJKUy6EkOwd9Pa1qJkXzY2gyNv7MdHR+AIwSTAg==", - "requires": { - "js-sha512": "^0.8.0", - "protobufjs": "^6.8.8", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "@confio/relayer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@confio/relayer/-/relayer-0.3.0.tgz", - "integrity": "sha512-U0DFJxACa5qgLo4OHQJNb8XrE1qHI3wpZwuWM6nwo4jnrwKNb8S/zp3AsGwK6TGcAPUQEfkiPmssY8oEM5GF5w==", - "requires": { - "@cosmjs/cosmwasm-stargate": "^0.26.0", - "@cosmjs/crypto": "^0.26.0", - "@cosmjs/encoding": "^0.26.0", - "@cosmjs/faucet-client": "^0.26.0", - "@cosmjs/math": "^0.26.0", - "@cosmjs/proto-signing": "^0.26.0", - "@cosmjs/stargate": "^0.26.0", - "@cosmjs/stream": "^0.26.0", - "@cosmjs/tendermint-rpc": "^0.26.0", - "@cosmjs/utils": "^0.26.0", - "ajv": "7.1.1", - "axios": "0.21.1", - "commander": "7.1.0", - "fast-safe-stringify": "2.0.4", - "js-yaml": "4.0.0", - "lodash": "4.17.21", - "prom-client": "13.1.0", - "protobufjs": "6.10.2", - "table": "^6.7.1", - "triple-beam": "1.3.0", - "winston": "3.3.3" - }, - "dependencies": { - "@cosmjs/amino": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.6.tgz", - "integrity": "sha512-O2MNJTduMnQzr7cK9PmvselY7XVCV+GxjC0vR/NBJmKZt7+GgGnHTLbbdOJr5MAQcESCwTkGAnnctw7hhoEjqw==", - "requires": { - "@cosmjs/crypto": "0.26.6", - "@cosmjs/encoding": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/utils": "0.26.6" - } - }, - "@cosmjs/crypto": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.6.tgz", - "integrity": "sha512-nR8gXZH6NljKL4vArkCmDCVA10hMtHHaJQYGlHpYufnXbbx4614FnzOd8Y/CkunhjFGM0jn/WFT4rCjbPYzuUw==", - "requires": { - "@cosmjs/encoding": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/utils": "0.26.6", - "bip39": "^3.0.2", - "bn.js": "^4.11.8", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "@cosmjs/encoding": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.6.tgz", - "integrity": "sha512-dU0P2Um9ZB5yHpQYq+a6XnPKV4LD1kHd3nggbD0smn7wTwWW1XJKlms40SBZHtbm4dW9wPaPGf4yOkwwBdJO+w==", - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "@cosmjs/json-rpc": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.6.tgz", - "integrity": "sha512-cxHEdiqeHxUHsOxUiaWUMF7idoto+5UtqvKiZyHdcy7Xvjx4j8d3FIG4p1LYh0Qbt4sHpRzzFLN4AMrhLz12OA==", - "requires": { - "@cosmjs/stream": "0.26.6", - "xstream": "^11.14.0" - } - }, - "@cosmjs/math": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.6.tgz", - "integrity": "sha512-nblvidxwugM/kh1Vx95s7MQ596r5ap1ZUpjHYJTLbnYvnObHvfYvM3qb8SJzY0u7x5+u9E0oSFzLwMRfUTEQ3g==", - "requires": { - "bn.js": "^4.11.8" - } - }, - "@cosmjs/proto-signing": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.6.tgz", - "integrity": "sha512-wwR/ObID/g3bCt+I9Xv0a7Qmhu/+cRacFyh4tFY9ak+M6Q+5eyn+Gpj0MVLWG9cRPT7W1uVnr+8HRLhUEHExqg==", - "requires": { - "@cosmjs/amino": "0.26.6", - "@cosmjs/crypto": "0.26.6", - "@cosmjs/math": "0.26.6", - "cosmjs-types": "^0.2.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" - } - }, - "@cosmjs/socket": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.6.tgz", - "integrity": "sha512-JLizR/QlRJ+nBE/A4QfhinTLycI7a20w0hgHhkq9UUvRlFEh+j6bBK7TilDYZpX0Yjb+wJhCt7wHTiJo+uLjSA==", - "requires": { - "@cosmjs/stream": "0.26.6", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stargate": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.6.tgz", - "integrity": "sha512-R5BolHkZGyblL0nNb0xXxwzDml57DYe2UE9jdlsOOJ7L/auZvThKxlfP473H/OHqsqwc7G2JRoCENtfvZRvTig==", - "requires": { - "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.26.6", - "@cosmjs/encoding": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/proto-signing": "0.26.6", - "@cosmjs/stream": "0.26.6", - "@cosmjs/tendermint-rpc": "0.26.6", - "@cosmjs/utils": "0.26.6", - "cosmjs-types": "^0.2.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stream": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.6.tgz", - "integrity": "sha512-4Tfh1UlSCEBl+yqPeu+4q1uqwkKbx5gqYU/JDL81cLHW5QpxUA83F59+Pr9XohcnrHUmSt3DoDPqIlAoIdft1Q==", - "requires": { - "xstream": "^11.14.0" - } - }, - "@cosmjs/tendermint-rpc": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.6.tgz", - "integrity": "sha512-mXK09xsu68EM08KRhZ5Hg0o8zhN2WoXLjdDfQ+DGbpJLZQePpzzXKaMYY4eqwvECB6zsImpMVtfXoHMfK623kA==", - "requires": { - "@cosmjs/crypto": "0.26.6", - "@cosmjs/encoding": "0.26.6", - "@cosmjs/json-rpc": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/socket": "0.26.6", - "@cosmjs/stream": "0.26.6", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - } - } - }, - "@cosmjs/utils": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.6.tgz", - "integrity": "sha512-Zx60MMI1vffX8c2UbUMlszrGIug3TWa25bD7NF3blJ5k/MVCZFsPafEZ+jEi7kcqoxdhMhgJTI6AmUhnMfq9SQ==" - }, - "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "requires": { - "follow-redirects": "^1.10.0" - } - }, - "cosmjs-types": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.2.1.tgz", - "integrity": "sha512-EUG6TgdWkYHBzXjo5tZ82L+0QLijTu/rZGNIbJ/n07ST30GmptYkPmO+REX7qF4YUtli//Rfy0rrNzH9IMrMmw==", - "requires": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - }, - "dependencies": { - "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - } - } - } - } - }, - "@cosmjs/amino": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.0.tgz", - "integrity": "sha512-ybyzRkGrRija1bjGjGP7sAp2ulPA2/S2wMY2pehB7b6ZR8dpwveCjz/IqFWC5KBxz6KZf5MuaONOY+t1kkjsfw==", - "requires": { - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0" - } - }, - "@cosmjs/cosmwasm-stargate": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.26.6.tgz", - "integrity": "sha512-eZlZJicNqZY41lqVjVc9VMbbEjbk3XfTqYY91taAYBGb5lYjJhRg44bt/hm94uuHBFRj+o1zNFOnpSnSqzEKOA==", - "requires": { - "@cosmjs/amino": "0.26.6", - "@cosmjs/crypto": "0.26.6", - "@cosmjs/encoding": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/proto-signing": "0.26.6", - "@cosmjs/stargate": "0.26.6", - "@cosmjs/tendermint-rpc": "0.26.6", - "@cosmjs/utils": "0.26.6", - "cosmjs-types": "^0.2.0", - "long": "^4.0.0", - "pako": "^2.0.2", - "protobufjs": "~6.10.2" - }, - "dependencies": { - "@cosmjs/amino": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.26.6.tgz", - "integrity": "sha512-O2MNJTduMnQzr7cK9PmvselY7XVCV+GxjC0vR/NBJmKZt7+GgGnHTLbbdOJr5MAQcESCwTkGAnnctw7hhoEjqw==", - "requires": { - "@cosmjs/crypto": "0.26.6", - "@cosmjs/encoding": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/utils": "0.26.6" - } - }, - "@cosmjs/crypto": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.26.6.tgz", - "integrity": "sha512-nR8gXZH6NljKL4vArkCmDCVA10hMtHHaJQYGlHpYufnXbbx4614FnzOd8Y/CkunhjFGM0jn/WFT4rCjbPYzuUw==", - "requires": { - "@cosmjs/encoding": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/utils": "0.26.6", - "bip39": "^3.0.2", - "bn.js": "^4.11.8", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - } - }, - "@cosmjs/encoding": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.26.6.tgz", - "integrity": "sha512-dU0P2Um9ZB5yHpQYq+a6XnPKV4LD1kHd3nggbD0smn7wTwWW1XJKlms40SBZHtbm4dW9wPaPGf4yOkwwBdJO+w==", - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "@cosmjs/json-rpc": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.26.6.tgz", - "integrity": "sha512-cxHEdiqeHxUHsOxUiaWUMF7idoto+5UtqvKiZyHdcy7Xvjx4j8d3FIG4p1LYh0Qbt4sHpRzzFLN4AMrhLz12OA==", - "requires": { - "@cosmjs/stream": "0.26.6", - "xstream": "^11.14.0" - } - }, - "@cosmjs/math": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.26.6.tgz", - "integrity": "sha512-nblvidxwugM/kh1Vx95s7MQ596r5ap1ZUpjHYJTLbnYvnObHvfYvM3qb8SJzY0u7x5+u9E0oSFzLwMRfUTEQ3g==", - "requires": { - "bn.js": "^4.11.8" - } - }, - "@cosmjs/proto-signing": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.26.6.tgz", - "integrity": "sha512-wwR/ObID/g3bCt+I9Xv0a7Qmhu/+cRacFyh4tFY9ak+M6Q+5eyn+Gpj0MVLWG9cRPT7W1uVnr+8HRLhUEHExqg==", - "requires": { - "@cosmjs/amino": "0.26.6", - "@cosmjs/crypto": "0.26.6", - "@cosmjs/math": "0.26.6", - "cosmjs-types": "^0.2.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" - } - }, - "@cosmjs/socket": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.26.6.tgz", - "integrity": "sha512-JLizR/QlRJ+nBE/A4QfhinTLycI7a20w0hgHhkq9UUvRlFEh+j6bBK7TilDYZpX0Yjb+wJhCt7wHTiJo+uLjSA==", - "requires": { - "@cosmjs/stream": "0.26.6", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stargate": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.26.6.tgz", - "integrity": "sha512-R5BolHkZGyblL0nNb0xXxwzDml57DYe2UE9jdlsOOJ7L/auZvThKxlfP473H/OHqsqwc7G2JRoCENtfvZRvTig==", - "requires": { - "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.26.6", - "@cosmjs/encoding": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/proto-signing": "0.26.6", - "@cosmjs/stream": "0.26.6", - "@cosmjs/tendermint-rpc": "0.26.6", - "@cosmjs/utils": "0.26.6", - "cosmjs-types": "^0.2.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stream": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.26.6.tgz", - "integrity": "sha512-4Tfh1UlSCEBl+yqPeu+4q1uqwkKbx5gqYU/JDL81cLHW5QpxUA83F59+Pr9XohcnrHUmSt3DoDPqIlAoIdft1Q==", - "requires": { - "xstream": "^11.14.0" - } - }, - "@cosmjs/tendermint-rpc": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.26.6.tgz", - "integrity": "sha512-mXK09xsu68EM08KRhZ5Hg0o8zhN2WoXLjdDfQ+DGbpJLZQePpzzXKaMYY4eqwvECB6zsImpMVtfXoHMfK623kA==", - "requires": { - "@cosmjs/crypto": "0.26.6", - "@cosmjs/encoding": "0.26.6", - "@cosmjs/json-rpc": "0.26.6", - "@cosmjs/math": "0.26.6", - "@cosmjs/socket": "0.26.6", - "@cosmjs/stream": "0.26.6", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "@cosmjs/utils": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.26.6.tgz", - "integrity": "sha512-Zx60MMI1vffX8c2UbUMlszrGIug3TWa25bD7NF3blJ5k/MVCZFsPafEZ+jEi7kcqoxdhMhgJTI6AmUhnMfq9SQ==" - }, - "cosmjs-types": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.2.1.tgz", - "integrity": "sha512-EUG6TgdWkYHBzXjo5tZ82L+0QLijTu/rZGNIbJ/n07ST30GmptYkPmO+REX7qF4YUtli//Rfy0rrNzH9IMrMmw==", - "requires": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - }, - "dependencies": { - "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - } - } - } - } - }, - "@cosmjs/crypto": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.0.tgz", - "integrity": "sha512-JTPHINCYZ+mnsxrfv8ZBHsFWgB7EGooa5SD0lQFhkCVX/FC3sqxuFNv6TZU5bVVU71DUSqXTMXF5m9kAMzPUkw==", - "requires": { - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0", - "bip39": "^3.0.2", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.6", - "ripemd160": "^2.0.2", - "sha.js": "^2.4.11" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - } - } - }, - "@cosmjs/encoding": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.0.tgz", - "integrity": "sha512-cCT8X/NUAGXOe14F/k2GE6N9btjrOqALBilUPIn5CL4OEGxvRTPD59nWSACu0iafCGz10Tw3LPcouuYPtZmkbg==", - "requires": { - "base64-js": "^1.3.0", - "bech32": "^1.1.4", - "readonly-date": "^1.0.0" - } - }, - "@cosmjs/faucet-client": { - "version": "0.26.6", - "resolved": "https://registry.npmjs.org/@cosmjs/faucet-client/-/faucet-client-0.26.6.tgz", - "integrity": "sha512-Q0YEdBOufSJRctrccUZiyPYNoOjzjs01sd9bZQn4zp8unDfiwP3xODy5BMPLW+62wr9rPdcf/v3BNi9MvQDl7A==", - "requires": { - "axios": "^0.21.2" - } - }, - "@cosmjs/json-rpc": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.27.0.tgz", - "integrity": "sha512-Q6na5KPYDD90QhlPZTInquwBycDjvhZvWwpV1TppDd2Em8S1FfN3ePiV2YCf4XzXREU5YPFSHzh5MHK/WhQY3w==", - "requires": { - "@cosmjs/stream": "0.27.0", - "xstream": "^11.14.0" - } - }, - "@cosmjs/launchpad": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.0.tgz", - "integrity": "sha512-V8pK3jNvLw/2jf0DK0uD0fN0qUgh+v04NxSNIdRxyn2sdZ8CkD1L+FeKM5mGEn9vreSHOD4Z9pRy2s2roD/tEw==", - "requires": { - "@cosmjs/amino": "0.27.0", - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/utils": "0.27.0", - "axios": "^0.21.2", - "fast-deep-equal": "^3.1.3" - } - }, - "@cosmjs/math": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.0.tgz", - "integrity": "sha512-+WsrdXojqpUL6l2LKOWYgiAJIDD0faONNtnjb1kpS1btSzZe1Ns+RdygG6QZLLvZuxMfkEzE54ZXDKPD5MhVPA==", - "requires": { - "bn.js": "^5.2.0" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - } - } - }, - "@cosmjs/proto-signing": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.27.0.tgz", - "integrity": "sha512-ODqnmY/ElmcEYu6HbDmeGce4KacgzSVGQzvGodZidC1RR9EYociuweBPNwSHqBPolC6PQPI/QGc83m/mbih2xw==", - "requires": { - "@cosmjs/amino": "0.27.0", - "@cosmjs/crypto": "0.27.0", - "@cosmjs/math": "0.27.0", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2" - } - }, - "@cosmjs/socket": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.27.0.tgz", - "integrity": "sha512-lOd0s6gLyjdjcs8xnYuS2IXRqBLUrI76Bek5wsia+m5CyUvHjRbbd7+nZiznbtVjApBlIwHGkiklLg3/byxkAA==", - "requires": { - "@cosmjs/stream": "0.27.0", - "isomorphic-ws": "^4.0.1", - "ws": "^7", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stargate": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.27.0.tgz", - "integrity": "sha512-Fiqk8rIpB4emzC/P7/+ZPPJV9aG6KJhVuOF4D8c1j1Bv8fVs1XqC6NgsY6elTLXl38pgXt7REn6VYzAdZwrHXQ==", - "requires": { - "@confio/ics23": "^0.6.3", - "@cosmjs/amino": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stream": "0.27.0", - "@cosmjs/tendermint-rpc": "0.27.0", - "@cosmjs/utils": "0.27.0", - "cosmjs-types": "^0.4.0", - "long": "^4.0.0", - "protobufjs": "~6.10.2", - "xstream": "^11.14.0" - } - }, - "@cosmjs/stream": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.27.0.tgz", - "integrity": "sha512-D9mXHqS6y7xrThhUg5SCvMjiVQ8ph9f7gAuWlrXhqVJ5FqrP6OyTGRbVyGGM91d5Jj7N7oidQ+hOfc34vKFgeg==", - "requires": { - "xstream": "^11.14.0" - } - }, - "@cosmjs/tendermint-rpc": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.27.0.tgz", - "integrity": "sha512-WFcJ2/UF76fBBVzPRiHJoC/GCKvgt0mb7+ewgpwKBeEcYwfj5qb1QreGBbHn/UZx9QSsF9jhI5k7SmNdglC3cA==", - "requires": { - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/json-rpc": "0.27.0", - "@cosmjs/math": "0.27.0", - "@cosmjs/socket": "0.27.0", - "@cosmjs/stream": "0.27.0", - "axios": "^0.21.2", - "readonly-date": "^1.0.0", - "xstream": "^11.14.0" - } - }, - "@cosmjs/utils": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.0.tgz", - "integrity": "sha512-UC1eWY9isDQm6POy6GaTmYtbPVY5dkywdjW8Qzj+JNMhbhMM0KHuI4pHwjv5TPXSO/Ba2z10MTnD9nUlZtDwtA==" - }, - "@dabh/diagnostics": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", - "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", - "requires": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" - }, - "@rollup/plugin-commonjs": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", - "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - } - }, - "@rollup/plugin-dynamic-import-vars": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-dynamic-import-vars/-/plugin-dynamic-import-vars-1.4.2.tgz", - "integrity": "sha512-SEaS9Pf0RyaZ/oJ1knLZT+Fu0X6DlyTfUcoE7XKkiKJjNaB+8SLoHmDVRhomo5RpWHPyd+B00G/bE5R5+Q+HEg==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^4.1.2", - "estree-walker": "^2.0.1", - "fast-glob": "^3.2.7", - "magic-string": "^0.25.7" - }, - "dependencies": { - "@rollup/pluginutils": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", - "integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==", - "dev": true, - "requires": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - } - } - } - }, - "@rollup/plugin-node-resolve": { - "version": "13.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.1.3.tgz", - "integrity": "sha512-BdxNk+LtmElRo5d06MGY4zoepyrXX1tkzX2hrnPEZ53k78GuOMWLqmJDGIIOPwVRIFZrLQOo+Yr6KtCuLIA0AQ==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.19.0" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "dependencies": { - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - } - } - }, - "@starport/vue": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@starport/vue/-/vue-0.3.0.tgz", - "integrity": "sha512-BafMxa1fKXXW3vfp+TO1X0oNWxq/3uXP/yb2KM2ns0A5ZKiaQf7mHpxgkEZlt1uuFh9vM+JZy+KdKrSlgAMZCQ==", - "requires": { - "@cosmjs/encoding": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stargate": "0.27.0", - "bip39": "^3.0.4", - "buffer": "^6.0.3", - "crypto-js": "^4.1.1", - "dayjs": "^1.10.7", - "file-saver": "^2.0.5", - "gradient-avatar": "^1.0.2", - "js-base64": "^3.7.2", - "long": "^4.0.0", - "qrcode": "^1.5.0", - "safe-buffer": "^5.2.1", - "vue": "^3.2.6", - "vuex": "^4.0.2" - } - }, - "@starport/vuex": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@starport/vuex/-/vuex-0.3.0.tgz", - "integrity": "sha512-H+9XirGo0JZYGtZaLnHb1IPlL+IF3xvwu2XV/S9VMPoMT6CEh6TdzqFRnENwtaZ5bQC34GDjrfaQt6srYpbYZQ==", - "requires": { - "@confio/relayer": "^0.3.0", - "@cosmjs/crypto": "0.27.0", - "@cosmjs/encoding": "0.27.0", - "@cosmjs/launchpad": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@cosmjs/stargate": "0.27.0", - "@cosmjs/tendermint-rpc": "0.27.0", - "@cosmjs/utils": "0.27.0", - "axios": "^0.22.0", - "bs58": "^4.0.1", - "buffer": "^6.0.3", - "crypto-js": "^4.1.1", - "events": "^3.3.0", - "reconnecting-websocket": "^4.4.0" - }, - "dependencies": { - "axios": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.22.0.tgz", - "integrity": "sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w==", - "requires": { - "follow-redirects": "^1.14.4" - } - } - } - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/long": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", - "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" - }, - "@types/node": { - "version": "17.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.8.tgz", - "integrity": "sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg==" - }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@vitejs/plugin-vue": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.0.1.tgz", - "integrity": "sha512-wtdMnGVvys9K8tg+DxowU1ytTrdVveXr3LzdhaKakysgGXyrsfaeds2cDywtvujEASjWOwWL/OgWM+qoeM8Plg==", - "dev": true - }, - "@vue/compiler-core": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.26.tgz", - "integrity": "sha512-N5XNBobZbaASdzY9Lga2D9Lul5vdCIOXvUMd6ThcN8zgqQhPKfCV+wfAJNNJKQkSHudnYRO2gEB+lp0iN3g2Tw==", - "requires": { - "@babel/parser": "^7.16.4", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "source-map": "^0.6.1" - } - }, - "@vue/compiler-dom": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.26.tgz", - "integrity": "sha512-smBfaOW6mQDxcT3p9TKT6mE22vjxjJL50GFVJiI0chXYGU/xzC05QRGrW3HHVuJrmLTLx5zBhsZ2dIATERbarg==", - "requires": { - "@vue/compiler-core": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/compiler-sfc": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.26.tgz", - "integrity": "sha512-ePpnfktV90UcLdsDQUh2JdiTuhV0Skv2iYXxfNMOK/F3Q+2BO0AulcVcfoksOpTJGmhhfosWfMyEaEf0UaWpIw==", - "requires": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.26", - "@vue/compiler-dom": "3.2.26", - "@vue/compiler-ssr": "3.2.26", - "@vue/reactivity-transform": "3.2.26", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "magic-string": "^0.25.7", - "postcss": "^8.1.10", - "source-map": "^0.6.1" - } - }, - "@vue/compiler-ssr": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.26.tgz", - "integrity": "sha512-2mywLX0ODc4Zn8qBoA2PDCsLEZfpUGZcyoFRLSOjyGGK6wDy2/5kyDOWtf0S0UvtoyVq95OTSGIALjZ4k2q/ag==", - "requires": { - "@vue/compiler-dom": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/devtools-api": { - "version": "6.0.0-beta.21.1", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.0.0-beta.21.1.tgz", - "integrity": "sha512-FqC4s3pm35qGVeXRGOjTsRzlkJjrBLriDS9YXbflHLsfA9FrcKzIyWnLXoNm+/7930E8rRakXuAc2QkC50swAw==" - }, - "@vue/reactivity": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.26.tgz", - "integrity": "sha512-h38bxCZLW6oFJVDlCcAiUKFnXI8xP8d+eO0pcDxx+7dQfSPje2AO6M9S9QO6MrxQB7fGP0DH0dYQ8ksf6hrXKQ==", - "requires": { - "@vue/shared": "3.2.26" - } - }, - "@vue/reactivity-transform": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.26.tgz", - "integrity": "sha512-XKMyuCmzNA7nvFlYhdKwD78rcnmPb7q46uoR00zkX6yZrUmcCQ5OikiwUEVbvNhL5hBJuvbSO95jB5zkUon+eQ==", - "requires": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.26", - "@vue/shared": "3.2.26", - "estree-walker": "^2.0.2", - "magic-string": "^0.25.7" - } - }, - "@vue/runtime-core": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.26.tgz", - "integrity": "sha512-BcYi7qZ9Nn+CJDJrHQ6Zsmxei2hDW0L6AB4vPvUQGBm2fZyC0GXd/4nVbyA2ubmuhctD5RbYY8L+5GUJszv9mQ==", - "requires": { - "@vue/reactivity": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/runtime-dom": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.26.tgz", - "integrity": "sha512-dY56UIiZI+gjc4e8JQBwAifljyexfVCkIAu/WX8snh8vSOt/gMSEGwPRcl2UpYpBYeyExV8WCbgvwWRNt9cHhQ==", - "requires": { - "@vue/runtime-core": "3.2.26", - "@vue/shared": "3.2.26", - "csstype": "^2.6.8" - } - }, - "@vue/server-renderer": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.26.tgz", - "integrity": "sha512-Jp5SggDUvvUYSBIvYEhy76t4nr1vapY/FIFloWmQzn7UxqaHrrBpbxrqPcTrSgGrcaglj0VBp22BKJNre4aA1w==", - "requires": { - "@vue/compiler-ssr": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "@vue/shared": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.26.tgz", - "integrity": "sha512-vPV6Cq+NIWbH5pZu+V+2QHE9y1qfuTq49uNWw4f7FDEeZaDU2H2cx5jcUZOAKW7qTrUS4k6qZPbMy1x4N96nbA==" - }, - "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true - }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true - }, - "ajv": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.1.tgz", - "integrity": "sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==" - }, - "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" - }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "bintrees": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.1.tgz", - "integrity": "sha1-DmVcm5wkNeqraL9AJyJtK1WjRSQ=" - }, - "bip39": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", - "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", - "requires": { - "@types/node": "11.11.6", - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1" - }, - "dependencies": { - "@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" - } - } - }, - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "requires": { - "base-x": "^3.0.2" - } - }, - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "builtin-modules": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", - "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" - }, - "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "requires": { - "color-convert": "^1.9.3", - "color-string": "^1.6.0" - }, - "dependencies": { - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - } - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "color-string": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", - "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", - "requires": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "colorspace": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", - "requires": { - "color": "^3.1.3", - "text-hex": "1.0.x" - } - }, - "commander": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", - "integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==" - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "core-js": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.2.tgz", - "integrity": "sha512-nuqhq11DcOAbFBV4zCbKeGbKQsUDRqTX0oqx7AttUBuqe3h20ixsE039QHelbL6P4h+9kytVqyEtyZ6gsiwEYw==" - }, - "cosmjs-types": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", - "integrity": "sha512-I7E/cHkIgoJzMNQdFF0YVqPlaTqrqKHrskuSTIqlEyxfB5Lf3WKCajSXVK2yHOfOFfSux/RxEdpMzw/eO4DIog==", - "requires": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - }, - "dependencies": { - "protobufjs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", - "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "crypto-js": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", - "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" - }, - "csstype": { - "version": "2.6.19", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.19.tgz", - "integrity": "sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ==" - }, - "dayjs": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", - "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==" - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } - }, - "dijkstrajs": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.2.tgz", - "integrity": "sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg==" - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "enabled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" - }, - "encode-utf8": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", - "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==" - }, - "esbuild": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.15.tgz", - "integrity": "sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw==", - "dev": true, - "requires": { - "esbuild-android-arm64": "0.13.15", - "esbuild-darwin-64": "0.13.15", - "esbuild-darwin-arm64": "0.13.15", - "esbuild-freebsd-64": "0.13.15", - "esbuild-freebsd-arm64": "0.13.15", - "esbuild-linux-32": "0.13.15", - "esbuild-linux-64": "0.13.15", - "esbuild-linux-arm": "0.13.15", - "esbuild-linux-arm64": "0.13.15", - "esbuild-linux-mips64le": "0.13.15", - "esbuild-linux-ppc64le": "0.13.15", - "esbuild-netbsd-64": "0.13.15", - "esbuild-openbsd-64": "0.13.15", - "esbuild-sunos-64": "0.13.15", - "esbuild-windows-32": "0.13.15", - "esbuild-windows-64": "0.13.15", - "esbuild-windows-arm64": "0.13.15" - } - }, - "esbuild-android-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz", - "integrity": "sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==", - "dev": true, - "optional": true - }, - "esbuild-darwin-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.15.tgz", - "integrity": "sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==", - "dev": true, - "optional": true - }, - "esbuild-darwin-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.15.tgz", - "integrity": "sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.15.tgz", - "integrity": "sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==", - "dev": true, - "optional": true - }, - "esbuild-freebsd-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.15.tgz", - "integrity": "sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==", - "dev": true, - "optional": true - }, - "esbuild-linux-32": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.15.tgz", - "integrity": "sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==", - "dev": true, - "optional": true - }, - "esbuild-linux-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.15.tgz", - "integrity": "sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.15.tgz", - "integrity": "sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==", - "dev": true, - "optional": true - }, - "esbuild-linux-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.15.tgz", - "integrity": "sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==", - "dev": true, - "optional": true - }, - "esbuild-linux-mips64le": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.15.tgz", - "integrity": "sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==", - "dev": true, - "optional": true - }, - "esbuild-linux-ppc64le": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.15.tgz", - "integrity": "sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==", - "dev": true, - "optional": true - }, - "esbuild-netbsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.15.tgz", - "integrity": "sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==", - "dev": true, - "optional": true - }, - "esbuild-openbsd-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz", - "integrity": "sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==", - "dev": true, - "optional": true - }, - "esbuild-sunos-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz", - "integrity": "sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==", - "dev": true, - "optional": true - }, - "esbuild-windows-32": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.15.tgz", - "integrity": "sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==", - "dev": true, - "optional": true - }, - "esbuild-windows-64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.15.tgz", - "integrity": "sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==", - "dev": true, - "optional": true - }, - "esbuild-windows-arm64": { - "version": "0.13.15", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz", - "integrity": "sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==", - "dev": true, - "optional": true - }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.10.tgz", - "integrity": "sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-safe-stringify": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.4.tgz", - "integrity": "sha512-mNlGUdKOeGNleyrmgbKYtbnCr9KZkZXU7eM89JRo8vY10f7Ul1Fbj07hUBW3N4fC0xM+fmfFfa2zM7mIizhpNQ==" - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fecha": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", - "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" - }, - "file-saver": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", - "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "fn.name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" - }, - "follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globalthis": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.2.tgz", - "integrity": "sha512-ZQnSFO1la8P7auIOQECnm0sSuoMeaSq0EEdXMBFF2QJO4uNcwbyhSgG3MruWNbFTqCLmxVwGOl7LZ9kASvHdeQ==", - "requires": { - "define-properties": "^1.1.3" - } - }, - "gradient-avatar": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/gradient-avatar/-/gradient-avatar-1.0.2.tgz", - "integrity": "sha512-Od9KI2YImV60wnsvU/u6GEyBm2fiHUUHgiLySE243GYl/T/tiJMJ5QYey8o7tepugmlnUGQRaCItHv19UnUjUg==", - "requires": { - "hsl-rgb": "^1.0.0", - "hsl-triad": "^1.0.0", - "string-hash": "^1.1.3" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "hsl-rgb": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hsl-rgb/-/hsl-rgb-1.0.0.tgz", - "integrity": "sha512-cNq+7sfwzSDoiG/jiu8wZpOmjScUZrMKiI33tH3aQ1MZsXWQd0yJjMpPwu2OZFYa4D/bOT1aCbB5gS1kOqFx1A==" - }, - "hsl-triad": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hsl-triad/-/hsl-triad-1.0.0.tgz", - "integrity": "sha512-PKnjrMugS6sHC5dVh4VQZYOHEKG2QILjVwbpEtNjEV19RyswuIxrIiGhumVJjya/FjK/p9gX6+zRMXFGTvaQAA==" - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "immutable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", - "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "requires": { - "@types/estree": "*" - } - }, - "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" - }, - "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==" - }, - "js-base64": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz", - "integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==" - }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" - }, - "js-sha512": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", - "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==" - }, - "js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", - "requires": { - "argparse": "^2.0.1" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "kuler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" - }, - "libsodium": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.9.tgz", - "integrity": "sha512-gfeADtR4D/CM0oRUviKBViMGXZDgnFdMKMzHsvBdqLBHd9ySi6EtYnmuhHVDDYgYpAO8eU8hEY+F8vIUAPh08A==" - }, - "libsodium-wrappers": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz", - "integrity": "sha512-9HaAeBGk1nKTRFRHkt7nzxqCvnkWTjn1pdjKgcUnZxj0FyOP4CnhgFhMdrFfgNsukijBGyBLpP2m2uKT1vuWhQ==", - "requires": { - "libsodium": "^0.7.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=" - }, - "logform": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", - "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", - "requires": { - "@colors/colors": "1.5.0", - "fecha": "^4.2.0", - "ms": "^2.1.1", - "safe-stable-stringify": "^2.3.1", - "triple-beam": "^1.3.0" - } - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "nanoid": { - "version": "3.1.32", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.32.tgz", - "integrity": "sha512-F8mf7R3iT9bvThBoW4tGXhXFHCctyCiUUPrWF8WaTqa3h96d9QybkSeba43XVOOE3oiLfkVDe4bT8MeGmkrTxw==" - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "one-time": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", - "requires": { - "fn.name": "1.x.x" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "pako": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz", - "integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==" - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pngjs": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", - "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==" - }, - "postcss": { - "version": "8.4.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz", - "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==", - "requires": { - "nanoid": "^3.1.30", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.1" - } - }, - "prom-client": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-13.1.0.tgz", - "integrity": "sha512-jT9VccZCWrJWXdyEtQddCDszYsiuWj5T0ekrPszi/WEegj3IZy6Mm09iOOVM86A4IKMWq8hZkT2dD9MaSe+sng==", - "requires": { - "tdigest": "^0.1.1" - } - }, - "protobufjs": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz", - "integrity": "sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": "^13.7.0", - "long": "^4.0.0" - }, - "dependencies": { - "@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qrcode": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.0.tgz", - "integrity": "sha512-9MgRpgVc+/+47dFvQeD6U2s0Z92EsKzcHogtum4QB+UNd025WOJSHvn/hjk9xmzj7Stj95CyUAs31mrjxliEsQ==", - "requires": { - "dijkstrajs": "^1.0.1", - "encode-utf8": "^1.0.3", - "pngjs": "^5.0.0", - "yargs": "^15.3.1" - } - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "readonly-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", - "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==" - }, - "reconnecting-websocket": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/reconnecting-websocket/-/reconnecting-websocket-4.4.0.tgz", - "integrity": "sha512-D2E33ceRPga0NvTDhJmphEgJ7FUYF0v4lr1ki0csq06OdlxKfugGzN0dSkxM/NfqCxYELK4KcaTOUOjTV6Dcng==" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "resolve": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", - "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", - "dev": true, - "requires": { - "is-core-module": "^2.8.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rollup": { - "version": "2.64.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.64.0.tgz", - "integrity": "sha512-+c+lbw1lexBKSMb1yxGDVfJ+vchJH3qLbmavR+awDinTDA2C5Ug9u7lkOzj62SCu0PKUExsW36tpgW7Fmpn3yQ==", - "dev": true, - "requires": { - "fsevents": "~2.3.2" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "safe-stable-stringify": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", - "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==" - }, - "sass": { - "version": "1.48.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.48.0.tgz", - "integrity": "sha512-hQi5g4DcfjcipotoHZ80l7GNJHGqQS5LwMBjVYB/TaT0vcSSpbgM8Ad7cgfsB2M0MinbkEQQPO9+sjjSiwxqmw==", - "dev": true, - "requires": { - "chokidar": ">=3.0.0 <4.0.0", - "immutable": "^4.0.0", - "source-map-js": ">=0.6.2 <2.0.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", - "requires": { - "is-arrayish": "^0.3.1" - } - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "source-map-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz", - "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==" - }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" - }, - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" - }, - "string-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", - "integrity": "sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true - }, - "symbol-observable": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", - "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==" - }, - "table": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.0.tgz", - "integrity": "sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==", - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - } - } - }, - "tdigest": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.1.tgz", - "integrity": "sha1-Ljyyw56kSeVdHmzZEReszKRYgCE=", - "requires": { - "bintrees": "1.0.1" - } - }, - "text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "vite": { - "version": "2.7.12", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.7.12.tgz", - "integrity": "sha512-KvPYToRQWhRfBeVkyhkZ5hASuHQkqZUUdUcE3xyYtq5oYEPIJ0h9LWiWTO6v990glmSac2cEPeYeXzpX5Z6qKQ==", - "dev": true, - "requires": { - "esbuild": "^0.13.12", - "fsevents": "~2.3.2", - "postcss": "^8.4.5", - "resolve": "^1.20.0", - "rollup": "^2.59.0" - } - }, - "vite-plugin-dynamic-import": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/vite-plugin-dynamic-import/-/vite-plugin-dynamic-import-0.1.1.tgz", - "integrity": "sha512-lk45O94+qgMbkwagBrnlPPGZ7OxmlEQBksHqdLim5NjzaR/fbFsIXf8jqZeYaeU3tKQzxnUtxHFYhJGfZQ3Hzw==", - "dev": true, - "requires": { - "acorn": "^8.5.0", - "acorn-walk": "^8.2.0", - "glob": "^7.1.7" - } - }, - "vite-plugin-env-compatible": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vite-plugin-env-compatible/-/vite-plugin-env-compatible-1.1.1.tgz", - "integrity": "sha512-4lqhBWhOzP+SaCPoCVdmpM5cXzjKQV5jgFauxea488oOeElXo/kw6bXkMIooZhrh9q7gclTl8en6N9NmnqUwRQ==", - "dev": true - }, - "vue": { - "version": "3.2.26", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.26.tgz", - "integrity": "sha512-KD4lULmskL5cCsEkfhERVRIOEDrfEL9CwAsLYpzptOGjaGFNWo3BQ9g8MAb7RaIO71rmVOziZ/uEN/rHwcUIhg==", - "requires": { - "@vue/compiler-dom": "3.2.26", - "@vue/compiler-sfc": "3.2.26", - "@vue/runtime-dom": "3.2.26", - "@vue/server-renderer": "3.2.26", - "@vue/shared": "3.2.26" - } - }, - "vue-router": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.12.tgz", - "integrity": "sha512-CPXvfqe+mZLB1kBWssssTiWg4EQERyqJZes7USiqfW9B5N2x+nHlnsM1D3b5CaJ6qgCvMmYJnz+G0iWjNCvXrg==", - "requires": { - "@vue/devtools-api": "^6.0.0-beta.18" - } - }, - "vuex": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz", - "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==", - "requires": { - "@vue/devtools-api": "^6.0.0-beta.11" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "winston": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz", - "integrity": "sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==", - "requires": { - "@dabh/diagnostics": "^2.0.2", - "async": "^3.1.0", - "is-stream": "^2.0.0", - "logform": "^2.2.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.4.0" - } - }, - "winston-transport": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", - "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", - "requires": { - "logform": "^2.3.2", - "readable-stream": "^3.6.0", - "triple-beam": "^1.3.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "ws": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", - "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==" - }, - "xstream": { - "version": "11.14.0", - "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", - "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", - "requires": { - "globalthis": "^1.0.1", - "symbol-observable": "^2.0.3" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } -} diff --git a/vue/package.json b/vue/package.json deleted file mode 100644 index 14e6f1d521..0000000000 --- a/vue/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@starport/template", - "version": "0.3.0", - "description": "A Vue 3 boilerplate project utilizing @starport/vue and @starport/vuex", - "author": "Tendermint, Inc ", - "private": true, - "scripts": { - "dev": "vite", - "build": "vite build", - "serve": "vite preview" - }, - "dependencies": { - "@cosmjs/stargate": "0.27.0", - "@cosmjs/launchpad": "0.27.0", - "@cosmjs/proto-signing": "0.27.0", - "@starport/vue": "^0.3.0", - "@starport/vuex": "^0.3.0", - "buffer": "^6.0.3", - "core-js": "^3.18.2", - "vue": "^3.2.6", - "vue-router": "^4.0.3", - "vuex": "^4.0.2" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-dynamic-import-vars": "^1.4.1", - "@rollup/plugin-node-resolve": "^13.1.1", - "@vitejs/plugin-vue": "^2.0.1", - "sass": "^1.47.0", - "vite": "^2.7.6", - "vite-plugin-dynamic-import": "^0.1.1", - "vite-plugin-env-compatible": "^1.1.1" - } -} diff --git a/vue/public/favicon.ico b/vue/public/favicon.ico deleted file mode 100644 index df36fcfb72..0000000000 Binary files a/vue/public/favicon.ico and /dev/null differ diff --git a/vue/src/App.vue b/vue/src/App.vue deleted file mode 100644 index 0fd92dd7f8..0000000000 --- a/vue/src/App.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/vue/src/main.js b/vue/src/main.js deleted file mode 100644 index 751dbc5653..0000000000 --- a/vue/src/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import starportLibrary from '@starport/vue' -import { createApp } from 'vue' - -import App from './App.vue' -import router from './router' -import store from './store' - -const app = createApp(App) -app.use(store).use(router).use(starportLibrary).mount('#app') diff --git a/vue/src/router/index.js b/vue/src/router/index.js deleted file mode 100644 index 3865c25178..0000000000 --- a/vue/src/router/index.js +++ /dev/null @@ -1,18 +0,0 @@ -import { createRouter, createWebHistory } from 'vue-router' - -import Data from '../views/Data.vue' -import Portfolio from '../views/Portfolio.vue' - -const routerHistory = createWebHistory() -const routes = [ - { path: '/', component: Portfolio }, - { path: '/portfolio', component: Portfolio }, - { path: '/data', component: Data } -] - -const router = createRouter({ - history: routerHistory, - routes -}) - -export default router diff --git a/vue/src/store/config.js b/vue/src/store/config.js deleted file mode 100644 index 3961975555..0000000000 --- a/vue/src/store/config.js +++ /dev/null @@ -1,11 +0,0 @@ -import { env, blocks, wallet, transfers } from '@starport/vuex' -import generated from './generated' -export default function init(store) { - for (const moduleInit of Object.values(generated)) { - moduleInit(store) - } - transfers(store) - blocks(store) - env(store) - wallet(store) -} diff --git a/vue/src/store/index.js b/vue/src/store/index.js deleted file mode 100644 index 9990c41225..0000000000 --- a/vue/src/store/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import { createStore } from 'vuex' -import init from './config' - -const store = createStore({ - state() { - return {} - }, - mutations: {}, - actions: {}, -}) -init(store) -export default store diff --git a/vue/src/views/Data.vue b/vue/src/views/Data.vue deleted file mode 100644 index 52039dc40f..0000000000 --- a/vue/src/views/Data.vue +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/vue/src/views/Portfolio.vue b/vue/src/views/Portfolio.vue deleted file mode 100644 index 852d26a012..0000000000 --- a/vue/src/views/Portfolio.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/vue/vite.config.ts b/vue/vite.config.ts deleted file mode 100644 index 1cc5c88f6d..0000000000 --- a/vue/vite.config.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { nodeResolve } from '@rollup/plugin-node-resolve' -import vue from '@vitejs/plugin-vue' -import { Buffer } from 'buffer' -import { defineConfig } from 'vite' -import { dynamicImport } from 'vite-plugin-dynamic-import' -import envCompatible from 'vite-plugin-env-compatible' - -// https://vitejs.dev/config/ -export default defineConfig({ - define: { - global: { - Buffer: Buffer - } - }, - server: { - watch: { - ignored: [ - '!**/node_modules/@starport/vue/src/**', - '!**/node_modules/@starport/vuex/src/**' - ] - } - }, - plugins: [vue(), nodeResolve(), dynamicImport(), envCompatible()], - optimizeDeps: { - include: [ - 'gradient-avatar', - 'crypto-js', - 'axios', - 'qrcode', - '@cosmjs/encoding' - ] - } -}) diff --git a/x/conflict/README.md b/x/conflict/README.md index 41a533fbc7..9da15d2e4d 100644 --- a/x/conflict/README.md +++ b/x/conflict/README.md @@ -6,33 +6,35 @@ This document specifies the conflict module of Lava Protocol. The purpose of the conflict module is to ensure data reliability from providers that offer their services on Lava. To achieve this, Lava allows consumers to report mismatches between different responses to the same request (for deterministic APIs). This way, Lava can identify fraudulent providers and penalize them by confiscating their staked tokens. Consumers are incentivized to do so by Lava, as they receive tokens taken from the fraudulent provider being punished. - ## Contents -* [Concepts](#concepts) - * [Response Conflict](#response-conflict) - * [Finalization Conflict](#finalization-conflict) - * [Self Provider Conflict](#self-provider-conflict) - * [Commit Period](#commit-period) - * [Reveal Period](#reveal-period) - * [Conflict Resolve](#Conflict-Resolve) -* [Parameters](#parameters) -* [Queries](#queries) -* [Transactions](#transactions) -* [Events](#events) + +- [Concepts](#concepts) + - [Response Conflict](#response-conflict) + - [Finalization Conflict](#finalization-conflict) + - [Self Provider Conflict](#self-provider-conflict) + - [Commit Period](#commit-period) + - [Reveal Period](#reveal-period) + - [Conflict Resolve](#Conflict-Resolve) +- [Parameters](#parameters) +- [Queries](#queries) +- [Transactions](#transactions) +- [Events](#events) ## Concepts ### Response Conflict + A response conflict occurs when a consumer receives mismatched responses from different providers. In such cases, the consumer is eligible to send a conflict detection message (this is done randomly, determined by the spec reliability threshold field), which includes the relay request and responses from the two providers. This conflict detection message is then validated to ensure that the responses are different, the signatures match the providers and consumer, and that the API is deterministic. If the message is valid, a conflict is opened. A group of validators is selected as a jury to determine the fraudulent and honest providers. Through an event, the chain announces the conflict voting period and the participating providers. During the voting period, providers need to submit their hashed response + salt to the original relay request. This is done to prevent other providers from cheating or copying their vote. Once the voting period ends, the conflict moves to the reveal state. In this state, providers need to reveal their response + salt, which is then verified and compared to the original responses. After the reveal period ends, the votes are counted, and the provider with the fewest votes, and the jury that voted for him, are penalized by having a fraction of their staked tokens taken and distributed among all the other participants. ### Finalization Conflict -N/A +A finalization conflict occurs when a consumer receives mismatched finalized block hashes from different providers. This is similar to a response conflict, except it involves the finalized block hash instead of a response to a request. The process is identical - the consumer submits a conflict detection message, a jury is selected, providers commit/reveal votes, and the provider with the fewest votes is penalized. ### Self Provider Conflict -N/A + +A finalization conflict occurs when a consumer receives mismatched finalized block hashes from the same provider. This can happen if a provider responds with different finalized block hashes to the same request sent multiple times. In this case, no voting is needed, since the provider contradicted itself. The provider is directly penalized for providing inconsistent responses. ### Commit Period @@ -68,7 +70,7 @@ To resolve the conflict, a majority of votes must be in favor of Provider A, Pro Once a majority is reached, providers who voted for the wrong side of the conflict will be slashed and frozen, and the slashed amount will be added to the conflict reward pool. The reward pool is then distributed between the consumer and the providers who voted for the correct provider. Providers in the jury that did not vote are punished by jail and slashing, their slashed amount will be added to the conflict reward pool. -For the conflict resolution there needs to be a majority met of votes for Provider A, Provider B or None of them. +For the conflict resolution there needs to be a majority met of votes for Provider A, Provider B or None of them. If a majority was not met, conflict reward pool is given to the consumer that reported the conflict. Once a majority is met providers that voted to the wrong side of the conflict are slashed and frozen, the slashed amount is added to the conflict reward pool. Now the reward pool is distributed between the consumer and the providers that voted for the correct provider. @@ -77,18 +79,18 @@ Now the reward pool is distributed between the consumer and the providers that v The conflict module contains the following parameters: -| Key | Type | Default Value | -| -------------------------------------- | ----------------------- | -----------------| -| MajorityPercent | math.LegacyDec | 0.95 | -| VoteStartSpan | uint64 | 3 | -| VotePeriod | uint64 | 2 | -| Rewards | rewards | N/A | +| Key | Type | Default Value | +| --------------- | -------------- | ------------- | +| MajorityPercent | math.LegacyDec | 0.95 | +| VoteStartSpan | uint64 | 3 | +| VotePeriod | uint64 | 2 | +| Rewards | rewards | N/A | -`MajorityPercent` determines the majority needed to conclude who is the winner of the conflict. +`MajorityPercent` determines the majority needed to conclude who is the winner of the conflict. `VoteStartSpan` is the amount of epochs in the past that a consumer can send conflict detection message for. -`VotePeriod` is the number of epochs in the past that a consumer can send a conflict detection message for. +`VotePeriod` is the number of epochs in the past that a consumer can send a conflict detection message for. `Rewards` defines how the reward pool tokens will be distributed between all the participants. ```go @@ -98,16 +100,17 @@ type Rewards struct { VotersRewardPercent github_com_cosmos_cosmos_sdk_types.Dec // the jury portion } ``` + ## Queries The Conflict module supports the following queries: -| Query | Arguments | What it does | -| ---------- | --------------- | ----------------------------------------------| -| `params` | none | show the params of the module | -| `consumer-conflicts` | consumer (string) | shows all the reported and active conflicts by a consumer | -| `list-conflict-vote` | none | shows all active conflicts | -| `show-conflict-vote` | voteID (string) | shows a specific active conflict | +| Query | Arguments | What it does | +| -------------------- | ----------------- | --------------------------------------------------------- | +| `params` | none | show the params of the module | +| `consumer-conflicts` | consumer (string) | shows all the reported and active conflicts by a consumer | +| `list-conflict-vote` | none | shows all active conflicts | +| `show-conflict-vote` | voteID (string) | shows a specific active conflict | ## Transactions @@ -118,12 +121,14 @@ for more information look [here](../../proto/lavanet/lava/conflict/tx.proto). The conflict module has the following events: -| Event | When it happens | -| ---------- | --------------- | -| `response_conflict_detection` | A new conflict has been opened, which involves all of the jury providers. It is now entering the commit stage | -| `conflict_vote_reveal_started` | conflict has transitioned to reveal state | -| `conflict_vote_got_commit` | provider committed his vote | -| `conflict_vote_got_reveal` | provider revealed his vote | -| `conflict_unstake_fraud_voter` | provider was unstaked due to conflict | -| `conflict_detection_vote_resolved` | conflict was successfully resolved | -| `conflict_detection_vote_unresolved` | conflict was not resolved (did not reach majority) | +| Event | When it happens | +| ------------------------------------ | ------------------------------------------------------------------------------------------------------------- | +| `response_conflict_detection` | A new conflict has been opened, which involves all of the jury providers. It is now entering the commit stage | +| `conflict_vote_reveal_started` | conflict has transitioned to reveal state | +| `conflict_vote_got_commit` | provider committed his vote | +| `conflict_vote_got_reveal` | provider revealed his vote | +| `conflict_unstake_fraud_voter` | provider was unstaked due to conflict | +| `conflict_detection_vote_resolved` | conflict was successfully resolved | +| `conflict_detection_vote_unresolved` | conflict was not resolved (did not reach majority) | +| `conflict_detection_same_provider` | same provider finalization conflict was detected | +| `conflict_detection_two_providers` | finalization conflict between two providers was detected | diff --git a/x/conflict/client/cli/query.go b/x/conflict/client/cli/query.go index 222a7d7e74..f9369a880b 100644 --- a/x/conflict/client/cli/query.go +++ b/x/conflict/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/conflict/client/cli/query_conflict_vote.go b/x/conflict/client/cli/query_conflict_vote.go index 5ca6c9bb4d..a989172ac8 100644 --- a/x/conflict/client/cli/query_conflict_vote.go +++ b/x/conflict/client/cli/query_conflict_vote.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/query_conflict_vote_test.go b/x/conflict/client/cli/query_conflict_vote_test.go index d3913be302..ba0f004e45 100644 --- a/x/conflict/client/cli/query_conflict_vote_test.go +++ b/x/conflict/client/cli/query_conflict_vote_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/conflict/client/cli" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/testutil/network" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/conflict/client/cli" + "github.com/lavanet/lava/v2/x/conflict/types" ) // Prevent strconv unused error diff --git a/x/conflict/client/cli/query_consumer_conflicts.go b/x/conflict/client/cli/query_consumer_conflicts.go index 4f4373698b..054e5b4d6a 100644 --- a/x/conflict/client/cli/query_consumer_conflicts.go +++ b/x/conflict/client/cli/query_consumer_conflicts.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/query_params.go b/x/conflict/client/cli/query_params.go index cd77709b31..a357ed2389 100644 --- a/x/conflict/client/cli/query_params.go +++ b/x/conflict/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/query_provider_conflicts.go b/x/conflict/client/cli/query_provider_conflicts.go index 68210e9646..7a61453212 100644 --- a/x/conflict/client/cli/query_provider_conflicts.go +++ b/x/conflict/client/cli/query_provider_conflicts.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/tx.go b/x/conflict/client/cli/tx.go index 4fbe9a5135..24f79c6c9b 100644 --- a/x/conflict/client/cli/tx.go +++ b/x/conflict/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/conflict/client/cli/tx_conflict_vote_commit.go b/x/conflict/client/cli/tx_conflict_vote_commit.go index 58e0b16f61..6a854625bd 100644 --- a/x/conflict/client/cli/tx_conflict_vote_commit.go +++ b/x/conflict/client/cli/tx_conflict_vote_commit.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/tx_conflict_vote_reveal.go b/x/conflict/client/cli/tx_conflict_vote_reveal.go index dd2122c240..e2522882a2 100644 --- a/x/conflict/client/cli/tx_conflict_vote_reveal.go +++ b/x/conflict/client/cli/tx_conflict_vote_reveal.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/conflict/client/cli/tx_detection.go b/x/conflict/client/cli/tx_detection.go index 71ca0d0198..6669d74620 100644 --- a/x/conflict/client/cli/tx_detection.go +++ b/x/conflict/client/cli/tx_detection.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/spf13/cobra" ) @@ -23,12 +23,7 @@ func CmdDetection() *cobra.Command { return err } - msg := types.NewMsgDetection( - clientCtx.GetFromAddress().String(), - nil, - nil, - nil, - ) + msg := types.NewMsgDetection(clientCtx.GetFromAddress().String()) if err := msg.ValidateBasic(); err != nil { return err } diff --git a/x/conflict/genesis.go b/x/conflict/genesis.go index 11a9407179..f1369c26ec 100644 --- a/x/conflict/genesis.go +++ b/x/conflict/genesis.go @@ -2,8 +2,8 @@ package conflict import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/conflict/genesis_test.go b/x/conflict/genesis_test.go index f9a779cc96..0bd923fab8 100644 --- a/x/conflict/genesis_test.go +++ b/x/conflict/genesis_test.go @@ -3,10 +3,10 @@ package conflict_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/conflict" - "github.com/lavanet/lava/x/conflict/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/conflict" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/handler.go b/x/conflict/handler.go index 6916c57cc8..6872196bf4 100644 --- a/x/conflict/handler.go +++ b/x/conflict/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) // NewHandler ... diff --git a/x/conflict/keeper/conflict.go b/x/conflict/keeper/conflict.go index 731f341a6d..473c8d07d0 100644 --- a/x/conflict/keeper/conflict.go +++ b/x/conflict/keeper/conflict.go @@ -2,12 +2,17 @@ package keeper import ( "bytes" + "encoding/json" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/maps" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) func (k Keeper) ValidateFinalizationConflict(ctx sdk.Context, conflictData *types.FinalizationConflict, clientAddr sdk.AccAddress) error { @@ -20,30 +25,38 @@ func (k Keeper) ValidateResponseConflict(ctx sdk.Context, conflictData *types.Re if chainID != conflictData.ConflictRelayData1.Request.RelaySession.SpecId { return fmt.Errorf("mismatching request parameters between providers %s, %s", chainID, conflictData.ConflictRelayData1.Request.RelaySession.SpecId) } + block := conflictData.ConflictRelayData0.Request.RelaySession.Epoch if block != conflictData.ConflictRelayData1.Request.RelaySession.Epoch { return fmt.Errorf("mismatching request parameters between providers %d, %d", block, conflictData.ConflictRelayData1.Request.RelaySession.Epoch) } + if conflictData.ConflictRelayData0.Request.RelayData.ConnectionType != conflictData.ConflictRelayData1.Request.RelayData.ConnectionType { return fmt.Errorf("mismatching request parameters between providers %s, %s", conflictData.ConflictRelayData0.Request.RelayData.ConnectionType, conflictData.ConflictRelayData1.Request.RelayData.ConnectionType) } + if conflictData.ConflictRelayData0.Request.RelayData.ApiUrl != conflictData.ConflictRelayData1.Request.RelayData.ApiUrl { return fmt.Errorf("mismatching request parameters between providers %s, %s", conflictData.ConflictRelayData0.Request.RelayData.ApiUrl, conflictData.ConflictRelayData1.Request.RelayData.ApiUrl) } + if !bytes.Equal(conflictData.ConflictRelayData0.Request.RelayData.Data, conflictData.ConflictRelayData1.Request.RelayData.Data) { return fmt.Errorf("mismatching request parameters between providers %s, %s", conflictData.ConflictRelayData0.Request.RelayData.Data, conflictData.ConflictRelayData1.Request.RelayData.Data) } + if conflictData.ConflictRelayData0.Request.RelayData.RequestBlock != conflictData.ConflictRelayData1.Request.RelayData.RequestBlock { return fmt.Errorf("mismatching request parameters between providers %d, %d", conflictData.ConflictRelayData0.Request.RelayData.RequestBlock, conflictData.ConflictRelayData1.Request.RelayData.RequestBlock) } + if conflictData.ConflictRelayData0.Request.RelayData.ApiInterface != conflictData.ConflictRelayData1.Request.RelayData.ApiInterface { return fmt.Errorf("mismatching request parameters between providers %s, %s", conflictData.ConflictRelayData0.Request.RelayData.ApiInterface, conflictData.ConflictRelayData1.Request.RelayData.ApiInterface) } + // 1.5 validate params epochStart, _, err := k.epochstorageKeeper.GetEpochStartForBlock(ctx, uint64(block)) if err != nil { return fmt.Errorf("could not find epoch for block %d", block) } + if conflictData.ConflictRelayData0.Request.RelayData.RequestBlock < 0 { return fmt.Errorf("invalid request block height %d", conflictData.ConflictRelayData0.Request.RelayData.RequestBlock) } @@ -81,14 +94,17 @@ func (k Keeper) ValidateResponseConflict(ctx sdk.Context, conflictData *types.Re } return nil } + err = verifyClientAddrFromSignatureOnRequest(*conflictData.ConflictRelayData0) if err != nil { return fmt.Errorf("conflict data 0: %s", err) } + err = verifyClientAddrFromSignatureOnRequest(*conflictData.ConflictRelayData1) if err != nil { return fmt.Errorf("conflict data 1: %s", err) } + // 3. validate providers signatures and stakeEntry for that epoch providerAddressFromRelayReplyAndVerifyStakeEntry := func(reply *types.ReplyMetadata, first bool) (providerAddress sdk.AccAddress, err error) { print_st := "first" @@ -103,7 +119,7 @@ func (k Keeper) ValidateResponseConflict(ctx sdk.Context, conflictData *types.Re if err != nil { return nil, fmt.Errorf("AccAddressFromHex %s provider: %w", print_st, err) } - stakeEntry, found := k.epochstorageKeeper.GetStakeEntryForProviderEpoch(ctx, chainID, providerAddress.String(), epochStart) + stakeEntry, found := k.epochstorageKeeper.GetStakeEntry(ctx, epochStart, chainID, providerAddress.String()) if !found { return nil, fmt.Errorf("did not find a stake entry for %s provider %s on epoch %d, chainID %s", print_st, providerAddress, epochStart, chainID) } @@ -113,23 +129,26 @@ func (k Keeper) ValidateResponseConflict(ctx sdk.Context, conflictData *types.Re } return providerAddress, nil } + providerAccAddress0, err := providerAddressFromRelayReplyAndVerifyStakeEntry(conflictData.ConflictRelayData0.Reply, true) if err != nil { return err } + providerAccAddress1, err := providerAddressFromRelayReplyAndVerifyStakeEntry(conflictData.ConflictRelayData1.Reply, false) if err != nil { return err } + // 4. validate finalization - validateResponseFinalizationData := func(expectedAddress sdk.AccAddress, response *types.ReplyMetadata, request *pairingtypes.RelayRequest, first bool) (err error) { + validateResponseFinalizationData := func(expectedAddress sdk.AccAddress, replyMetadata *types.ReplyMetadata, request *pairingtypes.RelayRequest, first bool) (err error) { print_st := "first" if !first { print_st = "second" } - metaData := types.NewRelayFinalizationMetaData(*response, *request, clientAddr) - pubKey, err := sigs.RecoverPubKey(metaData) + relayFinalization := types.NewRelayFinalizationFromReplyMetadataAndRelayRequest(*replyMetadata, *request, clientAddr) + pubKey, err := sigs.RecoverPubKey(relayFinalization) if err != nil { return fmt.Errorf("RecoverPubKey %s provider ResponseFinalizationData: %w", print_st, err) } @@ -138,29 +157,172 @@ func (k Keeper) ValidateResponseConflict(ctx sdk.Context, conflictData *types.Re return fmt.Errorf("AccAddressFromHex %s provider ResponseFinalizationData: %w", print_st, err) } if !derived_providerAccAddress.Equals(expectedAddress) { - return fmt.Errorf("mismatching %s provider address signature and responseFinazalizationData %s , %s", print_st, derived_providerAccAddress, expectedAddress) + return fmt.Errorf("mismatching %s provider address signature and responseFinalizationData %s , %s", print_st, derived_providerAccAddress, expectedAddress) } // validate the responses are finalized - if !k.specKeeper.IsFinalizedBlock(ctx, chainID, request.RelayData.RequestBlock, response.LatestBlock) { - return fmt.Errorf("block isn't finalized on %s provider! %d,%d ", print_st, request.RelayData.RequestBlock, response.LatestBlock) + if !k.specKeeper.IsFinalizedBlock(ctx, chainID, request.RelayData.RequestBlock, replyMetadata.LatestBlock) { + return fmt.Errorf("block isn't finalized on %s provider! %d,%d ", print_st, request.RelayData.RequestBlock, replyMetadata.LatestBlock) } return nil } + err = validateResponseFinalizationData(providerAccAddress0, conflictData.ConflictRelayData0.Reply, conflictData.ConflictRelayData0.Request, true) if err != nil { return err } + err = validateResponseFinalizationData(providerAccAddress1, conflictData.ConflictRelayData1.Reply, conflictData.ConflictRelayData1.Request, true) if err != nil { return err } + // 5. validate mismatching responses if bytes.Equal(conflictData.ConflictRelayData0.Reply.HashAllDataHash, conflictData.ConflictRelayData1.Reply.HashAllDataHash) { return fmt.Errorf("no conflict between providers data responses, its the same") } + return nil } -func (k Keeper) ValidateSameProviderConflict(ctx sdk.Context, conflictData *types.FinalizationConflict, clientAddr sdk.AccAddress) error { +func (k Keeper) ValidateSameProviderConflict(ctx sdk.Context, conflictData *types.FinalizationConflict, clientAddr sdk.AccAddress) (providerAddr sdk.AccAddress, mismatchingBlockHeight int64, mismatchingBlockHashes map[string]string, err error) { + // Nil check + if conflictData == nil { + return nil, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Conflict data is nil") + } + + if conflictData.RelayFinalization_0 == nil || conflictData.RelayFinalization_1 == nil { + return nil, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Reply metadata is nil") + } + + // Validate Sig of provider and compare addresses + provider0PubKey, err := sigs.RecoverPubKey(conflictData.RelayFinalization_0) + if err != nil { + return nil, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Failed to recover public key from RelayFinalization_0: %w", err) + } + + providerAddress0, err := sdk.AccAddressFromHexUnsafe(provider0PubKey.Address().String()) + if err != nil { + return nil, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Failed to get provider address from RelayFinalization_0: %w", err) + } + + provider1PubKey, err := sigs.RecoverPubKey(conflictData.RelayFinalization_1) + if err != nil { + return nil, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Failed to recover public key from RelayFinalization_1: %w", err) + } + + providerAddress1, err := sdk.AccAddressFromHexUnsafe(provider1PubKey.Address().String()) + if err != nil { + return nil, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Failed to get provider address from RelayFinalization_1: %w", err) + } + + if !providerAddress0.Equals(providerAddress1) { + return nil, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Mismatching provider addresses %s, %s", providerAddress0, providerAddress1) + } + + // Validate client address + if conflictData.RelayFinalization_0.ConsumerAddress != clientAddr.String() || conflictData.RelayFinalization_1.ConsumerAddress != clientAddr.String() { + return providerAddress0, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Mismatching client addresses %v, %v", conflictData.RelayFinalization_0.ConsumerAddress, conflictData.RelayFinalization_1.ConsumerAddress) + } + + // Validate matching spec and epoch + if conflictData.RelayFinalization_0.RelaySession.SpecId != conflictData.RelayFinalization_1.RelaySession.SpecId { + return providerAddress0, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Mismatching spec id %s, %s", conflictData.RelayFinalization_0.RelaySession.SpecId, conflictData.RelayFinalization_1.RelaySession.SpecId) + } + + spec, _ := k.specKeeper.GetSpec(ctx, conflictData.RelayFinalization_0.RelaySession.SpecId) + if uint64(conflictData.RelayFinalization_0.RelaySession.Epoch) <= spec.BlockLastUpdated { + return providerAddress0, 0, nil, fmt.Errorf("ValidateSameProviderConflict: Epoch %d is less than spec last updated block %d", conflictData.RelayFinalization_0.RelaySession.Epoch, spec.BlockLastUpdated) + } + + // Validate block nums are ordered && Finalization distance is right + finalizedBlocksMap0, earliestFinalizedBlock0, latestFinalizedBlock0, err := k.validateBlockHeights(conflictData.RelayFinalization_0, &spec) + if err != nil { + return providerAddress0, 0, nil, err + } + + finalizedBlocksMap1, earliestFinalizedBlock1, latestFinalizedBlock1, err := k.validateBlockHeights(conflictData.RelayFinalization_1, &spec) + if err != nil { + return providerAddress0, 0, nil, err + } + + if err := k.validateFinalizedBlock(conflictData.RelayFinalization_0, latestFinalizedBlock0, &spec); err != nil { + return providerAddress0, 0, nil, err + } + + if err := k.validateFinalizedBlock(conflictData.RelayFinalization_1, latestFinalizedBlock1, &spec); err != nil { + return providerAddress0, 0, nil, err + } + + // Check the hashes between responses + firstOverlappingBlock := utils.Max(earliestFinalizedBlock0, earliestFinalizedBlock1) + lastOverlappingBlock := utils.Min(latestFinalizedBlock0, latestFinalizedBlock1) + if firstOverlappingBlock > lastOverlappingBlock { + return providerAddress0, 0, nil, fmt.Errorf("ValidateSameProviderConflict: No overlapping blocks between providers: provider0: %d, provider1: %d", earliestFinalizedBlock0, earliestFinalizedBlock1) + } + + mismatchingBlockHashes = map[string]string{} + mismatchingBlockHeight = int64(0) + for i := firstOverlappingBlock; i <= lastOverlappingBlock; i++ { + if finalizedBlocksMap0[i] != finalizedBlocksMap1[i] { + mismatchingBlockHashes[providerAddress0.String()] = finalizedBlocksMap0[i] + mismatchingBlockHashes[providerAddress1.String()] = finalizedBlocksMap1[i] + mismatchingBlockHeight = i + } + } + + if len(mismatchingBlockHashes) == 0 { + return providerAddress0, 0, mismatchingBlockHashes, fmt.Errorf("ValidateSameProviderConflict: All overlapping blocks are equal between providers") + } + + return providerAddress0, mismatchingBlockHeight, mismatchingBlockHashes, nil +} + +func (k Keeper) validateBlockHeights(relayFinalization *types.RelayFinalization, spec *spectypes.Spec) (finalizedBlocksMarshalled map[int64]string, earliestFinalizedBlock int64, latestFinalizedBlock int64, err error) { + EMPTY_MAP := map[int64]string{} + + // Unmarshall finalized blocks + finalizedBlocks := map[int64]string{} + err = json.Unmarshal(relayFinalization.FinalizedBlocksHashes, &finalizedBlocks) + if err != nil { + return EMPTY_MAP, 0, 0, fmt.Errorf("ValidateSameProviderConflict: Failed unmarshalling finalized blocks data: %w", err) + } + + // Validate that finalized blocks are not empty + if len(finalizedBlocks) == 0 { + return EMPTY_MAP, 0, 0, fmt.Errorf("ValidateSameProviderConflict: No finalized blocks data") + } + + // Sort block heights + blockHeights := maps.StableSortedKeys(finalizedBlocks) + + // Validate that blocks are consecutive + _, isConsecutive := lavaslices.IsSliceConsecutive(blockHeights) + if !isConsecutive { + return EMPTY_MAP, 0, 0, fmt.Errorf("ValidateSameProviderConflict: Finalized blocks are not consecutive: %v", blockHeights) + } + + // Validate that all finalized blocks are finalized + for _, blockNum := range blockHeights { + if !spectypes.IsFinalizedBlock(blockNum, relayFinalization.GetLatestBlock(), int64(spec.BlockDistanceForFinalizedData)) { + return EMPTY_MAP, 0, 0, fmt.Errorf("ValidateSameProviderConflict: Finalized block is not finalized: %d", blockNum) + } + } + + return finalizedBlocks, blockHeights[0], blockHeights[len(blockHeights)-1], nil +} + +func (k Keeper) validateFinalizedBlock(relayFinalization *types.RelayFinalization, latestFinalizedBlock int64, spec *spectypes.Spec) error { + latestBlock := relayFinalization.GetLatestBlock() + blockDistanceToFinalization := int64(spec.BlockDistanceForFinalizedData) + + // Validate that finalization distance is right + if latestFinalizedBlock != latestBlock-blockDistanceToFinalization { + return fmt.Errorf("ValidateSameProviderConflict: Missing blocks from finalization blocks: latestFinalizedBlock[%d], latestBlock[%d]-blockDistanceToFinalization[%d]=expectedLatestFinalizedBlock[%d]", latestFinalizedBlock, latestBlock, blockDistanceToFinalization, latestBlock-blockDistanceToFinalization) + } + + if spectypes.IsFinalizedBlock(latestFinalizedBlock+1, latestBlock, int64(spec.BlockDistanceForFinalizedData)) { + return fmt.Errorf("ValidateSameProviderConflict: Non finalized block marked as finalized. Block height: %d", latestFinalizedBlock+1) + } + return nil } diff --git a/x/conflict/keeper/conflict_test.go b/x/conflict/keeper/conflict_test.go new file mode 100644 index 0000000000..7fa1024974 --- /dev/null +++ b/x/conflict/keeper/conflict_test.go @@ -0,0 +1,322 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" + "github.com/stretchr/testify/require" +) + +func TestValidateSameProviderConflict(t *testing.T) { + initTester := func() (tester *tester, keeper *keeper.Keeper, ctx sdk.Context) { + tester = newTester(t) + keeper = &tester.Keepers.Conflict + ctx = tester.Ctx + return + } + + t.Run("nil check", func(t *testing.T) { + _, keeper, ctx := initTester() + _, _, _, err := keeper.ValidateSameProviderConflict(ctx, nil, sdk.AccAddress{}) + require.Error(t, err) + + finalizationConflict := &types.FinalizationConflict{} + _, _, _, err = keeper.ValidateSameProviderConflict(ctx, finalizationConflict, sdk.AccAddress{}) + require.Error(t, err) + }) + + t.Run("empty reply", func(t *testing.T) { + _, keeper, ctx := initTester() + finalizationConflict := &types.FinalizationConflict{ + RelayFinalization_0: &types.RelayFinalization{}, + RelayFinalization_1: &types.RelayFinalization{}, + } + _, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, sdk.AccAddress{}) + require.Error(t, err) + }) + + t.Run("different provider addr", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(2) // stake provider + provider0Acc, _ := ts.GetAccount(common.PROVIDER, 0) + provider1Acc, _ := ts.GetAccount(common.PROVIDER, 1) + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{} + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, provider0Acc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, provider1Acc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + _, _, _, err = keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + }) + + t.Run("different consumer addr", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + + consumer, consumerAddr := ts.AddAccount("consumer", 1, 100000) + _, err := ts.TxSubscriptionBuy(consumerAddr, consumerAddr, ts.plan.Index, 1, false, false) + require.Nil(ts.T, err) + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{} + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("different spec", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + + altSpecName := ts.spec.Index + "PremiumPlus" + altSpec := ts.AddSpec(altSpecName, common.CreateMockSpec()).Spec(altSpecName) + altSpec.Index = altSpecName + altSpec.Name = altSpecName + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{} + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("provider not staked", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(0) // stake provider + providerAcc, _ := ts.AddAccount(common.PROVIDER, 1, 100000) + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{} + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("empty finalized block hashes", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{} + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("non consecutive block hashes", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{ + 1: "hash1", + 2: "hash2", + 4: "hash3", + 5: "hash4", + } + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("finalization distance is not right", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + ts.spec.BlockDistanceForFinalizedData = 1 + ts.AddSpec("modSpec", ts.spec) + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{ + 1: "hash1", + 2: "hash2", + 3: "hash3", + 4: "hash4", + } + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("all overlapping blocks are equal", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + ts.spec.BlockDistanceForFinalizedData = 2 + ts.AddSpec("modSpec", ts.spec) + + latestBlockHeight := int64(6) + finalizationBlockHashes := map[int64]string{ + 1: "hash1", + 2: "hash2", + 3: "hash3", + 4: "hash4", + } + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight, finalizationBlockHashes, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("no overlapping", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + ts.spec.BlockDistanceForFinalizedData = 2 + ts.AddSpec("modSpec", ts.spec) + + latestBlockHeight0 := int64(6) + finalizationBlockHashes0 := map[int64]string{ + 1: "hash1", + 2: "hash2", + 3: "hash3", + 4: "hash4", + } + + latestBlockHeight1 := int64(10) + finalizationBlockHashes1 := map[int64]string{ + 5: "hash5", + 6: "hash6", + 7: "hash7", + 8: "hash", + } + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight0, finalizationBlockHashes0, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight1, finalizationBlockHashes1, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("overlapping blocks match", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + ts.spec.BlockDistanceForFinalizedData = 2 + ts.AddSpec("modSpec", ts.spec) + + latestBlockHeight0 := int64(6) + finalizationBlockHashes0 := map[int64]string{ + 1: "hash1", + 2: "hash2", + 3: "hash3", + 4: "hash4", + } + + latestBlockHeight1 := int64(9) + finalizationBlockHashes1 := map[int64]string{ + 4: "hash4", + 5: "hash5", + 6: "hash6", + 7: "hash7", + } + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight0, finalizationBlockHashes0, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight1, finalizationBlockHashes1, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.Error(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) + + t.Run("overlapping blocks don't match", func(t *testing.T) { + ts, keeper, ctx := initTester() + ts.setupForConflict(1) // stake provider + providerAcc, _ := ts.GetAccount(common.PROVIDER, 0) + ts.spec.BlockDistanceForFinalizedData = 2 + ts.AddSpec("modSpec", ts.spec) + + latestBlockHeight0 := int64(6) + finalizationBlockHashes0 := map[int64]string{ + 1: "hash1", + 2: "hash2", + 3: "hash3", + 4: "hash4", + } + + latestBlockHeight1 := int64(9) + finalizationBlockHashes1 := map[int64]string{ + 4: "hash4FAIL", + 5: "hash5", + 6: "hash6", + 7: "hash7", + } + + reply0, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight0, finalizationBlockHashes0, &ts.spec) + require.NoError(t, err) + reply1, err := common.CreateRelayFinalizationForTest(ts.Ctx, ts.consumer, providerAcc, latestBlockHeight1, finalizationBlockHashes1, &ts.spec) + require.NoError(t, err) + finalizationConflict := &types.FinalizationConflict{RelayFinalization_0: reply0, RelayFinalization_1: reply1} + + providerAddr, _, _, err := keeper.ValidateSameProviderConflict(ctx, finalizationConflict, ts.consumer.Addr) + require.NoError(t, err) + require.Equal(t, providerAcc.Addr.String(), providerAddr.String()) + }) +} diff --git a/x/conflict/keeper/conflict_vote.go b/x/conflict/keeper/conflict_vote.go index 123f4d6d17..ed8bb5cfa8 100644 --- a/x/conflict/keeper/conflict_vote.go +++ b/x/conflict/keeper/conflict_vote.go @@ -3,7 +3,7 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" ) // SetConflictVote set a specific conflictVote in the store from its index diff --git a/x/conflict/keeper/conflict_vote_test.go b/x/conflict/keeper/conflict_vote_test.go index fc8e5716e4..79f8ce61f2 100644 --- a/x/conflict/keeper/conflict_vote_test.go +++ b/x/conflict/keeper/conflict_vote_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/grpc_query.go b/x/conflict/keeper/grpc_query.go index 4854bb6990..11c171ef99 100644 --- a/x/conflict/keeper/grpc_query.go +++ b/x/conflict/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/conflict/keeper/grpc_query_conflict_vote.go b/x/conflict/keeper/grpc_query_conflict_vote.go index 9744cc0ed7..fda470ad67 100644 --- a/x/conflict/keeper/grpc_query_conflict_vote.go +++ b/x/conflict/keeper/grpc_query_conflict_vote.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_conflict_vote_test.go b/x/conflict/keeper/grpc_query_conflict_vote_test.go index 2ff159b4ef..647d16fbd6 100644 --- a/x/conflict/keeper/grpc_query_conflict_vote_test.go +++ b/x/conflict/keeper/grpc_query_conflict_vote_test.go @@ -10,9 +10,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/conflict/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/conflict/types" ) // Prevent strconv unused error diff --git a/x/conflict/keeper/grpc_query_consumer_conflicts.go b/x/conflict/keeper/grpc_query_consumer_conflicts.go index 6a49893d17..0d58245cad 100644 --- a/x/conflict/keeper/grpc_query_consumer_conflicts.go +++ b/x/conflict/keeper/grpc_query_consumer_conflicts.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_consumer_conflicts_test.go b/x/conflict/keeper/grpc_query_consumer_conflicts_test.go index a911df8e56..6d5cc852e8 100644 --- a/x/conflict/keeper/grpc_query_consumer_conflicts_test.go +++ b/x/conflict/keeper/grpc_query_consumer_conflicts_test.go @@ -5,8 +5,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/conflict/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/grpc_query_params.go b/x/conflict/keeper/grpc_query_params.go index 0888dbdec6..8199d47198 100644 --- a/x/conflict/keeper/grpc_query_params.go +++ b/x/conflict/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_params_test.go b/x/conflict/keeper/grpc_query_params_test.go index ec3561bff8..1fc431bde9 100644 --- a/x/conflict/keeper/grpc_query_params_test.go +++ b/x/conflict/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/conflict/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/grpc_query_provider_conflicts.go b/x/conflict/keeper/grpc_query_provider_conflicts.go index 8f5eeab520..6a9b5b721d 100644 --- a/x/conflict/keeper/grpc_query_provider_conflicts.go +++ b/x/conflict/keeper/grpc_query_provider_conflicts.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/conflict/keeper/grpc_query_provider_conflicts_test.go b/x/conflict/keeper/grpc_query_provider_conflicts_test.go index 4ae58a9c70..d99872824b 100644 --- a/x/conflict/keeper/grpc_query_provider_conflicts_test.go +++ b/x/conflict/keeper/grpc_query_provider_conflicts_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/conflict/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) // Prevent strconv unused error diff --git a/x/conflict/keeper/keeper.go b/x/conflict/keeper/keeper.go index 5887d5c053..389dea3a7b 100644 --- a/x/conflict/keeper/keeper.go +++ b/x/conflict/keeper/keeper.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" ) type ( diff --git a/x/conflict/keeper/migrations.go b/x/conflict/keeper/migrations.go index dc72d78b7f..8ecffc7954 100644 --- a/x/conflict/keeper/migrations.go +++ b/x/conflict/keeper/migrations.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v5 "github.com/lavanet/lava/x/conflict/migrations/v5" + v5 "github.com/lavanet/lava/v2/x/conflict/migrations/v5" ) type Migrator struct { diff --git a/x/conflict/keeper/msg_server.go b/x/conflict/keeper/msg_server.go index ecdf8e2306..a05c5bdce8 100644 --- a/x/conflict/keeper/msg_server.go +++ b/x/conflict/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" ) type msgServer struct { diff --git a/x/conflict/keeper/msg_server_conflict_vote_commit.go b/x/conflict/keeper/msg_server_conflict_vote_commit.go index 644ca52e76..4e3884eb9e 100644 --- a/x/conflict/keeper/msg_server_conflict_vote_commit.go +++ b/x/conflict/keeper/msg_server_conflict_vote_commit.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/conflict/types" ) func (k msgServer) ConflictVoteCommit(goCtx context.Context, msg *types.MsgConflictVoteCommit) (*types.MsgConflictVoteCommitResponse, error) { diff --git a/x/conflict/keeper/msg_server_conflict_vote_reveal.go b/x/conflict/keeper/msg_server_conflict_vote_reveal.go index b153bbfdf8..0c132d570e 100644 --- a/x/conflict/keeper/msg_server_conflict_vote_reveal.go +++ b/x/conflict/keeper/msg_server_conflict_vote_reveal.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/conflict/types" ) func (k msgServer) ConflictVoteReveal(goCtx context.Context, msg *types.MsgConflictVoteReveal) (*types.MsgConflictVoteRevealResponse, error) { diff --git a/x/conflict/keeper/msg_server_detection.go b/x/conflict/keeper/msg_server_detection.go index b6b46e90af..50d1354fce 100644 --- a/x/conflict/keeper/msg_server_detection.go +++ b/x/conflict/keeper/msg_server_detection.go @@ -3,18 +3,19 @@ package keeper import ( "context" "encoding/json" + "fmt" "strconv" "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/conflict/types" - pairingfilters "github.com/lavanet/lava/x/pairing/keeper/filters" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/conflict/types" + pairingfilters "github.com/lavanet/lava/v2/x/pairing/keeper/filters" "golang.org/x/exp/slices" ) -func DetectionIndex(msg *types.MsgDetection, epochStart uint64) string { - return msg.Creator + msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Provider + msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider + strconv.FormatUint(epochStart, 10) +func DetectionIndex(creatorAddr string, conflict *types.ResponseConflict, epochStart uint64) string { + return creatorAddr + conflict.ConflictRelayData0.Request.RelaySession.Provider + conflict.ConflictRelayData1.Request.RelaySession.Provider + strconv.FormatUint(epochStart, 10) } func (k msgServer) Detection(goCtx context.Context, msg *types.MsgDetection) (*types.MsgDetectionResponse, error) { @@ -26,132 +27,60 @@ func (k msgServer) Detection(goCtx context.Context, msg *types.MsgDetection) (*t utils.Attribute{Key: "client", Value: msg.Creator}, ) } - if msg.FinalizationConflict != nil && msg.ResponseConflict == nil && msg.SameProviderConflict == nil { - err := k.Keeper.ValidateFinalizationConflict(ctx, msg.FinalizationConflict, clientAddr) - if err != nil { - return nil, utils.LavaFormatWarning("Simulation: invalid finalization conflict detection", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - ) - } - } else if msg.FinalizationConflict == nil && msg.ResponseConflict == nil && msg.SameProviderConflict != nil { - err := k.Keeper.ValidateSameProviderConflict(ctx, msg.SameProviderConflict, clientAddr) - if err != nil { - return nil, utils.LavaFormatWarning("Simulation: invalid same provider conflict detection", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - ) - } - } else if msg.FinalizationConflict == nil && msg.ResponseConflict != nil && msg.SameProviderConflict == nil { - err := k.Keeper.ValidateResponseConflict(ctx, msg.ResponseConflict, clientAddr) - if err != nil { - return nil, utils.LavaFormatWarning("Simulation: invalid response conflict detection", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - ) + switch msg.Conflict.(type) { + case *types.MsgDetection_FinalizationConflict: + conflict := msg.GetFinalizationConflict() + if conflict == nil { + return nil, utils.LavaFormatWarning("finalization conflict is nil", nil) } - // the conflict detection transaction is valid!, start a vote - // TODO: 1. start a vote, with vote ID (unique, list index isn't good because its changing, use a map) - // 2. create an event to declare vote - // 3. accept incoming commit transactions for this vote, - // 4. after vote ends, accept reveal transactions, strike down every provider that voted (only valid if there was a commit) - // 5. majority wins, minority gets penalised - epochStart, _, err := k.epochstorageKeeper.GetEpochStartForBlock(ctx, uint64(msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Epoch)) - if err != nil { - return nil, utils.LavaFormatWarning("Simulation: could not get EpochStart for specific block", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - utils.Attribute{Key: "provider0", Value: msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Provider}, - utils.Attribute{Key: "provider1", Value: msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider}, - ) - } - index := DetectionIndex(msg, epochStart) - found := k.Keeper.AllocateNewConflictVote(ctx, index) - if found { - return nil, utils.LavaFormatWarning("Simulation: conflict with is already open for this client and providers in this epoch", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - utils.Attribute{Key: "provider0", Value: msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Provider}, - utils.Attribute{Key: "provider1", Value: msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider}, - ) - } - conflictVote := types.ConflictVote{} - conflictVote.Index = index - conflictVote.VoteState = types.StateCommit - conflictVote.VoteStartBlock = uint64(msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Epoch) - epochBlocks, err := k.epochstorageKeeper.EpochBlocks(ctx, uint64(ctx.BlockHeight())) - if err != nil { - return nil, utils.LavaFormatError("Simulation: could not get epochblocks", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - utils.Attribute{Key: "provider0", Value: msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Provider}, - utils.Attribute{Key: "provider1", Value: msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider}, - ) + if conflict.RelayFinalization_0 == nil || conflict.RelayFinalization_1 == nil { + return nil, utils.LavaFormatWarning("conflict finalization is nil", nil) } - voteDeadline, err := k.Keeper.epochstorageKeeper.GetNextEpoch(ctx, uint64(ctx.BlockHeight())+k.VotePeriod(ctx)*epochBlocks) - if err != nil { - return nil, utils.LavaFormatError("Simulation: could not get NextEpoch", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - utils.Attribute{Key: "provider0", Value: msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Provider}, - utils.Attribute{Key: "provider1", Value: msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider}, - ) + if conflict.RelayFinalization_0.RelaySession == nil || conflict.RelayFinalization_1.RelaySession == nil { + return nil, utils.LavaFormatWarning("conflict relay session is nil", nil) } - conflictVote.VoteDeadline = voteDeadline - conflictVote.ApiUrl = msg.ResponseConflict.ConflictRelayData0.Request.RelayData.ApiUrl - conflictVote.ClientAddress = msg.Creator - conflictVote.ChainID = msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.SpecId - conflictVote.RequestBlock = uint64(msg.ResponseConflict.ConflictRelayData0.Request.RelayData.RequestBlock) - conflictVote.RequestData = msg.ResponseConflict.ConflictRelayData0.Request.RelayData.Data - - conflictVote.FirstProvider.Account = msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Provider - conflictVote.FirstProvider.Response = msg.ResponseConflict.ConflictRelayData0.Reply.HashAllDataHash - conflictVote.SecondProvider.Account = msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider - conflictVote.SecondProvider.Response = msg.ResponseConflict.ConflictRelayData1.Reply.HashAllDataHash - conflictVote.Votes = []types.Vote{} - voters := k.Keeper.LotteryVoters(goCtx, epochStart, conflictVote.ChainID, []string{conflictVote.FirstProvider.Account, conflictVote.SecondProvider.Account}) - for _, voter := range voters { - conflictVote.Votes = append(conflictVote.Votes, types.Vote{Address: voter, Hash: []byte{}, Result: types.NoVote}) + + if conflict.RelayFinalization_0.RelaySession.Provider == conflict.RelayFinalization_1.RelaySession.Provider { + eventData, err := k.handleSameProviderFinalizationConflict(ctx, conflict, clientAddr) + if err != nil { + return nil, err + } + + utils.LogLavaEvent(ctx, logger, types.ConflictDetectionSameProviderEventName, eventData, "Simulation: Got a new valid conflict detection from consumer on same provider") + } else { + eventData, err := k.handleTwoProvidersFinalizationConflict(ctx, conflict, clientAddr) + if err != nil { + return nil, err + } + + utils.LogLavaEvent(ctx, logger, types.ConflictDetectionTwoProvidersEventName, eventData, "Simulation: Got a new valid conflict detection from consumer on two providers") } - metadataBytes, err := json.Marshal(msg.ResponseConflict.ConflictRelayData0.Request.RelayData.Metadata) + + return &types.MsgDetectionResponse{}, nil + case *types.MsgDetection_ResponseConflict: + eventData, err := k.handleResponseConflict(ctx, goCtx, msg.GetResponseConflict(), clientAddr) if err != nil { - return nil, utils.LavaFormatError("could not marshal metadata in the event", err, - utils.Attribute{Key: "client", Value: msg.Creator}, - utils.Attribute{Key: "provider0", Value: msg.ResponseConflict.ConflictRelayData0.Request.RelaySession.Provider}, - utils.Attribute{Key: "provider1", Value: msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider}, - ) + return nil, err } - k.SetConflictVote(ctx, conflictVote) - - eventData := map[string]string{"client": msg.Creator} - eventData["voteID"] = conflictVote.Index - eventData["chainID"] = conflictVote.ChainID - eventData["connectionType"] = msg.ResponseConflict.ConflictRelayData0.Request.RelayData.ConnectionType - eventData["apiURL"] = conflictVote.ApiUrl - eventData["requestData"] = string(conflictVote.RequestData) - eventData["requestBlock"] = strconv.FormatUint(conflictVote.RequestBlock, 10) - eventData["voteDeadline"] = strconv.FormatUint(conflictVote.VoteDeadline, 10) - eventData["voters"] = strings.Join(voters, ",") - eventData["apiInterface"] = msg.ResponseConflict.ConflictRelayData0.Request.RelayData.ApiInterface - eventData["metadata"] = string(metadataBytes) - utils.LogLavaEvent(ctx, logger, types.ConflictVoteDetectionEventName, eventData, "Simulation: Got a new valid conflict detection from consumer, starting new vote") return &types.MsgDetectionResponse{}, nil + default: + return nil, utils.LavaFormatWarning("invalid conflict type", nil, utils.LogAttr("conflict", fmt.Sprintf("%+v", msg.Conflict))) } - - eventData := map[string]string{"client": msg.Creator} - utils.LogLavaEvent(ctx, logger, types.ConflictDetectionRecievedEventName, eventData, "Simulation: Got a new valid conflict detection from consumer") - return &types.MsgDetectionResponse{}, nil } func (k Keeper) LotteryVoters(goCtx context.Context, epoch uint64, chainID string, exemptions []string) []string { ctx := sdk.UnwrapSDKContext(goCtx) - entries, err := k.epochstorageKeeper.GetStakeEntryForAllProvidersEpoch(ctx, chainID, epoch) - if err != nil { - return make([]string, 0) - } + entries := k.epochstorageKeeper.GetAllStakeEntriesForEpochChainId(ctx, epoch, chainID) freezeFilter := pairingfilters.FrozenProvidersFilter{} - frozenProviders := freezeFilter.Filter(ctx, *entries, epoch) // bool array -> true == not frozen + frozenProviders := freezeFilter.Filter(ctx, entries, epoch) // bool array -> true == not frozen voters := make([]string, 0) - for i, entry := range *entries { + for i, entry := range entries { if !slices.Contains(exemptions, entry.Address) && frozenProviders[i] { voters = append(voters, entry.Address) } @@ -159,3 +88,132 @@ func (k Keeper) LotteryVoters(goCtx context.Context, epoch uint64, chainID strin return voters } + +func (k msgServer) handleTwoProvidersFinalizationConflict(ctx sdk.Context, conflict *types.FinalizationConflict, clientAddr sdk.AccAddress) (eventData map[string]string, err error) { + err = k.Keeper.ValidateFinalizationConflict(ctx, conflict, clientAddr) + if err != nil { + return nil, utils.LavaFormatWarning("Simulation: invalid finalization conflict detection", err, + utils.LogAttr("client", clientAddr.String()), + ) + } + + eventData = map[string]string{"client": clientAddr.String()} + eventData["chainID"] = conflict.RelayFinalization_0.RelaySession.SpecId + eventData["provider0"] = fmt.Sprintf("%+v", conflict.RelayFinalization_0.RelaySession.Provider) + eventData["provider1"] = fmt.Sprintf("%+v", conflict.RelayFinalization_1.RelaySession.Provider) + // eventData["mismatching_block_height"] = fmt.Sprintf("%+v", mismatchingBlockHeight) + // eventData["mismatching_block_hashes"] = fmt.Sprintf("%+v", mismatchingBlockHashes) + + return eventData, nil +} + +func (k msgServer) handleSameProviderFinalizationConflict(ctx sdk.Context, conflict *types.FinalizationConflict, clientAddr sdk.AccAddress) (eventData map[string]string, err error) { + providerAddress, mismatchingBlockHeight, mismatchingBlockHashes, err := k.Keeper.ValidateSameProviderConflict(ctx, conflict, clientAddr) + if err != nil { + return nil, utils.LavaFormatWarning("Simulation: invalid same provider conflict detection", err, + utils.LogAttr("client", clientAddr.String()), + ) + } + + eventData = map[string]string{"client": clientAddr.String()} + eventData["chainID"] = conflict.RelayFinalization_0.RelaySession.SpecId + eventData["provider"] = fmt.Sprintf("%+v", providerAddress) + eventData["mismatching_block_height"] = fmt.Sprintf("%+v", mismatchingBlockHeight) + eventData["mismatching_block_hashes"] = fmt.Sprintf("%+v", mismatchingBlockHashes) + + return eventData, nil +} + +func (k msgServer) handleResponseConflict(ctx sdk.Context, goCtx context.Context, conflict *types.ResponseConflict, clientAddr sdk.AccAddress) (eventData map[string]string, err error) { + err = k.Keeper.ValidateResponseConflict(ctx, conflict, clientAddr) + if err != nil { + return nil, utils.LavaFormatWarning("Simulation: invalid response conflict detection", err, + utils.LogAttr("client", clientAddr.String()), + ) + } + + // the conflict detection transaction is valid!, start a vote + // TODO: 1. start a vote, with vote ID (unique, list index isn't good because its changing, use a map) + // 2. create an event to declare vote + // 3. accept incoming commit transactions for this vote, + // 4. after vote ends, accept reveal transactions, strike down every provider that voted (only valid if there was a commit) + // 5. majority wins, minority gets penalised + epochStart, _, err := k.epochstorageKeeper.GetEpochStartForBlock(ctx, uint64(conflict.ConflictRelayData0.Request.RelaySession.Epoch)) + if err != nil { + return nil, utils.LavaFormatWarning("Simulation: could not get EpochStart for specific block", err, + utils.LogAttr("client", clientAddr.String()), + utils.LogAttr("provider0", conflict.ConflictRelayData0.Request.RelaySession.Provider), + utils.LogAttr("provider1", conflict.ConflictRelayData1.Request.RelaySession.Provider), + ) + } + index := DetectionIndex(clientAddr.String(), conflict, epochStart) + found := k.Keeper.AllocateNewConflictVote(ctx, index) + if found { + return nil, utils.LavaFormatWarning("Simulation: conflict with is already open for this client and providers in this epoch", err, + utils.LogAttr("client", clientAddr.String()), + utils.LogAttr("provider0", conflict.ConflictRelayData0.Request.RelaySession.Provider), + utils.LogAttr("provider1", conflict.ConflictRelayData1.Request.RelaySession.Provider), + ) + } + conflictVote := types.ConflictVote{} + conflictVote.Index = index + conflictVote.VoteState = types.StateCommit + conflictVote.VoteStartBlock = uint64(conflict.ConflictRelayData0.Request.RelaySession.Epoch) + epochBlocks, err := k.epochstorageKeeper.EpochBlocks(ctx, uint64(ctx.BlockHeight())) + if err != nil { + return nil, utils.LavaFormatError("Simulation: could not get epochblocks", err, + utils.LogAttr("client", clientAddr.String()), + utils.LogAttr("provider0", conflict.ConflictRelayData0.Request.RelaySession.Provider), + utils.LogAttr("provider1", conflict.ConflictRelayData1.Request.RelaySession.Provider), + ) + } + + voteDeadline, err := k.Keeper.epochstorageKeeper.GetNextEpoch(ctx, uint64(ctx.BlockHeight())+k.VotePeriod(ctx)*epochBlocks) + if err != nil { + return nil, utils.LavaFormatError("Simulation: could not get NextEpoch", err, + utils.LogAttr("client", clientAddr.String()), + utils.LogAttr("provider0", conflict.ConflictRelayData0.Request.RelaySession.Provider), + utils.LogAttr("provider1", conflict.ConflictRelayData1.Request.RelaySession.Provider), + ) + } + conflictVote.VoteDeadline = voteDeadline + conflictVote.ApiUrl = conflict.ConflictRelayData0.Request.RelayData.ApiUrl + conflictVote.ClientAddress = clientAddr.String() + conflictVote.ChainID = conflict.ConflictRelayData0.Request.RelaySession.SpecId + conflictVote.RequestBlock = uint64(conflict.ConflictRelayData0.Request.RelayData.RequestBlock) + conflictVote.RequestData = conflict.ConflictRelayData0.Request.RelayData.Data + + conflictVote.FirstProvider.Account = conflict.ConflictRelayData0.Request.RelaySession.Provider + conflictVote.FirstProvider.Response = conflict.ConflictRelayData0.Reply.HashAllDataHash + conflictVote.SecondProvider.Account = conflict.ConflictRelayData1.Request.RelaySession.Provider + conflictVote.SecondProvider.Response = conflict.ConflictRelayData1.Reply.HashAllDataHash + conflictVote.Votes = []types.Vote{} + voters := k.Keeper.LotteryVoters(goCtx, epochStart, conflictVote.ChainID, []string{conflictVote.FirstProvider.Account, conflictVote.SecondProvider.Account}) + for _, voter := range voters { + conflictVote.Votes = append(conflictVote.Votes, types.Vote{Address: voter, Hash: []byte{}, Result: types.NoVote}) + } + metadataBytes, err := json.Marshal(conflict.ConflictRelayData0.Request.RelayData.Metadata) + if err != nil { + return nil, utils.LavaFormatError("could not marshal metadata in the event", err, + utils.LogAttr("client", clientAddr.String()), + utils.LogAttr("provider0", conflict.ConflictRelayData0.Request.RelaySession.Provider), + utils.LogAttr("provider1", conflict.ConflictRelayData1.Request.RelaySession.Provider), + ) + } + + k.SetConflictVote(ctx, conflictVote) + + eventData = map[string]string{"client": clientAddr.String()} + eventData["voteID"] = conflictVote.Index + eventData["chainID"] = conflictVote.ChainID + eventData["connectionType"] = conflict.ConflictRelayData0.Request.RelayData.ConnectionType + eventData["apiURL"] = conflictVote.ApiUrl + eventData["requestData"] = string(conflictVote.RequestData) + eventData["requestBlock"] = strconv.FormatUint(conflictVote.RequestBlock, 10) + eventData["voteDeadline"] = strconv.FormatUint(conflictVote.VoteDeadline, 10) + eventData["voters"] = strings.Join(voters, ",") + eventData["apiInterface"] = conflict.ConflictRelayData0.Request.RelayData.ApiInterface + eventData["metadata"] = string(metadataBytes) + + return eventData, nil +} diff --git a/x/conflict/keeper/msg_server_detection_test.go b/x/conflict/keeper/msg_server_detection_test.go index 740b153b47..2c3f0c920d 100644 --- a/x/conflict/keeper/msg_server_detection_test.go +++ b/x/conflict/keeper/msg_server_detection_test.go @@ -5,15 +5,15 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - conflictconstruct "github.com/lavanet/lava/x/conflict/types/construct" - "github.com/lavanet/lava/x/pairing/types" - plantypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + conflictconstruct "github.com/lavanet/lava/v2/x/conflict/types/construct" + "github.com/lavanet/lava/v2/x/pairing/types" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -104,37 +104,42 @@ func TestDetection(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - msg, _, reply, err := common.CreateMsgDetectionTest(ts.GoCtx, tt.Creator, tt.Provider0, tt.Provider1, ts.spec) + msg, _, reply, err := common.CreateResponseConflictMsgDetectionForTest(ts.GoCtx, tt.Creator, tt.Provider0, tt.Provider1, &ts.spec) require.NoError(t, err) msg.Creator = tt.Creator.Addr.String() // changes to request1 according to test - msg.ResponseConflict.ConflictRelayData1.Request.RelayData.ConnectionType += tt.ConnectionType - msg.ResponseConflict.ConflictRelayData1.Request.RelayData.ApiUrl += tt.ApiUrl - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Epoch += tt.BlockHeight - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.SpecId += tt.ChainID - msg.ResponseConflict.ConflictRelayData1.Request.RelayData.Data = append(msg.ResponseConflict.ConflictRelayData1.Request.RelayData.Data, tt.Data...) - msg.ResponseConflict.ConflictRelayData1.Request.RelayData.RequestBlock += tt.RequestBlock - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.CuSum += tt.Cusum - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.QosReport = tt.QoSReport - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.RelayNum += tt.RelayNum - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.SessionId += tt.SeassionID - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Provider = tt.Provider1.Addr.String() - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Sig = []byte{} - sig, err := sigs.Sign(ts.consumer.SK, *msg.ResponseConflict.ConflictRelayData1.Request.RelaySession) + responseConflict := msg.GetResponseConflict() + responseConflict.ConflictRelayData1.Request.RelayData.ConnectionType += tt.ConnectionType + responseConflict.ConflictRelayData1.Request.RelayData.ApiUrl += tt.ApiUrl + responseConflict.ConflictRelayData1.Request.RelaySession.Epoch += tt.BlockHeight + responseConflict.ConflictRelayData1.Request.RelaySession.SpecId += tt.ChainID + responseConflict.ConflictRelayData1.Request.RelayData.Data = append(responseConflict.ConflictRelayData1.Request.RelayData.Data, tt.Data...) + responseConflict.ConflictRelayData1.Request.RelayData.RequestBlock += tt.RequestBlock + responseConflict.ConflictRelayData1.Request.RelaySession.CuSum += tt.Cusum + responseConflict.ConflictRelayData1.Request.RelaySession.QosReport = tt.QoSReport + responseConflict.ConflictRelayData1.Request.RelaySession.RelayNum += tt.RelayNum + responseConflict.ConflictRelayData1.Request.RelaySession.SessionId += tt.SeassionID + responseConflict.ConflictRelayData1.Request.RelaySession.Provider = tt.Provider1.Addr.String() + + responseConflict.ConflictRelayData1.Request.RelaySession.Sig = []byte{} + sig, err := sigs.Sign(ts.consumer.SK, *responseConflict.ConflictRelayData1.Request.RelaySession) require.NoError(t, err) - msg.ResponseConflict.ConflictRelayData1.Request.RelaySession.Sig = sig + responseConflict.ConflictRelayData1.Request.RelaySession.Sig = sig + reply.Data = append(reply.Data, tt.ReplyData...) - relayExchange := types.NewRelayExchange(*msg.ResponseConflict.ConflictRelayData1.Request, *reply) + relayExchange := types.NewRelayExchange(*responseConflict.ConflictRelayData1.Request, *reply) sig, err = sigs.Sign(tt.Provider1.SK, relayExchange) require.NoError(t, err) reply.Sig = sig - relayFinalization := types.NewRelayFinalization(types.NewRelayExchange(*msg.ResponseConflict.ConflictRelayData1.Request, *reply), ts.consumer.Addr) + + relayFinalization := conflicttypes.NewRelayFinalizationFromRelaySessionAndRelayReply(responseConflict.ConflictRelayData1.Request.RelaySession, reply, ts.consumer.Addr) sigBlocks, err := sigs.Sign(tt.Provider1.SK, relayFinalization) require.NoError(t, err) reply.SigBlocks = sigBlocks - msg.ResponseConflict.ConflictRelayData1.Reply = conflictconstruct.ConstructReplyMetadata(reply, msg.ResponseConflict.ConflictRelayData1.Request) + + responseConflict.ConflictRelayData1.Reply = conflictconstruct.ConstructReplyMetadata(reply, responseConflict.ConflictRelayData1.Request) // send detection msg _, err = ts.txConflictDetection(msg) if tt.Valid { @@ -164,7 +169,7 @@ func TestFrozenProviderDetection(t *testing.T) { ts.AdvanceEpoch() // apply the freeze // send a conflict detection TX - msg, _, _, err := common.CreateMsgDetectionTest(ts.GoCtx, ts.consumer, ts.providers[0], ts.providers[1], ts.spec) + msg, _, _, err := common.CreateResponseConflictMsgDetectionForTest(ts.GoCtx, ts.consumer, ts.providers[0], ts.providers[1], &ts.spec) require.NoError(t, err) _, err = ts.txConflictDetection(msg) require.NoError(t, err) diff --git a/x/conflict/keeper/msg_server_test.go b/x/conflict/keeper/msg_server_test.go index 95c1cff135..808b3c51b8 100644 --- a/x/conflict/keeper/msg_server_test.go +++ b/x/conflict/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/conflict/keeper/params.go b/x/conflict/keeper/params.go index f45d861c18..1bb7c907a7 100644 --- a/x/conflict/keeper/params.go +++ b/x/conflict/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" ) // GetParams get all parameters as types.Params diff --git a/x/conflict/keeper/params_test.go b/x/conflict/keeper/params_test.go index 10f3409bb2..e4ce0f51cd 100644 --- a/x/conflict/keeper/params_test.go +++ b/x/conflict/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/conflict/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/keeper/vote.go b/x/conflict/keeper/vote.go index 1327aa54f0..461821e65e 100644 --- a/x/conflict/keeper/vote.go +++ b/x/conflict/keeper/vote.go @@ -6,8 +6,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/conflict/types" "golang.org/x/exp/slices" ) @@ -89,7 +89,7 @@ func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictV } for _, vote := range conflictVote.Votes { - entry, found := k.epochstorageKeeper.GetStakeEntryForProviderEpoch(ctx, conflictVote.ChainID, vote.Address, epochVoteStart) + entry, found := k.epochstorageKeeper.GetStakeEntry(ctx, epochVoteStart, conflictVote.ChainID, vote.Address) if !found { utils.LavaFormatWarning("failed to get stake entry for provider in voter list", fmt.Errorf("stake entry not found"), utils.Attribute{Key: "voteID", Value: conflictVote.Index}, diff --git a/x/conflict/keeper/vote_test.go b/x/conflict/keeper/vote_test.go index 96cb1be21e..13f3a131d9 100644 --- a/x/conflict/keeper/vote_test.go +++ b/x/conflict/keeper/vote_test.go @@ -3,12 +3,12 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) @@ -27,7 +27,7 @@ func (ts *tester) txConflictDetection(msg *conflicttypes.MsgDetection) (*conflic func (ts *tester) setupForCommit() (string, conflicttypes.MsgDetection, *pairingtypes.RelayReply, *pairingtypes.RelayReply) { ts.setupForConflict(ProvidersCount) - msg, reply1, reply2, err := common.CreateMsgDetectionTest(ts.GoCtx, ts.consumer, ts.providers[0], ts.providers[1], ts.spec) + msg, reply1, reply2, err := common.CreateResponseConflictMsgDetectionForTest(ts.GoCtx, ts.consumer, ts.providers[0], ts.providers[1], &ts.spec) require.Nil(ts.T, err) _, err = ts.txConflictDetection(msg) @@ -70,7 +70,7 @@ func TestCommit(t *testing.T) { nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -93,7 +93,7 @@ func TestDoubleCommit(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -115,7 +115,7 @@ func TestNotVotersProviders(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -154,7 +154,7 @@ func TestNewVoterOldVote(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -184,7 +184,7 @@ func TestCommitAfterDeadline(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -203,7 +203,7 @@ func TestReveal(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -231,7 +231,7 @@ func TestReveal(t *testing.T) { msg := conflicttypes.MsgConflictVoteReveal{} msg.Creator = tt.creator msg.VoteID = tt.voteID - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) msg.Hash = sigs.HashMsg(relayExchange.DataToSign()) msg.Nonce = tt.nonce @@ -254,7 +254,7 @@ func TestPreRevealAndDoubleReveal(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -287,7 +287,7 @@ func TestRevealExpired(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -312,7 +312,7 @@ func TestFullMajorityVote(t *testing.T) { nonce := rand.Int63() // first 2 voters - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msgs := make([]conflicttypes.MsgConflictVoteCommit, ProvidersCount) for i := 2; i < ProvidersCount-1; i++ { @@ -326,7 +326,7 @@ func TestFullMajorityVote(t *testing.T) { } // last voter - relayExchange2 := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData1.Request, *relay1) + relayExchange2 := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData1.Request, *relay1) replyDataHash = sigs.HashMsg(relayExchange2.DataToSign()) msg := conflicttypes.MsgConflictVoteCommit{} msg.VoteID = voteID @@ -345,14 +345,14 @@ func TestFullMajorityVote(t *testing.T) { for i := 2; i < ProvidersCount-1; i++ { msgReveal.Creator = ts.providers[i].Addr.String() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) msgReveal.Hash = sigs.HashMsg(relayExchange.DataToSign()) _, err := ts.txConflictVoteReveal(&msgReveal) require.NoError(t, err) } // last voter - relayExchange = pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData1.Request, *relay1) + relayExchange = pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData1.Request, *relay1) msgReveal.Hash = sigs.HashMsg(relayExchange.DataToSign()) msgReveal.Creator = ts.providers[ProvidersCount-1].Addr.String() _, err = ts.txConflictVoteReveal(&msgReveal) @@ -379,7 +379,7 @@ func TestFullStrongMajorityVote(t *testing.T) { msg.VoteID = voteID nonce := rand.Int63() - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) for i := 2; i < ProvidersCount; i++ { msg.Creator = ts.providers[i].Addr.String() @@ -436,7 +436,7 @@ func TestNoDecisionVote(t *testing.T) { nonce := rand.Int63() // first vote for provider 0 - relayExchange := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData0.Request, *relay0) + relayExchange := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData0.Request, *relay0) replyDataHash := sigs.HashMsg(relayExchange.DataToSign()) msg.Creator = ts.providers[2].Addr.String() msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -445,7 +445,7 @@ func TestNoDecisionVote(t *testing.T) { require.NoError(t, err) // first vote for provider 1 - relayExchange1 := pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData1.Request, *relay1) + relayExchange1 := pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData1.Request, *relay1) replyDataHash = sigs.HashMsg(relayExchange1.DataToSign()) msg.Creator = ts.providers[3].Addr.String() msg.Hash = conflicttypes.CommitVoteData(nonce, replyDataHash, msg.Creator) @@ -477,7 +477,7 @@ func TestNoDecisionVote(t *testing.T) { // reveal vote provider 1 msgReveal.Creator = ts.providers[3].Addr.String() - relayExchange1 = pairingtypes.NewRelayExchange(*detection.ResponseConflict.ConflictRelayData1.Request, *relay1) + relayExchange1 = pairingtypes.NewRelayExchange(*detection.GetResponseConflict().ConflictRelayData1.Request, *relay1) msgReveal.Hash = sigs.HashMsg(relayExchange1.DataToSign()) _, err = ts.txConflictVoteReveal(&msgReveal) require.NoError(t, err) @@ -520,7 +520,7 @@ func TestVaultProviderConflictVote(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - msg, _, _, err := common.CreateMsgDetectionTest(ts.GoCtx, ts.consumer, tt.p1, tt.p2, ts.spec) + msg, _, _, err := common.CreateResponseConflictMsgDetectionForTest(ts.GoCtx, ts.consumer, tt.p1, tt.p2, &ts.spec) require.NoError(t, err) _, err = ts.txConflictDetection(msg) diff --git a/x/conflict/migrations/v5/migrations.go b/x/conflict/migrations/v5/migrations.go index 2438b53a4e..b515481c2f 100644 --- a/x/conflict/migrations/v5/migrations.go +++ b/x/conflict/migrations/v5/migrations.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) const ( diff --git a/x/conflict/module.go b/x/conflict/module.go index 6de9fc0ded..5c1bd71438 100644 --- a/x/conflict/module.go +++ b/x/conflict/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/conflict/client/cli" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/client/cli" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) var ( diff --git a/x/conflict/module_simulation.go b/x/conflict/module_simulation.go index 80ecc96b86..3373bb86ce 100644 --- a/x/conflict/module_simulation.go +++ b/x/conflict/module_simulation.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - conflictsimulation "github.com/lavanet/lava/x/conflict/simulation" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/testutil/sample" + conflictsimulation "github.com/lavanet/lava/v2/x/conflict/simulation" + "github.com/lavanet/lava/v2/x/conflict/types" ) // avoid unused import issue diff --git a/x/conflict/simulation/conflict_vote_commit.go b/x/conflict/simulation/conflict_vote_commit.go index c46689a7df..036482fd64 100644 --- a/x/conflict/simulation/conflict_vote_commit.go +++ b/x/conflict/simulation/conflict_vote_commit.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) func SimulateMsgConflictVoteCommit( diff --git a/x/conflict/simulation/conflict_vote_reveal.go b/x/conflict/simulation/conflict_vote_reveal.go index 81322975df..adc5f4889a 100644 --- a/x/conflict/simulation/conflict_vote_reveal.go +++ b/x/conflict/simulation/conflict_vote_reveal.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) func SimulateMsgConflictVoteReveal( diff --git a/x/conflict/simulation/detection.go b/x/conflict/simulation/detection.go index 995150bf36..1fafedd35b 100644 --- a/x/conflict/simulation/detection.go +++ b/x/conflict/simulation/detection.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/conflict/keeper" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/keeper" + "github.com/lavanet/lava/v2/x/conflict/types" ) func SimulateMsgDetection( diff --git a/x/conflict/types/codec.go b/x/conflict/types/codec.go index e73d2cbbfa..61c5fd18ec 100644 --- a/x/conflict/types/codec.go +++ b/x/conflict/types/codec.go @@ -3,6 +3,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "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" ) @@ -31,5 +32,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + ModuleCdc = codec.NewAminoCodec(Amino) + // ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterCodec(Amino) + cryptocodec.RegisterCrypto(Amino) + Amino.Seal() +} diff --git a/x/conflict/types/conflict_data.pb.go b/x/conflict/types/conflict_data.pb.go index 719b1dae5b..799227e31a 100644 --- a/x/conflict/types/conflict_data.pb.go +++ b/x/conflict/types/conflict_data.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/pairing/types" + types "github.com/lavanet/lava/v2/x/pairing/types" io "io" math "math" math_bits "math/bits" @@ -205,8 +205,8 @@ func (m *ReplyMetadata) GetSigBlocks() []byte { } type FinalizationConflict struct { - RelayReply0 *types.RelayReply `protobuf:"bytes,1,opt,name=relayReply0,proto3" json:"relayReply0,omitempty"` - RelayReply1 *types.RelayReply `protobuf:"bytes,2,opt,name=relayReply1,proto3" json:"relayReply1,omitempty"` + RelayFinalization_0 *RelayFinalization `protobuf:"bytes,1,opt,name=relay_finalization_0,json=relayFinalization0,proto3" json:"relay_finalization_0,omitempty"` + RelayFinalization_1 *RelayFinalization `protobuf:"bytes,2,opt,name=relay_finalization_1,json=relayFinalization1,proto3" json:"relay_finalization_1,omitempty"` } func (m *FinalizationConflict) Reset() { *m = FinalizationConflict{} } @@ -242,16 +242,92 @@ func (m *FinalizationConflict) XXX_DiscardUnknown() { var xxx_messageInfo_FinalizationConflict proto.InternalMessageInfo -func (m *FinalizationConflict) GetRelayReply0() *types.RelayReply { +func (m *FinalizationConflict) GetRelayFinalization_0() *RelayFinalization { if m != nil { - return m.RelayReply0 + return m.RelayFinalization_0 } return nil } -func (m *FinalizationConflict) GetRelayReply1() *types.RelayReply { +func (m *FinalizationConflict) GetRelayFinalization_1() *RelayFinalization { if m != nil { - return m.RelayReply1 + return m.RelayFinalization_1 + } + return nil +} + +type RelayFinalization struct { + FinalizedBlocksHashes []byte `protobuf:"bytes,1,opt,name=finalized_blocks_hashes,json=finalizedBlocksHashes,proto3" json:"finalized_blocks_hashes,omitempty"` + LatestBlock int64 `protobuf:"varint,2,opt,name=latest_block,json=latestBlock,proto3" json:"latest_block,omitempty"` + ConsumerAddress string `protobuf:"bytes,3,opt,name=consumer_address,json=consumerAddress,proto3" json:"consumer_address,omitempty"` + RelaySession *types.RelaySession `protobuf:"bytes,4,opt,name=relay_session,json=relaySession,proto3" json:"relay_session,omitempty"` + SigBlocks []byte `protobuf:"bytes,5,opt,name=sig_blocks,json=sigBlocks,proto3" json:"sig_blocks,omitempty"` +} + +func (m *RelayFinalization) Reset() { *m = RelayFinalization{} } +func (m *RelayFinalization) String() string { return proto.CompactTextString(m) } +func (*RelayFinalization) ProtoMessage() {} +func (*RelayFinalization) Descriptor() ([]byte, []int) { + return fileDescriptor_db493e54bcd78171, []int{4} +} +func (m *RelayFinalization) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RelayFinalization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RelayFinalization.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 *RelayFinalization) XXX_Merge(src proto.Message) { + xxx_messageInfo_RelayFinalization.Merge(m, src) +} +func (m *RelayFinalization) XXX_Size() int { + return m.Size() +} +func (m *RelayFinalization) XXX_DiscardUnknown() { + xxx_messageInfo_RelayFinalization.DiscardUnknown(m) +} + +var xxx_messageInfo_RelayFinalization proto.InternalMessageInfo + +func (m *RelayFinalization) GetFinalizedBlocksHashes() []byte { + if m != nil { + return m.FinalizedBlocksHashes + } + return nil +} + +func (m *RelayFinalization) GetLatestBlock() int64 { + if m != nil { + return m.LatestBlock + } + return 0 +} + +func (m *RelayFinalization) GetConsumerAddress() string { + if m != nil { + return m.ConsumerAddress + } + return "" +} + +func (m *RelayFinalization) GetRelaySession() *types.RelaySession { + if m != nil { + return m.RelaySession + } + return nil +} + +func (m *RelayFinalization) GetSigBlocks() []byte { + if m != nil { + return m.SigBlocks } return nil } @@ -261,6 +337,7 @@ func init() { proto.RegisterType((*ConflictRelayData)(nil), "lavanet.lava.conflict.ConflictRelayData") proto.RegisterType((*ReplyMetadata)(nil), "lavanet.lava.conflict.ReplyMetadata") proto.RegisterType((*FinalizationConflict)(nil), "lavanet.lava.conflict.FinalizationConflict") + proto.RegisterType((*RelayFinalization)(nil), "lavanet.lava.conflict.RelayFinalization") } func init() { @@ -268,35 +345,40 @@ func init() { } var fileDescriptor_db493e54bcd78171 = []byte{ - // 444 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0xcb, 0xd3, 0x30, - 0x1c, 0xc7, 0x97, 0xa7, 0xcf, 0xfc, 0x93, 0x4d, 0x9c, 0x61, 0xc3, 0x32, 0xb0, 0xcc, 0xe2, 0x61, - 0x22, 0xb4, 0x4e, 0xc1, 0x83, 0x78, 0xb1, 0x13, 0x19, 0x82, 0x97, 0x9c, 0xc4, 0x4b, 0xc9, 0xba, - 0xac, 0x0d, 0xc6, 0xa6, 0x36, 0x99, 0x58, 0x5f, 0x85, 0xe0, 0xdd, 0x97, 0x23, 0x3b, 0xee, 0xe8, - 0x51, 0xb6, 0x37, 0x22, 0x49, 0xda, 0x69, 0x75, 0x0a, 0xf2, 0x9c, 0xfa, 0x6b, 0xf2, 0xf9, 0x7e, - 0xf3, 0xe5, 0x97, 0xfc, 0xe0, 0x5d, 0x4e, 0xde, 0x93, 0x9c, 0xaa, 0x50, 0x7f, 0xc3, 0x44, 0xe4, - 0x6b, 0xce, 0x12, 0x75, 0x2c, 0xe2, 0x15, 0x51, 0x24, 0x28, 0x4a, 0xa1, 0x04, 0x1a, 0xd5, 0x68, - 0xa0, 0xbf, 0x41, 0x43, 0x8c, 0x87, 0xa9, 0x48, 0x85, 0x21, 0x42, 0x5d, 0x59, 0x78, 0x3c, 0x69, - 0xf9, 0x16, 0x84, 0x95, 0x2c, 0x4f, 0xc3, 0x92, 0x72, 0x52, 0x59, 0xc2, 0xff, 0x0a, 0xe0, 0x00, - 0x53, 0x59, 0x88, 0x5c, 0xd2, 0x79, 0x6d, 0x86, 0x5e, 0x41, 0xd4, 0x18, 0x63, 0xcd, 0x3e, 0x23, - 0x8a, 0xdc, 0x77, 0xc1, 0x04, 0x4c, 0x7b, 0x0f, 0xa6, 0xc1, 0xc9, 0x00, 0xc1, 0xfc, 0x77, 0x01, - 0x3e, 0xe1, 0x71, 0xd2, 0x79, 0xe6, 0x9e, 0x5d, 0xd8, 0x79, 0xe6, 0x7f, 0x06, 0xf0, 0xc6, 0x1f, - 0x24, 0x7a, 0x02, 0x2f, 0x97, 0xf4, 0xdd, 0x86, 0x4a, 0x55, 0xc7, 0xf7, 0xdb, 0x87, 0xd4, 0x2d, - 0x09, 0x8c, 0x02, 0x5b, 0x12, 0x37, 0x12, 0xf4, 0x18, 0x76, 0x4b, 0x5a, 0xf0, 0xca, 0x75, 0x8c, - 0xf6, 0xce, 0x5f, 0x02, 0x62, 0xcd, 0xbc, 0xa4, 0x8a, 0xe8, 0x6b, 0xc2, 0x56, 0xf2, 0xe2, 0xfc, - 0xca, 0xd9, 0xc0, 0xf1, 0xb7, 0x00, 0x5e, 0x6b, 0x6d, 0xa3, 0x7b, 0x10, 0x65, 0x44, 0x66, 0x31, - 0xe1, 0xdc, 0x5c, 0x6b, 0xac, 0xff, 0x4c, 0xb8, 0x3e, 0xbe, 0xae, 0xeb, 0xa7, 0x9c, 0xeb, 0xe8, - 0x0b, 0x22, 0x33, 0x34, 0x80, 0x8e, 0x64, 0xa9, 0xe9, 0x4f, 0x1f, 0xeb, 0x12, 0xdd, 0x86, 0x7d, - 0x4e, 0x14, 0x95, 0x2a, 0x5e, 0x72, 0x91, 0xbc, 0x31, 0xc9, 0x1c, 0xdc, 0xb3, 0x6b, 0x91, 0x5e, - 0x42, 0x8f, 0xe0, 0xcd, 0x35, 0xcb, 0x09, 0x67, 0x1f, 0xe9, 0xca, 0x52, 0xd2, 0x1c, 0x42, 0xa5, - 0x7b, 0x6e, 0x8c, 0x46, 0xc7, 0x6d, 0x23, 0x90, 0x0b, 0xb3, 0x89, 0x6e, 0x41, 0x28, 0x59, 0x5a, - 0x2b, 0xdc, 0xae, 0x41, 0xaf, 0x4a, 0x96, 0x5a, 0xc8, 0xff, 0x02, 0xe0, 0xf0, 0xb9, 0x15, 0x12, - 0xc5, 0x44, 0x7e, 0x7c, 0x2d, 0x11, 0xec, 0x95, 0xb6, 0x7d, 0x05, 0xaf, 0x9a, 0x67, 0x32, 0xf9, - 0x67, 0x9f, 0x0b, 0x5e, 0xe1, 0x5f, 0x45, 0x6d, 0x8f, 0xe6, 0x41, 0xfc, 0x97, 0xc7, 0x2c, 0x8a, - 0xb6, 0x7b, 0x0f, 0xec, 0xf6, 0x1e, 0xf8, 0xbe, 0xf7, 0xc0, 0xa7, 0x83, 0xd7, 0xd9, 0x1d, 0xbc, - 0xce, 0xb7, 0x83, 0xd7, 0x79, 0x3d, 0x4d, 0x99, 0xca, 0x36, 0xcb, 0x20, 0x11, 0x6f, 0xc3, 0xd6, - 0x44, 0x7c, 0xf8, 0x39, 0x6b, 0xaa, 0x2a, 0xa8, 0x5c, 0x5e, 0x32, 0x53, 0xf1, 0xf0, 0x47, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x08, 0x7d, 0x98, 0xa8, 0x91, 0x03, 0x00, 0x00, + // 521 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0x13, 0x31, + 0x10, 0x8d, 0x93, 0x16, 0xa8, 0x9b, 0xaa, 0xa9, 0x95, 0x8a, 0xa8, 0x12, 0xab, 0xb2, 0xe2, 0xd0, + 0xaa, 0xd2, 0x6e, 0x53, 0x24, 0x0e, 0x88, 0x4b, 0x5b, 0x3e, 0x2a, 0x24, 0x2e, 0xe6, 0x82, 0x7a, + 0x59, 0x39, 0x1b, 0x67, 0x63, 0xe1, 0xae, 0x97, 0x1d, 0xa7, 0x22, 0xdc, 0xf8, 0x07, 0x48, 0xfc, + 0x27, 0xd4, 0x13, 0xea, 0x91, 0x23, 0x4a, 0xfe, 0x08, 0xb2, 0xbd, 0x09, 0xf9, 0x6a, 0x82, 0xc4, + 0x69, 0xc7, 0x33, 0xef, 0x3d, 0xcf, 0xce, 0x1b, 0x19, 0x1f, 0x4a, 0x76, 0xcd, 0x52, 0xae, 0x43, + 0xf3, 0x0d, 0x63, 0x95, 0x76, 0xa4, 0x88, 0xf5, 0x38, 0x88, 0xda, 0x4c, 0xb3, 0x20, 0xcb, 0x95, + 0x56, 0x64, 0xb7, 0x80, 0x06, 0xe6, 0x1b, 0x8c, 0x10, 0x7b, 0xf5, 0x44, 0x25, 0xca, 0x22, 0x42, + 0x13, 0x39, 0xf0, 0xde, 0xfe, 0x94, 0x6e, 0xc6, 0x44, 0x2e, 0xd2, 0x24, 0xcc, 0xb9, 0x64, 0x7d, + 0x87, 0xf0, 0x7f, 0x20, 0x5c, 0xa3, 0x1c, 0x32, 0x95, 0x02, 0x3f, 0x2f, 0xc4, 0xc8, 0x07, 0x4c, + 0x46, 0xc2, 0xd4, 0x60, 0x5f, 0x32, 0xcd, 0x8e, 0x1b, 0x68, 0x1f, 0x1d, 0x6c, 0x9e, 0x1c, 0x04, + 0x0b, 0x1b, 0x08, 0xce, 0x67, 0x09, 0x74, 0x81, 0xc6, 0x42, 0xe5, 0x66, 0xa3, 0xfc, 0xdf, 0xca, + 0x4d, 0xff, 0x3b, 0xc2, 0x3b, 0x73, 0x48, 0xf2, 0x02, 0xdf, 0xcf, 0xf9, 0xa7, 0x1e, 0x07, 0x5d, + 0xb4, 0xef, 0x4f, 0x5f, 0x52, 0x8c, 0x24, 0xb0, 0x0c, 0xea, 0x90, 0x74, 0x44, 0x21, 0xcf, 0xf1, + 0x7a, 0xce, 0x33, 0xd9, 0x6f, 0x54, 0x2c, 0xf7, 0xc9, 0x1d, 0x0d, 0x52, 0x83, 0x79, 0xc7, 0x35, + 0x33, 0x36, 0x51, 0x47, 0x79, 0xbb, 0xf6, 0xa0, 0x5c, 0xab, 0xf8, 0x37, 0x08, 0x6f, 0x4d, 0x95, + 0xc9, 0x11, 0x26, 0x5d, 0x06, 0xdd, 0x88, 0x49, 0x69, 0x6d, 0x8d, 0xcc, 0xc9, 0x36, 0x57, 0xa5, + 0xdb, 0x26, 0x3e, 0x95, 0xd2, 0xb4, 0x7e, 0xc1, 0xa0, 0x4b, 0x6a, 0xb8, 0x02, 0x22, 0xb1, 0xf3, + 0xa9, 0x52, 0x13, 0x92, 0xc7, 0xb8, 0x2a, 0x99, 0xe6, 0xa0, 0xa3, 0x96, 0x54, 0xf1, 0x47, 0xdb, + 0x59, 0x85, 0x6e, 0xba, 0xdc, 0x99, 0x49, 0x91, 0x67, 0xf8, 0x61, 0x47, 0xa4, 0x4c, 0x8a, 0x2f, + 0xbc, 0xed, 0x50, 0x60, 0x2f, 0xe1, 0xd0, 0x58, 0xb3, 0x42, 0xbb, 0xe3, 0xb2, 0x25, 0xc0, 0x85, + 0x2d, 0x92, 0x47, 0x18, 0x83, 0x48, 0x0a, 0x46, 0x63, 0xdd, 0x42, 0x37, 0x40, 0x24, 0x0e, 0xe4, + 0xff, 0x44, 0xb8, 0xfe, 0xda, 0x11, 0x99, 0x16, 0x2a, 0x1d, 0x6f, 0xcb, 0x25, 0xae, 0xdb, 0x8d, + 0x8a, 0x3a, 0x13, 0xd5, 0x68, 0xd5, 0xbe, 0xd8, 0x89, 0x4f, 0xea, 0x51, 0x92, 0xcf, 0xa6, 0x8e, + 0xef, 0xd0, 0x5e, 0xb5, 0x31, 0xff, 0xa2, 0xdd, 0xf4, 0xbf, 0x96, 0xf1, 0xce, 0x1c, 0x72, 0xd9, + 0xf4, 0xd0, 0xb2, 0xe9, 0xcd, 0x1a, 0x53, 0x9e, 0x37, 0xe6, 0x10, 0xd7, 0x62, 0x95, 0x42, 0xef, + 0x8a, 0xe7, 0x11, 0x6b, 0xb7, 0x73, 0x0e, 0x60, 0xfd, 0xdb, 0xa0, 0xdb, 0xa3, 0xfc, 0xa9, 0x4b, + 0x93, 0x37, 0x78, 0xcb, 0xfd, 0x37, 0x70, 0x00, 0xa1, 0x52, 0xeb, 0xdc, 0xf2, 0xed, 0x7d, 0xef, + 0x90, 0xb4, 0x9a, 0x4f, 0x9c, 0x56, 0x98, 0x7a, 0xf6, 0xea, 0x66, 0xe0, 0xa1, 0xdb, 0x81, 0x87, + 0x7e, 0x0f, 0x3c, 0xf4, 0x6d, 0xe8, 0x95, 0x6e, 0x87, 0x5e, 0xe9, 0xd7, 0xd0, 0x2b, 0x5d, 0x1e, + 0x25, 0x42, 0x77, 0x7b, 0xad, 0x20, 0x56, 0x57, 0xe1, 0xd4, 0x2b, 0x72, 0x7d, 0x12, 0x7e, 0xfe, + 0xfb, 0x44, 0xe9, 0x7e, 0xc6, 0xa1, 0x75, 0xcf, 0x3e, 0x26, 0x4f, 0xff, 0x04, 0x00, 0x00, 0xff, + 0xff, 0x0f, 0x46, 0xfd, 0x0c, 0xc8, 0x04, 0x00, 0x00, } func (m *ResponseConflict) Marshal() (dAtA []byte, err error) { @@ -469,9 +551,9 @@ func (m *FinalizationConflict) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.RelayReply1 != nil { + if m.RelayFinalization_1 != nil { { - size, err := m.RelayReply1.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.RelayFinalization_1.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -481,9 +563,9 @@ func (m *FinalizationConflict) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if m.RelayReply0 != nil { + if m.RelayFinalization_0 != nil { { - size, err := m.RelayReply0.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.RelayFinalization_0.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -496,6 +578,67 @@ func (m *FinalizationConflict) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *RelayFinalization) 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 *RelayFinalization) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RelayFinalization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SigBlocks) > 0 { + i -= len(m.SigBlocks) + copy(dAtA[i:], m.SigBlocks) + i = encodeVarintConflictData(dAtA, i, uint64(len(m.SigBlocks))) + i-- + dAtA[i] = 0x2a + } + if m.RelaySession != nil { + { + size, err := m.RelaySession.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConflictData(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.ConsumerAddress) > 0 { + i -= len(m.ConsumerAddress) + copy(dAtA[i:], m.ConsumerAddress) + i = encodeVarintConflictData(dAtA, i, uint64(len(m.ConsumerAddress))) + i-- + dAtA[i] = 0x1a + } + if m.LatestBlock != 0 { + i = encodeVarintConflictData(dAtA, i, uint64(m.LatestBlock)) + i-- + dAtA[i] = 0x10 + } + if len(m.FinalizedBlocksHashes) > 0 { + i -= len(m.FinalizedBlocksHashes) + copy(dAtA[i:], m.FinalizedBlocksHashes) + i = encodeVarintConflictData(dAtA, i, uint64(len(m.FinalizedBlocksHashes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintConflictData(dAtA []byte, offset int, v uint64) int { offset -= sovConflictData(v) base := offset @@ -575,12 +718,40 @@ func (m *FinalizationConflict) Size() (n int) { } var l int _ = l - if m.RelayReply0 != nil { - l = m.RelayReply0.Size() + if m.RelayFinalization_0 != nil { + l = m.RelayFinalization_0.Size() + n += 1 + l + sovConflictData(uint64(l)) + } + if m.RelayFinalization_1 != nil { + l = m.RelayFinalization_1.Size() + n += 1 + l + sovConflictData(uint64(l)) + } + return n +} + +func (m *RelayFinalization) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FinalizedBlocksHashes) + if l > 0 { + n += 1 + l + sovConflictData(uint64(l)) + } + if m.LatestBlock != 0 { + n += 1 + sovConflictData(uint64(m.LatestBlock)) + } + l = len(m.ConsumerAddress) + if l > 0 { + n += 1 + l + sovConflictData(uint64(l)) + } + if m.RelaySession != nil { + l = m.RelaySession.Size() n += 1 + l + sovConflictData(uint64(l)) } - if m.RelayReply1 != nil { - l = m.RelayReply1.Size() + l = len(m.SigBlocks) + if l > 0 { n += 1 + l + sovConflictData(uint64(l)) } return n @@ -1072,7 +1243,7 @@ func (m *FinalizationConflict) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayReply0", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RelayFinalization_0", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1099,16 +1270,187 @@ func (m *FinalizationConflict) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RelayReply0 == nil { - m.RelayReply0 = &types.RelayReply{} + if m.RelayFinalization_0 == nil { + m.RelayFinalization_0 = &RelayFinalization{} + } + if err := m.RelayFinalization_0.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayFinalization_1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConflictData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConflictData + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConflictData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RelayFinalization_1 == nil { + m.RelayFinalization_1 = &RelayFinalization{} + } + if err := m.RelayFinalization_1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if err := m.RelayReply0.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConflictData(dAtA[iNdEx:]) + if err != nil { return err } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConflictData + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RelayFinalization) 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 ErrIntOverflowConflictData + } + 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: RelayFinalization: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RelayFinalization: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedBlocksHashes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConflictData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthConflictData + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthConflictData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FinalizedBlocksHashes = append(m.FinalizedBlocksHashes[:0], dAtA[iNdEx:postIndex]...) + if m.FinalizedBlocksHashes == nil { + m.FinalizedBlocksHashes = []byte{} + } iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestBlock", wireType) + } + m.LatestBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConflictData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LatestBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConflictData + } + 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 ErrInvalidLengthConflictData + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthConflictData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsumerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayReply1", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RelaySession", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1135,13 +1477,47 @@ func (m *FinalizationConflict) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RelayReply1 == nil { - m.RelayReply1 = &types.RelayReply{} + if m.RelaySession == nil { + m.RelaySession = &types.RelaySession{} } - if err := m.RelayReply1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RelaySession.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigBlocks", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConflictData + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthConflictData + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthConflictData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigBlocks = append(m.SigBlocks[:0], dAtA[iNdEx:postIndex]...) + if m.SigBlocks == nil { + m.SigBlocks = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipConflictData(dAtA[iNdEx:]) diff --git a/x/conflict/types/conflict_vote.pb.go b/x/conflict/types/conflict_vote.pb.go index 8ddc09dfef..f734e138c4 100644 --- a/x/conflict/types/conflict_vote.pb.go +++ b/x/conflict/types/conflict_vote.pb.go @@ -278,36 +278,36 @@ func init() { } var fileDescriptor_a96842d3d7b42db7 = []byte{ - // 452 bytes of a gzipped FileDescriptorProto + // 456 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0x13, 0x31, 0x10, 0xcd, 0x36, 0x9b, 0x34, 0x99, 0xa4, 0x3d, 0x58, 0x05, 0x59, 0x05, 0x6d, 0x57, 0x11, 0x42, - 0xcb, 0x65, 0x23, 0x95, 0x03, 0x57, 0x08, 0x39, 0x80, 0x00, 0x09, 0x2d, 0x82, 0x03, 0x17, 0xe4, - 0x7a, 0xa7, 0x89, 0xc5, 0x62, 0x07, 0xdb, 0x89, 0xca, 0x91, 0x3f, 0xe0, 0xb3, 0x7a, 0xec, 0x91, - 0x13, 0x42, 0xc9, 0x8f, 0x20, 0x7b, 0x9d, 0xb4, 0x5b, 0xc1, 0x81, 0x93, 0xe7, 0x3d, 0xbf, 0x79, - 0x9e, 0x19, 0xdb, 0xf0, 0xa8, 0x62, 0x2b, 0x26, 0xd1, 0x8e, 0xdd, 0x3a, 0xe6, 0x4a, 0x9e, 0x57, - 0x82, 0xdb, 0x5d, 0xf0, 0x69, 0xa5, 0x2c, 0xe6, 0x0b, 0xad, 0xac, 0x22, 0x77, 0x82, 0x34, 0x77, - 0x6b, 0xbe, 0x55, 0x1c, 0x1f, 0xcd, 0xd4, 0x4c, 0x79, 0xc5, 0xd8, 0x45, 0xb5, 0x78, 0xf4, 0x14, - 0x7a, 0x6f, 0xb5, 0x5a, 0x89, 0x12, 0x35, 0xa1, 0xb0, 0xcf, 0x38, 0x57, 0x4b, 0x69, 0x69, 0x94, - 0x46, 0x59, 0xbf, 0xd8, 0x42, 0x72, 0x0c, 0x3d, 0x8d, 0x66, 0xa1, 0xa4, 0x41, 0xba, 0x97, 0x46, - 0xd9, 0xb0, 0xd8, 0xe1, 0xd1, 0x6b, 0x88, 0x3f, 0x28, 0x8b, 0x3e, 0xbb, 0x2c, 0x35, 0x1a, 0xb3, - 0xcb, 0xae, 0x21, 0x21, 0x10, 0xbf, 0x60, 0x66, 0x1e, 0x32, 0x7d, 0x4c, 0xee, 0x42, 0xb7, 0x40, - 0xb3, 0xac, 0x2c, 0x6d, 0xa7, 0x51, 0xd6, 0x2e, 0x02, 0x1a, 0x7d, 0x8f, 0x61, 0xf8, 0x3c, 0x94, - 0xec, 0x6d, 0x8f, 0xa0, 0x23, 0x64, 0x89, 0x17, 0xc1, 0xb4, 0x06, 0xe4, 0x01, 0x1c, 0xf0, 0x4a, - 0xa0, 0xb4, 0xcf, 0xc2, 0x91, 0x7b, 0x7e, 0xb7, 0x49, 0x92, 0x11, 0x0c, 0xdd, 0x5c, 0xa6, 0xc8, - 0xca, 0x4a, 0x48, 0xf4, 0x47, 0xc5, 0x45, 0x83, 0x23, 0x0f, 0xe1, 0xd0, 0xe1, 0x77, 0x96, 0x69, - 0x3b, 0xa9, 0x14, 0xff, 0x4c, 0x63, 0xaf, 0xba, 0xc5, 0x92, 0xfb, 0xd0, 0x0f, 0x8c, 0x45, 0xda, - 0xf1, 0x35, 0x5f, 0x13, 0xae, 0x79, 0x3e, 0x67, 0x42, 0xbe, 0x9c, 0xd2, 0x6e, 0xdd, 0x7c, 0x80, - 0xae, 0x51, 0xb6, 0x10, 0xef, 0x75, 0x45, 0xf7, 0xfd, 0x46, 0x40, 0x24, 0x85, 0x81, 0xc6, 0xaf, - 0x4b, 0x34, 0x76, 0xca, 0x2c, 0xa3, 0x3d, 0x3f, 0x9b, 0x9b, 0x94, 0xab, 0x3e, 0xc0, 0xba, 0xae, - 0x7e, 0x5d, 0xfd, 0x4d, 0x8e, 0xbc, 0x82, 0x83, 0x73, 0xa1, 0x8d, 0xdd, 0xde, 0x21, 0x85, 0x34, - 0xca, 0x06, 0xa7, 0x27, 0xf9, 0x5f, 0xdf, 0x40, 0xbe, 0x95, 0x4d, 0xe2, 0xcb, 0x5f, 0x27, 0xad, - 0xa2, 0x99, 0x4b, 0xde, 0xc0, 0xa1, 0x41, 0xae, 0x64, 0xb9, 0x73, 0x1b, 0xfc, 0x8f, 0xdb, 0xad, - 0x64, 0xf2, 0x04, 0x3a, 0x6e, 0x40, 0x86, 0x0e, 0xd3, 0x76, 0x36, 0x38, 0xbd, 0xf7, 0x0f, 0x17, - 0x77, 0xcb, 0xc1, 0xa1, 0xd6, 0x4f, 0x26, 0x97, 0xeb, 0x24, 0xba, 0x5a, 0x27, 0xd1, 0xef, 0x75, - 0x12, 0xfd, 0xd8, 0x24, 0xad, 0xab, 0x4d, 0xd2, 0xfa, 0xb9, 0x49, 0x5a, 0x1f, 0xb3, 0x99, 0xb0, - 0xf3, 0xe5, 0x59, 0xce, 0xd5, 0x97, 0x71, 0xe3, 0x43, 0x5c, 0x5c, 0x7f, 0x09, 0xfb, 0x6d, 0x81, - 0xe6, 0xac, 0xeb, 0x9f, 0xf7, 0xe3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xd9, 0xbb, 0x28, - 0x38, 0x03, 0x00, 0x00, + 0x41, 0x48, 0xbb, 0x52, 0x38, 0x70, 0x85, 0x10, 0x24, 0x10, 0x20, 0xa1, 0x45, 0x70, 0xe0, 0x82, + 0x5c, 0xef, 0x34, 0xb1, 0x58, 0xec, 0x60, 0x3b, 0x51, 0x39, 0xf2, 0x07, 0x7c, 0x56, 0x8f, 0x3d, + 0x72, 0x42, 0x28, 0xf9, 0x11, 0x64, 0xaf, 0x93, 0x36, 0x15, 0x1c, 0x38, 0x79, 0xde, 0xf3, 0x9b, + 0xe7, 0x99, 0xb1, 0x0d, 0x0f, 0x2a, 0xb6, 0x64, 0x12, 0x6d, 0xee, 0xd6, 0x9c, 0x2b, 0x79, 0x56, + 0x09, 0x6e, 0xb7, 0xc1, 0xa7, 0xa5, 0xb2, 0x98, 0xcd, 0xb5, 0xb2, 0x8a, 0xdc, 0x0a, 0xd2, 0xcc, + 0xad, 0xd9, 0x46, 0x71, 0x7c, 0x34, 0x55, 0x53, 0xe5, 0x15, 0xb9, 0x8b, 0x6a, 0xf1, 0xe0, 0x09, + 0x74, 0xde, 0x6a, 0xb5, 0x14, 0x25, 0x6a, 0x42, 0x61, 0x9f, 0x71, 0xae, 0x16, 0xd2, 0xd2, 0x28, + 0x8d, 0x86, 0xdd, 0x62, 0x03, 0xc9, 0x31, 0x74, 0x34, 0x9a, 0xb9, 0x92, 0x06, 0xe9, 0x5e, 0x1a, + 0x0d, 0xfb, 0xc5, 0x16, 0x0f, 0x5e, 0x43, 0xfc, 0x41, 0x59, 0xf4, 0xd9, 0x65, 0xa9, 0xd1, 0x98, + 0x6d, 0x76, 0x0d, 0x09, 0x81, 0xf8, 0x05, 0x33, 0xb3, 0x90, 0xe9, 0x63, 0x72, 0x1b, 0xda, 0x05, + 0x9a, 0x45, 0x65, 0x69, 0x33, 0x8d, 0x86, 0xcd, 0x22, 0xa0, 0xc1, 0xf7, 0x18, 0xfa, 0xcf, 0x42, + 0xc9, 0xde, 0xf6, 0x08, 0x5a, 0x42, 0x96, 0x78, 0x1e, 0x4c, 0x6b, 0x40, 0xee, 0xc1, 0x01, 0xaf, + 0x04, 0x4a, 0xfb, 0x34, 0x1c, 0xb9, 0xe7, 0x77, 0x77, 0x49, 0x32, 0x80, 0xbe, 0x9b, 0xcb, 0x04, + 0x59, 0x59, 0x09, 0x89, 0xfe, 0xa8, 0xb8, 0xd8, 0xe1, 0xc8, 0x7d, 0x38, 0x74, 0xf8, 0x9d, 0x65, + 0xda, 0x8e, 0x2b, 0xc5, 0x3f, 0xd3, 0xd8, 0xab, 0x6e, 0xb0, 0xe4, 0x2e, 0x74, 0x03, 0x63, 0x91, + 0xb6, 0x7c, 0xcd, 0x57, 0x84, 0x6b, 0x9e, 0xcf, 0x98, 0x90, 0x2f, 0x27, 0xb4, 0x5d, 0x37, 0x1f, + 0xa0, 0x6b, 0x94, 0xcd, 0xc5, 0x7b, 0x5d, 0xd1, 0x7d, 0xbf, 0x11, 0x10, 0x49, 0xa1, 0xa7, 0xf1, + 0xeb, 0x02, 0x8d, 0x9d, 0x30, 0xcb, 0x68, 0xc7, 0xcf, 0xe6, 0x3a, 0xe5, 0xaa, 0x0f, 0xb0, 0xae, + 0xab, 0x5b, 0x57, 0x7f, 0x9d, 0x23, 0xaf, 0xe0, 0xe0, 0x4c, 0x68, 0x63, 0x37, 0x77, 0x48, 0x21, + 0x8d, 0x86, 0xbd, 0xd1, 0x49, 0xf6, 0xd7, 0x37, 0x90, 0x6d, 0x64, 0xe3, 0xf8, 0xe2, 0xd7, 0x49, + 0xa3, 0xd8, 0xcd, 0x25, 0x6f, 0xe0, 0xd0, 0x20, 0x57, 0xb2, 0xdc, 0xba, 0xf5, 0xfe, 0xc7, 0xed, + 0x46, 0x32, 0x79, 0x0c, 0x2d, 0x37, 0x20, 0x43, 0xfb, 0x69, 0x73, 0xd8, 0x1b, 0xdd, 0xf9, 0x87, + 0x8b, 0xbb, 0xe5, 0xe0, 0x50, 0xeb, 0xc7, 0xcf, 0x2f, 0x56, 0x49, 0x74, 0xb9, 0x4a, 0xa2, 0xdf, + 0xab, 0x24, 0xfa, 0xb1, 0x4e, 0x1a, 0x97, 0xeb, 0xa4, 0xf1, 0x73, 0x9d, 0x34, 0x3e, 0x3e, 0x9c, + 0x0a, 0x3b, 0x5b, 0x9c, 0x66, 0x5c, 0x7d, 0xc9, 0x77, 0x3e, 0xc4, 0x72, 0x94, 0x9f, 0x5f, 0xfd, + 0x0a, 0xfb, 0x6d, 0x8e, 0xe6, 0xb4, 0xed, 0x5f, 0xf8, 0xa3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x3a, 0xce, 0x3f, 0x28, 0x3b, 0x03, 0x00, 0x00, } func (m *Provider) Marshal() (dAtA []byte, err error) { diff --git a/x/conflict/types/construct/types.go b/x/conflict/types/construct/types.go index 2919d3cd6f..25beccc076 100644 --- a/x/conflict/types/construct/types.go +++ b/x/conflict/types/construct/types.go @@ -1,19 +1,25 @@ package construct import ( - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/conflict/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/conflict/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) func ConstructReplyMetadata(reply *pairingtypes.RelayReply, req *pairingtypes.RelayRequest) *types.ReplyMetadata { if reply == nil || req == nil { return nil } + relayExchange := pairingtypes.NewRelayExchange(*req, *reply) - allDataHash := sigs.HashMsg(relayExchange.DataToSign()) + + allDataHash := relayExchange.DataToSign() + for i := 0; i < relayExchange.HashRounds(); i++ { + allDataHash = sigs.HashMsg(allDataHash) + } + res := &types.ReplyMetadata{ - HashAllDataHash: sigs.HashMsg(allDataHash), + HashAllDataHash: allDataHash, Sig: reply.Sig, LatestBlock: reply.LatestBlock, FinalizedBlocksHashes: reply.FinalizedBlocksHashes, @@ -23,5 +29,8 @@ func ConstructReplyMetadata(reply *pairingtypes.RelayReply, req *pairingtypes.Re } func ConstructConflictRelayData(reply *pairingtypes.RelayReply, req *pairingtypes.RelayRequest) *types.ConflictRelayData { - return &types.ConflictRelayData{Reply: ConstructReplyMetadata(reply, req), Request: req} + return &types.ConflictRelayData{ + Request: req, + Reply: ConstructReplyMetadata(reply, req), + } } diff --git a/x/conflict/types/expected_keepers.go b/x/conflict/types/expected_keepers.go index da1d226f04..d1c9d9a9ae 100644 --- a/x/conflict/types/expected_keepers.go +++ b/x/conflict/types/expected_keepers.go @@ -3,9 +3,9 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - spectypes "github.com/lavanet/lava/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type PairingKeeper interface { @@ -17,6 +17,7 @@ type PairingKeeper interface { BailEntry(ctx sdk.Context, address string, chainID string, bail sdk.Coin) error SlashEntry(ctx sdk.Context, address string, chainID string, percentage sdk.Dec) (sdk.Coin, error) GetProjectData(ctx sdk.Context, developerKey sdk.AccAddress, chainID string, blockHeight uint64) (proj projectstypes.Project, errRet error) + ValidatePairingForClient(ctx sdk.Context, chainID string, providerAddress sdk.AccAddress, reqEpoch uint64, project projectstypes.Project) (isValidPairing bool, allowedCU uint64, pairedProviders []epochstoragetypes.StakeEntry, errorRet error) } type EpochstorageKeeper interface { @@ -26,16 +27,16 @@ type EpochstorageKeeper interface { BlocksToSave(ctx sdk.Context, block uint64) (res uint64, err error) GetEarliestEpochStart(ctx sdk.Context) uint64 GetEpochStartForBlock(ctx sdk.Context, block uint64) (epochStart, blockInEpoch uint64, err error) - GetStakeEntryForProviderEpoch(ctx sdk.Context, chainID string, selectedProvider string, epoch uint64) (entry epochstoragetypes.StakeEntry, found bool) - GetStakeEntryForAllProvidersEpoch(ctx sdk.Context, chainID string, epoch uint64) (entrys *[]epochstoragetypes.StakeEntry, err error) - ModifyStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry epochstoragetypes.StakeEntry) - GetStakeEntryByAddressCurrent(ctx sdk.Context, chainID string, address string) (value epochstoragetypes.StakeEntry, found bool) + GetStakeEntryCurrent(ctx sdk.Context, chainID string, address string) (value epochstoragetypes.StakeEntry, found bool) PushFixatedParams(ctx sdk.Context, block, limit uint64) + GetStakeEntry(ctx sdk.Context, epoch uint64, chainID string, provider string) (val epochstoragetypes.StakeEntry, found bool) + GetAllStakeEntriesForEpochChainId(ctx sdk.Context, epoch uint64, chainID string) []epochstoragetypes.StakeEntry } type SpecKeeper interface { IsSpecFoundAndActive(ctx sdk.Context, chainID string) (foundAndActive, found bool, providersType spectypes.Spec_ProvidersTypes) IsFinalizedBlock(ctx sdk.Context, chainID string, requestedBlock, latestBlock int64) bool + GetSpec(ctx sdk.Context, index string) (val spectypes.Spec, found bool) } // AccountKeeper defines the expected account keeper used for simulations (noalias) diff --git a/x/conflict/types/genesis.pb.go b/x/conflict/types/genesis.pb.go index 4e05d234ef..b6b148c7f9 100644 --- a/x/conflict/types/genesis.pb.go +++ b/x/conflict/types/genesis.pb.go @@ -85,7 +85,7 @@ func init() { } var fileDescriptor_71a0ca73fa4559da = []byte{ - // 238 bytes of a gzipped FileDescriptorProto + // 241 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc9, 0xf9, 0x79, 0x69, 0x39, 0x99, 0xc9, 0x25, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xa2, 0x50, @@ -96,11 +96,12 @@ var fileDescriptor_71a0ca73fa4559da = []byte{ 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd5, 0xc3, 0xea, 0x3a, 0xbd, 0x00, 0xb0, 0x22, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0x5a, 0x84, 0x42, 0xb9, 0x04, 0x60, 0x0a, 0xc2, 0xf2, 0x4b, 0x52, 0x7d, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0x94, 0x71, 0x18, - 0xe3, 0x8c, 0xa4, 0x1c, 0x6a, 0x18, 0x86, 0x11, 0x4e, 0x4e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, + 0xe3, 0x8c, 0xa4, 0x1c, 0x6a, 0x18, 0x86, 0x11, 0x4e, 0xae, 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, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, - 0x8f, 0xe2, 0xe9, 0x0a, 0x84, 0xb7, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xfe, 0x35, - 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x24, 0xd4, 0x8c, 0x92, 0x01, 0x00, 0x00, + 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9d, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, + 0x8f, 0xe2, 0xe9, 0x32, 0x23, 0xfd, 0x0a, 0x84, 0xcf, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, + 0xc0, 0x5e, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xbb, 0x8f, 0xc5, 0x95, 0x01, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/conflict/types/genesis_test.go b/x/conflict/types/genesis_test.go index 7019e5bd6c..b3e5741f9e 100644 --- a/x/conflict/types/genesis_test.go +++ b/x/conflict/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/conflict/types" + "github.com/lavanet/lava/v2/x/conflict/types" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/message_conflict_vote_commit_test.go b/x/conflict/types/message_conflict_vote_commit_test.go index 5e8a6a11e2..8e9a5587bd 100644 --- a/x/conflict/types/message_conflict_vote_commit_test.go +++ b/x/conflict/types/message_conflict_vote_commit_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/message_conflict_vote_reveal_test.go b/x/conflict/types/message_conflict_vote_reveal_test.go index 9ea7ec3748..36bed287fe 100644 --- a/x/conflict/types/message_conflict_vote_reveal_test.go +++ b/x/conflict/types/message_conflict_vote_reveal_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/message_detection.go b/x/conflict/types/message_detection.go index 15e9bbb3f2..f3869223f6 100644 --- a/x/conflict/types/message_detection.go +++ b/x/conflict/types/message_detection.go @@ -10,12 +10,21 @@ const TypeMsgDetection = "detection" var _ sdk.Msg = &MsgDetection{} -func NewMsgDetection(creator string, finalizationConflict *FinalizationConflict, responseConflict *ResponseConflict, sameProviderConflict *FinalizationConflict) *MsgDetection { +func NewMsgDetection(creator string) *MsgDetection { return &MsgDetection{ - Creator: creator, + Creator: creator, + } +} + +func (msg *MsgDetection) SetFinalizationConflict(finalizationConflict *FinalizationConflict) { + msg.Conflict = &MsgDetection_FinalizationConflict{ FinalizationConflict: finalizationConflict, - ResponseConflict: responseConflict, - SameProviderConflict: sameProviderConflict, + } +} + +func (msg *MsgDetection) SetResponseConflict(responseConflict *ResponseConflict) { + msg.Conflict = &MsgDetection_ResponseConflict{ + ResponseConflict: responseConflict, } } diff --git a/x/conflict/types/message_detection_test.go b/x/conflict/types/message_detection_test.go index 187da40526..8d94ecdf2a 100644 --- a/x/conflict/types/message_detection_test.go +++ b/x/conflict/types/message_detection_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/conflict/types/params.pb.go b/x/conflict/types/params.pb.go index a361a823fd..22ce70908f 100644 --- a/x/conflict/types/params.pb.go +++ b/x/conflict/types/params.pb.go @@ -134,7 +134,7 @@ func init() { } var fileDescriptor_a921a7b735ec6ed8 = []byte{ - // 385 bytes of a gzipped FileDescriptorProto + // 388 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xca, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc9, 0xf9, 0x79, 0x69, 0x39, 0x99, 0xc9, 0x25, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xa2, 0x50, 0x35, @@ -155,11 +155,11 @@ var fileDescriptor_a921a7b735ec6ed8 = []byte{ 0x12, 0x22, 0x10, 0x23, 0xe3, 0x8b, 0xc0, 0x66, 0x22, 0x82, 0x05, 0x9b, 0x55, 0x60, 0x27, 0x24, 0xe7, 0x64, 0xa6, 0xe6, 0x95, 0xa0, 0x3a, 0x81, 0x89, 0x32, 0x27, 0x40, 0x8c, 0xc4, 0x74, 0x02, 0x16, 0xab, 0xc0, 0x4e, 0x00, 0x05, 0x73, 0x51, 0x31, 0xaa, 0x13, 0x98, 0x29, 0x73, 0x02, 0xc4, - 0x48, 0x4c, 0x27, 0x60, 0xb1, 0xca, 0xc9, 0xe9, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, + 0x48, 0x4c, 0x27, 0x60, 0xb1, 0xca, 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, - 0x18, 0xa2, 0x34, 0x90, 0xac, 0x45, 0xc9, 0x16, 0x15, 0x88, 0x8c, 0x01, 0xb6, 0x3c, 0x89, 0x0d, - 0x9c, 0xd6, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xc1, 0xa8, 0x71, 0x3e, 0x03, 0x00, - 0x00, + 0x18, 0xa2, 0xb4, 0x91, 0xac, 0x45, 0xc9, 0x16, 0x65, 0x46, 0xfa, 0x15, 0x88, 0xbc, 0x01, 0xb6, + 0x3f, 0x89, 0x0d, 0x9c, 0xdc, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xac, 0xfe, 0x9a, 0xdd, + 0x41, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/conflict/types/query.pb.go b/x/conflict/types/query.pb.go index 7f8f552b41..500106910b 100644 --- a/x/conflict/types/query.pb.go +++ b/x/conflict/types/query.pb.go @@ -505,50 +505,50 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/conflict/query.proto", fileDescriptor_1179eb365bacd460) } var fileDescriptor_1179eb365bacd460 = []byte{ - // 673 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0xe3, 0x96, 0x46, 0xcd, 0x51, 0x09, 0x71, 0x14, 0xa9, 0x72, 0x5b, 0x17, 0x0c, 0x94, - 0xb6, 0xaa, 0x7c, 0x6a, 0x13, 0x58, 0x8a, 0x90, 0x9a, 0x4a, 0x74, 0x42, 0x2a, 0x1e, 0x18, 0x58, - 0x2a, 0xc7, 0x39, 0x8c, 0x25, 0xdb, 0xe7, 0xda, 0x97, 0xd0, 0xaa, 0xca, 0xc2, 0xc0, 0x8c, 0xc4, - 0x97, 0x60, 0x61, 0x65, 0x64, 0xee, 0x58, 0x89, 0x85, 0x09, 0xa1, 0x84, 0x95, 0xef, 0x80, 0x7c, - 0xf7, 0x9c, 0x38, 0x8a, 0xed, 0xa6, 0x62, 0xf2, 0xdd, 0xbb, 0xf7, 0x7f, 0xef, 0xf7, 0x72, 0xef, - 0x5e, 0xd0, 0x7d, 0xcf, 0xea, 0x5a, 0x01, 0xe5, 0x24, 0xf9, 0x12, 0x9b, 0x05, 0x6f, 0x3d, 0xd7, - 0xe6, 0xe4, 0xa4, 0x43, 0xa3, 0x33, 0x23, 0x8c, 0x18, 0x67, 0xf8, 0x2e, 0xb8, 0x18, 0xc9, 0xd7, - 0x48, 0x5d, 0xd4, 0x15, 0x87, 0x31, 0xc7, 0xa3, 0xc4, 0x0a, 0x5d, 0x62, 0x05, 0x01, 0xe3, 0x16, - 0x77, 0x59, 0x10, 0x4b, 0x91, 0xba, 0x65, 0xb3, 0xd8, 0x67, 0x31, 0x69, 0x59, 0x31, 0x95, 0xd1, - 0x48, 0x77, 0xa7, 0x45, 0xb9, 0xb5, 0x43, 0x42, 0xcb, 0x71, 0x03, 0xe1, 0x0c, 0xbe, 0x7a, 0x3e, - 0x43, 0x68, 0x45, 0x96, 0x9f, 0xc6, 0xdb, 0xcc, 0xf7, 0x49, 0x17, 0xc7, 0x5d, 0xc6, 0x29, 0xb8, - 0x2e, 0x3a, 0xcc, 0x61, 0x62, 0x49, 0x92, 0x95, 0xb4, 0xea, 0x8b, 0x08, 0xbf, 0x4a, 0x30, 0x8e, - 0x44, 0x54, 0x93, 0x9e, 0x74, 0x68, 0xcc, 0x75, 0x13, 0xdd, 0x19, 0xb3, 0xc6, 0x21, 0x0b, 0x62, - 0x8a, 0xf7, 0x50, 0x55, 0x66, 0x5f, 0x52, 0xee, 0x29, 0x1b, 0x37, 0x77, 0x57, 0x8d, 0xdc, 0xdf, - 0xc0, 0x90, 0xb2, 0xe6, 0x8d, 0x8b, 0x5f, 0x6b, 0x15, 0x13, 0x24, 0x7a, 0x1d, 0x2d, 0x8b, 0x98, - 0x87, 0x94, 0x1f, 0x80, 0xe3, 0x6b, 0xc6, 0x29, 0xa4, 0xc4, 0x8b, 0x68, 0xce, 0x0d, 0xda, 0xf4, - 0x54, 0x84, 0xae, 0x99, 0x72, 0xa3, 0xfb, 0x68, 0x25, 0x5f, 0x04, 0x44, 0x2f, 0xd1, 0x82, 0x9d, - 0xb1, 0x03, 0xd7, 0x83, 0x02, 0xae, 0x6c, 0x08, 0xa0, 0x1b, 0x93, 0xeb, 0x14, 0x18, 0xf7, 0x3d, - 0x2f, 0x8f, 0xf1, 0x05, 0x42, 0xa3, 0x5b, 0x82, 0x5c, 0xeb, 0x86, 0xbc, 0x52, 0x23, 0xb9, 0x52, - 0x43, 0x36, 0x08, 0x5c, 0xa9, 0x71, 0x64, 0x39, 0xa9, 0xd6, 0xcc, 0x28, 0xf5, 0x6f, 0x0a, 0x94, - 0x35, 0x91, 0xa7, 0xb0, 0xac, 0xd9, 0xff, 0x28, 0x0b, 0x1f, 0x8e, 0x71, 0xcf, 0x08, 0xee, 0xc7, - 0x57, 0x72, 0x4b, 0x96, 0x31, 0xf0, 0x3d, 0xb4, 0x2a, 0xfb, 0x22, 0x62, 0x5d, 0xb7, 0x4d, 0xa3, - 0x34, 0x73, 0xda, 0x38, 0x58, 0x45, 0xf3, 0x21, 0x9c, 0xc1, 0x45, 0x0e, 0xf7, 0xfa, 0x7b, 0xa4, - 0x15, 0x89, 0xa1, 0x6c, 0x15, 0xcd, 0x47, 0x34, 0x64, 0x11, 0xa7, 0x6d, 0x51, 0x72, 0xcd, 0x1c, - 0xee, 0xf1, 0x32, 0xaa, 0x05, 0x4c, 0x36, 0x74, 0x7b, 0x69, 0x46, 0x1e, 0x06, 0x4c, 0xd4, 0xd7, - 0xc6, 0x2b, 0xa8, 0x66, 0x33, 0xdf, 0x77, 0x79, 0x72, 0x38, 0x2b, 0x0e, 0x47, 0x86, 0x21, 0xf5, - 0x01, 0x0b, 0xe2, 0x8e, 0x9f, 0x4f, 0x6d, 0xc3, 0x59, 0x4a, 0x9d, 0xee, 0xf5, 0xe7, 0x40, 0x9d, - 0x23, 0x06, 0x6a, 0x91, 0x1c, 0x8c, 0x80, 0x3d, 0x32, 0xec, 0xfe, 0xad, 0xa2, 0x39, 0x11, 0x00, - 0x7f, 0x54, 0x50, 0x55, 0xbe, 0x0c, 0xbc, 0x59, 0x70, 0x93, 0x93, 0x4f, 0x51, 0xdd, 0x9a, 0xc6, - 0x55, 0x92, 0xe8, 0x8f, 0x3e, 0xfc, 0xf8, 0xf3, 0x79, 0x66, 0x0d, 0xaf, 0x92, 0xb2, 0xd1, 0x81, - 0xbf, 0x2a, 0x68, 0x21, 0xdb, 0x33, 0x78, 0xb7, 0x2c, 0x47, 0xfe, 0x7b, 0x55, 0xeb, 0xd7, 0xd2, - 0x00, 0x60, 0x43, 0x00, 0x1a, 0x78, 0x9b, 0x4c, 0x31, 0xb7, 0xc8, 0xb9, 0x98, 0x01, 0x3d, 0xfc, - 0x45, 0x41, 0xb7, 0xb2, 0xe1, 0xf6, 0x3d, 0xaf, 0x1c, 0x39, 0xff, 0xf9, 0x96, 0x23, 0x17, 0x3c, - 0x45, 0x7d, 0x5b, 0x20, 0xaf, 0xe3, 0x87, 0xd3, 0x20, 0xe3, 0xef, 0x0a, 0xba, 0x3d, 0xd1, 0x29, - 0xb8, 0x51, 0x96, 0xb8, 0xa8, 0x2b, 0xd5, 0x27, 0xd7, 0x54, 0x01, 0xf0, 0x33, 0x01, 0xfc, 0x14, - 0x37, 0x8a, 0x81, 0x85, 0xf2, 0x78, 0xd8, 0xa3, 0xe4, 0x3c, 0xb5, 0xf5, 0x44, 0x01, 0x13, 0x0f, - 0xb4, 0xbc, 0x80, 0xa2, 0x61, 0x50, 0x5e, 0x40, 0xe1, 0x14, 0xb8, 0xb2, 0x80, 0x74, 0xa0, 0x64, - 0x0b, 0x48, 0x6d, 0xbd, 0x66, 0xf3, 0xa2, 0xaf, 0x29, 0x97, 0x7d, 0x4d, 0xf9, 0xdd, 0xd7, 0x94, - 0x4f, 0x03, 0xad, 0x72, 0x39, 0xd0, 0x2a, 0x3f, 0x07, 0x5a, 0xe5, 0xcd, 0x86, 0xe3, 0xf2, 0x77, - 0x9d, 0x96, 0x61, 0x33, 0x7f, 0x3c, 0xf2, 0xe9, 0x28, 0x36, 0x3f, 0x0b, 0x69, 0xdc, 0xaa, 0x8a, - 0xff, 0xc6, 0xfa, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x42, 0xb3, 0x42, 0x2e, 0x06, 0x08, 0x00, - 0x00, + // 677 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0xb1, 0x6f, 0xd3, 0x4e, + 0x14, 0xc7, 0xe3, 0xf6, 0xd7, 0xa8, 0xb9, 0x5f, 0x25, 0xc4, 0x51, 0xa4, 0xca, 0x6d, 0x5d, 0x30, + 0x50, 0x68, 0xa9, 0x7c, 0x6a, 0x12, 0x58, 0x8a, 0x90, 0xda, 0x0a, 0x3a, 0x21, 0x15, 0x0f, 0x0c, + 0x2c, 0x95, 0xe3, 0x1c, 0xc6, 0x92, 0xed, 0x73, 0xed, 0x4b, 0x68, 0x55, 0x65, 0x61, 0x60, 0x46, + 0xe2, 0x9f, 0x60, 0x61, 0x65, 0x64, 0xee, 0x58, 0x89, 0x85, 0x09, 0xa1, 0x84, 0x95, 0xff, 0x01, + 0xf9, 0xee, 0x39, 0x71, 0x14, 0xdb, 0x4d, 0xc5, 0xe4, 0xbb, 0x77, 0xef, 0xfb, 0xde, 0xe7, 0xe5, + 0xde, 0xbd, 0xa0, 0xdb, 0x9e, 0xd5, 0xb5, 0x02, 0xca, 0x49, 0xf2, 0x25, 0x36, 0x0b, 0xde, 0x78, + 0xae, 0xcd, 0xc9, 0x71, 0x87, 0x46, 0xa7, 0x46, 0x18, 0x31, 0xce, 0xf0, 0x4d, 0x70, 0x31, 0x92, + 0xaf, 0x91, 0xba, 0xa8, 0x2b, 0x0e, 0x63, 0x8e, 0x47, 0x89, 0x15, 0xba, 0xc4, 0x0a, 0x02, 0xc6, + 0x2d, 0xee, 0xb2, 0x20, 0x96, 0x22, 0x75, 0xd3, 0x66, 0xb1, 0xcf, 0x62, 0xd2, 0xb2, 0x62, 0x2a, + 0xa3, 0x91, 0xee, 0x76, 0x8b, 0x72, 0x6b, 0x9b, 0x84, 0x96, 0xe3, 0x06, 0xc2, 0x19, 0x7c, 0xf5, + 0x7c, 0x86, 0xd0, 0x8a, 0x2c, 0x3f, 0x8d, 0xb7, 0x91, 0xef, 0x93, 0x2e, 0x8e, 0xba, 0x8c, 0x53, + 0x70, 0x5d, 0x74, 0x98, 0xc3, 0xc4, 0x92, 0x24, 0x2b, 0x69, 0xd5, 0x17, 0x11, 0x7e, 0x99, 0x60, + 0x1c, 0x8a, 0xa8, 0x26, 0x3d, 0xee, 0xd0, 0x98, 0xeb, 0x26, 0xba, 0x31, 0x66, 0x8d, 0x43, 0x16, + 0xc4, 0x14, 0xef, 0xa0, 0xaa, 0xcc, 0xbe, 0xa4, 0xdc, 0x52, 0x1e, 0xfc, 0x5f, 0x5f, 0x35, 0x72, + 0x7f, 0x03, 0x43, 0xca, 0xf6, 0xfe, 0x3b, 0xff, 0xb9, 0x56, 0x31, 0x41, 0xa2, 0x37, 0xd0, 0xb2, + 0x88, 0x79, 0x40, 0xf9, 0x3e, 0x38, 0xbe, 0x62, 0x9c, 0x42, 0x4a, 0xbc, 0x88, 0xe6, 0xdc, 0xa0, + 0x4d, 0x4f, 0x44, 0xe8, 0x9a, 0x29, 0x37, 0xba, 0x8f, 0x56, 0xf2, 0x45, 0x40, 0xf4, 0x02, 0x2d, + 0xd8, 0x19, 0x3b, 0x70, 0xdd, 0x29, 0xe0, 0xca, 0x86, 0x00, 0xba, 0x31, 0xb9, 0x4e, 0x81, 0x71, + 0xd7, 0xf3, 0xf2, 0x18, 0x9f, 0x23, 0x34, 0xba, 0x25, 0xc8, 0xb5, 0x6e, 0xc8, 0x2b, 0x35, 0x92, + 0x2b, 0x35, 0x64, 0x83, 0xc0, 0x95, 0x1a, 0x87, 0x96, 0x93, 0x6a, 0xcd, 0x8c, 0x52, 0xff, 0xaa, + 0x40, 0x59, 0x13, 0x79, 0x0a, 0xcb, 0x9a, 0xfd, 0x87, 0xb2, 0xf0, 0xc1, 0x18, 0xf7, 0x8c, 0xe0, + 0xbe, 0x7f, 0x29, 0xb7, 0x64, 0x19, 0x03, 0xdf, 0x41, 0xab, 0xb2, 0x2f, 0x22, 0xd6, 0x75, 0xdb, + 0x34, 0x4a, 0x33, 0xa7, 0x8d, 0x83, 0x55, 0x34, 0x1f, 0xc2, 0x19, 0x5c, 0xe4, 0x70, 0xaf, 0xbf, + 0x43, 0x5a, 0x91, 0x18, 0xca, 0x56, 0xd1, 0x7c, 0x44, 0x43, 0x16, 0x71, 0xda, 0x16, 0x25, 0xd7, + 0xcc, 0xe1, 0x1e, 0x2f, 0xa3, 0x5a, 0xc0, 0x64, 0x43, 0xb7, 0x97, 0x66, 0xe4, 0x61, 0xc0, 0x44, + 0x7d, 0x6d, 0xbc, 0x82, 0x6a, 0x36, 0xf3, 0x7d, 0x97, 0x27, 0x87, 0xb3, 0xe2, 0x70, 0x64, 0x18, + 0x52, 0xef, 0xb3, 0x20, 0xee, 0xf8, 0xf9, 0xd4, 0x36, 0x9c, 0xa5, 0xd4, 0xe9, 0x5e, 0x7f, 0x0a, + 0xd4, 0x39, 0x62, 0xa0, 0x16, 0xc9, 0xc1, 0x08, 0xd8, 0x23, 0x43, 0xfd, 0x4f, 0x15, 0xcd, 0x89, + 0x00, 0xf8, 0x83, 0x82, 0xaa, 0xf2, 0x65, 0xe0, 0x8d, 0x82, 0x9b, 0x9c, 0x7c, 0x8a, 0xea, 0xe6, + 0x34, 0xae, 0x92, 0x44, 0xbf, 0xf7, 0xfe, 0xfb, 0xef, 0x4f, 0x33, 0x6b, 0x78, 0x95, 0x94, 0x8d, + 0x0e, 0xfc, 0x45, 0x41, 0x0b, 0xd9, 0x9e, 0xc1, 0xf5, 0xb2, 0x1c, 0xf9, 0xef, 0x55, 0x6d, 0x5c, + 0x49, 0x03, 0x80, 0x4d, 0x01, 0x68, 0xe0, 0x2d, 0x32, 0xc5, 0xdc, 0x22, 0x67, 0x62, 0x06, 0xf4, + 0xf0, 0x67, 0x05, 0x5d, 0xcb, 0x86, 0xdb, 0xf5, 0xbc, 0x72, 0xe4, 0xfc, 0xe7, 0x5b, 0x8e, 0x5c, + 0xf0, 0x14, 0xf5, 0x2d, 0x81, 0xbc, 0x8e, 0xef, 0x4e, 0x83, 0x8c, 0xbf, 0x29, 0xe8, 0xfa, 0x44, + 0xa7, 0xe0, 0x66, 0x59, 0xe2, 0xa2, 0xae, 0x54, 0x1f, 0x5d, 0x51, 0x05, 0xc0, 0x4f, 0x04, 0xf0, + 0x63, 0xdc, 0x2c, 0x06, 0x16, 0xca, 0xa3, 0x61, 0x8f, 0x92, 0xb3, 0xd4, 0xd6, 0x13, 0x05, 0x4c, + 0x3c, 0xd0, 0xf2, 0x02, 0x8a, 0x86, 0x41, 0x79, 0x01, 0x85, 0x53, 0xe0, 0xd2, 0x02, 0xd2, 0x81, + 0x92, 0x2d, 0x20, 0xb5, 0xf5, 0xf6, 0x9e, 0x9d, 0xf7, 0x35, 0xe5, 0xa2, 0xaf, 0x29, 0xbf, 0xfa, + 0x9a, 0xf2, 0x71, 0xa0, 0x55, 0x2e, 0x06, 0x5a, 0xe5, 0xc7, 0x40, 0xab, 0xbc, 0x7e, 0xe8, 0xb8, + 0xfc, 0x6d, 0xa7, 0x65, 0xd8, 0xcc, 0x1f, 0x8f, 0xdc, 0xad, 0x93, 0x93, 0x51, 0x78, 0x7e, 0x1a, + 0xd2, 0xb8, 0x55, 0x15, 0x7f, 0x8f, 0x8d, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x96, 0xa7, + 0x2e, 0x09, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/conflict/types/relay_finalization.go b/x/conflict/types/relay_finalization.go new file mode 100644 index 0000000000..d594d85d29 --- /dev/null +++ b/x/conflict/types/relay_finalization.go @@ -0,0 +1,79 @@ +package types + +import ( + "encoding/json" + fmt "fmt" + + tendermintcrypto "github.com/cometbft/cometbft/crypto" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" +) + +func NewRelayFinalizationFromReplyMetadataAndRelayRequest(reply ReplyMetadata, req pairingtypes.RelayRequest, consumerAddr sdk.AccAddress) RelayFinalization { + return RelayFinalization{ + FinalizedBlocksHashes: reply.FinalizedBlocksHashes, + LatestBlock: reply.LatestBlock, + ConsumerAddress: consumerAddr.String(), + RelaySession: req.RelaySession, + SigBlocks: reply.SigBlocks, + } +} + +func NewRelayFinalizationFromRelaySessionAndRelayReply(relaySession *pairingtypes.RelaySession, relayReply *pairingtypes.RelayReply, consumerAddr sdk.AccAddress) RelayFinalization { + return RelayFinalization{ + FinalizedBlocksHashes: relayReply.FinalizedBlocksHashes, + LatestBlock: relayReply.LatestBlock, + ConsumerAddress: consumerAddr.String(), + RelaySession: relaySession, + SigBlocks: relayReply.SigBlocks, + } +} + +func (rf RelayFinalization) GetSignature() []byte { + return rf.SigBlocks +} + +func (rf RelayFinalization) DataToSign() []byte { + if rf.RelaySession == nil { + return nil + } + + // This is for backward compatibility with old relay finalization messages + sdkAccAddress, err := sdk.AccAddressFromBech32(rf.ConsumerAddress) + if err != nil { + utils.LavaFormatError("failed to convert consumer address to sdk.AccAddress", err) + return nil + } + + relaySessionHash := tendermintcrypto.Sha256(rf.RelaySession.CalculateHashForFinalization()) + latestBlockBytes := sigs.EncodeUint64(uint64(rf.LatestBlock)) + msgParts := [][]byte{ + latestBlockBytes, + rf.FinalizedBlocksHashes, + sdkAccAddress, + relaySessionHash, + } + return sigs.Join(msgParts) +} + +func (rfm RelayFinalization) HashRounds() int { + return 1 +} + +func (rf RelayFinalization) Stringify() string { + consumerAddr := sdk.AccAddress{} + consumerAddr.Unmarshal([]byte(rf.ConsumerAddress)) + consumerAddrStr := consumerAddr.String() + + finalizedBlocks := map[int64]string{} + json.Unmarshal(rf.FinalizedBlocksHashes, &finalizedBlocks) + + return fmt.Sprintf("{latestBlock: %v consumerAddress: %v finalizedBlocksHashes: %v relaySessionHash: %v}", + utils.StrValue(rf.LatestBlock), + consumerAddrStr, + utils.StrValue(finalizedBlocks), + utils.StrValue(rf.RelaySession.CalculateHashForFinalization()), + ) +} diff --git a/x/conflict/types/relay_finalization_metadata.go b/x/conflict/types/relay_finalization_metadata.go deleted file mode 100644 index 30a0d00712..0000000000 --- a/x/conflict/types/relay_finalization_metadata.go +++ /dev/null @@ -1,38 +0,0 @@ -package types - -import ( - tendermintcrypto "github.com/cometbft/cometbft/crypto" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" -) - -type RelayFinalizationMetaData struct { - MetaData ReplyMetadata - Request pairingtypes.RelayRequest - Addr sdk.AccAddress -} - -func NewRelayFinalizationMetaData(meta ReplyMetadata, req pairingtypes.RelayRequest, addr sdk.AccAddress) RelayFinalizationMetaData { - return RelayFinalizationMetaData{MetaData: meta, Request: req, Addr: addr} -} - -func (rfm RelayFinalizationMetaData) GetSignature() []byte { - return rfm.MetaData.SigBlocks -} - -func (rfm RelayFinalizationMetaData) DataToSign() []byte { - relaySessionHash := tendermintcrypto.Sha256(rfm.Request.RelaySession.CalculateHashForFinalization()) - latestBlockBytes := sigs.EncodeUint64(uint64(rfm.MetaData.LatestBlock)) - msgParts := [][]byte{ - latestBlockBytes, - rfm.MetaData.FinalizedBlocksHashes, - rfm.Addr, - relaySessionHash, - } - return sigs.Join(msgParts) -} - -func (rfm RelayFinalizationMetaData) HashRounds() int { - return 1 -} diff --git a/x/conflict/types/tx.pb.go b/x/conflict/types/tx.pb.go index 6c7b09ecab..e65617d1d1 100644 --- a/x/conflict/types/tx.pb.go +++ b/x/conflict/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-sdk/types" + _ "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" @@ -31,10 +32,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // TODO:: change coin type to another proto (define proto in another file int this directory) type MsgDetection struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - FinalizationConflict *FinalizationConflict `protobuf:"bytes,2,opt,name=finalizationConflict,proto3" json:"finalizationConflict,omitempty"` - ResponseConflict *ResponseConflict `protobuf:"bytes,3,opt,name=responseConflict,proto3" json:"responseConflict,omitempty"` - SameProviderConflict *FinalizationConflict `protobuf:"bytes,4,opt,name=sameProviderConflict,proto3" json:"sameProviderConflict,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Types that are valid to be assigned to Conflict: + // *MsgDetection_FinalizationConflict + // *MsgDetection_ResponseConflict + Conflict isMsgDetection_Conflict `protobuf_oneof:"conflict"` } func (m *MsgDetection) Reset() { *m = MsgDetection{} } @@ -70,6 +72,29 @@ func (m *MsgDetection) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDetection proto.InternalMessageInfo +type isMsgDetection_Conflict interface { + isMsgDetection_Conflict() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgDetection_FinalizationConflict struct { + FinalizationConflict *FinalizationConflict `protobuf:"bytes,5,opt,name=finalization_conflict,json=finalizationConflict,proto3,oneof" json:"finalization_conflict,omitempty"` +} +type MsgDetection_ResponseConflict struct { + ResponseConflict *ResponseConflict `protobuf:"bytes,6,opt,name=response_conflict,json=responseConflict,proto3,oneof" json:"response_conflict,omitempty"` +} + +func (*MsgDetection_FinalizationConflict) isMsgDetection_Conflict() {} +func (*MsgDetection_ResponseConflict) isMsgDetection_Conflict() {} + +func (m *MsgDetection) GetConflict() isMsgDetection_Conflict { + if m != nil { + return m.Conflict + } + return nil +} + func (m *MsgDetection) GetCreator() string { if m != nil { return m.Creator @@ -78,24 +103,25 @@ func (m *MsgDetection) GetCreator() string { } func (m *MsgDetection) GetFinalizationConflict() *FinalizationConflict { - if m != nil { - return m.FinalizationConflict + if x, ok := m.GetConflict().(*MsgDetection_FinalizationConflict); ok { + return x.FinalizationConflict } return nil } func (m *MsgDetection) GetResponseConflict() *ResponseConflict { - if m != nil { - return m.ResponseConflict + if x, ok := m.GetConflict().(*MsgDetection_ResponseConflict); ok { + return x.ResponseConflict } return nil } -func (m *MsgDetection) GetSameProviderConflict() *FinalizationConflict { - if m != nil { - return m.SameProviderConflict +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgDetection) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgDetection_FinalizationConflict)(nil), + (*MsgDetection_ResponseConflict)(nil), } - return nil } type MsgDetectionResponse struct { @@ -346,35 +372,39 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/conflict/tx.proto", fileDescriptor_8d098f1e58e895a1) } var fileDescriptor_8d098f1e58e895a1 = []byte{ - // 443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4d, 0x6b, 0xdb, 0x40, - 0x10, 0xb5, 0x6c, 0x37, 0xc5, 0xdb, 0x1c, 0xca, 0xe2, 0x04, 0x63, 0xe8, 0x36, 0xb8, 0x87, 0xba, - 0xa4, 0x68, 0x49, 0xda, 0x5f, 0x90, 0x84, 0x42, 0x0f, 0x86, 0xb2, 0x85, 0x1e, 0x0a, 0x21, 0xac, - 0x37, 0x13, 0x79, 0x41, 0xda, 0x31, 0xda, 0xad, 0x70, 0xfb, 0x2b, 0xfa, 0x8f, 0x7a, 0xed, 0x31, - 0xc7, 0x1c, 0x8b, 0xfd, 0x47, 0x8a, 0x3e, 0xeb, 0xd4, 0x52, 0x70, 0x7c, 0xda, 0x19, 0xed, 0x9b, - 0xf7, 0x9e, 0x9e, 0xc4, 0x10, 0x16, 0xca, 0x44, 0x1a, 0x70, 0x3c, 0x3d, 0xb9, 0x42, 0x73, 0x13, - 0x6a, 0xe5, 0xb8, 0x5b, 0xf8, 0xf3, 0x18, 0x1d, 0xd2, 0x83, 0xe2, 0xde, 0x4f, 0x4f, 0xbf, 0xbc, - 0x1f, 0x32, 0x85, 0x36, 0x42, 0xcb, 0xa7, 0xd2, 0x02, 0x4f, 0x4e, 0xa6, 0xe0, 0xe4, 0x09, 0x57, - 0xa8, 0x4d, 0x3e, 0x36, 0xec, 0x07, 0x18, 0x60, 0x56, 0xf2, 0xb4, 0x2a, 0x9e, 0xbe, 0xa9, 0x17, - 0x2b, 0x8b, 0xab, 0x6b, 0xe9, 0x64, 0x0e, 0x1d, 0xfd, 0x6a, 0x93, 0xfd, 0x89, 0x0d, 0x2e, 0xc0, - 0x81, 0x72, 0x1a, 0x0d, 0x1d, 0x90, 0xa7, 0x2a, 0x06, 0xe9, 0x30, 0x1e, 0x78, 0x47, 0xde, 0xb8, - 0x27, 0xca, 0x96, 0x5e, 0x91, 0xfe, 0x8d, 0x36, 0x32, 0xd4, 0x3f, 0x64, 0x8a, 0x3c, 0x2f, 0xd8, - 0x06, 0xed, 0x23, 0x6f, 0xfc, 0xec, 0xf4, 0xd8, 0xaf, 0x7d, 0x03, 0xff, 0x43, 0xcd, 0x88, 0xa8, - 0x25, 0xa2, 0x9f, 0xc9, 0xf3, 0x18, 0xec, 0x1c, 0x8d, 0x85, 0x8a, 0xbc, 0x93, 0x91, 0xbf, 0x6e, - 0x20, 0x17, 0xff, 0xc1, 0xc5, 0x06, 0x41, 0xea, 0xda, 0xca, 0x08, 0x3e, 0xc5, 0x98, 0xe8, 0x6b, - 0x88, 0x2b, 0xe2, 0xee, 0x0e, 0xae, 0xeb, 0x88, 0x46, 0x87, 0xa4, 0xbf, 0x1e, 0x60, 0x69, 0x69, - 0x74, 0x49, 0x0e, 0x26, 0x36, 0x28, 0x61, 0x5f, 0xd0, 0xc1, 0x39, 0x46, 0x91, 0x76, 0x0f, 0x24, - 0x7c, 0x48, 0xf6, 0x12, 0x74, 0xf0, 0xf1, 0x22, 0xcb, 0xb4, 0x27, 0x8a, 0x8e, 0x52, 0xd2, 0x9d, - 0x49, 0x3b, 0xcb, 0xc2, 0xd8, 0x17, 0x59, 0x3d, 0x7a, 0x49, 0x5e, 0xd4, 0xd2, 0x57, 0xfa, 0x76, - 0x43, 0x5f, 0x40, 0x02, 0x32, 0xdc, 0x41, 0xbf, 0x4f, 0x9e, 0x18, 0x34, 0x0a, 0x32, 0x03, 0x1d, - 0x91, 0x37, 0x95, 0xab, 0xee, 0x83, 0xae, 0x72, 0xd1, 0xd2, 0xd5, 0xe9, 0x5d, 0x9b, 0x74, 0x26, - 0x36, 0xa0, 0x97, 0xa4, 0xf7, 0xef, 0x9f, 0x7b, 0xd5, 0xf0, 0x15, 0xd6, 0x73, 0x1d, 0x1e, 0x6f, - 0x01, 0x2a, 0x65, 0xe8, 0x82, 0xd0, 0x9a, 0xe4, 0xdf, 0x36, 0x53, 0x6c, 0xa2, 0x87, 0xef, 0x1f, - 0x83, 0x6e, 0x52, 0x2e, 0x32, 0xdf, 0x52, 0x39, 0x47, 0x6f, 0xab, 0x7c, 0x3f, 0xda, 0xb3, 0xb3, - 0xdf, 0x4b, 0xe6, 0xdd, 0x2e, 0x99, 0xf7, 0x67, 0xc9, 0xbc, 0x9f, 0x2b, 0xd6, 0xba, 0x5d, 0xb1, - 0xd6, 0xdd, 0x8a, 0xb5, 0xbe, 0x8e, 0x03, 0xed, 0x66, 0xdf, 0xa6, 0xbe, 0xc2, 0x88, 0xdf, 0x5b, - 0x0d, 0x8b, 0xb5, 0x4d, 0xf4, 0x7d, 0x0e, 0x76, 0xba, 0x97, 0x6d, 0x85, 0x77, 0x7f, 0x03, 0x00, - 0x00, 0xff, 0xff, 0x3b, 0x67, 0x8d, 0xb0, 0xaf, 0x04, 0x00, 0x00, + // 501 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0x8e, 0x13, 0x27, 0xa4, 0x47, 0x87, 0xf4, 0x94, 0x14, 0x2b, 0x08, 0x13, 0x85, 0x81, 0x40, + 0x90, 0x4f, 0x0d, 0x4c, 0x1d, 0xdb, 0x82, 0x20, 0x52, 0x16, 0x0f, 0x1d, 0x90, 0x50, 0x75, 0x36, + 0x17, 0xc7, 0x52, 0x7c, 0x2f, 0xf2, 0x1d, 0x56, 0x60, 0x61, 0x67, 0x62, 0x61, 0xe2, 0x9f, 0xe0, + 0xcf, 0x60, 0xec, 0xd8, 0x11, 0x25, 0x03, 0xff, 0x06, 0xf2, 0x8f, 0x73, 0x5d, 0xe2, 0xa0, 0xd0, + 0x25, 0xf7, 0xee, 0xbd, 0x2f, 0xdf, 0xf7, 0xdd, 0x7b, 0xd6, 0x43, 0xe6, 0x9c, 0x46, 0x94, 0x33, + 0x49, 0xe2, 0x93, 0xb8, 0xc0, 0xa7, 0x73, 0xdf, 0x95, 0x44, 0x2e, 0xad, 0x45, 0x08, 0x12, 0x70, + 0x27, 0xab, 0x5b, 0xf1, 0x69, 0xa9, 0x7a, 0xf7, 0x80, 0x06, 0x3e, 0x07, 0x92, 0xfc, 0xa6, 0xc8, + 0xae, 0xe9, 0x82, 0x08, 0x40, 0x10, 0x87, 0x0a, 0x46, 0xa2, 0x23, 0x87, 0x49, 0x7a, 0x44, 0x5c, + 0xf0, 0x79, 0x56, 0x6f, 0x7b, 0xe0, 0x41, 0x12, 0x92, 0x38, 0xca, 0xb2, 0x4f, 0xca, 0xf5, 0x55, + 0x70, 0xf1, 0x9e, 0x4a, 0x9a, 0x42, 0xfb, 0xdf, 0xab, 0x68, 0x7f, 0x22, 0xbc, 0x33, 0x26, 0x99, + 0x2b, 0x7d, 0xe0, 0xd8, 0x40, 0x77, 0xdc, 0x90, 0x51, 0x09, 0xa1, 0xa1, 0xf5, 0xb4, 0xc1, 0x9e, + 0xad, 0xae, 0xd8, 0x41, 0x9d, 0xa9, 0xcf, 0xe9, 0xdc, 0xff, 0x44, 0x63, 0xe4, 0x85, 0xa2, 0x33, + 0xea, 0x3d, 0x6d, 0x70, 0x77, 0x34, 0xb4, 0x4a, 0x5f, 0x65, 0xbd, 0x2a, 0xfc, 0xe7, 0x34, 0x4b, + 0xbe, 0xae, 0xd8, 0xed, 0x69, 0x49, 0x1e, 0x9f, 0xa3, 0x83, 0x90, 0x89, 0x05, 0x70, 0xc1, 0xae, + 0xf9, 0x1b, 0x09, 0xff, 0xe3, 0x2d, 0xfc, 0x76, 0x86, 0x2f, 0x70, 0xb7, 0xc2, 0xbf, 0x72, 0xc7, + 0xf7, 0xbe, 0xfc, 0xfe, 0xf1, 0x14, 0xe7, 0x9d, 0xc8, 0x9f, 0x7b, 0x82, 0x50, 0x53, 0x65, 0xc7, + 0x7a, 0xb3, 0xda, 0xaa, 0x8d, 0xf5, 0x66, 0xad, 0xa5, 0x8f, 0xf5, 0xa6, 0xde, 0xaa, 0xf7, 0x0f, + 0x51, 0xbb, 0xd8, 0x1c, 0x25, 0xd5, 0xff, 0x8c, 0x3a, 0x13, 0xe1, 0x29, 0xf6, 0x73, 0x90, 0xec, + 0x14, 0x82, 0xc0, 0x97, 0xff, 0xe8, 0xde, 0x21, 0x6a, 0x44, 0x20, 0xd9, 0x9b, 0x33, 0xa3, 0x9a, + 0x14, 0xb2, 0x1b, 0xc6, 0x48, 0x9f, 0x51, 0x31, 0x33, 0x6a, 0x3d, 0x6d, 0xb0, 0x6f, 0x27, 0xf1, + 0x71, 0x2f, 0x76, 0x7b, 0x3f, 0x77, 0xbb, 0xa9, 0xd3, 0x7f, 0x88, 0x1e, 0x94, 0x1a, 0xc8, 0x1d, + 0x7e, 0xd3, 0x36, 0x2c, 0xda, 0x2c, 0x62, 0x74, 0x7e, 0x0b, 0x8b, 0x6d, 0x54, 0xe7, 0xc0, 0x5d, + 0x96, 0x78, 0xac, 0xd9, 0xe9, 0x25, 0x37, 0xae, 0xef, 0x66, 0x3c, 0x55, 0x2f, 0x31, 0x9e, 0x16, + 0x94, 0xf1, 0xd1, 0x55, 0x15, 0xd5, 0x26, 0xc2, 0xc3, 0xef, 0xd0, 0xde, 0xf5, 0x47, 0xf9, 0x68, + 0xcb, 0xec, 0x8b, 0xc3, 0xe9, 0x0e, 0x77, 0x00, 0x29, 0x19, 0xbc, 0x44, 0xb8, 0x64, 0x7c, 0xcf, + 0xb6, 0x53, 0x6c, 0xa2, 0xbb, 0x2f, 0xfe, 0x07, 0xbd, 0x4d, 0x39, 0x9b, 0xca, 0x8e, 0xca, 0x29, + 0x7a, 0x57, 0xe5, 0x9b, 0xad, 0x3d, 0x79, 0xf9, 0x73, 0x65, 0x6a, 0x97, 0x2b, 0x53, 0xfb, 0xb5, + 0x32, 0xb5, 0xaf, 0x6b, 0xb3, 0x72, 0xb9, 0x36, 0x2b, 0x57, 0x6b, 0xb3, 0xf2, 0x76, 0xe8, 0xf9, + 0x72, 0xf6, 0xc1, 0xb1, 0x5c, 0x08, 0xc8, 0x8d, 0xdd, 0x11, 0x8d, 0xc8, 0xb2, 0xb0, 0xc0, 0x3e, + 0x2e, 0x98, 0x70, 0x1a, 0xc9, 0xe6, 0x78, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x6d, 0x23, + 0x46, 0xe6, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -549,21 +579,35 @@ func (m *MsgDetection) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.SameProviderConflict != nil { + if m.Conflict != nil { { - size, err := m.SameProviderConflict.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.Conflict.Size() + i -= size + if _, err := m.Conflict.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0xa } - if m.ResponseConflict != nil { + return len(dAtA) - i, nil +} + +func (m *MsgDetection_FinalizationConflict) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDetection_FinalizationConflict) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FinalizationConflict != nil { { - size, err := m.ResponseConflict.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.FinalizationConflict.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -571,11 +615,20 @@ func (m *MsgDetection) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } - if m.FinalizationConflict != nil { + return len(dAtA) - i, nil +} +func (m *MsgDetection_ResponseConflict) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDetection_ResponseConflict) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ResponseConflict != nil { { - size, err := m.FinalizationConflict.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ResponseConflict.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -583,18 +636,10 @@ func (m *MsgDetection) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa + dAtA[i] = 0x32 } return len(dAtA) - i, nil } - func (m *MsgDetectionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -778,21 +823,36 @@ func (m *MsgDetection) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.Conflict != nil { + n += m.Conflict.Size() + } + return n +} + +func (m *MsgDetection_FinalizationConflict) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.FinalizationConflict != nil { l = m.FinalizationConflict.Size() n += 1 + l + sovTx(uint64(l)) } + return n +} +func (m *MsgDetection_ResponseConflict) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.ResponseConflict != nil { l = m.ResponseConflict.Size() n += 1 + l + sovTx(uint64(l)) } - if m.SameProviderConflict != nil { - l = m.SameProviderConflict.Size() - n += 1 + l + sovTx(uint64(l)) - } return n } - func (m *MsgDetectionResponse) Size() (n int) { if m == nil { return 0 @@ -932,7 +992,7 @@ func (m *MsgDetection) Unmarshal(dAtA []byte) error { } m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FinalizationConflict", wireType) } @@ -961,14 +1021,13 @@ func (m *MsgDetection) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.FinalizationConflict == nil { - m.FinalizationConflict = &FinalizationConflict{} - } - if err := m.FinalizationConflict.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &FinalizationConflict{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Conflict = &MsgDetection_FinalizationConflict{v} iNdEx = postIndex - case 3: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResponseConflict", wireType) } @@ -997,48 +1056,11 @@ func (m *MsgDetection) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ResponseConflict == nil { - m.ResponseConflict = &ResponseConflict{} - } - if err := m.ResponseConflict.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SameProviderConflict", 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 m.SameProviderConflict == nil { - m.SameProviderConflict = &FinalizationConflict{} - } - if err := m.SameProviderConflict.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &ResponseConflict{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.Conflict = &MsgDetection_ResponseConflict{v} iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/conflict/types/types.go b/x/conflict/types/types.go index f581e61e4e..91173c0748 100644 --- a/x/conflict/types/types.go +++ b/x/conflict/types/types.go @@ -2,7 +2,7 @@ package types import ( tendermintcrypto "github.com/cometbft/cometbft/crypto" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/utils/sigs" ) const ( @@ -20,14 +20,16 @@ const ( ) const ( - ConflictVoteRevealEventName = "conflict_vote_reveal_started" - ConflictDetectionRecievedEventName = "conflict_detection_received" - ConflictVoteDetectionEventName = "response_conflict_detection" - ConflictVoteResolvedEventName = "conflict_detection_vote_resolved" - ConflictVoteUnresolvedEventName = "conflict_detection_vote_unresolved" - ConflictVoteGotCommitEventName = "conflict_vote_got_commit" - ConflictVoteGotRevealEventName = "conflict_vote_got_reveal" - ConflictUnstakeFraudVoterEventName = "conflict_unstake_fraud_voter" + ConflictVoteRevealEventName = "conflict_vote_reveal_started" + ConflictDetectionReceivedEventName = "conflict_detection_received" + ConflictVoteDetectionEventName = "response_conflict_detection" + ConflictVoteResolvedEventName = "conflict_detection_vote_resolved" + ConflictVoteUnresolvedEventName = "conflict_detection_vote_unresolved" + ConflictVoteGotCommitEventName = "conflict_vote_got_commit" + ConflictVoteGotRevealEventName = "conflict_vote_got_reveal" + ConflictUnstakeFraudVoterEventName = "conflict_unstake_fraud_voter" + ConflictDetectionSameProviderEventName = "conflict_detection_same_provider" + ConflictDetectionTwoProvidersEventName = "conflict_detection_two_providers" ) // unstake description diff --git a/x/downtime/client/cli/query.go b/x/downtime/client/cli/query.go index a06024ba0b..f45387d177 100644 --- a/x/downtime/client/cli/query.go +++ b/x/downtime/client/cli/query.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/downtime/types" - v1 "github.com/lavanet/lava/x/downtime/v1" + "github.com/lavanet/lava/v2/x/downtime/types" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" "github.com/spf13/cobra" ) diff --git a/x/downtime/client/cli/tx.go b/x/downtime/client/cli/tx.go index 2f52351abe..64f0e25ed3 100644 --- a/x/downtime/client/cli/tx.go +++ b/x/downtime/client/cli/tx.go @@ -3,7 +3,7 @@ package cli import ( "fmt" - "github.com/lavanet/lava/x/downtime/types" + "github.com/lavanet/lava/v2/x/downtime/types" "github.com/spf13/cobra" ) diff --git a/x/downtime/keeper/keeper.go b/x/downtime/keeper/keeper.go index 1acd760f59..09d367b81c 100644 --- a/x/downtime/keeper/keeper.go +++ b/x/downtime/keeper/keeper.go @@ -10,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" gogowellknown "github.com/gogo/protobuf/types" - "github.com/lavanet/lava/x/downtime/types" - v1 "github.com/lavanet/lava/x/downtime/v1" + "github.com/lavanet/lava/v2/x/downtime/types" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" ) type EpochStorageKeeper interface { diff --git a/x/downtime/keeper/keeper_test.go b/x/downtime/keeper/keeper_test.go index 724b91fae7..3c3b7b41b7 100644 --- a/x/downtime/keeper/keeper_test.go +++ b/x/downtime/keeper/keeper_test.go @@ -5,9 +5,9 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/app" - v1 "github.com/lavanet/lava/x/downtime/v1" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/app" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/downtime/keeper/query_server.go b/x/downtime/keeper/query_server.go index 5bb31ca76a..c61eedfa95 100644 --- a/x/downtime/keeper/query_server.go +++ b/x/downtime/keeper/query_server.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - v1 "github.com/lavanet/lava/x/downtime/v1" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" ) var _ v1.QueryServer = queryServer{} diff --git a/x/downtime/keeper/query_server_test.go b/x/downtime/keeper/query_server_test.go index 359a850d21..dd75600e45 100644 --- a/x/downtime/keeper/query_server_test.go +++ b/x/downtime/keeper/query_server_test.go @@ -6,10 +6,10 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/app" - "github.com/lavanet/lava/x/downtime/keeper" - v1 "github.com/lavanet/lava/x/downtime/v1" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/app" + "github.com/lavanet/lava/v2/x/downtime/keeper" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/downtime/module.go b/x/downtime/module.go index bc1d36f6e7..097ff5cdfd 100644 --- a/x/downtime/module.go +++ b/x/downtime/module.go @@ -11,10 +11,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/lavanet/lava/x/downtime/client/cli" - "github.com/lavanet/lava/x/downtime/keeper" - "github.com/lavanet/lava/x/downtime/types" - v1 "github.com/lavanet/lava/x/downtime/v1" + "github.com/lavanet/lava/v2/x/downtime/client/cli" + "github.com/lavanet/lava/v2/x/downtime/keeper" + "github.com/lavanet/lava/v2/x/downtime/types" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" "github.com/spf13/cobra" ) diff --git a/x/downtime/v1/downtime.pb.go b/x/downtime/v1/downtime.pb.go index 59c7186b59..a492926cb5 100644 --- a/x/downtime/v1/downtime.pb.go +++ b/x/downtime/v1/downtime.pb.go @@ -150,7 +150,7 @@ func init() { } var fileDescriptor_17cbf2f7c6c4bd94 = []byte{ - // 273 bytes of a gzipped FileDescriptorProto + // 276 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcf, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x29, 0xf9, 0xe5, 0x79, 0x25, 0x99, 0xb9, 0xa9, 0xfa, 0x65, 0x86, 0x70, 0xb6, 0x5e, 0x41, 0x51, 0x7e, 0x49, 0xbe, 0x90, 0x04, 0x54, 0xa1, 0x1e, 0x88, @@ -164,11 +164,11 @@ var fileDescriptor_17cbf2f7c6c4bd94 = []byte{ 0x8b, 0x2f, 0xb5, 0x20, 0x3f, 0x39, 0x03, 0x61, 0x1c, 0x13, 0xf1, 0xc6, 0xf1, 0x82, 0xb5, 0xc2, 0x24, 0x94, 0x12, 0xb9, 0x38, 0x5c, 0xa0, 0xe6, 0x0b, 0x89, 0x70, 0xb1, 0x26, 0xe5, 0xe4, 0x27, 0x67, 0x83, 0x5d, 0xc7, 0x12, 0x04, 0xe1, 0x08, 0xd9, 0x73, 0x71, 0x90, 0x63, 0x0f, 0x5c, 0x93, - 0x93, 0xfd, 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, 0xa9, 0xa6, 0x67, 0x96, - 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x44, 0x65, 0x05, 0x72, 0x64, 0x26, 0xb1, - 0x81, 0xed, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xea, 0xa8, 0x87, 0xef, 0x01, 0x00, - 0x00, + 0x93, 0xd3, 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, 0x69, 0xa4, 0x67, 0x96, + 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x44, 0x65, 0x99, 0x91, 0x7e, 0x05, 0x72, + 0x7c, 0x26, 0xb1, 0x81, 0xad, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x0f, 0xc4, 0x9c, + 0xf2, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/downtime/v1/genesis.pb.go b/x/downtime/v1/genesis.pb.go index 39b4a2cd2f..d9c5280dfd 100644 --- a/x/downtime/v1/genesis.pb.go +++ b/x/downtime/v1/genesis.pb.go @@ -100,7 +100,7 @@ func init() { } var fileDescriptor_6fd11efb3f8802bf = []byte{ - // 293 bytes of a gzipped FileDescriptorProto + // 296 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcb, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x29, 0xf9, 0xe5, 0x79, 0x25, 0x99, 0xb9, 0xa9, 0xfa, 0x65, 0x86, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, @@ -115,11 +115,11 @@ var fileDescriptor_6fd11efb3f8802bf = []byte{ 0xf2, 0xe1, 0xe2, 0xcf, 0x49, 0x2c, 0x2e, 0x89, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x8e, 0x07, 0x89, 0x49, 0x30, 0x83, 0x9d, 0x22, 0xa5, 0x07, 0xf1, 0xa3, 0x1e, 0xcc, 0x8f, 0x7a, 0x21, 0x30, 0x3f, 0x3a, 0x71, 0x9c, 0xb8, 0x27, 0xcf, 0x38, 0xe1, 0xbe, 0x3c, 0x63, 0x10, 0x2f, 0x48, 0xb3, 0x13, - 0x48, 0x2f, 0x48, 0xd6, 0xc9, 0xfe, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, + 0x48, 0x2f, 0x48, 0xd6, 0xc9, 0xe9, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, - 0x54, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x42, 0xb9, 0x02, - 0x39, 0x9c, 0x93, 0xd8, 0xc0, 0xb6, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x3b, 0x46, - 0x49, 0xcc, 0x01, 0x00, 0x00, + 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x42, 0xb9, 0xcc, + 0x48, 0xbf, 0x02, 0x39, 0xa8, 0x93, 0xd8, 0xc0, 0x16, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, + 0xac, 0x8a, 0x13, 0x41, 0xcf, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/downtime/v1/query.pb.go b/x/downtime/v1/query.pb.go index 1b6d0dfcf6..de96c6c3b0 100644 --- a/x/downtime/v1/query.pb.go +++ b/x/downtime/v1/query.pb.go @@ -215,34 +215,34 @@ func init() { } var fileDescriptor_b667ee25520f3a08 = []byte{ - // 423 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0xeb, 0xd3, 0x30, - 0x18, 0xc6, 0x9b, 0xa1, 0x43, 0x32, 0x44, 0x8c, 0x13, 0x66, 0x19, 0x5d, 0x29, 0x8a, 0x65, 0x68, - 0xe2, 0xe6, 0xc5, 0x9b, 0x50, 0x76, 0x57, 0xe7, 0xcd, 0x4b, 0x49, 0xbb, 0xd8, 0x15, 0xdb, 0xa6, - 0x6b, 0xd3, 0xaa, 0x17, 0x0f, 0x7e, 0x02, 0x41, 0x0f, 0x9e, 0xfd, 0x2a, 0x5e, 0x76, 0x1c, 0x78, - 0xf1, 0xa4, 0xb2, 0xf9, 0x41, 0xa4, 0x69, 0x3a, 0xb7, 0x49, 0xfd, 0xef, 0x94, 0xf0, 0xe4, 0xc9, - 0xef, 0x7d, 0xde, 0xbe, 0x29, 0xbc, 0x1d, 0xd1, 0x92, 0x26, 0x4c, 0x90, 0x6a, 0x25, 0x0b, 0xfe, - 0x3a, 0x11, 0x61, 0xcc, 0x48, 0x39, 0x21, 0xab, 0x82, 0x65, 0x6f, 0x71, 0x9a, 0x71, 0xc1, 0xd1, - 0x40, 0xb9, 0x70, 0xb5, 0xe2, 0xc6, 0x85, 0xcb, 0x89, 0x6e, 0x04, 0x9c, 0x07, 0x11, 0x23, 0xd2, - 0xe7, 0x15, 0x2f, 0xc9, 0xa2, 0xc8, 0xa8, 0x08, 0x79, 0x52, 0xdf, 0xd4, 0xef, 0xb6, 0xf2, 0xf7, - 0x94, 0xda, 0xd8, 0x0f, 0x78, 0xc0, 0xe5, 0x96, 0x54, 0x3b, 0xa5, 0x0e, 0x15, 0x9e, 0xa6, 0x21, - 0xa1, 0x49, 0xc2, 0x85, 0x64, 0xe7, 0xf5, 0xa9, 0xe5, 0xc0, 0xfe, 0xb3, 0x2a, 0xe5, 0x4c, 0xa1, - 0xe6, 0x6c, 0x55, 0xb0, 0x5c, 0xa0, 0x31, 0xbc, 0xce, 0x52, 0xee, 0x2f, 0xdd, 0x5c, 0xd0, 0x4c, - 0xb8, 0x5e, 0xc4, 0xfd, 0x57, 0x03, 0x60, 0x02, 0xfb, 0xd2, 0xfc, 0x9a, 0x3c, 0x78, 0x5e, 0xe9, - 0x4e, 0x25, 0x5b, 0xef, 0xe0, 0xcd, 0x13, 0x46, 0x9e, 0xf2, 0x24, 0x67, 0x88, 0xc1, 0xa1, 0x5f, - 0xc4, 0x45, 0x44, 0x45, 0x58, 0x32, 0xb7, 0x49, 0xeb, 0x36, 0xfd, 0x0d, 0x3a, 0x26, 0xb0, 0x7b, - 0xd3, 0x5b, 0xb8, 0x4e, 0x88, 0x9b, 0x0f, 0x80, 0x67, 0xca, 0xe0, 0x5c, 0x59, 0xff, 0x18, 0x69, - 0x9f, 0x7f, 0x8e, 0xc0, 0x5c, 0xff, 0x0b, 0x6a, 0xca, 0x34, 0x2e, 0xab, 0x0f, 0x91, 0xac, 0xff, - 0x94, 0x66, 0x34, 0xce, 0x55, 0x07, 0xd6, 0x13, 0x78, 0xe3, 0x48, 0x55, 0x99, 0x1e, 0xc1, 0x6e, - 0x2a, 0x15, 0xd9, 0x4d, 0x6f, 0x6a, 0xe2, 0xb6, 0xc1, 0x60, 0x75, 0x53, 0xf9, 0xa7, 0x5f, 0x3b, - 0xf0, 0xb2, 0x24, 0xa2, 0x4f, 0x00, 0xf6, 0x0e, 0xd8, 0xe8, 0x5e, 0x3b, 0xe3, 0xdf, 0x60, 0xfa, - 0xfd, 0x33, 0xdd, 0x75, 0x60, 0xcb, 0x7e, 0xff, 0xed, 0xf7, 0xc7, 0x8e, 0x85, 0x4c, 0xd2, 0xfa, - 0x0e, 0xea, 0x80, 0xe8, 0x0b, 0x80, 0x57, 0x8f, 0x06, 0x81, 0xf0, 0x05, 0xa5, 0x4e, 0xa6, 0xae, - 0x93, 0xb3, 0xfd, 0x2a, 0xdc, 0x03, 0x19, 0x6e, 0x8c, 0x6c, 0xf2, 0xff, 0x9f, 0x60, 0x3f, 0x7c, - 0xe7, 0xf1, 0x7a, 0x6b, 0x80, 0xcd, 0xd6, 0x00, 0xbf, 0xb6, 0x06, 0xf8, 0xb0, 0x33, 0xb4, 0xcd, - 0xce, 0xd0, 0xbe, 0xef, 0x0c, 0xed, 0xc5, 0x9d, 0x20, 0x14, 0xcb, 0xc2, 0xc3, 0x3e, 0x8f, 0x8f, - 0x69, 0x6f, 0x0e, 0x79, 0x5e, 0x57, 0x3e, 0x93, 0x87, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xeb, - 0x4f, 0x82, 0x6d, 0x77, 0x03, 0x00, 0x00, + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x41, 0xef, 0x93, 0x30, + 0x18, 0xc6, 0xe9, 0xa2, 0xff, 0x98, 0x2e, 0xc6, 0x58, 0x67, 0x32, 0xc9, 0xc2, 0x08, 0x31, 0x91, + 0x2c, 0xda, 0x3a, 0xbc, 0x78, 0x26, 0xbb, 0xab, 0xf3, 0xe6, 0x85, 0x14, 0x56, 0x19, 0x11, 0x28, + 0x83, 0x82, 0x7a, 0xf1, 0xe0, 0x27, 0x30, 0xd1, 0x83, 0x67, 0xbf, 0x8a, 0x97, 0x1d, 0x97, 0x78, + 0xf1, 0xa4, 0x66, 0xf3, 0x83, 0x18, 0x4a, 0x99, 0xdb, 0x0c, 0xfe, 0x77, 0x6a, 0xf3, 0xf4, 0xe9, + 0xef, 0x7d, 0x5e, 0xde, 0x02, 0xef, 0xc6, 0xb4, 0xa2, 0x29, 0x13, 0xa4, 0x5e, 0xc9, 0x82, 0xbf, + 0x4e, 0x45, 0x94, 0x30, 0x52, 0x4d, 0xc9, 0xaa, 0x64, 0xf9, 0x5b, 0x9c, 0xe5, 0x5c, 0x70, 0x34, + 0x54, 0x2e, 0x5c, 0xaf, 0xb8, 0x75, 0xe1, 0x6a, 0xaa, 0x1b, 0x21, 0xe7, 0x61, 0xcc, 0x88, 0xf4, + 0xf9, 0xe5, 0x4b, 0xb2, 0x28, 0x73, 0x2a, 0x22, 0x9e, 0x36, 0x37, 0xf5, 0x7b, 0x9d, 0xfc, 0x3d, + 0xa5, 0x31, 0x0e, 0x42, 0x1e, 0x72, 0xb9, 0x25, 0xf5, 0x4e, 0xa9, 0x23, 0x85, 0xa7, 0x59, 0x44, + 0x68, 0x9a, 0x72, 0x21, 0xd9, 0x45, 0x73, 0x6a, 0xb9, 0x70, 0xf0, 0xac, 0x4e, 0x39, 0x53, 0xa8, + 0x39, 0x5b, 0x95, 0xac, 0x10, 0x68, 0x02, 0x6f, 0xb2, 0x8c, 0x07, 0x4b, 0xaf, 0x10, 0x34, 0x17, + 0x9e, 0x1f, 0xf3, 0xe0, 0xd5, 0x10, 0x98, 0xc0, 0xbe, 0x32, 0xbf, 0x21, 0x0f, 0x9e, 0xd7, 0xba, + 0x5b, 0xcb, 0xd6, 0x3b, 0x78, 0xfb, 0x84, 0x51, 0x64, 0x3c, 0x2d, 0x18, 0x62, 0x70, 0x14, 0x94, + 0x49, 0x19, 0x53, 0x11, 0x55, 0xcc, 0x6b, 0xd3, 0x7a, 0x6d, 0x7f, 0xc3, 0x9e, 0x09, 0xec, 0xbe, + 0x73, 0x07, 0x37, 0x09, 0x71, 0xfb, 0x01, 0xf0, 0x4c, 0x19, 0xdc, 0x6b, 0xeb, 0x1f, 0x63, 0xed, + 0xf3, 0xcf, 0x31, 0x98, 0xeb, 0x7f, 0x41, 0x6d, 0x99, 0xd6, 0x65, 0x0d, 0x20, 0x92, 0xf5, 0x9f, + 0xd2, 0x9c, 0x26, 0x85, 0xea, 0xc0, 0x7a, 0x02, 0x6f, 0x1d, 0xa9, 0x2a, 0xd3, 0x63, 0x78, 0x91, + 0x49, 0x45, 0x76, 0xd3, 0x77, 0x4c, 0xdc, 0x35, 0x18, 0xac, 0x6e, 0x2a, 0xbf, 0xf3, 0xb5, 0x07, + 0xaf, 0x4a, 0x22, 0xfa, 0x04, 0x60, 0xff, 0x80, 0x8d, 0xee, 0x77, 0x33, 0xfe, 0x0d, 0xa6, 0x3f, + 0x38, 0xd3, 0xdd, 0x04, 0xb6, 0xec, 0xf7, 0xdf, 0x7e, 0x7f, 0xec, 0x59, 0xc8, 0x24, 0x9d, 0xef, + 0xa0, 0x09, 0x88, 0xbe, 0x00, 0x78, 0xfd, 0x68, 0x10, 0x08, 0x5f, 0x52, 0xea, 0x64, 0xea, 0x3a, + 0x39, 0xdb, 0xaf, 0xc2, 0x3d, 0x94, 0xe1, 0x26, 0xc8, 0x26, 0xff, 0xff, 0x09, 0xf6, 0xc3, 0x77, + 0xdd, 0xf5, 0xd6, 0x00, 0x9b, 0xad, 0x01, 0x7e, 0x6d, 0x0d, 0xf0, 0x61, 0x67, 0x68, 0x9b, 0x9d, + 0xa1, 0x7d, 0xdf, 0x19, 0xda, 0x0b, 0x3b, 0x8c, 0xc4, 0xb2, 0xf4, 0x71, 0xc0, 0x93, 0x63, 0x5a, + 0xe5, 0x90, 0x37, 0x87, 0x48, 0xff, 0x42, 0xbe, 0x94, 0x47, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x95, 0x50, 0xb5, 0xbf, 0x7a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dualstaking/README.md b/x/dualstaking/README.md index 674d538f33..61b0cac937 100644 --- a/x/dualstaking/README.md +++ b/x/dualstaking/README.md @@ -115,8 +115,7 @@ The Dualstaking module supports the following queries: | `provider-delegators` | provider address | shows all the providers delegators | | `delegator-rewards` | delegator address | shows all the claimable rewards of the delegator | -Note, use the provider's operator address for the `provider-delegators` query, and the provider's vault address for the `delegator-rewards` query. -For more information on the operator and vault addresses see the pairing module's [README.md](../pairing/README.md). +Note, use the provider's address for the `provider-delegators` query, and the provider's vault address for the `delegator-rewards` query. For more information on the provider's two addresses see the epochstorage module's [README.md](../epochstorage/README.md). ## Transactions diff --git a/x/dualstaking/ante/disable_redelegation_hooks.go b/x/dualstaking/ante/disable_redelegation_hooks.go index 630ca03cbe..f1a0d10511 100644 --- a/x/dualstaking/ante/disable_redelegation_hooks.go +++ b/x/dualstaking/ante/disable_redelegation_hooks.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" ) // RedelegationFlager sets the dualstaking redelegation flag when needed. diff --git a/x/dualstaking/ante/disable_redelegation_hooks_test.go b/x/dualstaking/ante/disable_redelegation_hooks_test.go index 1da1f67b84..ded204030b 100644 --- a/x/dualstaking/ante/disable_redelegation_hooks_test.go +++ b/x/dualstaking/ante/disable_redelegation_hooks_test.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/testutil/common" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/x/dualstaking/ante" + "github.com/lavanet/lava/v2/testutil/common" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/dualstaking/ante" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/client/cli/query.go b/x/dualstaking/client/cli/query.go index d4ed174307..20bc8d90d7 100644 --- a/x/dualstaking/client/cli/query.go +++ b/x/dualstaking/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/dualstaking/client/cli/query_delegator_providers.go b/x/dualstaking/client/cli/query_delegator_providers.go index 135fcb13b8..ab8f0b9bf0 100644 --- a/x/dualstaking/client/cli/query_delegator_providers.go +++ b/x/dualstaking/client/cli/query_delegator_providers.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) const WithPendingDelegatorsFlagName = "with-pending" diff --git a/x/dualstaking/client/cli/query_delegator_rewards.go b/x/dualstaking/client/cli/query_delegator_rewards.go index f1045f2d2c..82d2805012 100644 --- a/x/dualstaking/client/cli/query_delegator_rewards.go +++ b/x/dualstaking/client/cli/query_delegator_rewards.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) const ( diff --git a/x/dualstaking/client/cli/query_params.go b/x/dualstaking/client/cli/query_params.go index b035d038e8..3e6c76bfc2 100644 --- a/x/dualstaking/client/cli/query_params.go +++ b/x/dualstaking/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func CmdQueryParams() *cobra.Command { diff --git a/x/dualstaking/client/cli/query_provider_delegators.go b/x/dualstaking/client/cli/query_provider_delegators.go index 2b65bc5b26..dffcbc1c1f 100644 --- a/x/dualstaking/client/cli/query_provider_delegators.go +++ b/x/dualstaking/client/cli/query_provider_delegators.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func CmdQueryProviderDelegators() *cobra.Command { diff --git a/x/dualstaking/client/cli/tx.go b/x/dualstaking/client/cli/tx.go index 1cde18791f..eaf9c47c85 100644 --- a/x/dualstaking/client/cli/tx.go +++ b/x/dualstaking/client/cli/tx.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/dualstaking/client/cli/tx_claim_rewards.go b/x/dualstaking/client/cli/tx_claim_rewards.go index d333ffd365..094fe38c32 100644 --- a/x/dualstaking/client/cli/tx_claim_rewards.go +++ b/x/dualstaking/client/cli/tx_claim_rewards.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/client/cli/tx_delegate.go b/x/dualstaking/client/cli/tx_delegate.go index d7094884b8..431707b6f7 100644 --- a/x/dualstaking/client/cli/tx_delegate.go +++ b/x/dualstaking/client/cli/tx_delegate.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/client/cli/tx_redelegate.go b/x/dualstaking/client/cli/tx_redelegate.go index 6560d1a91a..e027a00a51 100644 --- a/x/dualstaking/client/cli/tx_redelegate.go +++ b/x/dualstaking/client/cli/tx_redelegate.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/client/cli/tx_unbond.go b/x/dualstaking/client/cli/tx_unbond.go index 013d3a84d3..e0a6ff9ec5 100644 --- a/x/dualstaking/client/cli/tx_unbond.go +++ b/x/dualstaking/client/cli/tx_unbond.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/spf13/cobra" ) diff --git a/x/dualstaking/genesis.go b/x/dualstaking/genesis.go index 3445ac9776..8845e12132 100644 --- a/x/dualstaking/genesis.go +++ b/x/dualstaking/genesis.go @@ -2,8 +2,8 @@ package dualstaking import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) // InitGenesis initializes the module's state from a provided genesis state. diff --git a/x/dualstaking/genesis_test.go b/x/dualstaking/genesis_test.go index 8400d15b23..b052655942 100644 --- a/x/dualstaking/genesis_test.go +++ b/x/dualstaking/genesis_test.go @@ -3,10 +3,10 @@ package dualstaking_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/dualstaking" - "github.com/lavanet/lava/x/dualstaking/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/dualstaking" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/handler.go b/x/dualstaking/handler.go index 6448f23557..45daf773c6 100644 --- a/x/dualstaking/handler.go +++ b/x/dualstaking/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) // NewHandler ... diff --git a/x/dualstaking/keeper/balance.go b/x/dualstaking/keeper/balance.go index 9c42ff2bd9..b8571250d0 100644 --- a/x/dualstaking/keeper/balance.go +++ b/x/dualstaking/keeper/balance.go @@ -2,8 +2,8 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) func (k Keeper) BalanceDelegator(ctx sdk.Context, delegator sdk.AccAddress) (int, error) { @@ -17,7 +17,7 @@ func (k Keeper) BalanceDelegator(ctx sdk.Context, delegator sdk.AccAddress) (int return providers, nil } else if diff.IsPositive() { // less provider delegations,a delegation operation was done, delegate to empty provider - err = k.delegate(ctx, delegator.String(), types.EMPTY_PROVIDER, types.EMPTY_PROVIDER_CHAINID, + err = k.delegate(ctx, delegator.String(), commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), diff)) if err != nil { return providers, err diff --git a/x/dualstaking/keeper/delegate.go b/x/dualstaking/keeper/delegate.go index 965c5a1272..d95ac248cf 100644 --- a/x/dualstaking/keeper/delegate.go +++ b/x/dualstaking/keeper/delegate.go @@ -22,10 +22,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - lavaslices "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + lavaslices "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" "golang.org/x/exp/slices" ) @@ -72,7 +73,7 @@ func (k Keeper) increaseDelegation(ctx sdk.Context, delegator, provider, chainID } } - if provider != types.EMPTY_PROVIDER { + if provider != commontypes.EMPTY_PROVIDER { // update the stake entry return k.modifyStakeEntryDelegation(ctx, delegator, provider, chainID, amount, true) } @@ -166,7 +167,7 @@ func (k Keeper) decreaseDelegation(ctx sdk.Context, delegator, provider, chainID } } - if provider != types.EMPTY_PROVIDER { + if provider != commontypes.EMPTY_PROVIDER { return k.modifyStakeEntryDelegation(ctx, delegator, provider, chainID, amount, false) } @@ -175,7 +176,7 @@ func (k Keeper) decreaseDelegation(ctx sdk.Context, delegator, provider, chainID // modifyStakeEntryDelegation modifies the (epochstorage) stake-entry of the provider for a chain based on the action (increase or decrease). func (k Keeper) modifyStakeEntryDelegation(ctx sdk.Context, delegator, provider, chainID string, amount sdk.Coin, increase bool) (err error) { - stakeEntry, exists := k.epochstorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, provider) + stakeEntry, exists := k.epochstorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) if !exists || provider != stakeEntry.Address { if increase { return epochstoragetypes.ErrProviderNotStaked @@ -215,17 +216,9 @@ func (k Keeper) modifyStakeEntryDelegation(ctx sdk.Context, delegator, provider, } if stakeEntry.Stake.IsLT(k.GetParams(ctx).MinSelfDelegation) { - err = k.epochstorageKeeper.RemoveStakeEntryCurrent(ctx, chainID, stakeEntry.Vault) - if err != nil { - return utils.LavaFormatError("can't remove stake Entry after decreasing provider self delegation", err, - utils.Attribute{Key: "provider", Value: stakeEntry.Address}, - utils.Attribute{Key: "spec", Value: chainID}, - ) - } + k.epochstorageKeeper.RemoveStakeEntryCurrent(ctx, chainID, stakeEntry.Address) details["min_self_delegation"] = k.GetParams(ctx).MinSelfDelegation.String() utils.LogLavaEvent(ctx, k.Logger(ctx), types.UnstakeFromUnbond, details, "unstaking provider due to unbond that lowered its stake below min self delegation") - unstakeHoldBlocks := k.epochstorageKeeper.GetUnstakeHoldBlocks(ctx, stakeEntry.Chain) - k.epochstorageKeeper.AppendUnstakeEntry(ctx, stakeEntry, unstakeHoldBlocks) return nil } else if stakeEntry.EffectiveStake().LT(k.specKeeper.GetMinStake(ctx, chainID).Amount) { details["min_spec_stake"] = k.specKeeper.GetMinStake(ctx, chainID).String() @@ -235,7 +228,7 @@ func (k Keeper) modifyStakeEntryDelegation(ctx sdk.Context, delegator, provider, stakeEntry.UnFreeze(k.epochstorageKeeper.GetCurrentNextEpoch(ctx) + 1) } - k.epochstorageKeeper.ModifyStakeEntryCurrent(ctx, chainID, stakeEntry) + k.epochstorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) return nil } @@ -252,7 +245,7 @@ func (k Keeper) delegate(ctx sdk.Context, delegator, provider, chainID string, a ) } - if provider != types.EMPTY_PROVIDER { + if provider != commontypes.EMPTY_PROVIDER { if _, err = sdk.AccAddressFromBech32(provider); err != nil { return utils.LavaFormatWarning("invalid provider address", err, utils.Attribute{Key: "provider", Value: provider}, @@ -287,8 +280,8 @@ func (k Keeper) delegate(ctx sdk.Context, delegator, provider, chainID string, a func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, toChainID string, amount sdk.Coin) error { _, foundFrom := k.specKeeper.GetSpec(ctx, fromChainID) _, foundTo := k.specKeeper.GetSpec(ctx, toChainID) - if (!foundFrom && fromChainID != types.EMPTY_PROVIDER_CHAINID) || - (!foundTo && toChainID != types.EMPTY_PROVIDER_CHAINID) { + if (!foundFrom && fromChainID != commontypes.EMPTY_PROVIDER_CHAINID) || + (!foundTo && toChainID != commontypes.EMPTY_PROVIDER_CHAINID) { return utils.LavaFormatWarning("cannot redelegate with invalid chain IDs", fmt.Errorf("chain ID not found"), utils.LogAttr("from_chain_id", fromChainID), utils.LogAttr("to_chain_id", toChainID), @@ -303,7 +296,7 @@ func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, to ) } - if from != types.EMPTY_PROVIDER { + if from != commontypes.EMPTY_PROVIDER { if _, err := sdk.AccAddressFromBech32(from); err != nil { return utils.LavaFormatWarning("invalid from-provider address", err, utils.Attribute{Key: "from_provider", Value: from}, @@ -311,7 +304,7 @@ func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, to } } - if to != types.EMPTY_PROVIDER { + if to != commontypes.EMPTY_PROVIDER { if _, err := sdk.AccAddressFromBech32(to); err != nil { return utils.LavaFormatWarning("invalid to-provider address", err, utils.Attribute{Key: "to_provider", Value: to}, @@ -357,7 +350,7 @@ func (k Keeper) Redelegate(ctx sdk.Context, delegator, from, to, fromChainID, to // (effective on next epoch) func (k Keeper) unbond(ctx sdk.Context, delegator, provider, chainID string, amount sdk.Coin) error { _, found := k.specKeeper.GetSpec(ctx, chainID) - if chainID != types.EMPTY_PROVIDER_CHAINID && !found { + if chainID != commontypes.EMPTY_PROVIDER_CHAINID && !found { return utils.LavaFormatWarning("cannot unbond with invalid chain ID", fmt.Errorf("chain ID not found"), utils.LogAttr("chain_id", chainID)) } @@ -370,7 +363,7 @@ func (k Keeper) unbond(ctx sdk.Context, delegator, provider, chainID string, amo ) } - if provider != types.EMPTY_PROVIDER { + if provider != commontypes.EMPTY_PROVIDER { if _, err := sdk.AccAddressFromBech32(provider); err != nil { return utils.LavaFormatWarning("invalid provider address", err, utils.Attribute{Key: "provider", Value: provider}, @@ -414,7 +407,7 @@ func (k Keeper) GetDelegatorProviders(ctx sdk.Context, delegator string, epoch u } func (k Keeper) GetProviderDelegators(ctx sdk.Context, provider string, epoch uint64) ([]types.Delegation, error) { - if provider != types.EMPTY_PROVIDER { + if provider != commontypes.EMPTY_PROVIDER { _, err := sdk.AccAddressFromBech32(provider) if err != nil { return nil, utils.LavaFormatWarning("cannot get provider's delegators", err, @@ -484,15 +477,15 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount } // first remove from the empty provider - if lavaslices.Contains[string](providers, types.EMPTY_PROVIDER) { - delegation, found := k.GetDelegation(ctx, delegator, types.EMPTY_PROVIDER, types.EMPTY_PROVIDER_CHAINID, epoch) + if lavaslices.Contains[string](providers, commontypes.EMPTY_PROVIDER) { + delegation, found := k.GetDelegation(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, epoch) if found { if delegation.Amount.Amount.GTE(amount.Amount) { // we have enough here, remove all from empty delegator and bail - return k.unbond(ctx, delegator, types.EMPTY_PROVIDER, types.EMPTY_PROVIDER_CHAINID, amount) + return k.unbond(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, amount) } else { // we dont have enough in the empty provider, remove everything and continue with the rest - err = k.unbond(ctx, delegator, types.EMPTY_PROVIDER, types.EMPTY_PROVIDER_CHAINID, delegation.Amount) + err = k.unbond(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, delegation.Amount) if err != nil { return err } @@ -501,7 +494,7 @@ func (k Keeper) UnbondUniformProviders(ctx sdk.Context, delegator string, amount } } - providers, _ = lavaslices.Remove[string](providers, types.EMPTY_PROVIDER) + providers, _ = lavaslices.Remove[string](providers, commontypes.EMPTY_PROVIDER) var delegations []types.Delegation for _, provider := range providers { diff --git a/x/dualstaking/keeper/delegate_test.go b/x/dualstaking/keeper/delegate_test.go index d2ee8d85a8..e3a442f4ee 100644 --- a/x/dualstaking/keeper/delegate_test.go +++ b/x/dualstaking/keeper/delegate_test.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - commontypes "github.com/lavanet/lava/utils/common/types" + "github.com/lavanet/lava/v2/testutil/common" + commontypes "github.com/lavanet/lava/v2/utils/common/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/delegator_reward.go b/x/dualstaking/keeper/delegator_reward.go index 089f125486..26142e8a48 100644 --- a/x/dualstaking/keeper/delegator_reward.go +++ b/x/dualstaking/keeper/delegator_reward.go @@ -6,11 +6,11 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) // SetDelegatorReward set a specific DelegatorReward in the store from its index @@ -172,7 +172,7 @@ func (k Keeper) ClaimRewards(ctx sdk.Context, delegator string, provider string) // RewardProvidersAndDelegators is the main function handling provider rewards with delegations // it returns the provider reward amount and updates the delegatorReward map with the reward portion for each delegator -func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributer bool) (providerReward sdk.Coins, claimableRewards sdk.Coins, err error) { +func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributor bool) (providerReward sdk.Coins, claimableRewards sdk.Coins, err error) { block := uint64(ctx.BlockHeight()) zeroCoins := sdk.NewCoins() epoch, _, err := k.epochstorageKeeper.GetEpochStartForBlock(ctx, block) @@ -181,7 +181,7 @@ func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, c utils.Attribute{Key: "block", Value: block}, ) } - stakeEntry, found := k.epochstorageKeeper.GetStakeEntryForProviderEpoch(ctx, chainID, provider, epoch) + stakeEntry, found := k.epochstorageKeeper.GetStakeEntry(ctx, epoch, chainID, provider) if !found { return zeroCoins, zeroCoins, err } @@ -199,7 +199,7 @@ func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, c // make sure to round it down for the integers division contributorReward = contributorReward.QuoInt(contributorsNum).MulInt(contributorsNum) claimableRewards = totalReward.Sub(contributorReward...) - if !calcOnlyContributer { + if !calcOnlyContributor { err = k.PayContributors(ctx, senderModule, contributorAddresses, contributorReward, chainID) if err != nil { return zeroCoins, zeroCoins, err @@ -209,7 +209,7 @@ func (k Keeper) RewardProvidersAndDelegators(ctx sdk.Context, provider string, c relevantDelegations := lavaslices.Filter(delegations, func(d types.Delegation) bool { - return d.ChainID == chainID && d.IsFirstMonthPassed(ctx.BlockTime().UTC().Unix()) && d.Delegator != stakeEntry.Vault + return d.ChainID == chainID && d.IsFirstWeekPassed(ctx.BlockTime().UTC().Unix()) && d.Delegator != stakeEntry.Vault }) providerReward, delegatorsReward := k.CalcRewards(ctx, stakeEntry, claimableRewards, relevantDelegations) @@ -272,8 +272,9 @@ func (k Keeper) PayContributors(ctx sdk.Context, senderModule string, contributo } rewardCoins := contributorReward.QuoInt(sdk.NewInt(int64(len(contributorAddresses)))) details := map[string]string{ - "rewardCoins": rewardCoins.String(), - "specId": specId, + "total_reward_coins": contributorReward.String(), + "reward_coins_per_contributor": rewardCoins.String(), + "chain_id": specId, } leftRewards := contributorReward for i, contributorAddress := range contributorAddresses { @@ -287,7 +288,7 @@ func (k Keeper) PayContributors(ctx sdk.Context, senderModule string, contributo return err } } - utils.LogLavaEvent(ctx, k.Logger(ctx), types.ContributorRewardEventName, details, "contributors rewards given") + utils.LogLavaEvent(ctx, k.Logger(ctx), types.ContributorRewardEventName, details, "All contributors rewarded successfully") if !leftRewards.IsZero() { utils.LavaFormatError("leftover rewards", nil, utils.LogAttr("rewardCoins", rewardCoins.String()), utils.LogAttr("contributorReward", contributorReward.String()), utils.LogAttr("leftRewards", leftRewards.String())) // we don;t want to bail on this diff --git a/x/dualstaking/keeper/delegator_reward_test.go b/x/dualstaking/keeper/delegator_reward_test.go index 57bde83f7e..97ac4d32d8 100644 --- a/x/dualstaking/keeper/delegator_reward_test.go +++ b/x/dualstaking/keeper/delegator_reward_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/grpc_query_delegator_providers.go b/x/dualstaking/keeper/grpc_query_delegator_providers.go index a218441169..98730d7d93 100644 --- a/x/dualstaking/keeper/grpc_query_delegator_providers.go +++ b/x/dualstaking/keeper/grpc_query_delegator_providers.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/dualstaking/keeper/grpc_query_delegator_providers_test.go b/x/dualstaking/keeper/grpc_query_delegator_providers_test.go index 83c8ff8333..e5e5a11f3d 100644 --- a/x/dualstaking/keeper/grpc_query_delegator_providers_test.go +++ b/x/dualstaking/keeper/grpc_query_delegator_providers_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/grpc_query_delegator_rewards.go b/x/dualstaking/keeper/grpc_query_delegator_rewards.go index fa1d27fc0b..d4c93de1f5 100644 --- a/x/dualstaking/keeper/grpc_query_delegator_rewards.go +++ b/x/dualstaking/keeper/grpc_query_delegator_rewards.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -40,3 +40,7 @@ func (k Keeper) DelegatorRewards(goCtx context.Context, req *types.QueryDelegato return &types.QueryDelegatorRewardsResponse{Rewards: rewards}, nil } + +func (k Keeper) DelegatorRewardsList(goCtx context.Context, req *types.QueryDelegatorRewardsRequest) (res *types.QueryDelegatorRewardsResponse, err error) { + return k.DelegatorRewards(goCtx, req) +} diff --git a/x/dualstaking/keeper/grpc_query_provider_delegators.go b/x/dualstaking/keeper/grpc_query_provider_delegators.go index 788b4e6ada..9f9b65e646 100644 --- a/x/dualstaking/keeper/grpc_query_provider_delegators.go +++ b/x/dualstaking/keeper/grpc_query_provider_delegators.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/dualstaking/keeper/grpc_query_provider_delegators_test.go b/x/dualstaking/keeper/grpc_query_provider_delegators_test.go index 7dc02f9a7d..ca5446fc94 100644 --- a/x/dualstaking/keeper/grpc_query_provider_delegators_test.go +++ b/x/dualstaking/keeper/grpc_query_provider_delegators_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/helpers_test.go b/x/dualstaking/keeper/helpers_test.go index c1dc1e10fb..31ab04597d 100644 --- a/x/dualstaking/keeper/helpers_test.go +++ b/x/dualstaking/keeper/helpers_test.go @@ -4,10 +4,10 @@ import ( "testing" "cosmossdk.io/math" - "github.com/lavanet/lava/testutil/common" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/common" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -95,7 +95,7 @@ func (ts *tester) getStakeEntry(provider string, chainID string) epochstoragetyp epoch := ts.EpochStart() keeper := ts.Keepers.Epochstorage - stakeEntry, found := keeper.GetStakeEntryForProviderEpoch(ts.Ctx, chainID, provider, epoch) + stakeEntry, found := keeper.GetStakeEntry(ts.Ctx, epoch, chainID, provider) if !found { panic("getStakeEntry: no stake entry: " + provider + " " + chainID) } diff --git a/x/dualstaking/keeper/hooks.go b/x/dualstaking/keeper/hooks.go index badcbc3be4..74737110e4 100644 --- a/x/dualstaking/keeper/hooks.go +++ b/x/dualstaking/keeper/hooks.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) // Wrapper struct diff --git a/x/dualstaking/keeper/hooks_test.go b/x/dualstaking/keeper/hooks_test.go index ca71700823..a7000d6c50 100644 --- a/x/dualstaking/keeper/hooks_test.go +++ b/x/dualstaking/keeper/hooks_test.go @@ -9,10 +9,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/utils/sigs" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" "golang.org/x/exp/slices" ) @@ -27,7 +28,7 @@ func TestCreateValidator(t *testing.T) { amount := sdk.NewIntFromUint64(100) ts.TxCreateValidator(validator, amount) - res, err := ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, true) + res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) require.NoError(t, err) require.Equal(t, res.Delegations[0].Delegator, validator.Addr.String()) } @@ -42,7 +43,7 @@ func TestDelegateToValidator(t *testing.T) { amount := sdk.NewIntFromUint64(100) ts.TxCreateValidator(validator, amount) - res, err := ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, true) + res, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) require.NoError(t, err) require.Equal(t, res.Delegations[0].Delegator, validator.Addr.String()) @@ -51,7 +52,7 @@ func TestDelegateToValidator(t *testing.T) { _, err = ts.TxDelegateValidator(delegator, validator, amount) require.NoError(t, err) - res, err = ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, true) + res, err = ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) require.NoError(t, err) require.Equal(t, 2, len(res.Delegations)) require.True(t, res.Delegations[0].Delegator == validator.Addr.String() || res.Delegations[0].Delegator == delegator.Addr.String()) @@ -70,7 +71,7 @@ func TestReDelegateToValidator(t *testing.T) { ts.TxCreateValidator(validator1, amount) ts.TxCreateValidator(validator2, amount) - delegatorsRes, err := ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, true) + delegatorsRes, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) require.NoError(t, err) require.Equal(t, 2, len(delegatorsRes.Delegations)) @@ -79,7 +80,7 @@ func TestReDelegateToValidator(t *testing.T) { _, err = ts.TxDelegateValidator(delegator, validator1, amount) require.NoError(t, err) - delegatorsRes, err = ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, true) + delegatorsRes, err = ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) require.NoError(t, err) require.Equal(t, 3, len(delegatorsRes.Delegations)) @@ -91,7 +92,7 @@ func TestReDelegateToValidator(t *testing.T) { _, err = ts.TxReDelegateValidator(delegator, validator1, validator2, amount) require.NoError(t, err) - delegatorsRes1, err := ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, true) + delegatorsRes1, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, true) require.NoError(t, err) require.Equal(t, delegatorsRes, delegatorsRes1) @@ -123,21 +124,21 @@ func TestReDelegateToProvider(t *testing.T) { require.NoError(t, err) epoch := ts.EpochStart() - entry, found := ts.Keepers.Epochstorage.GetStakeEntryForProviderEpoch(ts.Ctx, ts.spec.Index, provider, epoch) + entry, found := ts.Keepers.Epochstorage.GetStakeEntry(ts.Ctx, epoch, ts.spec.Index, provider) require.True(t, found) require.Equal(t, amount, entry.Stake.Amount) providersRes, err := ts.QueryDualstakingDelegatorProviders(delegator.Addr.String(), true) require.NoError(t, err) require.Equal(t, 1, len(providersRes.Delegations)) - require.Equal(t, dualstakingtypes.EMPTY_PROVIDER, providersRes.Delegations[0].Provider) + require.Equal(t, commontypes.EMPTY_PROVIDER, providersRes.Delegations[0].Provider) ts.AdvanceEpoch() _, err = ts.TxDualstakingRedelegate(delegator.Addr.String(), - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, provider, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, entry.Chain, sdk.NewCoin(ts.TokenDenom(), amount)) @@ -154,7 +155,7 @@ func TestReDelegateToProvider(t *testing.T) { ts.AdvanceEpoch() epoch = ts.EpochStart() - entry, found = ts.Keepers.Epochstorage.GetStakeEntryForProviderEpoch(ts.Ctx, ts.spec.Index, provider, epoch) + entry, found = ts.Keepers.Epochstorage.GetStakeEntry(ts.Ctx, epoch, ts.spec.Index, provider) require.True(t, found) require.Equal(t, amount, entry.DelegateTotal.Amount) require.Equal(t, amount, entry.Stake.Amount) @@ -205,9 +206,9 @@ func TestUnbondUniformProviders(t *testing.T) { _, provider := ts.GetAccount(common.PROVIDER, i) providers = append(providers, provider) _, err = ts.TxDualstakingRedelegate(delegatorAcc.Addr.String(), - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, provider, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), redelegateAmts[i])) require.NoError(t, err) @@ -253,7 +254,7 @@ func TestValidatorSlash(t *testing.T) { require.Equal(t, amount, val.Tokens) // sanity check: empty provider should have delegation of 1000000000 tokens - resQ, err := ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, false) + resQ, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, false) require.NoError(t, err) require.Equal(t, 1, len(resQ.Delegations)) require.Equal(t, amount, resQ.Delegations[0].Amount.Amount) @@ -321,7 +322,7 @@ func TestValidatorAndProvidersSlash(t *testing.T) { ts.AdvanceEpoch() // advance epoch to apply the empty provider delegation (that happens automatically when delegating to the validator) // sanity check: empty provider should have val_stake(=1000000000) + 250*consensusPowerTokens tokens in two delegations - resQ, err := ts.QueryDualstakingProviderDelegators(dualstakingtypes.EMPTY_PROVIDER, false) + resQ, err := ts.QueryDualstakingProviderDelegators(commontypes.EMPTY_PROVIDER, false) require.NoError(t, err) require.Equal(t, 2, len(resQ.Delegations)) require.Equal(t, stake.Add(consensusPowerTokens.MulRaw(250)), resQ.Delegations[0].Amount.Amount.Add(resQ.Delegations[1].Amount.Amount)) @@ -340,9 +341,9 @@ func TestValidatorAndProvidersSlash(t *testing.T) { providers = append(providers, provider) _, err = ts.TxDualstakingRedelegate(delegatorAcc.Addr.String(), - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, provider, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), redelegateAmts[i])) require.NoError(t, err) @@ -574,15 +575,15 @@ func TestUnbondValidatorButNotRemoveStakeEntry(t *testing.T) { // other delegator should not be able to delegate to the provider _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, provider, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) require.Error(t, err) // checking that provider is not found - _, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + _, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.False(t, found) _, err = ts.QueryDualstakingProviderDelegators(provider, true) @@ -631,9 +632,9 @@ func TestUndelegateProvider(t *testing.T) { // delegator1 redelegates 9999 to the provider _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, provider, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) require.NoError(t, err) @@ -644,26 +645,10 @@ func TestUndelegateProvider(t *testing.T) { require.NoError(t, err) fmt.Println("Delegation of Provider before provider is removed", res2) - unstakeHoldBlocks := ts.Keepers.Epochstorage.UnstakeHoldBlocks(ts.Ctx, ts.BlockHeight()) - unstakeHoldBlocksStatic := ts.Keepers.Epochstorage.UnstakeHoldBlocksStatic(ts.Ctx, ts.BlockHeight()) - _, err = ts.TxPairingUnstakeProvider(providerAcct.GetVaultAddr(), ts.spec.Index) require.NoError(t, err) - ts.AdvanceBlocks(unstakeHoldBlocks) - - _, found := ts.Keepers.Epochstorage.UnstakeEntryByAddress(ts.Ctx, providerAcct.GetVaultAddr()) - require.True(t, found) - - ts.AdvanceBlocks(unstakeHoldBlocksStatic - unstakeHoldBlocks) - - // checking that provider can't be found - _, found = ts.Keepers.Epochstorage.UnstakeEntryByAddress(ts.Ctx, providerAcct.GetVaultAddr()) - require.False(t, found) - - ts.AdvanceEpoch() - - _, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + _, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.False(t, found) // delegation of the removed provider @@ -672,33 +657,35 @@ func TestUndelegateProvider(t *testing.T) { require.NoError(t, err) fmt.Println("Delegation of Provider after provider is removed", res2) + ts.AdvanceEpochUntilStale() + // stake provider again err = ts.StakeProvider(providerAcct.GetVaultAddr(), providerAcct.Addr.String(), ts.spec, sdk.NewIntFromUint64(1000).Int64()) require.NoError(t, err) - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) fmt.Println("Stake entry of re-staked provider", stakeEntry.String()) // delegator1 should be able to redelegate back to the empty provider _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, ts.spec.Index, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(1))) require.NoError(t, err) - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) fmt.Println("Stake entry of re-staked provider after del1 9999 redelegation", stakeEntry.String()) // another one delegates to provider // delegator2 delegates 9998 to the provider _, err = ts.TxDualstakingRedelegate(delegatorAcc2.Addr.String(), - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, provider, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, ts.spec.Index, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9998))) require.NoError(t, err) @@ -708,17 +695,17 @@ func TestUndelegateProvider(t *testing.T) { _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, ts.spec.Index, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9999))) require.Error(t, err) _, err = ts.TxDualstakingRedelegate(delegatorAcc1.Addr.String(), provider, - dualstakingtypes.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, ts.spec.Index, - dualstakingtypes.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(9998))) require.NoError(t, err) } diff --git a/x/dualstaking/keeper/keeper.go b/x/dualstaking/keeper/keeper.go index c8aa91ab3e..f9552ea7eb 100644 --- a/x/dualstaking/keeper/keeper.go +++ b/x/dualstaking/keeper/keeper.go @@ -10,9 +10,9 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) type ( diff --git a/x/dualstaking/keeper/migrations.go b/x/dualstaking/keeper/migrations.go index 7420b6f49c..ca4564d49a 100644 --- a/x/dualstaking/keeper/migrations.go +++ b/x/dualstaking/keeper/migrations.go @@ -1,18 +1,13 @@ package keeper import ( - "encoding/json" - "fmt" - _ "embed" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - dualstakingv4 "github.com/lavanet/lava/x/dualstaking/migrations/v4" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" + dualstakingv4 "github.com/lavanet/lava/v2/x/dualstaking/migrations/v4" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) type Migrator struct { @@ -23,355 +18,6 @@ func NewMigrator(keeper Keeper) Migrator { return Migrator{keeper: keeper} } -// ConvertProviderStakeToSelfDelegation does: -// 1. zero out each provider stake and return their money -// 2. use that same money to make the providers self delegate -func (m Migrator) ConvertProviderStakeToSelfDelegation(ctx sdk.Context) error { - // get highest staked validator - validatorsByPower := m.keeper.stakingKeeper.GetBondedValidatorsByPower(ctx) - highestVal := validatorsByPower[0] - - // loop over all providers - chains := m.keeper.specKeeper.GetAllChainIDs(ctx) - for _, chainID := range chains { - storage, found := m.keeper.epochstorageKeeper.GetStakeStorageCurrent(ctx, chainID) - if found { - for _, entry := range storage.StakeEntries { - // return the providers all their coins - addr, err := sdk.AccAddressFromBech32(entry.Address) - if err != nil { - return err - } - - err = m.keeper.bankKeeper.MintCoins(ctx, types.ModuleName, []sdk.Coin{entry.Stake}) - if err != nil { - return err - } - - err = m.keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, addr, []sdk.Coin{entry.Stake}) - if err != nil { - utils.LavaFormatError("failed to send coins from module to account", err, - utils.Attribute{Key: "Account", Value: addr}, - ) - } - - // create self delegation, this will increase the stake entry, we need to fix that by reseting the stake before delegating - stake := entry.Stake - entry.Stake.Amount = sdk.ZeroInt() - m.keeper.epochstorageKeeper.ModifyStakeEntryCurrent(ctx, chainID, entry) - err = m.keeper.DelegateFull(ctx, entry.Address, highestVal.OperatorAddress, entry.Address, chainID, stake) - if err != nil { - return err - } - } - } - } - - moduleBalance := m.keeper.bankKeeper.GetBalance(ctx, m.keeper.accountKeeper.GetModuleAddress(types.ModuleName), m.keeper.stakingKeeper.BondDenom(ctx)) - if !moduleBalance.IsZero() { - err := m.keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(moduleBalance)) - if err != nil { - return err - } - } - - return nil -} - -// HandleProviderDelegators does: -// 1. merge the deprecated bonded and not-bonded pool funds -// 2. return the providers' delegators money back from the merged pool -// 3. use the same money to delegate to both the original delegation's provider and highest staked validator -func (m Migrator) HandleProviderDelegators(ctx sdk.Context) error { - delegationsInds := m.keeper.delegationFS.GetAllEntryIndices(ctx) - nextEpoch := m.keeper.epochstorageKeeper.GetCurrentNextEpoch(ctx) - - // burn all coins from the pools - moduleBalance := m.keeper.bankKeeper.GetBalance(ctx, m.keeper.accountKeeper.GetModuleAddress(dualstakingtypes.BondedPoolName), m.keeper.stakingKeeper.BondDenom(ctx)) - if !moduleBalance.IsZero() { - err := m.keeper.bankKeeper.BurnCoins(ctx, dualstakingtypes.BondedPoolName, sdk.NewCoins(moduleBalance)) - if err != nil { - return err - } - } - - if !moduleBalance.IsZero() { - moduleBalance = m.keeper.bankKeeper.GetBalance(ctx, m.keeper.accountKeeper.GetModuleAddress(dualstakingtypes.NotBondedPoolName), m.keeper.stakingKeeper.BondDenom(ctx)) - err := m.keeper.bankKeeper.BurnCoins(ctx, dualstakingtypes.NotBondedPoolName, sdk.NewCoins(moduleBalance)) - if err != nil { - return err - } - } - - // give money back to delegators from the bonded pool - originalDelegations := []dualstakingtypes.Delegation{} - for _, ind := range delegationsInds { - // find the delegation and keep its original form - var d dualstakingtypes.Delegation - block, _, _, found := m.keeper.delegationFS.FindEntryDetailed(ctx, ind, nextEpoch, &d) - if !found { - continue - } - - if d.Delegator == d.Provider || d.Provider == dualstakingtypes.EMPTY_PROVIDER { - continue - } - - originalAmount := d.Amount - - // zero the delegation amount in the fixation store - d.Amount = sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()) - m.keeper.delegationFS.ModifyEntry(ctx, ind, block, &d) - - // give money back from the bonded pool - delegatorAddr, err := sdk.AccAddressFromBech32(d.Delegator) - if err != nil { - return err - } - - err = m.keeper.bankKeeper.MintCoins(ctx, types.ModuleName, []sdk.Coin{originalAmount}) - if err != nil { - return err - } - - err = m.keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, delegatorAddr, sdk.Coins{originalAmount}) - if err != nil { - return err - } - - entry, found := m.keeper.epochstorageKeeper.GetStakeEntryByAddressCurrent(ctx, d.ChainID, d.Provider) - if !found { - continue - } - entry.DelegateTotal = entry.DelegateTotal.Sub(originalAmount) - m.keeper.epochstorageKeeper.ModifyStakeEntryCurrent(ctx, d.ChainID, entry) - - originalDelegations = append(originalDelegations, d) - } - - // get highest staked validator and delegate to it - validatorsByPower := m.keeper.stakingKeeper.GetBondedValidatorsByPower(ctx) - highestVal := validatorsByPower[0] - for _, d := range originalDelegations { - err := m.keeper.DelegateFull(ctx, d.Delegator, highestVal.OperatorAddress, d.Provider, d.ChainID, d.Amount) - if err != nil { - return err - } - } - - return nil -} - -// HandleValidatorsDelegators does: -// 1. get each validator's delegators -// 2. delegate the amount of their delegation to the empty provider (using the AfterDelegationModified hook) -func (m Migrator) HandleValidatorsDelegators(ctx sdk.Context) error { - // get all validators - validators := m.keeper.stakingKeeper.GetAllValidators(ctx) - - // for each validator+delegator, run the AfterDelegationModified to delegate to empty provider - for _, v := range validators { - delegations := m.keeper.stakingKeeper.GetValidatorDelegations(ctx, v.GetOperator()) - for _, d := range delegations { - err := m.keeper.Hooks().AfterDelegationModified(ctx, d.GetDelegatorAddr(), v.GetOperator()) - if err != nil { - return err - } - } - } - - return nil -} - -// VerifyDelegationsBalance gets all delegators (from both providers and validators) -// and verifies that each delegator has the same amount of delegations in both the provider -// and validator sides -func (m Migrator) VerifyDelegationsBalance(ctx sdk.Context) error { - delegationsInds := m.keeper.delegationFS.GetAllEntryIndices(ctx) - validators := m.keeper.stakingKeeper.GetAllValidators(ctx) - nextEpoch := m.keeper.epochstorageKeeper.GetCurrentNextEpoch(ctx) - - // get all the providers' delegators - var delegators []sdk.AccAddress - for _, ind := range delegationsInds { - var d dualstakingtypes.Delegation - found := m.keeper.delegationFS.FindEntry(ctx, ind, nextEpoch, &d) - if !found { - continue - } - delegatorAddr, err := sdk.AccAddressFromBech32(d.Delegator) - if err != nil { - return err - } - delegators = append(delegators, delegatorAddr) - } - - // get all the validators' delegators - for _, v := range validators { - delegations := m.keeper.stakingKeeper.GetValidatorDelegations(ctx, v.GetOperator()) - for _, d := range delegations { - delegatorAddr, err := sdk.AccAddressFromBech32(d.DelegatorAddress) - if err != nil { - return err - } - delegators = append(delegators, delegatorAddr) - } - } - - // verify delegations balance for each delegator - for _, d := range delegators { - diff, _, err := m.keeper.VerifyDelegatorBalance(ctx, d) - if err != nil { - return err - } - - if !diff.IsZero() { - return utils.LavaFormatError("delegations balance migration failed", fmt.Errorf("delegator not balanced"), - utils.Attribute{Key: "delegator", Value: d.String()}, - utils.Attribute{Key: "diff", Value: diff.String()}, - ) - } - } - - return nil -} - -// MigrateVersion1To2 implements store migration: Create a self delegation for all providers, Make providers-validators delegations balance -func (m Migrator) MigrateVersion1To2(ctx sdk.Context) error { - // first balance all validators - err := m.HandleValidatorsDelegators(ctx) - if err != nil { - return err - } - - // create providers self delegations - err = m.ConvertProviderStakeToSelfDelegation(ctx) - if err != nil { - return err - } - - // convert the rest of the delegations - err = m.HandleProviderDelegators(ctx) - if err != nil { - return err - } - - // verify the balance once again to make sure - err = m.VerifyDelegationsBalance(ctx) - if err != nil { - return err - } - - return nil -} - -// MigrateVersion2To3 implements store migration: Create a self delegation for all providers, Make providers-validators delegations balance -func (m Migrator) MigrateVersion2To3(ctx sdk.Context) error { - nextEpoch := m.keeper.epochstorageKeeper.GetCurrentNextEpoch(ctx) - chains := m.keeper.specKeeper.GetAllChainIDs(ctx) - OldStakeStorages := GetStakeStorages(ctx.ChainID()) - for _, chainID := range chains { - storage, found := m.keeper.epochstorageKeeper.GetStakeStorageCurrent(ctx, chainID) - if found { - providers := map[string]interface{}{} - stakeEntries := []epochstoragetypes.StakeEntry{} - - duplicated := 0 - missing := 0 - // remove duplicates - for _, entry := range storage.StakeEntries { - if _, ok := providers[entry.Address]; !ok { - d, found := m.keeper.GetDelegation(ctx, entry.Address, entry.Address, entry.Chain, nextEpoch) - if found { - delegations, err := m.keeper.GetProviderDelegators(ctx, entry.Address, nextEpoch) - if err == nil { - entry.DelegateTotal.Amount = sdk.ZeroInt() - for _, d := range delegations { - if d.Delegator != d.Provider && d.ChainID == chainID { - entry.DelegateTotal.Amount = entry.DelegateTotal.Amount.Add(d.Amount.Amount) - } - } - } else { - fmt.Println("didnt find delegations for:", entry.Address) - } - entry.Stake = d.Amount - stakeEntries = append(stakeEntries, entry) - } else { - fmt.Println("didnt find self delegation for:", entry.Address) - } - - providers[entry.Address] = struct{}{} - } else { - duplicated++ - } - } - - // add back the old ones if they were deleted - if len(OldStakeStorages) > 0 { - deletedEntriesToAdd := OldStakeStorages[chainID] - for _, entry := range deletedEntriesToAdd.StakeEntries { - if _, ok := providers[entry.Address]; !ok { - d, found := m.keeper.GetDelegation(ctx, entry.Address, entry.Address, entry.Chain, nextEpoch) - if found { - missing++ - delegations, err := m.keeper.GetProviderDelegators(ctx, entry.Address, nextEpoch) - if err == nil { - entry.DelegateTotal.Amount = sdk.ZeroInt() - for _, d := range delegations { - if d.Delegator != d.Provider && d.ChainID == chainID { - entry.DelegateTotal.Amount = entry.DelegateTotal.Amount.Add(d.Amount.Amount) - } - } - } - entry.Stake = d.Amount - stakeEntries = append(stakeEntries, entry) - } - } - } - } - - utils.LavaFormatInfo("Migrator for chain id providers", utils.LogAttr("chainID", chainID), - utils.LogAttr("duplicated", duplicated), - utils.LogAttr("missing", missing)) - storage.StakeEntries = stakeEntries - m.keeper.epochstorageKeeper.SetStakeStorageCurrent(ctx, storage.Index, storage) - } - } - return nil -} - -var ( - good_stakeStorage_lava_staging_4 []byte - good_stakeStorage_lava_testnet_2 []byte -) - -func GetStakeStorages(lavaChainID string) map[string]epochstoragetypes.StakeStorage { - var payload []byte - if lavaChainID == "lava-testnet-2" { - payload = good_stakeStorage_lava_testnet_2 - } else if lavaChainID == "lava-staging-4" { - payload = good_stakeStorage_lava_staging_4 - } - - var stakestorages []epochstoragetypes.StakeStorage - err := json.Unmarshal(payload, &stakestorages) - if err != nil { - utils.LavaFormatWarning("Could not unmarshal stakestorages", err, utils.LogAttr("chainID", lavaChainID), utils.LogAttr("PayloadLen", len(payload))) - } - - stakestoragesMap := map[string]epochstoragetypes.StakeStorage{} - for _, stakestorage := range stakestorages { - stakestoragesMap[stakestorage.Index] = stakestorage - } - return stakestoragesMap -} - -// MigrateVersion3To4 sets the DisableDualstakingHook flag to false -func (m Migrator) MigrateVersion3To4(ctx sdk.Context) error { - m.keeper.SetDisableDualstakingHook(ctx, false) - return nil -} - // MigrateVersion4To5 change the DelegatorReward object amount's field from sdk.Coin to sdk.Coins func (m Migrator) MigrateVersion4To5(ctx sdk.Context) error { delegatorRewards := m.GetAllDelegatorRewardV4(ctx) diff --git a/x/dualstaking/keeper/msg_server.go b/x/dualstaking/keeper/msg_server.go index 934164aacd..4e00b79ba3 100644 --- a/x/dualstaking/keeper/msg_server.go +++ b/x/dualstaking/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) type msgServer struct { diff --git a/x/dualstaking/keeper/msg_server_claim_rewards.go b/x/dualstaking/keeper/msg_server_claim_rewards.go index 1afa0e3c00..2d1163121b 100644 --- a/x/dualstaking/keeper/msg_server_claim_rewards.go +++ b/x/dualstaking/keeper/msg_server_claim_rewards.go @@ -4,8 +4,9 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func (k msgServer) ClaimRewards(goCtx context.Context, msg *types.MsgClaimRewards) (*types.MsgClaimRewardsResponse, error) { @@ -16,7 +17,7 @@ func (k msgServer) ClaimRewards(goCtx context.Context, msg *types.MsgClaimReward return &types.MsgClaimRewardsResponse{}, utils.LavaFormatError("invalid creator address", err) } - if msg.Provider != "" && msg.Provider != types.EMPTY_PROVIDER { + if msg.Provider != "" && msg.Provider != commontypes.EMPTY_PROVIDER { _, err = sdk.AccAddressFromBech32(msg.Provider) if err != nil { return &types.MsgClaimRewardsResponse{}, utils.LavaFormatError("invalid provider address", err) diff --git a/x/dualstaking/keeper/msg_server_delegate.go b/x/dualstaking/keeper/msg_server_delegate.go index 892bea30f9..070e714ae7 100644 --- a/x/dualstaking/keeper/msg_server_delegate.go +++ b/x/dualstaking/keeper/msg_server_delegate.go @@ -6,8 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*types.MsgDelegateResponse, error) { @@ -18,7 +19,7 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ // DelegateFull uses staking module for to delegate with hooks func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string, provider string, chainID string, amount sdk.Coin) error { _, found := k.specKeeper.GetSpec(ctx, chainID) - if !found && chainID != types.EMPTY_PROVIDER_CHAINID { + if !found && chainID != commontypes.EMPTY_PROVIDER_CHAINID { return utils.LavaFormatWarning("invalid chain ID", fmt.Errorf("chain ID not found"), utils.LogAttr("chain_id", chainID)) } @@ -48,7 +49,7 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string nextEpoch := k.epochstorageKeeper.GetCurrentNextEpoch(ctx) - delegation, found := k.GetDelegation(ctx, delegator, types.EMPTY_PROVIDER, types.EMPTY_PROVIDER_CHAINID, nextEpoch) + delegation, found := k.GetDelegation(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, nextEpoch) amountBefore := sdk.ZeroInt() if found { amountBefore = delegation.Amount.Amount @@ -59,16 +60,16 @@ func (k Keeper) DelegateFull(ctx sdk.Context, delegator string, validator string return err } - delegation, _ = k.GetDelegation(ctx, delegator, types.EMPTY_PROVIDER, types.EMPTY_PROVIDER_CHAINID, nextEpoch) + delegation, _ = k.GetDelegation(ctx, delegator, commontypes.EMPTY_PROVIDER, commontypes.EMPTY_PROVIDER_CHAINID, nextEpoch) amount.Amount = delegation.Amount.Amount.Sub(amountBefore) err = k.Redelegate( ctx, delegator, - types.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, provider, - types.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, chainID, amount, ) diff --git a/x/dualstaking/keeper/msg_server_redelegate.go b/x/dualstaking/keeper/msg_server_redelegate.go index 652c0b9c02..0a25fd4165 100644 --- a/x/dualstaking/keeper/msg_server_redelegate.go +++ b/x/dualstaking/keeper/msg_server_redelegate.go @@ -4,8 +4,9 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func (k msgServer) Redelegate(goCtx context.Context, msg *types.MsgRedelegate) (*types.MsgRedelegateResponse, error) { @@ -19,6 +20,14 @@ func (k msgServer) Redelegate(goCtx context.Context, msg *types.MsgRedelegate) ( return &types.MsgRedelegateResponse{}, err } + // allow non empty chainID calls to redelegate form empty provider + if msg.FromChainID == commontypes.EMPTY_PROVIDER_CHAINID_STAR { + msg.FromChainID = commontypes.EMPTY_PROVIDER_CHAINID + } + if msg.ToChainID == commontypes.EMPTY_PROVIDER_CHAINID_STAR { + msg.ToChainID = commontypes.EMPTY_PROVIDER_CHAINID + } + err := k.Keeper.Redelegate( ctx, msg.Creator, diff --git a/x/dualstaking/keeper/msg_server_test.go b/x/dualstaking/keeper/msg_server_test.go index 22ce4d5833..e6010a1964 100644 --- a/x/dualstaking/keeper/msg_server_test.go +++ b/x/dualstaking/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/msg_server_unbond.go b/x/dualstaking/keeper/msg_server_unbond.go index 96c2b71eaa..b6c354a955 100644 --- a/x/dualstaking/keeper/msg_server_unbond.go +++ b/x/dualstaking/keeper/msg_server_unbond.go @@ -4,8 +4,9 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func (k msgServer) Unbond(goCtx context.Context, msg *types.MsgUnbond) (*types.MsgUnbondResponse, error) { @@ -43,9 +44,9 @@ func (k Keeper) UnbondFull(ctx sdk.Context, delegator string, validator string, ctx, delegator, provider, - types.EMPTY_PROVIDER, + commontypes.EMPTY_PROVIDER, chainID, - types.EMPTY_PROVIDER_CHAINID, + commontypes.EMPTY_PROVIDER_CHAINID, amount, ) if err != nil { diff --git a/x/dualstaking/keeper/params.go b/x/dualstaking/keeper/params.go index 56164d3716..bda905cba9 100644 --- a/x/dualstaking/keeper/params.go +++ b/x/dualstaking/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) // GetParams get all parameters as types.Params diff --git a/x/dualstaking/keeper/params_test.go b/x/dualstaking/keeper/params_test.go index 62ba71bd5b..8469712eb6 100644 --- a/x/dualstaking/keeper/params_test.go +++ b/x/dualstaking/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/query.go b/x/dualstaking/keeper/query.go index e8bc54d01b..34161a9014 100644 --- a/x/dualstaking/keeper/query.go +++ b/x/dualstaking/keeper/query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/dualstaking/keeper/query_params.go b/x/dualstaking/keeper/query_params.go index 80b9836565..993c08c6da 100644 --- a/x/dualstaking/keeper/query_params.go +++ b/x/dualstaking/keeper/query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/dualstaking/keeper/query_params_test.go b/x/dualstaking/keeper/query_params_test.go index 9115e2f058..e51c2c2c97 100644 --- a/x/dualstaking/keeper/query_params_test.go +++ b/x/dualstaking/keeper/query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/keeper/slashing.go b/x/dualstaking/keeper/slashing.go index d3be3483bb..2c1c3e3dcd 100644 --- a/x/dualstaking/keeper/slashing.go +++ b/x/dualstaking/keeper/slashing.go @@ -3,8 +3,8 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) // balance delegators dualstaking after potential validators slashing diff --git a/x/dualstaking/module.go b/x/dualstaking/module.go index a85f30ebc1..e71b104208 100644 --- a/x/dualstaking/module.go +++ b/x/dualstaking/module.go @@ -17,9 +17,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/dualstaking/client/cli" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/client/cli" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) var ( @@ -118,24 +118,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v1 -> v2 migration - if err := cfg.RegisterMigration(types.ModuleName, 1, migrator.MigrateVersion1To2); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v2: %w", types.ModuleName, err)) - } - - // register v2 -> v3 migration - if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.MigrateVersion2To3); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) - } - - // register v3 -> v4 migration - if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.MigrateVersion3To4); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) - } - // register v4 -> v5 migration if err := cfg.RegisterMigration(types.ModuleName, 4, migrator.MigrateVersion4To5); err != nil { // panic:ok: at start up, migration cannot proceed anyhow diff --git a/x/dualstaking/module_simulation.go b/x/dualstaking/module_simulation.go index 1abd800706..4380646950 100644 --- a/x/dualstaking/module_simulation.go +++ b/x/dualstaking/module_simulation.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - dualstakingsimulation "github.com/lavanet/lava/x/dualstaking/simulation" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/testutil/sample" + dualstakingsimulation "github.com/lavanet/lava/v2/x/dualstaking/simulation" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) // avoid unused import issue diff --git a/x/dualstaking/simulation/claim_rewards.go b/x/dualstaking/simulation/claim_rewards.go index da5c129d9d..8711414aa2 100644 --- a/x/dualstaking/simulation/claim_rewards.go +++ b/x/dualstaking/simulation/claim_rewards.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func SimulateMsgClaimRewards( diff --git a/x/dualstaking/simulation/delegate.go b/x/dualstaking/simulation/delegate.go index a737f79e40..20c7672a5c 100644 --- a/x/dualstaking/simulation/delegate.go +++ b/x/dualstaking/simulation/delegate.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/dualstaking/keeper" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/keeper" + "github.com/lavanet/lava/v2/x/dualstaking/types" ) func SimulateMsgDelegate( diff --git a/x/dualstaking/types/codec.go b/x/dualstaking/types/codec.go index ac9155c6aa..e6385fcb37 100644 --- a/x/dualstaking/types/codec.go +++ b/x/dualstaking/types/codec.go @@ -3,6 +3,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" // this line is used by starport scaffolding # 1 sdk "github.com/cosmos/cosmos-sdk/types" @@ -37,5 +38,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + ModuleCdc = codec.NewAminoCodec(Amino) + // ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterCodec(Amino) + cryptocodec.RegisterCrypto(Amino) + Amino.Seal() +} diff --git a/x/dualstaking/types/delegate.go b/x/dualstaking/types/delegate.go index 4fa5dfca05..6e1d446d3f 100644 --- a/x/dualstaking/types/delegate.go +++ b/x/dualstaking/types/delegate.go @@ -4,8 +4,8 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" ) func NewDelegation(delegator, provider, chainID string, blockTime time.Time, tokenDenom string) Delegation { @@ -40,8 +40,9 @@ func (delegation *Delegation) Equal(other *Delegation) bool { return true } -func (delegation *Delegation) IsFirstMonthPassed(currentTimestamp int64) bool { - return delegation.Timestamp <= currentTimestamp +func (delegation *Delegation) IsFirstWeekPassed(currentTimestamp int64) bool { + // this is a temporary code to reduce the time to 1 week instead of month, will be changed in the gradual delegation increase feature. + return delegation.Timestamp-int64((3*7*24*time.Hour).Seconds()) <= currentTimestamp } func NewDelegator(delegator, provider string) Delegator { diff --git a/x/dualstaking/types/delegate.pb.go b/x/dualstaking/types/delegate.pb.go index f9a1680961..aa9ed8f97f 100644 --- a/x/dualstaking/types/delegate.pb.go +++ b/x/dualstaking/types/delegate.pb.go @@ -154,27 +154,27 @@ func init() { } var fileDescriptor_547eac7f30bf94d4 = []byte{ - // 305 bytes of a gzipped FileDescriptorProto + // 306 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x86, 0x63, 0x5a, 0x0a, 0x31, 0x5b, 0xc4, 0x60, 0xaa, 0xca, 0x44, 0x5d, 0x28, 0x42, 0xb2, - 0x55, 0x18, 0xd8, 0x4b, 0x19, 0x58, 0x3b, 0xb2, 0x39, 0xa9, 0x95, 0x5a, 0x34, 0xbe, 0x28, 0x76, - 0x23, 0x78, 0x0b, 0xde, 0x86, 0x57, 0xe8, 0xd8, 0x91, 0x09, 0xa1, 0xe4, 0x45, 0x90, 0x93, 0x34, - 0xa5, 0xd3, 0xf9, 0xfe, 0xff, 0x97, 0xef, 0xd3, 0x1d, 0xbe, 0x59, 0x8b, 0x42, 0x68, 0x69, 0xb9, - 0xab, 0x7c, 0xb9, 0x11, 0x6b, 0x63, 0xc5, 0x9b, 0xd2, 0x09, 0x5f, 0xca, 0xb5, 0x4c, 0x84, 0x95, - 0x2c, 0xcb, 0xc1, 0x42, 0x40, 0xda, 0x20, 0x73, 0x95, 0xfd, 0x0b, 0x0e, 0x2f, 0x13, 0x48, 0xa0, - 0x0e, 0x71, 0xf7, 0x6a, 0xf2, 0x43, 0x1a, 0x83, 0x49, 0xc1, 0xf0, 0x48, 0x18, 0xc9, 0x8b, 0x69, - 0x24, 0xad, 0x98, 0xf2, 0x18, 0x94, 0x6e, 0xfc, 0xf1, 0x17, 0xc2, 0x78, 0xde, 0x8c, 0x50, 0xa0, - 0x83, 0x21, 0x3e, 0xcf, 0x72, 0x28, 0xd4, 0x52, 0xe6, 0x04, 0x85, 0x68, 0xe2, 0x2f, 0xba, 0x3e, - 0x20, 0xf8, 0x2c, 0x5e, 0x09, 0xa5, 0x5f, 0xe6, 0xe4, 0xa4, 0xb6, 0xf6, 0x6d, 0x30, 0xc2, 0x7e, - 0x8b, 0x09, 0x39, 0xe9, 0xd5, 0xde, 0x41, 0x08, 0x1e, 0xf1, 0x40, 0xa4, 0xb0, 0xd1, 0x96, 0xf4, - 0x43, 0x34, 0xb9, 0xb8, 0xbf, 0x62, 0x0d, 0x13, 0x73, 0x4c, 0xac, 0x65, 0x62, 0x4f, 0xa0, 0xf4, - 0xac, 0xbf, 0xfd, 0xb9, 0xf6, 0x16, 0x6d, 0xdc, 0x7d, 0x6b, 0x55, 0x2a, 0x8d, 0x15, 0x69, 0x46, - 0x4e, 0x43, 0x34, 0xe9, 0x2d, 0x0e, 0xc2, 0xf8, 0x16, 0xfb, 0xf3, 0x6e, 0xc6, 0x08, 0xfb, 0x7b, - 0x4e, 0x43, 0x50, 0xd8, 0x73, 0x04, 0x9d, 0x30, 0x7b, 0xde, 0x96, 0x14, 0xed, 0x4a, 0x8a, 0x7e, - 0x4b, 0x8a, 0x3e, 0x2b, 0xea, 0xed, 0x2a, 0xea, 0x7d, 0x57, 0xd4, 0x7b, 0xbd, 0x4b, 0x94, 0x5d, - 0x6d, 0x22, 0x16, 0x43, 0xca, 0x8f, 0x4e, 0xf0, 0x7e, 0x74, 0x04, 0xfb, 0x91, 0x49, 0x13, 0x0d, - 0xea, 0x95, 0x3d, 0xfc, 0x05, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xa0, 0xb8, 0x13, 0xad, 0x01, 0x00, - 0x00, + 0x10, 0x86, 0x63, 0x5a, 0x0a, 0x31, 0x5b, 0xc4, 0x60, 0xaa, 0xca, 0x44, 0x5d, 0x28, 0x8b, 0xad, + 0x96, 0x81, 0xbd, 0x74, 0x80, 0xb5, 0x23, 0x9b, 0x93, 0x5a, 0xa9, 0x45, 0xe3, 0x8b, 0x62, 0x37, + 0x82, 0xb7, 0xe0, 0x6d, 0x78, 0x85, 0x8e, 0x1d, 0x99, 0x10, 0x4a, 0x5e, 0x04, 0x39, 0x49, 0x53, + 0x3a, 0x9d, 0xef, 0xff, 0x7f, 0xf9, 0x3e, 0xdd, 0xe1, 0xbb, 0x8d, 0x28, 0x84, 0x96, 0x96, 0xbb, + 0xca, 0x57, 0x5b, 0xb1, 0x31, 0x56, 0xbc, 0x29, 0x9d, 0xf0, 0x95, 0xdc, 0xc8, 0x44, 0x58, 0xc9, + 0xb2, 0x1c, 0x2c, 0x04, 0xa4, 0x0d, 0x32, 0x57, 0xd9, 0xbf, 0xe0, 0xf0, 0x3a, 0x81, 0x04, 0xea, + 0x10, 0x77, 0xaf, 0x26, 0x3f, 0xa4, 0x31, 0x98, 0x14, 0x0c, 0x8f, 0x84, 0x91, 0xbc, 0x98, 0x46, + 0xd2, 0x8a, 0x29, 0x8f, 0x41, 0xe9, 0xc6, 0x1f, 0x7f, 0x21, 0x8c, 0x17, 0xcd, 0x08, 0x05, 0x3a, + 0x18, 0xe2, 0xcb, 0x2c, 0x87, 0x42, 0xad, 0x64, 0x4e, 0x50, 0x88, 0x26, 0xfe, 0xb2, 0xeb, 0x03, + 0x82, 0x2f, 0xe2, 0xb5, 0x50, 0xfa, 0x65, 0x41, 0xce, 0x6a, 0xeb, 0xd0, 0x06, 0x23, 0xec, 0xb7, + 0x98, 0x90, 0x93, 0x5e, 0xed, 0x1d, 0x85, 0xe0, 0x11, 0x0f, 0x44, 0x0a, 0x5b, 0x6d, 0x49, 0x3f, + 0x44, 0x93, 0xab, 0xd9, 0x0d, 0x6b, 0x98, 0x98, 0x63, 0x62, 0x2d, 0x13, 0x7b, 0x02, 0xa5, 0xe7, + 0xfd, 0xdd, 0xcf, 0xad, 0xb7, 0x6c, 0xe3, 0xee, 0x5b, 0xab, 0x52, 0x69, 0xac, 0x48, 0x33, 0x72, + 0x1e, 0xa2, 0x49, 0x6f, 0x79, 0x14, 0xc6, 0xf7, 0xd8, 0x5f, 0x74, 0x33, 0x46, 0xd8, 0x3f, 0x70, + 0x1a, 0x82, 0xc2, 0x9e, 0x23, 0xe8, 0x84, 0xf9, 0xf3, 0xae, 0xa4, 0x68, 0x5f, 0x52, 0xf4, 0x5b, + 0x52, 0xf4, 0x59, 0x51, 0x6f, 0x5f, 0x51, 0xef, 0xbb, 0xa2, 0xde, 0x2b, 0x4b, 0x94, 0x5d, 0x6f, + 0x23, 0x16, 0x43, 0xca, 0x4f, 0x4e, 0x50, 0xcc, 0xf8, 0xfb, 0xc9, 0x1d, 0xec, 0x47, 0x26, 0x4d, + 0x34, 0xa8, 0xb7, 0xf6, 0xf0, 0x17, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x6e, 0x15, 0x5f, 0xb0, 0x01, + 0x00, 0x00, } func (m *Delegation) Marshal() (dAtA []byte, err error) { diff --git a/x/dualstaking/types/delegator_reward.pb.go b/x/dualstaking/types/delegator_reward.pb.go index 831a94b1e3..e64aa0c3c4 100644 --- a/x/dualstaking/types/delegator_reward.pb.go +++ b/x/dualstaking/types/delegator_reward.pb.go @@ -102,26 +102,26 @@ func init() { } var fileDescriptor_c8b6da054bf40d1f = []byte{ - // 300 bytes of a gzipped FileDescriptorProto + // 301 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x50, 0xbd, 0x4e, 0xf3, 0x30, - 0x14, 0x8d, 0xbf, 0x7e, 0x2a, 0xad, 0x19, 0x90, 0x22, 0x86, 0xb4, 0x42, 0x6e, 0xc5, 0x54, 0x09, - 0x61, 0x53, 0x78, 0x83, 0x02, 0x03, 0x6b, 0x47, 0x96, 0xca, 0x89, 0xad, 0xd4, 0x6a, 0xeb, 0x5b, - 0xd9, 0x4e, 0x80, 0xb7, 0xe0, 0x39, 0x78, 0x92, 0x4a, 0x2c, 0x1d, 0x99, 0x00, 0x25, 0x2f, 0x82, - 0xe2, 0x84, 0xd2, 0x4e, 0x37, 0x37, 0xe7, 0x9e, 0x1f, 0x1f, 0xcc, 0x96, 0x3c, 0xe7, 0x5a, 0x3a, - 0x3f, 0x99, 0xc8, 0xf8, 0xd2, 0x3a, 0xbe, 0x50, 0x3a, 0x65, 0x42, 0x2e, 0x65, 0xca, 0x1d, 0x98, - 0x99, 0x91, 0x4f, 0xdc, 0x08, 0xba, 0x36, 0xe0, 0x20, 0x8c, 0x1a, 0x02, 0xad, 0x26, 0xdd, 0x23, - 0xf4, 0x4f, 0x53, 0x48, 0xc1, 0x1f, 0xb1, 0xea, 0xab, 0xbe, 0xef, 0x93, 0x04, 0xec, 0x0a, 0x2c, - 0x8b, 0xb9, 0x95, 0x2c, 0x1f, 0xc7, 0xd2, 0xf1, 0x31, 0x4b, 0x40, 0xe9, 0x1a, 0x3f, 0x7f, 0x47, - 0xf8, 0xe4, 0xee, 0xd7, 0x6a, 0xea, 0x9d, 0xc2, 0x33, 0xdc, 0xdd, 0xb9, 0x47, 0x68, 0x88, 0x46, - 0xdd, 0xe9, 0xdf, 0x8f, 0xb0, 0x8f, 0x3b, 0x6b, 0x03, 0xb9, 0x12, 0xd2, 0x44, 0xff, 0x3c, 0xb8, - 0xdb, 0xc3, 0x1e, 0xee, 0x24, 0x73, 0xae, 0xf4, 0x4c, 0x89, 0xa8, 0xe5, 0xb1, 0x23, 0xbf, 0x3f, - 0x88, 0x30, 0xc1, 0x6d, 0xbe, 0x82, 0x4c, 0xbb, 0xe8, 0xff, 0xb0, 0x35, 0x3a, 0xbe, 0xee, 0xd1, - 0x3a, 0x19, 0xad, 0x92, 0xd1, 0x26, 0x19, 0xbd, 0x05, 0xa5, 0x27, 0x57, 0x9b, 0xcf, 0x41, 0xf0, - 0xf6, 0x35, 0x18, 0xa5, 0xca, 0xcd, 0xb3, 0x98, 0x26, 0xb0, 0x62, 0xcd, 0x33, 0xea, 0x71, 0x69, - 0xc5, 0x82, 0xb9, 0x97, 0xb5, 0xb4, 0x9e, 0x60, 0xa7, 0x8d, 0xf4, 0xe4, 0x7e, 0x53, 0x10, 0xb4, - 0x2d, 0x08, 0xfa, 0x2e, 0x08, 0x7a, 0x2d, 0x49, 0xb0, 0x2d, 0x49, 0xf0, 0x51, 0x92, 0xe0, 0xf1, - 0x62, 0x4f, 0xeb, 0xa0, 0xf3, 0xe7, 0x83, 0xd6, 0xbd, 0x68, 0xdc, 0xf6, 0xdd, 0xdc, 0xfc, 0x04, - 0x00, 0x00, 0xff, 0xff, 0x3d, 0x8e, 0xbf, 0x24, 0x9e, 0x01, 0x00, 0x00, + 0x14, 0x8d, 0xbf, 0x7e, 0x2a, 0xad, 0x19, 0x90, 0x22, 0x86, 0xb4, 0x42, 0x6e, 0xc5, 0xd4, 0x05, + 0x9b, 0x96, 0x37, 0x28, 0x0c, 0xb0, 0x76, 0x64, 0xa9, 0x9c, 0xd8, 0x4a, 0xad, 0xb6, 0xbe, 0x95, + 0xed, 0x04, 0x78, 0x0b, 0x9e, 0x83, 0x27, 0xa9, 0xc4, 0xd2, 0x91, 0x09, 0x50, 0xf2, 0x22, 0x28, + 0x4e, 0x28, 0xed, 0x74, 0x73, 0x73, 0xee, 0xf9, 0xf1, 0xc1, 0x6c, 0xc5, 0x73, 0xae, 0xa5, 0xf3, + 0x93, 0x89, 0x8c, 0xaf, 0xac, 0xe3, 0x4b, 0xa5, 0x53, 0x26, 0xe4, 0x4a, 0xa6, 0xdc, 0x81, 0x99, + 0x1b, 0xf9, 0xc4, 0x8d, 0xa0, 0x1b, 0x03, 0x0e, 0xc2, 0xa8, 0x21, 0xd0, 0x6a, 0xd2, 0x03, 0x42, + 0xff, 0x3c, 0x85, 0x14, 0xfc, 0x11, 0xab, 0xbe, 0xea, 0xfb, 0x3e, 0x49, 0xc0, 0xae, 0xc1, 0xb2, + 0x98, 0x5b, 0xc9, 0xf2, 0x71, 0x2c, 0x1d, 0x1f, 0xb3, 0x04, 0x94, 0xae, 0xf1, 0xcb, 0x77, 0x84, + 0xcf, 0xee, 0x7e, 0xad, 0x66, 0xde, 0x29, 0xbc, 0xc0, 0xdd, 0xbd, 0x7b, 0x84, 0x86, 0x68, 0xd4, + 0x9d, 0xfd, 0xfd, 0x08, 0xfb, 0xb8, 0xb3, 0x31, 0x90, 0x2b, 0x21, 0x4d, 0xf4, 0xcf, 0x83, 0xfb, + 0x3d, 0xec, 0xe1, 0x4e, 0xb2, 0xe0, 0x4a, 0xcf, 0x95, 0x88, 0x5a, 0x1e, 0x3b, 0xf1, 0xfb, 0x83, + 0x08, 0x13, 0xdc, 0xe6, 0x6b, 0xc8, 0xb4, 0x8b, 0xfe, 0x0f, 0x5b, 0xa3, 0xd3, 0x49, 0x8f, 0xd6, + 0xc9, 0x68, 0x95, 0x8c, 0x36, 0xc9, 0xe8, 0x2d, 0x28, 0x3d, 0xbd, 0xde, 0x7e, 0x0e, 0x82, 0xb7, + 0xaf, 0xc1, 0x28, 0x55, 0x6e, 0x91, 0xc5, 0x34, 0x81, 0x35, 0x6b, 0x9e, 0x51, 0x8f, 0x2b, 0x2b, + 0x96, 0xcc, 0xbd, 0x6c, 0xa4, 0xf5, 0x04, 0x3b, 0x6b, 0xa4, 0xa7, 0xf7, 0xdb, 0x82, 0xa0, 0x5d, + 0x41, 0xd0, 0x77, 0x41, 0xd0, 0x6b, 0x49, 0x82, 0x5d, 0x49, 0x82, 0x8f, 0x92, 0x04, 0x8f, 0xf4, + 0x40, 0xeb, 0xa8, 0xf3, 0x7c, 0xc2, 0x9e, 0x8f, 0x8a, 0xf7, 0xba, 0x71, 0xdb, 0xd7, 0x73, 0xf3, + 0x13, 0x00, 0x00, 0xff, 0xff, 0x62, 0x26, 0xf2, 0xc9, 0xa1, 0x01, 0x00, 0x00, } func (m *DelegatorReward) Marshal() (dAtA []byte, err error) { diff --git a/x/dualstaking/types/expected_keepers.go b/x/dualstaking/types/expected_keepers.go index e6df058bd1..b9804b0e63 100644 --- a/x/dualstaking/types/expected_keepers.go +++ b/x/dualstaking/types/expected_keepers.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/x/fixationstore/types" - spectypes "github.com/lavanet/lava/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v2/x/fixationstore/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -32,19 +32,12 @@ type BankKeeper interface { } type EpochstorageKeeper interface { - GetStakeEntryByAddressCurrent(ctx sdk.Context, chainID string, address string) (value epochstoragetypes.StakeEntry, found bool) - ModifyStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry epochstoragetypes.StakeEntry) - UnstakeHoldBlocks(ctx sdk.Context, block uint64) (res uint64) - UnstakeHoldBlocksStatic(ctx sdk.Context, block uint64) (res uint64) - GetStakeEntryForProviderEpoch(ctx sdk.Context, chainID string, selectedProvider string, epoch uint64) (entry epochstoragetypes.StakeEntry, found bool) + GetStakeEntryCurrent(ctx sdk.Context, chainID string, address string) (value epochstoragetypes.StakeEntry, found bool) + SetStakeEntryCurrent(ctx sdk.Context, stakeEntry epochstoragetypes.StakeEntry) GetEpochStartForBlock(ctx sdk.Context, block uint64) (epochStart, blockInEpoch uint64, err error) GetCurrentNextEpoch(ctx sdk.Context) (nextEpoch uint64) - GetStakeStorageCurrent(ctx sdk.Context, chainID string) (epochstoragetypes.StakeStorage, bool) - SetStakeStorageCurrent(ctx sdk.Context, chainID string, stakeStorage epochstoragetypes.StakeStorage) - RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, address string) error - AppendUnstakeEntry(ctx sdk.Context, stakeEntry epochstoragetypes.StakeEntry, unstakeHoldBlocks uint64) - GetUnstakeHoldBlocks(ctx sdk.Context, chainID string) uint64 - UnstakeEntryByAddress(ctx sdk.Context, address string) (value epochstoragetypes.StakeEntry, found bool) + RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, address string) + GetStakeEntry(ctx sdk.Context, epoch uint64, chainID string, provider string) (val epochstoragetypes.StakeEntry, found bool) // Methods imported from epochstorage should be defined here } diff --git a/x/dualstaking/types/genesis.go b/x/dualstaking/types/genesis.go index dd29a95e22..3046d2c9f9 100644 --- a/x/dualstaking/types/genesis.go +++ b/x/dualstaking/types/genesis.go @@ -3,7 +3,7 @@ package types import ( fmt "fmt" - fixationstoretypes "github.com/lavanet/lava/x/fixationstore/types" + fixationstoretypes "github.com/lavanet/lava/v2/x/fixationstore/types" ) // DefaultIndex is the default global index diff --git a/x/dualstaking/types/genesis.pb.go b/x/dualstaking/types/genesis.pb.go index a775e10bd2..f49e627b8d 100644 --- a/x/dualstaking/types/genesis.pb.go +++ b/x/dualstaking/types/genesis.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/fixationstore/types" - _ "github.com/lavanet/lava/x/timerstore/types" + types "github.com/lavanet/lava/v2/x/fixationstore/types" + _ "github.com/lavanet/lava/v2/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -103,28 +103,29 @@ func init() { } var fileDescriptor_d5bca863c53f218f = []byte{ - // 336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0x4d, 0x4b, 0xfb, 0x30, - 0x1c, 0xc7, 0xdb, 0x3d, 0xf1, 0xa7, 0xdb, 0x1f, 0xa4, 0x2a, 0x94, 0x1d, 0xe2, 0x50, 0x94, 0x0d, - 0x21, 0x85, 0x79, 0xf7, 0x30, 0x7c, 0x00, 0xf1, 0x20, 0x9b, 0x27, 0x2f, 0x23, 0x5b, 0x63, 0x0c, - 0x76, 0xcd, 0x48, 0x7e, 0xd3, 0xf9, 0x2e, 0x7c, 0x59, 0x3b, 0xee, 0xe8, 0x49, 0xa4, 0x7d, 0x23, - 0xd2, 0x34, 0x8e, 0x45, 0xe8, 0xc5, 0x53, 0xd2, 0xf2, 0xf9, 0x7e, 0x92, 0x6f, 0x7e, 0xde, 0x49, - 0x4c, 0x5e, 0x48, 0x42, 0x21, 0xcc, 0xd7, 0x30, 0x5a, 0x90, 0x58, 0x01, 0x79, 0xe6, 0x09, 0x0b, - 0x19, 0x4d, 0xa8, 0xe2, 0x0a, 0xcf, 0xa5, 0x00, 0xe1, 0x07, 0x86, 0xc3, 0xf9, 0x8a, 0xb7, 0xb8, - 0xf6, 0x1e, 0x13, 0x4c, 0x68, 0x28, 0xcc, 0x77, 0x05, 0xdf, 0x3e, 0x2e, 0xf5, 0xce, 0x89, 0x24, - 0x33, 0xa3, 0x6d, 0xf7, 0x2c, 0xec, 0x91, 0x2f, 0x09, 0x70, 0x91, 0x28, 0x10, 0x92, 0x6e, 0xbe, - 0x0c, 0x7a, 0x64, 0xa1, 0xc0, 0x67, 0x54, 0x16, 0x9c, 0xde, 0x1a, 0x28, 0x2c, 0x3d, 0x36, 0xa2, - 0x31, 0x65, 0x04, 0x84, 0x1c, 0x4b, 0xfa, 0x4a, 0x64, 0x54, 0x04, 0x0e, 0xb3, 0x8a, 0xd7, 0xba, - 0x2e, 0x9a, 0x8e, 0x80, 0x00, 0xf5, 0xcf, 0xbd, 0x46, 0x71, 0xc3, 0xc0, 0xed, 0xb8, 0xdd, 0x66, - 0xbf, 0x83, 0xcb, 0x9a, 0xe3, 0x3b, 0xcd, 0x0d, 0x6a, 0xab, 0xcf, 0x03, 0x67, 0x68, 0x52, 0xfe, - 0xbd, 0xf7, 0xdf, 0x1c, 0x95, 0x17, 0xb9, 0x1a, 0x05, 0x15, 0xad, 0xe9, 0xda, 0x1a, 0xab, 0x29, - 0xde, 0xbe, 0x80, 0xd1, 0xd9, 0x12, 0x7f, 0xe8, 0xb5, 0x36, 0x05, 0x72, 0x69, 0xf5, 0x4f, 0x52, - 0xcb, 0xe1, 0x4f, 0xbd, 0xfd, 0xdf, 0x8f, 0x32, 0x8e, 0xb9, 0x82, 0xa0, 0xde, 0xa9, 0x76, 0x9b, - 0xfd, 0x5e, 0x79, 0xf1, 0x8b, 0x9f, 0xd8, 0x50, 0xa7, 0x8c, 0x7d, 0x37, 0xb2, 0x7f, 0xdf, 0x72, - 0x05, 0x37, 0xb5, 0x7f, 0xb5, 0x9d, 0xfa, 0xe0, 0x72, 0x95, 0x22, 0x77, 0x9d, 0x22, 0xf7, 0x2b, - 0x45, 0xee, 0x7b, 0x86, 0x9c, 0x75, 0x86, 0x9c, 0x8f, 0x0c, 0x39, 0x0f, 0xa7, 0x8c, 0xc3, 0xd3, - 0x62, 0x82, 0xa7, 0x62, 0x66, 0xcf, 0x6e, 0x69, 0x4d, 0x0f, 0xde, 0xe6, 0x54, 0x4d, 0x1a, 0x7a, - 0x66, 0x67, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2e, 0xd4, 0x46, 0x25, 0xb5, 0x02, 0x00, 0x00, + // 337 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0x4f, 0x4b, 0xf3, 0x30, + 0x1c, 0xc7, 0xdb, 0xfd, 0xe3, 0xa1, 0xdb, 0x03, 0x52, 0x15, 0xca, 0x0e, 0x75, 0x28, 0xca, 0x76, + 0x49, 0x60, 0xde, 0x3d, 0x0c, 0x51, 0x11, 0x0f, 0xb2, 0x79, 0xf2, 0x32, 0xb2, 0x35, 0xc6, 0x60, + 0xd7, 0x8c, 0xe4, 0xb7, 0x39, 0xdf, 0x85, 0x2f, 0x6b, 0xc7, 0x1d, 0x3d, 0x89, 0xb4, 0x6f, 0x44, + 0x9a, 0xc6, 0xb1, 0x08, 0xbd, 0x78, 0x4a, 0x5a, 0x3e, 0xdf, 0x4f, 0xf2, 0xcd, 0xcf, 0x3b, 0x8b, + 0xc9, 0x92, 0x24, 0x14, 0x70, 0xbe, 0xe2, 0x68, 0x41, 0x62, 0x05, 0xe4, 0x85, 0x27, 0x0c, 0x33, + 0x9a, 0x50, 0xc5, 0x15, 0x9a, 0x4b, 0x01, 0xc2, 0x0f, 0x0c, 0x87, 0xf2, 0x15, 0xed, 0x70, 0xed, + 0x03, 0x26, 0x98, 0xd0, 0x10, 0xce, 0x77, 0x05, 0xdf, 0x3e, 0x2d, 0xf5, 0xce, 0x89, 0x24, 0x33, + 0xa3, 0x6d, 0xf7, 0x2c, 0xec, 0x89, 0xaf, 0x08, 0x70, 0x91, 0x28, 0x10, 0x92, 0x6e, 0xbf, 0x0c, + 0x7a, 0x62, 0xa1, 0xc0, 0x67, 0x54, 0x16, 0x9c, 0xde, 0x1a, 0x08, 0x97, 0x1e, 0x1b, 0xd1, 0x98, + 0x32, 0x02, 0x42, 0x8e, 0x25, 0x7d, 0x25, 0x32, 0x2a, 0x02, 0xc7, 0x59, 0xc5, 0x6b, 0x5d, 0x17, + 0x4d, 0x47, 0x40, 0x80, 0xfa, 0x17, 0x5e, 0xa3, 0xb8, 0x61, 0xe0, 0x76, 0xdc, 0x6e, 0xb3, 0xdf, + 0x41, 0x65, 0xcd, 0xd1, 0xbd, 0xe6, 0x06, 0xb5, 0xf5, 0xe7, 0x91, 0x33, 0x34, 0x29, 0xff, 0xc1, + 0xfb, 0x6f, 0x8e, 0xca, 0x8b, 0x5c, 0x8d, 0x82, 0x8a, 0xd6, 0x74, 0x6d, 0x8d, 0xd5, 0x14, 0xed, + 0x5e, 0xc0, 0xe8, 0x6c, 0x89, 0x3f, 0xf4, 0x5a, 0xdb, 0x02, 0xb9, 0xb4, 0xfa, 0x27, 0xa9, 0xe5, + 0xf0, 0xa7, 0xde, 0xe1, 0xef, 0x47, 0x19, 0xc7, 0x5c, 0x41, 0x50, 0xef, 0x54, 0xbb, 0xcd, 0x7e, + 0xaf, 0xbc, 0xf8, 0xe5, 0x4f, 0x6c, 0xa8, 0x53, 0xc6, 0xbe, 0x1f, 0xd9, 0xbf, 0xef, 0xb8, 0x82, + 0xdb, 0xda, 0xbf, 0xda, 0x5e, 0x7d, 0x70, 0xb3, 0x4e, 0x43, 0x77, 0x93, 0x86, 0xee, 0x57, 0x1a, + 0xba, 0xef, 0x59, 0xe8, 0x6c, 0xb2, 0xd0, 0xf9, 0xc8, 0x42, 0xe7, 0x11, 0x31, 0x0e, 0xcf, 0x8b, + 0x09, 0x9a, 0x8a, 0x99, 0x3d, 0xbb, 0x65, 0x1f, 0xaf, 0xac, 0x01, 0xc2, 0xdb, 0x9c, 0xaa, 0x49, + 0x43, 0x8f, 0xed, 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xc4, 0xa7, 0x53, 0xb8, 0x02, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/dualstaking/types/genesis_test.go b/x/dualstaking/types/genesis_test.go index 900ae7fe29..acdab8eeb6 100644 --- a/x/dualstaking/types/genesis_test.go +++ b/x/dualstaking/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/dualstaking/types" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/types/keys.go b/x/dualstaking/types/keys.go index 7f7fccd775..b8aaa80a3e 100644 --- a/x/dualstaking/types/keys.go +++ b/x/dualstaking/types/keys.go @@ -26,10 +26,6 @@ const ( // prefix for the unbonding timer store UnbondingPrefix = "unbonding-ts" - // empty provider consts - EMPTY_PROVIDER = "empty_provider" - EMPTY_PROVIDER_CHAINID = "" - // DisableDualstakingHooks prefix DisableDualstakingHookPrefix = "disable-dualstaking-hooks" diff --git a/x/dualstaking/types/message_claim_rewards.go b/x/dualstaking/types/message_claim_rewards.go index f47643bec9..2cbdc85b63 100644 --- a/x/dualstaking/types/message_claim_rewards.go +++ b/x/dualstaking/types/message_claim_rewards.go @@ -4,6 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) const TypeMsgClaimRewards = "claim_rewards" @@ -44,7 +45,7 @@ func (msg *MsgClaimRewards) ValidateBasic() error { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid delegator address (%s)", err) } - if msg.Provider != "" && msg.Provider != EMPTY_PROVIDER { + if msg.Provider != "" && msg.Provider != commontypes.EMPTY_PROVIDER { _, err = sdk.AccAddressFromBech32(msg.Provider) if err != nil { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid provider address (%s)", err) diff --git a/x/dualstaking/types/message_claim_rewards_test.go b/x/dualstaking/types/message_claim_rewards_test.go index 1cb10b1564..132e917b27 100644 --- a/x/dualstaking/types/message_claim_rewards_test.go +++ b/x/dualstaking/types/message_claim_rewards_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/dualstaking/types/message_delegate.go b/x/dualstaking/types/message_delegate.go index 2cf0ee0f67..b1a4083b20 100644 --- a/x/dualstaking/types/message_delegate.go +++ b/x/dualstaking/types/message_delegate.go @@ -4,6 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) const TypeMsgDelegate = "delegate" @@ -47,7 +48,7 @@ func (msg *MsgDelegate) ValidateBasic() error { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid delegator address (%s)", err) } - if msg.Provider != EMPTY_PROVIDER { + if msg.Provider != commontypes.EMPTY_PROVIDER { _, err = sdk.AccAddressFromBech32(msg.Provider) if err != nil { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid provider address (%s)", err) diff --git a/x/dualstaking/types/message_delegate_test.go b/x/dualstaking/types/message_delegate_test.go index 6e96938acb..717c01ee8a 100644 --- a/x/dualstaking/types/message_delegate_test.go +++ b/x/dualstaking/types/message_delegate_test.go @@ -5,7 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" + commontypes "github.com/lavanet/lava/v2/utils/common/types" "github.com/stretchr/testify/require" ) @@ -25,7 +26,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, @@ -36,7 +37,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: "invalid_address", Amount: oneCoin, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, @@ -47,7 +48,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, }, { @@ -57,7 +58,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidCoins, }, @@ -68,7 +69,7 @@ func TestMsgDelegate_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: "invalid_validator", - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, diff --git a/x/dualstaking/types/message_redelegate.go b/x/dualstaking/types/message_redelegate.go index ffd05e20c4..574987bc91 100644 --- a/x/dualstaking/types/message_redelegate.go +++ b/x/dualstaking/types/message_redelegate.go @@ -4,6 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) const TypeMsgRedelegate = "redelegate" @@ -48,14 +49,14 @@ func (msg *MsgRedelegate) ValidateBasic() error { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid delegator address (%s)", err) } - if msg.FromProvider != EMPTY_PROVIDER { + if msg.FromProvider != commontypes.EMPTY_PROVIDER { _, err = sdk.AccAddressFromBech32(msg.FromProvider) if err != nil { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid (from) provider address (%s)", err) } } - if msg.ToProvider != EMPTY_PROVIDER { + if msg.ToProvider != commontypes.EMPTY_PROVIDER { _, err = sdk.AccAddressFromBech32(msg.ToProvider) if err != nil { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid (to) provider address (%s)", err) diff --git a/x/dualstaking/types/message_redelegate_test.go b/x/dualstaking/types/message_redelegate_test.go index 53e5b1dc7d..cd8247bdc0 100644 --- a/x/dualstaking/types/message_redelegate_test.go +++ b/x/dualstaking/types/message_redelegate_test.go @@ -5,7 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" + commontypes "github.com/lavanet/lava/v2/utils/common/types" "github.com/stretchr/testify/require" ) @@ -24,8 +25,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: sample.AccAddress(), ToProvider: sample.AccAddress(), Amount: oneCoin, - FromChainID: EMPTY_PROVIDER_CHAINID, - ToChainID: EMPTY_PROVIDER_CHAINID, + FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, { @@ -35,8 +36,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: "invalid_address", ToProvider: sample.AccAddress(), Amount: oneCoin, - FromChainID: EMPTY_PROVIDER_CHAINID, - ToChainID: EMPTY_PROVIDER_CHAINID, + FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, { @@ -46,8 +47,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: sample.AccAddress(), ToProvider: sample.AccAddress(), Amount: oneCoin, - FromChainID: EMPTY_PROVIDER_CHAINID, - ToChainID: EMPTY_PROVIDER_CHAINID, + FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, }, { name: "invalid amount", @@ -56,8 +57,8 @@ func TestMsgRedelegate_ValidateBasic(t *testing.T) { FromProvider: sample.AccAddress(), ToProvider: sample.AccAddress(), Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, - FromChainID: EMPTY_PROVIDER_CHAINID, - ToChainID: EMPTY_PROVIDER_CHAINID, + FromChainID: commontypes.EMPTY_PROVIDER_CHAINID, + ToChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidCoins, }, diff --git a/x/dualstaking/types/message_unbond.go b/x/dualstaking/types/message_unbond.go index e48b8e45f7..e1adeccfd5 100644 --- a/x/dualstaking/types/message_unbond.go +++ b/x/dualstaking/types/message_unbond.go @@ -4,6 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) const TypeMsgUnbond = "unbond" @@ -47,7 +48,7 @@ func (msg *MsgUnbond) ValidateBasic() error { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid delegator address (%s)", err) } - if msg.Provider != EMPTY_PROVIDER { + if msg.Provider != commontypes.EMPTY_PROVIDER { _, err = sdk.AccAddressFromBech32(msg.Provider) if err != nil { return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid provider address (%s)", err) diff --git a/x/dualstaking/types/message_unbond_test.go b/x/dualstaking/types/message_unbond_test.go index 692c181a4c..6b7ccbc499 100644 --- a/x/dualstaking/types/message_unbond_test.go +++ b/x/dualstaking/types/message_unbond_test.go @@ -5,7 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" + commontypes "github.com/lavanet/lava/v2/utils/common/types" "github.com/stretchr/testify/require" ) @@ -25,7 +26,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, @@ -36,7 +37,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: "invalid_address", Amount: oneCoin, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, @@ -47,7 +48,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: "invalid_validator", - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidAddress, }, @@ -58,7 +59,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: oneCoin, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, }, { @@ -68,7 +69,7 @@ func TestMsgUnbond_ValidateBasic(t *testing.T) { Provider: sample.AccAddress(), Amount: sdk.Coin{Denom: "utest", Amount: sdk.NewInt(-1)}, Validator: validator, - ChainID: EMPTY_PROVIDER_CHAINID, + ChainID: commontypes.EMPTY_PROVIDER_CHAINID, }, err: legacyerrors.ErrInvalidCoins, }, diff --git a/x/dualstaking/types/params.go b/x/dualstaking/types/params.go index 7dfcf60193..19ae863a32 100644 --- a/x/dualstaking/types/params.go +++ b/x/dualstaking/types/params.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - commontypes "github.com/lavanet/lava/utils/common/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" "gopkg.in/yaml.v2" ) diff --git a/x/dualstaking/types/params.pb.go b/x/dualstaking/types/params.pb.go index 8f5a37f5c8..71a7909658 100644 --- a/x/dualstaking/types/params.pb.go +++ b/x/dualstaking/types/params.pb.go @@ -123,25 +123,25 @@ func init() { } var fileDescriptor_df864e1276b03c21 = []byte{ - // 281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbd, 0x6a, 0xf3, 0x30, - 0x14, 0x86, 0x2d, 0xbe, 0x10, 0xf8, 0xd4, 0x29, 0x69, 0x07, 0x37, 0x83, 0x12, 0x02, 0x85, 0x40, - 0x41, 0x22, 0xcd, 0xd6, 0x31, 0x6d, 0xe7, 0x96, 0x04, 0x3a, 0x74, 0x31, 0xc7, 0xb6, 0xe2, 0x88, - 0xca, 0x3a, 0xc6, 0x52, 0x4c, 0x7b, 0x17, 0x1d, 0x3b, 0xf6, 0x72, 0x32, 0x66, 0xec, 0x54, 0x8a, - 0x7d, 0x23, 0xc5, 0x76, 0x08, 0xc9, 0xf4, 0xea, 0xe7, 0x39, 0x0f, 0x9c, 0x97, 0x5e, 0x69, 0x28, - 0xc0, 0x48, 0x27, 0xea, 0x14, 0xf1, 0x06, 0xb4, 0x75, 0xf0, 0xaa, 0x4c, 0x22, 0x32, 0xc8, 0x21, - 0xb5, 0x3c, 0xcb, 0xd1, 0x61, 0xdf, 0xdf, 0x63, 0xbc, 0x4e, 0x7e, 0x84, 0x0d, 0x2e, 0x12, 0x4c, - 0xb0, 0x81, 0x44, 0x7d, 0x6a, 0xf9, 0x01, 0x8b, 0xd0, 0xa6, 0x68, 0x45, 0x08, 0x56, 0x8a, 0x62, - 0x1a, 0x4a, 0x07, 0x53, 0x11, 0xa1, 0x32, 0xed, 0xff, 0x38, 0xa0, 0xdd, 0xa7, 0xc6, 0xdf, 0x7f, - 0xa4, 0xe7, 0xa9, 0x32, 0x81, 0x95, 0x7a, 0x15, 0xc4, 0x52, 0xcb, 0x04, 0x9c, 0x42, 0xe3, 0x93, - 0x11, 0x99, 0x9c, 0xdd, 0x5c, 0xf2, 0xd6, 0xc3, 0x6b, 0x0f, 0xdf, 0x7b, 0xf8, 0x1d, 0x2a, 0x33, - 0xef, 0x6c, 0x7f, 0x86, 0xde, 0xa2, 0x97, 0x2a, 0xb3, 0x94, 0x7a, 0x75, 0x7f, 0x98, 0xbc, 0xed, - 0x7c, 0x7e, 0x0d, 0xbd, 0xf1, 0x8c, 0xf6, 0x96, 0x1a, 0xec, 0x5a, 0xc6, 0xcf, 0xa0, 0x55, 0x0c, - 0x0e, 0x73, 0xdb, 0x67, 0x94, 0x16, 0x87, 0x9b, 0x4f, 0x46, 0xff, 0x26, 0xff, 0x17, 0x47, 0x2f, - 0xf3, 0x87, 0x6d, 0xc9, 0xc8, 0xae, 0x64, 0xe4, 0xb7, 0x64, 0xe4, 0xa3, 0x62, 0xde, 0xae, 0x62, - 0xde, 0x77, 0xc5, 0xbc, 0x97, 0xeb, 0x44, 0xb9, 0xf5, 0x26, 0xe4, 0x11, 0xa6, 0xe2, 0xa4, 0xb1, - 0xb7, 0x93, 0xce, 0xdc, 0x7b, 0x26, 0x6d, 0xd8, 0x6d, 0x76, 0x9c, 0xfd, 0x05, 0x00, 0x00, 0xff, - 0xff, 0x32, 0x79, 0xe1, 0x4c, 0x5c, 0x01, 0x00, 0x00, + // 283 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbd, 0x6e, 0xf2, 0x30, + 0x14, 0x86, 0x63, 0x7d, 0x08, 0xe9, 0x73, 0x27, 0x68, 0x87, 0x94, 0xc1, 0x20, 0xa4, 0x4a, 0x4c, + 0xb6, 0x80, 0xad, 0x23, 0xed, 0xd0, 0xad, 0x15, 0x48, 0x1d, 0xba, 0x44, 0x27, 0x89, 0x09, 0x56, + 0x1d, 0x9f, 0x28, 0x36, 0x51, 0x7b, 0x17, 0x1d, 0x3b, 0xf6, 0x72, 0x18, 0x19, 0x3b, 0x55, 0x55, + 0x72, 0x23, 0x55, 0x12, 0x84, 0x60, 0x7a, 0xfd, 0xf3, 0x9c, 0x47, 0x3a, 0x2f, 0xbd, 0xd1, 0x50, + 0x80, 0x91, 0x4e, 0xd4, 0x29, 0xe2, 0x2d, 0x68, 0xeb, 0xe0, 0x55, 0x99, 0x44, 0x64, 0x90, 0x43, + 0x6a, 0x79, 0x96, 0xa3, 0xc3, 0xbe, 0x7f, 0xc0, 0x78, 0x9d, 0xfc, 0x04, 0x1b, 0x5c, 0x25, 0x98, + 0x60, 0x03, 0x89, 0xfa, 0xd4, 0xf2, 0x03, 0x16, 0xa1, 0x4d, 0xd1, 0x8a, 0x10, 0xac, 0x14, 0xc5, + 0x34, 0x94, 0x0e, 0xa6, 0x22, 0x42, 0x65, 0xda, 0xff, 0x71, 0x40, 0xbb, 0x4f, 0x8d, 0xbf, 0xff, + 0x48, 0x2f, 0x53, 0x65, 0x02, 0x2b, 0xf5, 0x3a, 0x88, 0xa5, 0x96, 0x09, 0x38, 0x85, 0xc6, 0x27, + 0x23, 0x32, 0xb9, 0x98, 0x5d, 0xf3, 0xd6, 0xc3, 0x6b, 0x0f, 0x3f, 0x78, 0xf8, 0x1d, 0x2a, 0xb3, + 0xe8, 0xec, 0x7e, 0x86, 0xde, 0xb2, 0x97, 0x2a, 0xb3, 0x92, 0x7a, 0x7d, 0x7f, 0x9c, 0xbc, 0xed, + 0x7c, 0x7e, 0x0d, 0xbd, 0xf1, 0x9c, 0xf6, 0x56, 0x1a, 0xec, 0x46, 0xc6, 0xcf, 0xa0, 0x55, 0x0c, + 0x0e, 0x73, 0xdb, 0x67, 0x94, 0x16, 0xc7, 0x9b, 0x4f, 0x46, 0xff, 0x26, 0xff, 0x97, 0x27, 0x2f, + 0x8b, 0x87, 0x5d, 0xc9, 0xc8, 0xbe, 0x64, 0xe4, 0xb7, 0x64, 0xe4, 0xa3, 0x62, 0xde, 0xbe, 0x62, + 0xde, 0x77, 0xc5, 0xbc, 0x17, 0x9e, 0x28, 0xb7, 0xd9, 0x86, 0x3c, 0xc2, 0x54, 0x9c, 0x35, 0x56, + 0xcc, 0xc4, 0xdb, 0x59, 0x6d, 0xee, 0x3d, 0x93, 0x36, 0xec, 0x36, 0x6b, 0xce, 0xff, 0x02, 0x00, + 0x00, 0xff, 0xff, 0xbe, 0x6a, 0x80, 0x15, 0x5f, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/dualstaking/types/query.pb.go b/x/dualstaking/types/query.pb.go index 939af107fb..eb52d6779e 100644 --- a/x/dualstaking/types/query.pb.go +++ b/x/dualstaking/types/query.pb.go @@ -488,51 +488,52 @@ func init() { } var fileDescriptor_8393eed0cfbc46b2 = []byte{ - // 695 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x41, 0x4f, 0x13, 0x41, - 0x14, 0xee, 0x14, 0x2d, 0x30, 0xf5, 0x60, 0x06, 0x0e, 0xa5, 0xc1, 0xa5, 0x6e, 0x30, 0x36, 0x2a, - 0x3b, 0x82, 0x89, 0x82, 0x26, 0x46, 0x11, 0x0f, 0x24, 0x12, 0xb1, 0x09, 0x17, 0x2f, 0xcd, 0xb4, - 0x3b, 0x2e, 0x13, 0xda, 0x99, 0x65, 0x67, 0x0a, 0x12, 0xc2, 0xc5, 0x3f, 0xa0, 0x09, 0xff, 0xc2, - 0x9b, 0xff, 0x82, 0x44, 0x0f, 0x24, 0x5e, 0x8c, 0x07, 0x35, 0xe0, 0x0f, 0x31, 0x3b, 0x3b, 0x5b, - 0x77, 0x81, 0x65, 0x8b, 0x89, 0xa7, 0xe9, 0xbe, 0xf9, 0xde, 0xfb, 0xde, 0xf7, 0x5e, 0xbe, 0x29, - 0x9c, 0xee, 0x90, 0x2d, 0xc2, 0xa9, 0xc2, 0xe1, 0x89, 0xdd, 0x1e, 0xe9, 0x48, 0x45, 0x36, 0x18, - 0xf7, 0xf0, 0x66, 0x8f, 0x06, 0x3b, 0x8e, 0x1f, 0x08, 0x25, 0x50, 0xc5, 0xa0, 0x9c, 0xf0, 0x74, - 0x12, 0xa8, 0xea, 0xb8, 0x27, 0x3c, 0xa1, 0x41, 0x38, 0xfc, 0x15, 0xe1, 0xab, 0x93, 0x9e, 0x10, - 0x5e, 0x87, 0x62, 0xe2, 0x33, 0x4c, 0x38, 0x17, 0x8a, 0x28, 0x26, 0xb8, 0x34, 0xb7, 0xb7, 0xda, - 0x42, 0x76, 0x85, 0xc4, 0x2d, 0x22, 0x69, 0x44, 0x83, 0xb7, 0x66, 0x5b, 0x54, 0x91, 0x59, 0xec, - 0x13, 0x8f, 0x71, 0x0d, 0x36, 0xd8, 0x1b, 0x99, 0xfd, 0xf9, 0x24, 0x20, 0xdd, 0xb8, 0xe4, 0xcd, - 0x4c, 0x98, 0x4b, 0x3b, 0xd4, 0x23, 0x8a, 0x1a, 0xa0, 0x95, 0xe4, 0x8e, 0x59, 0xdb, 0x82, 0x19, - 0x3e, 0x7b, 0x1c, 0xa2, 0x57, 0x61, 0x47, 0xab, 0xba, 0x7a, 0x83, 0x6e, 0xf6, 0xa8, 0x54, 0xf6, - 0x1a, 0x1c, 0x4b, 0x45, 0xa5, 0x2f, 0xb8, 0xa4, 0xe8, 0x31, 0x2c, 0x45, 0x5d, 0x54, 0x40, 0x0d, - 0xd4, 0xcb, 0x73, 0x35, 0x27, 0x6b, 0x4e, 0x4e, 0x94, 0xb9, 0x78, 0xe9, 0xe0, 0xc7, 0x54, 0xa1, - 0x61, 0xb2, 0x6c, 0x02, 0x2d, 0x5d, 0x76, 0x29, 0xea, 0x51, 0x04, 0xab, 0x81, 0xd8, 0x62, 0x2e, - 0x0d, 0x62, 0x62, 0x34, 0x09, 0x47, 0xdd, 0xf8, 0x52, 0x93, 0x8c, 0x36, 0xfe, 0x06, 0xd0, 0x75, - 0x78, 0x65, 0x9b, 0xa9, 0xf5, 0xa6, 0x4f, 0xb9, 0xcb, 0xb8, 0x57, 0x29, 0xd6, 0x40, 0x7d, 0xa4, - 0x51, 0x0e, 0x63, 0xab, 0x51, 0xc8, 0x16, 0x70, 0x2a, 0x93, 0xc2, 0xa8, 0x78, 0x01, 0xcb, 0xa6, - 0x64, 0xb8, 0xa3, 0x0a, 0xa8, 0x0d, 0xd5, 0xcb, 0x73, 0xd3, 0xd9, 0x52, 0x96, 0xfa, 0x60, 0x23, - 0x27, 0x99, 0x6e, 0x37, 0x8d, 0xa6, 0x98, 0xa7, 0x4f, 0xdc, 0xd7, 0x54, 0x85, 0x23, 0xbe, 0xb9, - 0x34, 0x92, 0xfa, 0xdf, 0x17, 0x51, 0x74, 0x16, 0xc1, 0x7f, 0x51, 0x24, 0xe1, 0x64, 0x7a, 0x84, - 0x0d, 0xba, 0x4d, 0x02, 0x77, 0xc0, 0x1d, 0x25, 0xd5, 0x16, 0x4f, 0xa8, 0x9d, 0x80, 0x23, 0xed, - 0x75, 0xc2, 0x78, 0x93, 0xb9, 0x95, 0x21, 0x7d, 0x37, 0xac, 0xbf, 0x97, 0x5d, 0x9b, 0xc3, 0x6b, - 0x19, 0xa4, 0x46, 0xe3, 0x0a, 0x1c, 0x0e, 0xa2, 0x90, 0xd1, 0x37, 0x93, 0xab, 0x2f, 0x2e, 0xb2, - 0xcc, 0xdf, 0x08, 0x23, 0x34, 0xae, 0x61, 0x7f, 0x02, 0x70, 0xec, 0x0c, 0xd8, 0xb9, 0xcb, 0x4a, - 0xb6, 0x5f, 0x4c, 0xb5, 0x8f, 0xda, 0xb0, 0x44, 0xba, 0xa2, 0xc7, 0x55, 0x65, 0x48, 0x37, 0x37, - 0xe1, 0x44, 0xbe, 0x73, 0x42, 0xdf, 0x39, 0xc6, 0x77, 0xce, 0x33, 0xc1, 0xf8, 0xe2, 0xdd, 0xb0, - 0x91, 0x8f, 0x3f, 0xa7, 0xea, 0x1e, 0x53, 0xeb, 0xbd, 0x96, 0xd3, 0x16, 0x5d, 0x6c, 0x4c, 0x1a, - 0x1d, 0x33, 0xd2, 0xdd, 0xc0, 0x6a, 0xc7, 0xa7, 0x52, 0x27, 0xc8, 0x86, 0x29, 0x3d, 0xb7, 0x5f, - 0x82, 0x97, 0xf5, 0x90, 0xd0, 0x7b, 0x00, 0x4b, 0x91, 0xc3, 0xd0, 0x9d, 0xec, 0x31, 0x9c, 0x36, - 0x76, 0x75, 0x66, 0x40, 0x74, 0x34, 0x74, 0xbb, 0xfe, 0xee, 0xeb, 0xef, 0xfd, 0xa2, 0x8d, 0x6a, - 0x38, 0xe7, 0x59, 0x42, 0x5f, 0x00, 0x44, 0xa7, 0x3d, 0x87, 0xe6, 0x73, 0xf8, 0x32, 0x5f, 0x82, - 0xea, 0xc2, 0x3f, 0x64, 0x9a, 0xae, 0x9f, 0xea, 0xae, 0x1f, 0xa1, 0x05, 0x9c, 0xf7, 0x4a, 0x8a, - 0xa0, 0x19, 0x6f, 0x57, 0xe2, 0xdd, 0x7e, 0x70, 0x0f, 0x7d, 0x06, 0x10, 0x9d, 0x36, 0x5c, 0xae, - 0x9c, 0xcc, 0x47, 0x20, 0x57, 0x4e, 0xb6, 0xbb, 0xed, 0x27, 0x5a, 0xce, 0x43, 0x34, 0x7f, 0xce, - 0x12, 0x4c, 0x76, 0xb3, 0x2f, 0x41, 0xe2, 0xdd, 0x38, 0xb8, 0x87, 0xbe, 0x03, 0x78, 0xf5, 0xa4, - 0xb1, 0xd0, 0xfd, 0x41, 0x07, 0x9c, 0xb6, 0x7f, 0xf5, 0xc1, 0x85, 0xf3, 0x8c, 0x8e, 0x35, 0xad, - 0xe3, 0x25, 0x5a, 0x19, 0x64, 0x2d, 0xc6, 0xa7, 0xc9, 0xa5, 0x24, 0x14, 0xe1, 0xdd, 0xd8, 0x88, - 0x7b, 0x8b, 0xcf, 0x0f, 0x8e, 0x2c, 0x70, 0x78, 0x64, 0x81, 0x5f, 0x47, 0x16, 0xf8, 0x70, 0x6c, - 0x15, 0x0e, 0x8f, 0xad, 0xc2, 0xb7, 0x63, 0xab, 0xf0, 0xfa, 0x76, 0xc2, 0x61, 0x29, 0xca, 0xb7, - 0x29, 0x52, 0x6d, 0xb5, 0x56, 0x49, 0xff, 0x1f, 0xde, 0xfb, 0x13, 0x00, 0x00, 0xff, 0xff, 0x87, - 0xee, 0x91, 0xfe, 0x21, 0x08, 0x00, 0x00, + // 720 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xc7, 0x3b, 0x45, 0x0b, 0x4c, 0x3d, 0x98, 0x81, 0x43, 0x69, 0x70, 0xa9, 0x1b, 0x8c, 0x8d, + 0x91, 0x1d, 0xa9, 0x89, 0x80, 0x26, 0xfe, 0x40, 0x0e, 0x92, 0x40, 0xc4, 0x26, 0x5c, 0xbc, 0x34, + 0xd3, 0xee, 0xb8, 0x4c, 0x68, 0x67, 0x96, 0x9d, 0x69, 0x91, 0x10, 0x2e, 0xfe, 0x03, 0x9a, 0xf8, + 0x5f, 0x78, 0xf3, 0xbf, 0x20, 0xd1, 0x03, 0x89, 0x17, 0xe3, 0x01, 0x0d, 0xf8, 0x87, 0x98, 0x9d, + 0x9d, 0xad, 0x5b, 0x60, 0x69, 0x21, 0xd1, 0xd3, 0xd2, 0x37, 0xef, 0xbd, 0xef, 0xfb, 0xcc, 0xcb, + 0x77, 0x80, 0xd3, 0x4d, 0xd2, 0x21, 0x9c, 0x2a, 0x1c, 0x7e, 0xb1, 0xdb, 0x26, 0x4d, 0xa9, 0xc8, + 0x26, 0xe3, 0x1e, 0xde, 0x6a, 0xd3, 0x60, 0xc7, 0xf1, 0x03, 0xa1, 0x04, 0x2a, 0x98, 0x2c, 0x27, + 0xfc, 0x3a, 0x89, 0xac, 0xe2, 0xb8, 0x27, 0x3c, 0xa1, 0x93, 0x70, 0xf8, 0x57, 0x94, 0x5f, 0x9c, + 0xf4, 0x84, 0xf0, 0x9a, 0x14, 0x13, 0x9f, 0x61, 0xc2, 0xb9, 0x50, 0x44, 0x31, 0xc1, 0xa5, 0x39, + 0xbd, 0xd3, 0x10, 0xb2, 0x25, 0x24, 0xae, 0x13, 0x49, 0x23, 0x19, 0xdc, 0x99, 0xad, 0x53, 0x45, + 0x66, 0xb1, 0x4f, 0x3c, 0xc6, 0x75, 0xb2, 0xc9, 0xbd, 0x95, 0x3a, 0x9f, 0x4f, 0x02, 0xd2, 0x8a, + 0x5b, 0xde, 0x4e, 0x4d, 0x73, 0x69, 0x93, 0x7a, 0x44, 0x51, 0x93, 0x68, 0x25, 0xb5, 0x63, 0xd5, + 0x86, 0x60, 0x46, 0xcf, 0x1e, 0x87, 0xe8, 0x55, 0x38, 0xd1, 0x9a, 0xee, 0x5e, 0xa5, 0x5b, 0x6d, + 0x2a, 0x95, 0xbd, 0x0e, 0xc7, 0x7a, 0xa2, 0xd2, 0x17, 0x5c, 0x52, 0xf4, 0x18, 0xe6, 0xa2, 0x29, + 0x0a, 0xa0, 0x04, 0xca, 0xf9, 0x4a, 0xc9, 0x49, 0xbb, 0x27, 0x27, 0xaa, 0x5c, 0xbc, 0xb2, 0x7f, + 0x38, 0x95, 0xa9, 0x9a, 0x2a, 0x9b, 0x40, 0x4b, 0xb7, 0x5d, 0x8a, 0x66, 0x14, 0xc1, 0x5a, 0x20, + 0x3a, 0xcc, 0xa5, 0x41, 0x2c, 0x8c, 0x26, 0xe1, 0xa8, 0x1b, 0x1f, 0x6a, 0x91, 0xd1, 0xea, 0xdf, + 0x00, 0xba, 0x09, 0xaf, 0x6d, 0x33, 0xb5, 0x51, 0xf3, 0x29, 0x77, 0x19, 0xf7, 0x0a, 0xd9, 0x12, + 0x28, 0x8f, 0x54, 0xf3, 0x61, 0x6c, 0x2d, 0x0a, 0xd9, 0x02, 0x4e, 0xa5, 0x4a, 0x18, 0x8a, 0x15, + 0x98, 0x37, 0x2d, 0xc3, 0x1d, 0x15, 0x40, 0x69, 0xa8, 0x9c, 0xaf, 0x4c, 0xa7, 0xa3, 0x2c, 0x75, + 0x93, 0x0d, 0x4e, 0xb2, 0xdc, 0xae, 0x19, 0xa6, 0x58, 0xa7, 0x2b, 0xdc, 0x65, 0x2a, 0xc2, 0x11, + 0xdf, 0x1c, 0x1a, 0xa4, 0xee, 0xef, 0x8b, 0x10, 0x9d, 0x25, 0xf0, 0x4f, 0x88, 0x24, 0x9c, 0xec, + 0xbd, 0xc2, 0x2a, 0xdd, 0x26, 0x81, 0x3b, 0xe0, 0x8e, 0x92, 0xb4, 0xd9, 0x13, 0xb4, 0x13, 0x70, + 0xa4, 0xb1, 0x41, 0x18, 0xaf, 0x31, 0xb7, 0x30, 0xa4, 0xcf, 0x86, 0xf5, 0xef, 0x65, 0xd7, 0xe6, + 0xf0, 0x46, 0x8a, 0xa8, 0x61, 0x5c, 0x85, 0xc3, 0x41, 0x14, 0x32, 0x7c, 0x33, 0x7d, 0xf9, 0xe2, + 0x26, 0xcb, 0xfc, 0x8d, 0x30, 0xa0, 0x71, 0x0f, 0xfb, 0x33, 0x80, 0x63, 0x67, 0xa4, 0x9d, 0xbb, + 0xac, 0xe4, 0xf8, 0xd9, 0x9e, 0xf1, 0x51, 0x03, 0xe6, 0x48, 0x4b, 0xb4, 0xb9, 0x2a, 0x0c, 0xe9, + 0xe1, 0x26, 0x9c, 0xc8, 0x77, 0x4e, 0xe8, 0x3b, 0xc7, 0xf8, 0xce, 0x79, 0x2e, 0x18, 0x5f, 0xbc, + 0x17, 0x0e, 0xf2, 0xe9, 0xe7, 0x54, 0xd9, 0x63, 0x6a, 0xa3, 0x5d, 0x77, 0x1a, 0xa2, 0x85, 0x8d, + 0x49, 0xa3, 0xcf, 0x8c, 0x74, 0x37, 0xb1, 0xda, 0xf1, 0xa9, 0xd4, 0x05, 0xb2, 0x6a, 0x5a, 0x57, + 0x0e, 0x87, 0xe1, 0x55, 0x7d, 0x49, 0xe8, 0x3d, 0x80, 0xb9, 0xc8, 0x61, 0xe8, 0x6e, 0xfa, 0x35, + 0x9c, 0x36, 0x76, 0x71, 0x66, 0xc0, 0xec, 0xe8, 0xd2, 0xed, 0xf2, 0xbb, 0x6f, 0xbf, 0x3f, 0x66, + 0x6d, 0x54, 0xc2, 0x7d, 0x9e, 0x25, 0xf4, 0x15, 0x40, 0x74, 0xda, 0x73, 0x68, 0xbe, 0x8f, 0x5e, + 0xea, 0x4b, 0x50, 0x5c, 0xb8, 0x44, 0xa5, 0x99, 0xfa, 0x99, 0x9e, 0xfa, 0x11, 0x5a, 0xc0, 0xfd, + 0x5e, 0x49, 0x11, 0xd4, 0xe2, 0xed, 0x4a, 0xbc, 0xdb, 0x0d, 0xee, 0xa1, 0x2f, 0x00, 0xa2, 0xd3, + 0x86, 0xeb, 0x8b, 0x93, 0xfa, 0x08, 0xf4, 0xc5, 0x49, 0x77, 0xb7, 0xfd, 0x54, 0xe3, 0x3c, 0x44, + 0xf3, 0xe7, 0x2c, 0xc1, 0x54, 0xd7, 0xba, 0x08, 0x12, 0xef, 0xc6, 0xc1, 0x3d, 0xf4, 0x03, 0xc0, + 0xeb, 0x27, 0x8d, 0x85, 0x1e, 0x0c, 0x7a, 0xc1, 0xbd, 0xf6, 0x2f, 0xce, 0x5d, 0xb8, 0xce, 0x70, + 0xac, 0x6b, 0x8e, 0x97, 0x68, 0x75, 0x90, 0xb5, 0x18, 0x9f, 0x26, 0x97, 0x92, 0x20, 0xc2, 0xbb, + 0xb1, 0x11, 0xf7, 0xd0, 0x3e, 0x80, 0xe3, 0x27, 0x35, 0x57, 0x98, 0x54, 0xff, 0x1f, 0xf0, 0x89, + 0x06, 0x5c, 0x40, 0x73, 0x97, 0x04, 0x5c, 0x7c, 0xb1, 0x7f, 0x64, 0x81, 0x83, 0x23, 0x0b, 0xfc, + 0x3a, 0xb2, 0xc0, 0x87, 0x63, 0x2b, 0x73, 0x70, 0x6c, 0x65, 0xbe, 0x1f, 0x5b, 0x99, 0xd7, 0x4e, + 0xe2, 0xb1, 0xe8, 0x69, 0xde, 0xa9, 0xe0, 0xb7, 0x3d, 0x0a, 0xfa, 0xe1, 0xa8, 0xe7, 0xf4, 0x7f, + 0xf7, 0xfb, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x28, 0x8d, 0x35, 0xed, 0xef, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -555,6 +556,8 @@ type QueryClient interface { ProviderDelegators(ctx context.Context, in *QueryProviderDelegatorsRequest, opts ...grpc.CallOption) (*QueryProviderDelegatorsResponse, error) // Queries a the unclaimed rewards of a delegator. DelegatorRewards(ctx context.Context, in *QueryDelegatorRewardsRequest, opts ...grpc.CallOption) (*QueryDelegatorRewardsResponse, error) + // Queries a the unclaimed rewards of a delegator. + DelegatorRewardsList(ctx context.Context, in *QueryDelegatorRewardsRequest, opts ...grpc.CallOption) (*QueryDelegatorRewardsResponse, error) } type queryClient struct { @@ -601,6 +604,15 @@ func (c *queryClient) DelegatorRewards(ctx context.Context, in *QueryDelegatorRe return out, nil } +func (c *queryClient) DelegatorRewardsList(ctx context.Context, in *QueryDelegatorRewardsRequest, opts ...grpc.CallOption) (*QueryDelegatorRewardsResponse, error) { + out := new(QueryDelegatorRewardsResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.dualstaking.Query/DelegatorRewardsList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -611,6 +623,8 @@ type QueryServer interface { ProviderDelegators(context.Context, *QueryProviderDelegatorsRequest) (*QueryProviderDelegatorsResponse, error) // Queries a the unclaimed rewards of a delegator. DelegatorRewards(context.Context, *QueryDelegatorRewardsRequest) (*QueryDelegatorRewardsResponse, error) + // Queries a the unclaimed rewards of a delegator. + DelegatorRewardsList(context.Context, *QueryDelegatorRewardsRequest) (*QueryDelegatorRewardsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -629,6 +643,9 @@ func (*UnimplementedQueryServer) ProviderDelegators(ctx context.Context, req *Qu func (*UnimplementedQueryServer) DelegatorRewards(ctx context.Context, req *QueryDelegatorRewardsRequest) (*QueryDelegatorRewardsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DelegatorRewards not implemented") } +func (*UnimplementedQueryServer) DelegatorRewardsList(ctx context.Context, req *QueryDelegatorRewardsRequest) (*QueryDelegatorRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorRewardsList not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -706,6 +723,24 @@ func _Query_DelegatorRewards_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_DelegatorRewardsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DelegatorRewardsList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.dualstaking.Query/DelegatorRewardsList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegatorRewardsList(ctx, req.(*QueryDelegatorRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "lavanet.lava.dualstaking.Query", HandlerType: (*QueryServer)(nil), @@ -726,6 +761,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "DelegatorRewards", Handler: _Query_DelegatorRewards_Handler, }, + { + MethodName: "DelegatorRewardsList", + Handler: _Query_DelegatorRewardsList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "lavanet/lava/dualstaking/query.proto", diff --git a/x/dualstaking/types/query.pb.gw.go b/x/dualstaking/types/query.pb.gw.go index 56b0831425..59002ca1fa 100644 --- a/x/dualstaking/types/query.pb.gw.go +++ b/x/dualstaking/types/query.pb.gw.go @@ -293,6 +293,78 @@ func local_request_Query_DelegatorRewards_0(ctx context.Context, marshaler runti } +var ( + filter_Query_DelegatorRewardsList_0 = &utilities.DoubleArray{Encoding: map[string]int{"delegator": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_DelegatorRewardsList_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator") + } + + protoReq.Delegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DelegatorRewardsList_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DelegatorRewardsList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DelegatorRewardsList_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator") + } + + protoReq.Delegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DelegatorRewardsList_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DelegatorRewardsList(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -391,6 +463,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DelegatorRewardsList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DelegatorRewardsList_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegatorRewardsList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -512,6 +607,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DelegatorRewardsList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DelegatorRewardsList_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegatorRewardsList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -523,6 +638,8 @@ var ( pattern_Query_ProviderDelegators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "dualstaking", "provider_delegators", "provider"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_DelegatorRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"lavanet", "lava", "dualstaking", "delegator_rewards", "delegator", "provider", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DelegatorRewardsList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "dualstaking", "delegator_rewards", "delegator"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -533,4 +650,6 @@ var ( forward_Query_ProviderDelegators_0 = runtime.ForwardResponseMessage forward_Query_DelegatorRewards_0 = runtime.ForwardResponseMessage + + forward_Query_DelegatorRewardsList_0 = runtime.ForwardResponseMessage ) diff --git a/x/dualstaking/types/tx.pb.go b/x/dualstaking/types/tx.pb.go index 222c3f54f9..7a0e44d73d 100644 --- a/x/dualstaking/types/tx.pb.go +++ b/x/dualstaking/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + _ "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" @@ -475,39 +476,43 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/dualstaking/tx.proto", fileDescriptor_29c4c178d368211c) } var fileDescriptor_29c4c178d368211c = []byte{ - // 509 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x94, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xc7, 0x63, 0x12, 0x42, 0x33, 0x69, 0x85, 0x70, 0xa9, 0xea, 0x5a, 0xe0, 0xb6, 0xa9, 0x10, - 0x45, 0x15, 0x6b, 0xa5, 0x1c, 0xb8, 0x37, 0x45, 0x88, 0x83, 0x25, 0x64, 0x89, 0x4b, 0x2f, 0x65, - 0x1d, 0x6f, 0xb7, 0x16, 0xb6, 0x27, 0xf2, 0x6e, 0x42, 0x79, 0x0b, 0xae, 0xbc, 0x06, 0xe2, 0x21, - 0x7a, 0xec, 0x91, 0x13, 0x42, 0xc9, 0x8d, 0xa7, 0x40, 0xfe, 0xda, 0x38, 0x41, 0x98, 0x70, 0xec, - 0x69, 0x77, 0x67, 0x7f, 0xf3, 0xf1, 0x9f, 0xfd, 0x80, 0xfd, 0x90, 0x4e, 0x68, 0xcc, 0xa4, 0x9d, - 0x8e, 0xb6, 0x3f, 0xa6, 0xa1, 0x90, 0xf4, 0x43, 0x10, 0x73, 0x5b, 0x5e, 0x91, 0x51, 0x82, 0x12, - 0x75, 0xa3, 0x40, 0x48, 0x3a, 0x92, 0x0a, 0x62, 0x5a, 0x43, 0x14, 0x11, 0x0a, 0xdb, 0xa3, 0x82, - 0xd9, 0x93, 0xbe, 0xc7, 0x24, 0xed, 0xdb, 0x43, 0x0c, 0xe2, 0xdc, 0xd3, 0x7c, 0xc8, 0x91, 0x63, - 0x36, 0xb5, 0xd3, 0x59, 0x6e, 0xed, 0x7d, 0xd3, 0xa0, 0xeb, 0x08, 0x7e, 0xca, 0x42, 0xc6, 0xa9, - 0x64, 0xba, 0x01, 0xf7, 0x86, 0x09, 0xa3, 0x12, 0x13, 0x43, 0xdb, 0xd3, 0x0e, 0x3b, 0x6e, 0xb9, - 0xd4, 0x1f, 0x41, 0x67, 0x42, 0xc3, 0xc0, 0xcf, 0xf6, 0xee, 0x66, 0x7b, 0x73, 0x83, 0x6e, 0xc2, - 0xda, 0x28, 0xc1, 0x49, 0xe0, 0xb3, 0xc4, 0xb8, 0x93, 0x6d, 0xaa, 0x75, 0x16, 0xf3, 0x92, 0x06, - 0xf1, 0x9b, 0x53, 0xa3, 0x59, 0xc4, 0xcc, 0x97, 0xfa, 0x4b, 0x68, 0xd3, 0x08, 0xc7, 0xb1, 0x34, - 0x5a, 0x7b, 0xda, 0x61, 0xf7, 0x78, 0x87, 0xe4, 0x22, 0x48, 0x2a, 0x82, 0x14, 0x22, 0xc8, 0x00, - 0x83, 0xf8, 0xa4, 0x75, 0xfd, 0x63, 0xb7, 0xe1, 0x16, 0x78, 0x6f, 0x0b, 0x36, 0x2b, 0x55, 0xbb, - 0x4c, 0x8c, 0x30, 0x16, 0xac, 0xf7, 0x4b, 0x83, 0x0d, 0x47, 0x70, 0x97, 0xf9, 0xff, 0xd6, 0x73, - 0x00, 0x1b, 0x17, 0x09, 0x46, 0xe7, 0x4b, 0x65, 0xaf, 0xa7, 0xc6, 0xb7, 0x65, 0xe9, 0xbb, 0xd0, - 0x95, 0x38, 0x47, 0xf2, 0xf2, 0x41, 0xa2, 0x02, 0xf6, 0x21, 0x73, 0x38, 0x2f, 0x05, 0xb6, 0x32, - 0xa2, 0x9b, 0xda, 0x06, 0x85, 0xc8, 0xc7, 0x00, 0x12, 0x15, 0x50, 0x74, 0x4e, 0xe2, 0xe0, 0x8f, - 0x1e, 0xb4, 0xff, 0xaf, 0x07, 0xdb, 0xb0, 0xb5, 0xa0, 0x55, 0x75, 0xe1, 0xab, 0x06, 0x1d, 0x47, - 0xf0, 0x77, 0xb1, 0x87, 0xb1, 0x7f, 0x5b, 0x4e, 0x74, 0x13, 0x1e, 0xa8, 0x9a, 0x95, 0x92, 0xd7, - 0x70, 0xdf, 0x11, 0x7c, 0x10, 0xd2, 0x20, 0x72, 0xd9, 0x47, 0x9a, 0xf8, 0xa2, 0x46, 0x4e, 0x4d, - 0xc1, 0xbd, 0x1d, 0xd8, 0x5e, 0x0a, 0x54, 0xe6, 0x38, 0xfe, 0xd2, 0x84, 0xa6, 0x23, 0xb8, 0xfe, - 0x1e, 0xd6, 0xd4, 0x2b, 0x78, 0x42, 0xfe, 0xf6, 0xcc, 0x48, 0xe5, 0xda, 0x99, 0xcf, 0x57, 0xc2, - 0xca, 0x4c, 0xfa, 0x05, 0x40, 0xe5, 0x66, 0x3e, 0xad, 0x75, 0x9e, 0x83, 0xa6, 0xbd, 0x22, 0xa8, - 0xf2, 0x9c, 0x41, 0xbb, 0x38, 0xfb, 0x83, 0x5a, 0xd7, 0x1c, 0x32, 0x8f, 0x56, 0x80, 0x54, 0xec, - 0x10, 0xd6, 0x17, 0x8e, 0xe3, 0x59, 0xad, 0x73, 0x15, 0x35, 0xfb, 0x2b, 0xa3, 0x65, 0xb6, 0x93, - 0x57, 0xd7, 0x53, 0x4b, 0xbb, 0x99, 0x5a, 0xda, 0xcf, 0xa9, 0xa5, 0x7d, 0x9e, 0x59, 0x8d, 0x9b, - 0x99, 0xd5, 0xf8, 0x3e, 0xb3, 0x1a, 0x67, 0x47, 0x3c, 0x90, 0x97, 0x63, 0x8f, 0x0c, 0x31, 0xb2, - 0x17, 0x7e, 0xcd, 0xab, 0xc5, 0x7f, 0xf3, 0xd3, 0x88, 0x09, 0xaf, 0x9d, 0xfd, 0x75, 0x2f, 0x7e, - 0x07, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xba, 0x8a, 0xf3, 0x60, 0x05, 0x00, 0x00, + // 564 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x94, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xc7, 0xe3, 0x26, 0xbf, 0xfc, 0x9a, 0x49, 0x2b, 0x54, 0xb7, 0x25, 0x8e, 0x0b, 0x6e, 0xea, + 0x0a, 0x51, 0x40, 0xec, 0x2a, 0xe1, 0x80, 0xd4, 0x63, 0xd3, 0x03, 0x1c, 0x22, 0xa1, 0x48, 0x5c, + 0x7a, 0x29, 0x9b, 0x78, 0xeb, 0x5a, 0xd8, 0x9e, 0xc8, 0xbb, 0x09, 0xe5, 0x09, 0x90, 0x38, 0x71, + 0xe5, 0x2d, 0x78, 0x8c, 0x4a, 0x1c, 0xe8, 0x91, 0x13, 0x42, 0xc9, 0x81, 0xd7, 0x40, 0xfe, 0x1b, + 0x27, 0x08, 0x13, 0x8e, 0x5c, 0x62, 0xef, 0xec, 0x77, 0x66, 0xfc, 0xf9, 0x66, 0x76, 0xe1, 0xc0, + 0x65, 0x13, 0xe6, 0x73, 0x49, 0xc3, 0x27, 0xb5, 0xc6, 0xcc, 0x15, 0x92, 0xbd, 0x76, 0x7c, 0x9b, + 0xca, 0x2b, 0x32, 0x0a, 0x50, 0xa2, 0xaa, 0x25, 0x12, 0x12, 0x3e, 0x49, 0x4e, 0xa2, 0x6f, 0x31, + 0xcf, 0xf1, 0x91, 0x46, 0xbf, 0xb1, 0x58, 0x37, 0x86, 0x28, 0x3c, 0x14, 0x74, 0xc0, 0x04, 0xa7, + 0x93, 0xf6, 0x80, 0x4b, 0xd6, 0xa6, 0x43, 0x74, 0xfc, 0x64, 0x7f, 0xc7, 0x46, 0x1b, 0xa3, 0x57, + 0x1a, 0xbe, 0xc5, 0x51, 0xf3, 0x8b, 0x02, 0xf5, 0x9e, 0xb0, 0x4f, 0xb9, 0xcb, 0x6d, 0x26, 0xb9, + 0xaa, 0xc1, 0xff, 0xc3, 0x80, 0x33, 0x89, 0x81, 0xa6, 0xb4, 0x94, 0xa3, 0x5a, 0x3f, 0x5d, 0xaa, + 0x77, 0xa0, 0x36, 0x61, 0xae, 0x63, 0x45, 0x7b, 0xff, 0x45, 0x7b, 0xf3, 0x80, 0xaa, 0xc3, 0xfa, + 0x28, 0xc0, 0x89, 0x63, 0xf1, 0x40, 0x5b, 0x8b, 0x36, 0xb3, 0x75, 0x54, 0xf3, 0x92, 0x39, 0xfe, + 0xf3, 0x53, 0xad, 0x9c, 0xd4, 0x8c, 0x97, 0xea, 0x53, 0xa8, 0x32, 0x0f, 0xc7, 0xbe, 0xd4, 0x2a, + 0x2d, 0xe5, 0xa8, 0xde, 0x69, 0x92, 0x18, 0x82, 0x84, 0x10, 0x24, 0x81, 0x20, 0x5d, 0x74, 0xfc, + 0x93, 0xca, 0xf5, 0xb7, 0xfd, 0x52, 0x3f, 0x91, 0x1f, 0x37, 0xdf, 0xff, 0xf8, 0xf4, 0x70, 0x27, + 0x6f, 0x5a, 0x4a, 0x60, 0xee, 0xc2, 0x76, 0x0e, 0xa8, 0xcf, 0xc5, 0x08, 0x7d, 0xc1, 0xcd, 0x77, + 0x6b, 0xb0, 0xd9, 0x13, 0x76, 0x9f, 0x5b, 0x7f, 0x46, 0x3d, 0x84, 0xcd, 0x8b, 0x00, 0xbd, 0xf3, + 0x25, 0xa2, 0x8d, 0x30, 0xf8, 0x22, 0xa5, 0xda, 0x87, 0xba, 0xc4, 0xb9, 0x24, 0x26, 0x03, 0x89, + 0x99, 0xe0, 0x00, 0xa2, 0x84, 0xf3, 0x94, 0xbd, 0x12, 0x29, 0xea, 0x61, 0xac, 0x9b, 0xf0, 0xdf, + 0x05, 0x90, 0x98, 0x09, 0x12, 0x53, 0x25, 0x76, 0x7f, 0xb1, 0xa7, 0xfa, 0x77, 0xf6, 0xec, 0x85, + 0xf6, 0xdc, 0xce, 0xdb, 0x33, 0xe7, 0x36, 0x1b, 0xb0, 0xbb, 0x60, 0x44, 0x66, 0xd1, 0x67, 0x05, + 0x6a, 0x3d, 0x61, 0xbf, 0xf4, 0x07, 0xe8, 0x5b, 0xff, 0xca, 0x24, 0x34, 0x42, 0x54, 0x35, 0x8f, + 0x1a, 0x7f, 0xbf, 0xb9, 0x0d, 0x5b, 0x19, 0x4c, 0x86, 0xe8, 0xc0, 0xad, 0x9e, 0xb0, 0xbb, 0x2e, + 0x73, 0xbc, 0x3e, 0x7f, 0xc3, 0x02, 0x4b, 0x14, 0x70, 0x16, 0x90, 0x1c, 0xb7, 0xc2, 0xb6, 0x7b, + 0xf9, 0xb6, 0x4b, 0x75, 0xcd, 0x26, 0x34, 0x96, 0x42, 0xe9, 0x57, 0x74, 0x3e, 0x96, 0xa1, 0xdc, + 0x13, 0xb6, 0xfa, 0x0a, 0xd6, 0xb3, 0x83, 0x77, 0x8f, 0xfc, 0xee, 0xb0, 0x93, 0xdc, 0x38, 0xeb, + 0x8f, 0x57, 0x92, 0xa5, 0x9d, 0xd4, 0x0b, 0x80, 0xdc, 0xc4, 0xdf, 0x2f, 0x4c, 0x9e, 0x0b, 0x75, + 0xba, 0xa2, 0x30, 0xeb, 0x73, 0x06, 0xd5, 0x64, 0x6c, 0x0e, 0x0b, 0x53, 0x63, 0x91, 0xfe, 0x68, + 0x05, 0x51, 0x56, 0xdb, 0x85, 0x8d, 0x85, 0x3f, 0xec, 0x41, 0x61, 0x72, 0x5e, 0xaa, 0xb7, 0x57, + 0x96, 0xa6, 0xdd, 0x4e, 0x9e, 0x5d, 0x4f, 0x0d, 0xe5, 0x66, 0x6a, 0x28, 0xdf, 0xa7, 0x86, 0xf2, + 0x61, 0x66, 0x94, 0x6e, 0x66, 0x46, 0xe9, 0xeb, 0xcc, 0x28, 0x9d, 0x11, 0xdb, 0x91, 0x97, 0xe3, + 0x01, 0x19, 0xa2, 0x47, 0x17, 0xee, 0xee, 0x49, 0x87, 0x5e, 0x2d, 0x5e, 0xe0, 0x6f, 0x47, 0x5c, + 0x0c, 0xaa, 0xd1, 0x0d, 0xfb, 0xe4, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x85, 0xe9, 0xf1, 0x9c, + 0xe9, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dualstaking/types/types.go b/x/dualstaking/types/types.go index a56dbb9765..d22e2ed3f3 100644 --- a/x/dualstaking/types/types.go +++ b/x/dualstaking/types/types.go @@ -9,6 +9,8 @@ const ( ValidatorSlashEventName = "validator_slash" FreezeFromUnbond = "freeze_from_unbond" UnstakeFromUnbond = "unstake_from_unbond" + ProviderRewardEventName = "provider_reward" + DelegatorRewardEventName = "delegator_reward" ) const ( diff --git a/x/epochstorage/README.md b/x/epochstorage/README.md index da0200f5a0..cab73a26ac 100644 --- a/x/epochstorage/README.md +++ b/x/epochstorage/README.md @@ -13,8 +13,8 @@ Note that the module will make sure that any changes will be applied only in the * [Epoch](#epoch) * [EpochDetails](#epochdetails) * [FixatedParams](#fixatedparams) - * [StakeStorage](#stakeStorage) * [StakeEntry](#stakeentry) + * [StakeEntry Storage](#stakeentry-storage) * [Parameters](#parameters) * [Queries](#queries) * [Transactions](#transactions) @@ -63,28 +63,6 @@ type FixatedParams struct { This is done in the [BeginBlock method of the module](keeper/fixated_params.go) - -### StakeStorage - -StakeStorage is an object that is saved on the store per epoch. it contains the list of all the providers that are available in this epoch per chainID. - -```go -type StakeStorage struct { - Index string // index of the stake storage (epoch + chainid) - StakeEntries []StakeEntry // list of providers stake - EpochBlockHash []byte // the block hash of the of the epoch block (used as salt for pairing) -} -``` - -The index of the stakestorage is constructed from the epoch and chainID, for example: "100 ETH1" - -When a provider stakes itself to a chain (using the pairing module) it will be in the providers list of the next epoch. the stake storage of the next epoch (e.g. current stakestorage) is where all the changes are registered. - -When a new epoch starts, the module will create a copy of the current stake and save it as a specific epoch stake storage. this is done in the BeginBlock method of the module. - -Also, when a new epoch starts the epoch storage will delete any outdated stakestorage (determined by the param EpochsToSave). -Note that if a stakestorage does not exist (either if it was deleted or it is in the future), verify pairing and relay payments will fail for the requested epoch (look at pairing readme). - ### StakeEntry The stake entry is a struct that contains all the information of a provider. @@ -93,7 +71,7 @@ The stake entry is a struct that contains all the information of a provider. type StakeEntry struct { Stake types.Coin // the providers stake amount (self delegation) Vault string // the lava address of the provider's vault which holds most of its funds - Operator string // the lava address of the provider's operator which is used to run and operate the provider process + Address string // the lava address of the provider is used to run and operate the provider process StakeAppliedBlock uint64 // the block at which the provider is included in the pairing list Endpoints []Endpoint // the endpoints of the provider Geolocation int32 // the geolocation this provider supports @@ -105,12 +83,24 @@ type StakeEntry struct { } ``` +The provider entity utilizes two different addresses: the operator address ("address" field in the StakeEntry protobuf) and the vault address. The operator address is used when running the provider process, while the vault address holds the provider's funds. This separation enhances security by allowing the user to store the vault address' private key on a different machine from the one running the visible provider process. + +Despite the provider being operated via the operator address, all rewards are directed to the vault address, which holds the provider's funds. Most provider-related transactions can be executed using the operator address, except for actions like staking/unstaking, changing delegation limit and commission, and claiming rewards. These actions can only be done by the vault address. + +It's important to note that the operator address is used for the pairing mechanism and relay payments. Also, note that specifying a vault address when staking a provider is optional. By default, the same address is used for both operating the provider and holding its funds. + Geolocation are bit flags that indicate all the geolocations that the provider supports, this is the sum of all endpoints geolocations. for more about [geolocation](../../proto/lavanet/lava/plans/plan.proto). For more information about delegation, go to dualstaking [README.md](../dualstaking/README.md). -For more information about the vault and operator addresses, see pairing module's [README.md](../pairing/README.md). +#### StakeEntry Storage + +Stake entries are kept in two dedicated KV stores. One store keeps the current stake entries and the other keeps past stake entries (by epoch). + +The current stake entries store is updated when a provider stakes itself to a chain (using the pairing module). This will make it be in the providers list of the next epoch. + +When a new epoch starts, the epochstorage module will create a copy of the current stake entries and save it in the past stake entries store with their matching epoch. Then, every outdated stake entry is deleted (determined by the param EpochsToSave). ### EndPoint diff --git a/x/epochstorage/client/cli/query.go b/x/epochstorage/client/cli/query.go index 8ab438f71e..9483fe52ba 100644 --- a/x/epochstorage/client/cli/query.go +++ b/x/epochstorage/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/epochstorage/client/cli/query_epoch_details.go b/x/epochstorage/client/cli/query_epoch_details.go index f949343354..5f82f0bc00 100644 --- a/x/epochstorage/client/cli/query_epoch_details.go +++ b/x/epochstorage/client/cli/query_epoch_details.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/query_epoch_details_test.go b/x/epochstorage/client/cli/query_epoch_details_test.go index a4b40e73c8..949df09cf9 100644 --- a/x/epochstorage/client/cli/query_epoch_details_test.go +++ b/x/epochstorage/client/cli/query_epoch_details_test.go @@ -9,10 +9,10 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc/status" - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/client/cli" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/testutil/network" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage/client/cli" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) func networkWithEpochDetailsObjects(t *testing.T) (*network.Network, types.EpochDetails) { diff --git a/x/epochstorage/client/cli/query_fixated_params.go b/x/epochstorage/client/cli/query_fixated_params.go index e6300c5f79..61f2dbf232 100644 --- a/x/epochstorage/client/cli/query_fixated_params.go +++ b/x/epochstorage/client/cli/query_fixated_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/query_fixated_params_test.go b/x/epochstorage/client/cli/query_fixated_params_test.go index 47234ec047..7f01f4d44f 100644 --- a/x/epochstorage/client/cli/query_fixated_params_test.go +++ b/x/epochstorage/client/cli/query_fixated_params_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/client/cli" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/testutil/network" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage/client/cli" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // Prevent strconv unused error @@ -152,7 +152,7 @@ func TestListFixatedParams(t *testing.T) { var resp types.QueryAllFixatedParamsResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)-4) + require.Equal(t, len(objs), int(resp.Pagination.Total)-2) require.ElementsMatch(t, nullify.Fill(objs), nullify.Fill(resp.FixatedParams), diff --git a/x/epochstorage/client/cli/query_params.go b/x/epochstorage/client/cli/query_params.go index 618e9c4f33..cb52965380 100644 --- a/x/epochstorage/client/cli/query_params.go +++ b/x/epochstorage/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/query_stake_storage.go b/x/epochstorage/client/cli/query_stake_storage.go index ae4d338348..aded4c7144 100644 --- a/x/epochstorage/client/cli/query_stake_storage.go +++ b/x/epochstorage/client/cli/query_stake_storage.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/spf13/cobra" ) diff --git a/x/epochstorage/client/cli/query_stake_storage_test.go b/x/epochstorage/client/cli/query_stake_storage_test.go deleted file mode 100644 index d1d4772340..0000000000 --- a/x/epochstorage/client/cli/query_stake_storage_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package cli_test - -import ( - "fmt" - "strconv" - "testing" - - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/client/cli" - "github.com/lavanet/lava/x/epochstorage/types" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -func networkWithStakeStorageObjects(t *testing.T, n int) (*network.Network, []types.StakeStorage) { - t.Helper() - cfg := network.DefaultConfig() - state := types.GenesisState{} - require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) - - for i := 0; i < n; i++ { - stakeStorage := types.StakeStorage{ - Index: strconv.Itoa(i), - } - nullify.Fill(&stakeStorage) - state.StakeStorageList = append(state.StakeStorageList, stakeStorage) - } - buf, err := cfg.Codec.MarshalJSON(&state) - require.NoError(t, err) - cfg.GenesisState[types.ModuleName] = buf - return network.New(t, cfg), state.StakeStorageList -} - -func TestShowStakeStorage(t *testing.T) { - net, objs := networkWithStakeStorageObjects(t, 2) - - ctx := net.Validators[0].ClientCtx - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - desc string - idIndex string - - args []string - err error - obj types.StakeStorage - }{ - { - desc: "found", - idIndex: objs[0].Index, - - args: common, - obj: objs[0], - }, - { - desc: "not found", - idIndex: strconv.Itoa(100000), - - args: common, - err: status.Error(codes.InvalidArgument, "not found"), - }, - } { - tc := tc - t.Run(tc.desc, func(t *testing.T) { - args := []string{ - tc.idIndex, - } - args = append(args, tc.args...) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowStakeStorage(), args) - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - var resp types.QueryGetStakeStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NotNil(t, resp.StakeStorage) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.StakeStorage), - ) - } - }) - } -} - -func TestListStakeStorage(t *testing.T) { - net, objs := networkWithStakeStorageObjects(t, 5) - - ctx := net.Validators[0].ClientCtx - request := func(next []byte, offset, limit uint64, total bool) []string { - args := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - if next == nil { - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) - } else { - args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) - } - args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) - if total { - args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) - } - return args - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(objs); i += step { - args := request(nil, uint64(i), uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListStakeStorage(), args) - require.NoError(t, err) - var resp types.QueryAllStakeStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.StakeStorage), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.StakeStorage), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(objs); i += step { - args := request(next, 0, uint64(step), false) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListStakeStorage(), args) - require.NoError(t, err) - var resp types.QueryAllStakeStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.LessOrEqual(t, len(resp.StakeStorage), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.StakeStorage), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - args := request(nil, 0, uint64(len(objs)), true) - out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListStakeStorage(), args) - require.NoError(t, err) - var resp types.QueryAllStakeStorageResponse - require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) - require.NoError(t, err) - require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.StakeStorage), - ) - }) -} diff --git a/x/epochstorage/client/cli/tx.go b/x/epochstorage/client/cli/tx.go index 57f7ea28ad..b51beda9c5 100644 --- a/x/epochstorage/client/cli/tx.go +++ b/x/epochstorage/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/epochstorage/genesis.go b/x/epochstorage/genesis.go index aa26ac5567..02716bfd49 100644 --- a/x/epochstorage/genesis.go +++ b/x/epochstorage/genesis.go @@ -1,9 +1,12 @@ package epochstorage import ( + "strconv" + + "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // InitGenesis initializes the capability module's state from a provided genesis @@ -11,8 +14,19 @@ import ( func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { // Set all the stakeStorage for _, elem := range genState.StakeStorageList { - k.SetStakeStorage(ctx, elem) + for _, entry := range elem.StakeEntries { + if elem.Index != "" { + epoch, err := strconv.ParseUint(elem.Index, 10, 64) + if err != nil { + panic(errors.Wrapf(err, "failed InitGenesis of epochstorage")) + } + k.SetStakeEntry(ctx, epoch, entry) + } else { + k.SetStakeEntryCurrent(ctx, entry) + } + } } + // Set if defined if genState.EpochDetails != nil { k.SetEpochDetails(ctx, *genState.EpochDetails) @@ -30,7 +44,9 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - genesis.StakeStorageList = k.GetAllStakeStorage(ctx) + // get all stake entries + genesis.StakeStorageList = k.GetAllStakeEntriesForGenesis(ctx) + // Get all epochDetails epochDetails, found := k.GetEpochDetails(ctx) if found { diff --git a/x/epochstorage/genesis_test.go b/x/epochstorage/genesis_test.go index d2142a26c2..b3475479c4 100644 --- a/x/epochstorage/genesis_test.go +++ b/x/epochstorage/genesis_test.go @@ -3,10 +3,10 @@ package epochstorage_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage" - "github.com/lavanet/lava/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/handler.go b/x/epochstorage/handler.go index 54db081f01..319a13b38d 100644 --- a/x/epochstorage/handler.go +++ b/x/epochstorage/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // NewHandler ... diff --git a/x/epochstorage/keeper/epoch_details.go b/x/epochstorage/keeper/epoch_details.go index 4439afbc4e..524ad6093c 100644 --- a/x/epochstorage/keeper/epoch_details.go +++ b/x/epochstorage/keeper/epoch_details.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // SetEpochDetails set epochDetails in the store diff --git a/x/epochstorage/keeper/epoch_details_test.go b/x/epochstorage/keeper/epoch_details_test.go index 238ac7e569..c35e20abb0 100644 --- a/x/epochstorage/keeper/epoch_details_test.go +++ b/x/epochstorage/keeper/epoch_details_test.go @@ -6,10 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) func createTestEpochDetails(keeper *keeper.Keeper, ctx sdk.Context) types.EpochDetails { diff --git a/x/epochstorage/keeper/epoch_start.go b/x/epochstorage/keeper/epoch_start.go index b8a39f29ee..0ea2fdb764 100644 --- a/x/epochstorage/keeper/epoch_start.go +++ b/x/epochstorage/keeper/epoch_start.go @@ -1,13 +1,18 @@ package keeper import ( + "fmt" + "strconv" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // Function that calls all the functions that are supposed to run in epoch start func (k Keeper) EpochStart(ctx sdk.Context) { block := uint64(ctx.BlockHeight()) - + k.SetEpochHash(ctx) // save params for this epoch k.FixateParams(ctx, block) @@ -20,9 +25,96 @@ func (k Keeper) EpochStart(ctx sdk.Context) { k.SetEpochDetailsStart(ctx, block) - k.StoreCurrentEpochStakeStorage(ctx, block) + k.StoreCurrentStakeEntries(ctx, block) k.UpdateEarliestEpochstart(ctx) k.RemoveOldEpochData(ctx) } + +// StoreCurrentStakeEntries store the current stake entries in the epoch-prefixed stake entries store +func (k Keeper) StoreCurrentStakeEntries(ctx sdk.Context, epoch uint64) { + entries := k.GetAllStakeEntriesCurrent(ctx) + for _, entry := range entries { + k.SetStakeEntry(ctx, epoch, entry) + } +} + +func (k *Keeper) UpdateEarliestEpochstart(ctx sdk.Context) { + currentBlock := uint64(ctx.BlockHeight()) + earliestEpochBlock := k.GetEarliestEpochStart(ctx) + + // we take the epochs memory size at earliestEpochBlock, and not the current one + blocksToSaveAtEarliestEpoch, err := k.BlocksToSave(ctx, earliestEpochBlock) + if err != nil { + // panic:ok: critical, no recovery, avoid further corruption + utils.LavaFormatPanic("critical: failed to advance EarliestEpochstart", err, + utils.LogAttr("earliestEpochBlock", earliestEpochBlock), + utils.LogAttr("fixations", k.GetAllFixatedParams(ctx)), + ) + } + + if currentBlock <= blocksToSaveAtEarliestEpoch { + return + } + + lastBlockInMemory := currentBlock - blocksToSaveAtEarliestEpoch + + deletedEpochs := []uint64{} + for earliestEpochBlock < lastBlockInMemory { + deletedEpochs = append(deletedEpochs, earliestEpochBlock) + earliestEpochBlock, err = k.GetNextEpoch(ctx, earliestEpochBlock) + if err != nil { + // panic:ok: critical, no recovery, avoid further corruption + utils.LavaFormatPanic("critical: failed to advance EarliestEpochstart", err, + utils.LogAttr("earliestEpochBlock", earliestEpochBlock), + utils.LogAttr("fixations", k.GetAllFixatedParams(ctx)), + ) + } + } + + if len(deletedEpochs) == 0 { + return + } + + utils.LogLavaEvent(ctx, k.Logger(ctx), types.EarliestEpochEventName, + map[string]string{"block": strconv.FormatUint(earliestEpochBlock, 10)}, + "updated earliest epoch block") + + // now update the earliest epoch start + k.SetEarliestEpochStart(ctx, earliestEpochBlock, deletedEpochs) +} + +func (k Keeper) RemoveOldEpochData(ctx sdk.Context) { + for _, epoch := range k.GetDeletedEpochs(ctx) { + k.RemoveEpochHash(ctx, epoch) + k.RemoveAllStakeEntriesForEpoch(ctx, epoch) + } +} + +func (k Keeper) SetEpochHash(ctx sdk.Context) { + err := k.epochHashes.Set(ctx, uint64(ctx.BlockHeight()), ctx.HeaderHash()) + if err != nil { + panic(err) + } +} + +func (k Keeper) GetEpochHash(ctx sdk.Context, epoch uint64) []byte { + hash, err := k.epochHashes.Get(ctx, epoch) + if err != nil { + utils.LavaFormatError("GetEpochHash: epoch hash not found", fmt.Errorf("not found"), + utils.LogAttr("epoch", epoch), + utils.LogAttr("current_block", ctx.BlockHeight()), + ) + return []byte{} + } + + return hash +} + +func (k Keeper) RemoveEpochHash(ctx sdk.Context, epoch uint64) { + err := k.epochHashes.Remove(ctx, epoch) + if err != nil { + panic(err) + } +} diff --git a/x/epochstorage/keeper/fixated_params.go b/x/epochstorage/keeper/fixated_params.go index 2b7cbcd5c0..7c904a0253 100644 --- a/x/epochstorage/keeper/fixated_params.go +++ b/x/epochstorage/keeper/fixated_params.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // SetFixatedParams set a specific fixatedParams in the store from its index @@ -174,7 +174,7 @@ func (k Keeper) GetFixatedParamsForBlock(ctx sdk.Context, fixationKey string, bl utils.Attribute{Key: "earliest", Value: earliestEpochStart}, ) } else { - err = utils.LavaFormatError("block not found", fmt.Errorf("tried to read index: "+thisIdxKey+" but wasn't found"), + err = utils.LavaFormatError("block not found", fmt.Errorf("tried to read index: %s but wasn't found", thisIdxKey), utils.Attribute{Key: "block", Value: block}, ) } diff --git a/x/epochstorage/keeper/fixated_params_test.go b/x/epochstorage/keeper/fixated_params_test.go index 5407b6e92f..cca571094b 100644 --- a/x/epochstorage/keeper/fixated_params_test.go +++ b/x/epochstorage/keeper/fixated_params_test.go @@ -6,11 +6,11 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - common "github.com/lavanet/lava/testutil/common" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + common "github.com/lavanet/lava/v2/testutil/common" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/keeper/grpc_query.go b/x/epochstorage/keeper/grpc_query.go index 75c8b0e11c..ae0a8198d4 100644 --- a/x/epochstorage/keeper/grpc_query.go +++ b/x/epochstorage/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/epochstorage/keeper/grpc_query_epoch_details.go b/x/epochstorage/keeper/grpc_query_epoch_details.go index 2a858185be..1e195e6daa 100644 --- a/x/epochstorage/keeper/grpc_query_epoch_details.go +++ b/x/epochstorage/keeper/grpc_query_epoch_details.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/epochstorage/keeper/grpc_query_epoch_details_test.go b/x/epochstorage/keeper/grpc_query_epoch_details_test.go index e6acaf8500..58f7aac62f 100644 --- a/x/epochstorage/keeper/grpc_query_epoch_details_test.go +++ b/x/epochstorage/keeper/grpc_query_epoch_details_test.go @@ -8,9 +8,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) func TestEpochDetailsQuery(t *testing.T) { diff --git a/x/epochstorage/keeper/grpc_query_fixated_params.go b/x/epochstorage/keeper/grpc_query_fixated_params.go index c10cdd4559..83e5cdc185 100644 --- a/x/epochstorage/keeper/grpc_query_fixated_params.go +++ b/x/epochstorage/keeper/grpc_query_fixated_params.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/epochstorage/keeper/grpc_query_fixated_params_test.go b/x/epochstorage/keeper/grpc_query_fixated_params_test.go index 6b3987cf34..a0f1def02e 100644 --- a/x/epochstorage/keeper/grpc_query_fixated_params_test.go +++ b/x/epochstorage/keeper/grpc_query_fixated_params_test.go @@ -10,9 +10,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // Prevent strconv unused error diff --git a/x/epochstorage/keeper/grpc_query_params.go b/x/epochstorage/keeper/grpc_query_params.go index 865223bda4..912e610170 100644 --- a/x/epochstorage/keeper/grpc_query_params.go +++ b/x/epochstorage/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/epochstorage/keeper/grpc_query_params_test.go b/x/epochstorage/keeper/grpc_query_params_test.go index 37793ba27e..e9f473bce5 100644 --- a/x/epochstorage/keeper/grpc_query_params_test.go +++ b/x/epochstorage/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/keeper/grpc_query_stake_storage.go b/x/epochstorage/keeper/grpc_query_stake_storage.go index 84857e0687..8ddb15bdbb 100644 --- a/x/epochstorage/keeper/grpc_query_stake_storage.go +++ b/x/epochstorage/keeper/grpc_query_stake_storage.go @@ -3,10 +3,8 @@ package keeper import ( "context" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -16,26 +14,10 @@ func (k Keeper) StakeStorageAll(c context.Context, req *types.QueryAllStakeStora return nil, status.Error(codes.InvalidArgument, "invalid request") } - var stakeStorages []types.StakeStorage ctx := sdk.UnwrapSDKContext(c) + stakeStorages := k.GetAllStakeEntriesForGenesis(ctx) - store := ctx.KVStore(k.storeKey) - stakeStorageStore := prefix.NewStore(store, types.KeyPrefix(types.StakeStorageKeyPrefix)) - - pageRes, err := query.Paginate(stakeStorageStore, req.Pagination, func(key, value []byte) error { - var stakeStorage types.StakeStorage - if err := k.cdc.Unmarshal(value, &stakeStorage); err != nil { - return err - } - - stakeStorages = append(stakeStorages, stakeStorage) - return nil - }) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllStakeStorageResponse{StakeStorage: stakeStorages, Pagination: pageRes}, nil + return &types.QueryAllStakeStorageResponse{StakeStorage: stakeStorages}, nil } func (k Keeper) StakeStorage(c context.Context, req *types.QueryGetStakeStorageRequest) (*types.QueryGetStakeStorageResponse, error) { @@ -44,13 +26,14 @@ func (k Keeper) StakeStorage(c context.Context, req *types.QueryGetStakeStorageR } ctx := sdk.UnwrapSDKContext(c) - val, found := k.GetStakeStorage( - ctx, - req.Index, - ) - if !found { + stakeEntries := k.GetAllStakeEntriesCurrentForChainId(ctx, req.Index) + if len(stakeEntries) == 0 { return nil, status.Error(codes.InvalidArgument, "not found") } + val := types.StakeStorage{ + Index: req.Index, + StakeEntries: stakeEntries, + } return &types.QueryGetStakeStorageResponse{StakeStorage: val}, nil } diff --git a/x/epochstorage/keeper/grpc_query_stake_storage_test.go b/x/epochstorage/keeper/grpc_query_stake_storage_test.go index 604a3d7164..59c699a41d 100644 --- a/x/epochstorage/keeper/grpc_query_stake_storage_test.go +++ b/x/epochstorage/keeper/grpc_query_stake_storage_test.go @@ -5,19 +5,30 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/types" ) // Prevent strconv unused error var _ = strconv.IntSize +func createNStakeStorage(k *keeper.Keeper, ctx sdk.Context, n int) []types.StakeStorage { + items := []types.StakeStorage{} + stakeEntries := createNStakeEntriesCurrent(k, ctx, n) + for _, entry := range stakeEntries { + items = append(items, types.StakeStorage{ + Index: entry.Address, + StakeEntries: []types.StakeEntry{entry}, + }) + } + return items +} + func TestStakeStorageQuerySingle(t *testing.T) { keeper, ctx := keepertest.EpochstorageKeeper(t) wctx := sdk.WrapSDKContext(ctx) @@ -68,59 +79,3 @@ func TestStakeStorageQuerySingle(t *testing.T) { }) } } - -func TestStakeStorageQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.EpochstorageKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - msgs := createNStakeStorage(keeper, ctx, 5) - - request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllStakeStorageRequest { - return &types.QueryAllStakeStorageRequest{ - Pagination: &query.PageRequest{ - Key: next, - Offset: offset, - Limit: limit, - CountTotal: total, - }, - } - } - t.Run("ByOffset", func(t *testing.T) { - step := 2 - for i := 0; i < len(msgs); i += step { - resp, err := keeper.StakeStorageAll(wctx, request(nil, uint64(i), uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.StakeStorage), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.StakeStorage), - ) - } - }) - t.Run("ByKey", func(t *testing.T) { - step := 2 - var next []byte - for i := 0; i < len(msgs); i += step { - resp, err := keeper.StakeStorageAll(wctx, request(next, 0, uint64(step), false)) - require.NoError(t, err) - require.LessOrEqual(t, len(resp.StakeStorage), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.StakeStorage), - ) - next = resp.Pagination.NextKey - } - }) - t.Run("Total", func(t *testing.T) { - resp, err := keeper.StakeStorageAll(wctx, request(nil, 0, 0, true)) - require.NoError(t, err) - require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.StakeStorage), - ) - }) - t.Run("InvalidRequest", func(t *testing.T) { - _, err := keeper.StakeStorageAll(wctx, nil) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) - }) -} diff --git a/x/epochstorage/keeper/keeper.go b/x/epochstorage/keeper/keeper.go index f1530472ff..3ba3df98a2 100644 --- a/x/epochstorage/keeper/keeper.go +++ b/x/epochstorage/keeper/keeper.go @@ -3,6 +3,7 @@ package keeper import ( "fmt" + "cosmossdk.io/collections" storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cometbft/cometbft/libs/log" @@ -10,8 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/utils" + collcompat "github.com/lavanet/lava/v2/utils/collcompat" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) type ( @@ -27,6 +29,11 @@ type ( stakingKeeper types.StakingKeeper fixationRegistries map[string]func(sdk.Context) any + + schema collections.Schema + stakeEntries *collections.IndexedMap[collections.Triple[uint64, string, collections.Pair[uint64, string]], types.StakeEntry, types.EpochChainIdProviderIndexes] + stakeEntriesCurrent *collections.IndexedMap[collections.Pair[string, string], types.StakeEntry, types.ChainIdVaultIndexes] + epochHashes collections.Map[uint64, []byte] } ) @@ -46,6 +53,8 @@ func NewKeeper( ps = ps.WithKeyTable(types.ParamKeyTable()) } + sb := collections.NewSchemaBuilder(collcompat.NewKVStoreService(storeKey)) + keeper := &Keeper{ cdc: cdc, storeKey: storeKey, @@ -57,12 +66,27 @@ func NewKeeper( stakingKeeper: stakingKeeper, fixationRegistries: make(map[string]func(sdk.Context) any), + + stakeEntries: collections.NewIndexedMap(sb, types.StakeEntriesPrefix, "stake_entries", + collections.TripleKeyCodec(collections.Uint64Key, collections.StringKey, + collections.PairKeyCodec(collections.Uint64Key, collections.StringKey)), + collcompat.ProtoValue[types.StakeEntry](cdc), types.NewEpochChainIdProviderIndexes(sb)), + + stakeEntriesCurrent: collections.NewIndexedMap(sb, types.StakeEntriesCurrentPrefix, "stake_entries_current", + collections.PairKeyCodec(collections.StringKey, collections.StringKey), + collcompat.ProtoValue[types.StakeEntry](cdc), types.NewChainIdVaultIndexes(sb)), + + epochHashes: collections.NewMap(sb, types.EpochHashesPrefix, "epoch_hashes", collections.Uint64Key, collections.BytesValue), } keeper.AddFixationRegistry(string(types.KeyEpochBlocks), func(ctx sdk.Context) any { return keeper.EpochBlocksRaw(ctx) }) keeper.AddFixationRegistry(string(types.KeyEpochsToSave), func(ctx sdk.Context) any { return keeper.EpochsToSaveRaw(ctx) }) - keeper.AddFixationRegistry(string(types.KeyUnstakeHoldBlocks), func(ctx sdk.Context) any { return keeper.UnstakeHoldBlocksRaw(ctx) }) - keeper.AddFixationRegistry(string(types.KeyUnstakeHoldBlocksStatic), func(ctx sdk.Context) any { return keeper.UnstakeHoldBlocksStaticRaw(ctx) }) + + schema, err := sb.Build() + if err != nil { + panic(err) + } + keeper.schema = schema return keeper } diff --git a/x/epochstorage/keeper/migrations.go b/x/epochstorage/keeper/migrations.go index 3a6180fcaa..da1e964239 100644 --- a/x/epochstorage/keeper/migrations.go +++ b/x/epochstorage/keeper/migrations.go @@ -1,15 +1,18 @@ package keeper import ( - "math" + "fmt" + "strconv" + "strings" + "unicode" + "cosmossdk.io/collections" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/epochstorage/types" - v3 "github.com/lavanet/lava/x/epochstorage/types/migrations/v3" - v4 "github.com/lavanet/lava/x/epochstorage/types/migrations/v4" - v6 "github.com/lavanet/lava/x/epochstorage/types/migrations/v6" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/epochstorage/types" + v3 "github.com/lavanet/lava/v2/x/epochstorage/types/migrations/v3" + v6 "github.com/lavanet/lava/v2/x/epochstorage/types/migrations/v6" ) type Migrator struct { @@ -20,122 +23,11 @@ func NewMigrator(keeper Keeper) Migrator { return Migrator{keeper: keeper} } -// Migrate2to3 implements store migration from v2 to v3: -// - refund all clients stake -// - migrate providers to a new key -func (m Migrator) Migrate2to3(ctx sdk.Context) error { - const ClientKey = "client" - const ProviderKey = "provider" - - storage := m.keeper.GetAllStakeStorage(ctx) - for _, storage := range storage { - // handle client keys - if storage.Index[:len(ClientKey)] == ClientKey { - m.keeper.RemoveStakeStorage(ctx, storage.Index) - } else if storage.Index[:len(ProviderKey)] == ProviderKey { // handle provider keys - if len(storage.Index) > len(ProviderKey) { - storage.Index = storage.Index[len(ProviderKey):] - m.keeper.SetStakeStorage(ctx, storage) - } - } - } - return nil -} - -// Migrate3to4 implements store migration from v3 to v4: -// set geolocation to int32 -func (m Migrator) Migrate3to4(ctx sdk.Context) error { - utils.LavaFormatDebug("migrate: epochstorage change geolocation from uint64 to int32") - - store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), v3.KeyPrefix(v3.StakeStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var stakeStorageV3 v3.StakeStorage - m.keeper.cdc.MustUnmarshal(iterator.Value(), &stakeStorageV3) - - stakeStorageV4 := v4.StakeStorage{ - Index: stakeStorageV3.Index, - EpochBlockHash: stakeStorageV3.EpochBlockHash, - } - - var stakeEntriesV4 []v4.StakeEntry - for _, stakeEntryV3 := range stakeStorageV3.StakeEntries { - stakeEntryV4 := v4.StakeEntry{ - Stake: stakeEntryV3.Stake, - Address: stakeEntryV3.Address, - StakeAppliedBlock: stakeEntryV3.StakeAppliedBlock, - Chain: stakeEntryV3.Chain, - Moniker: stakeEntryV3.Moniker, - } - - var geoInt32 int32 - if stakeEntryV3.Geolocation <= math.MaxInt32 { - geoInt32 = int32(stakeEntryV3.Geolocation) - } else { - geoInt32 = math.MaxInt32 - } - - stakeEntryV4.Geolocation = geoInt32 - - var endpointsV4 []v4.Endpoint - for _, endpointV3 := range stakeEntryV3.Endpoints { - endpointV4 := v4.Endpoint{ - IPPORT: endpointV3.IPPORT, - Addons: endpointV3.Addons, - ApiInterfaces: endpointV3.ApiInterfaces, - Extensions: endpointV3.Extensions, - } - - var geoEndpInt32 int32 - if stakeEntryV3.Geolocation <= math.MaxInt32 { - geoEndpInt32 = int32(stakeEntryV3.Geolocation) - } else { - geoEndpInt32 = math.MaxInt32 - } - - endpointV4.Geolocation = geoEndpInt32 - endpointsV4 = append(endpointsV4, endpointV4) - } - - stakeEntryV4.Endpoints = endpointsV4 - - stakeEntriesV4 = append(stakeEntriesV4, stakeEntryV4) - } - stakeStorageV4.StakeEntries = stakeEntriesV4 - - store.Delete(iterator.Key()) - store.Set(iterator.Key(), m.keeper.cdc.MustMarshal(&stakeStorageV4)) - } - - return nil -} - -// Migrate4to5 implements store migration from v4 to v5: -// - initialize DelegateTotal, DelegateLimit, DelegateCommission -func (m Migrator) Migrate4to5(ctx sdk.Context) error { - utils.LavaFormatDebug("migrate: epochstorage to include delegations") - - StakeStorages := m.keeper.GetAllStakeStorage(ctx) - for st := range StakeStorages { - for s := range StakeStorages[st].StakeEntries { - StakeStorages[st].StakeEntries[s].DelegateTotal = sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()) - StakeStorages[st].StakeEntries[s].DelegateLimit = sdk.NewCoin(m.keeper.stakingKeeper.BondDenom(ctx), sdk.ZeroInt()) - StakeStorages[st].StakeEntries[s].DelegateCommission = 100 - } - m.keeper.SetStakeStorage(ctx, StakeStorages[st]) - } - - return nil -} - // Migrate5to6 goes over all existing stake entries and populates the new vault address field with the stake entry address func (m Migrator) Migrate5to6(ctx sdk.Context) error { utils.LavaFormatDebug("migrate: epochstorage to include provider and vault addresses") - store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(types.StakeStorageKeyPrefix)) + store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(v3.StakeStorageKeyPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -158,7 +50,7 @@ func (m Migrator) Migrate5to6(ctx sdk.Context) error { func (m Migrator) Migrate6to7(ctx sdk.Context) error { utils.LavaFormatDebug("migrate: epochstorage to include detailed description") - store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(types.StakeStorageKeyPrefix)) + store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(v3.StakeStorageKeyPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() @@ -177,3 +69,106 @@ func (m Migrator) Migrate6to7(ctx sdk.Context) error { return nil } + +// Migrate7to8 transfers all the stake entries from the old stake storage to the new stake entries store +// StakeStorage is set to the stake entries store +// StakeStorageCurrent is set to the stake entries current store +// StakeStorageUnstake is deleted +func (m Migrator) Migrate7to8(ctx sdk.Context) error { + utils.LavaFormatDebug("migrate: epochstorage to move stake entries from stake storage") + k := m.keeper + + store := prefix.NewStore(ctx.KVStore(k.storeKey), v3.KeyPrefix(v3.StakeStorageKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + key := string(iterator.Key()) + + // identify stake storage type: regular, current or unstake + if m.isUnstakeStakeStorageKey(key) { + store.Delete(iterator.Key()) + continue + } + + epoch, err := extractEpochFromStakeStorageKey(key) + isCurrentStakeStorage := m.isCurrentStakeStorageKey(ctx, key) + if err != nil && !isCurrentStakeStorage { + panic(fmt.Errorf("stake storage with unidentified index %s", key)) + } + + var stakeStorage types.StakeStorage + k.cdc.MustUnmarshal(iterator.Value(), &stakeStorage) + + for i, entry := range stakeStorage.StakeEntries { + if isCurrentStakeStorage { + k.SetStakeEntryCurrent(ctx, entry) + } else { + // we make sure that the stake entries order is the same as the previous version's order + k.SetStakeEntryForMigrator(ctx, epoch, entry, uint64(len(stakeStorage.StakeEntries)-i)) + } + } + + if !isCurrentStakeStorage { + m.SetEpochHashForMigrator(ctx, epoch, stakeStorage.EpochBlockHash) + } + + store.Delete(iterator.Key()) + } + + return nil +} + +// Set stake entry +func (k Keeper) SetStakeEntryForMigrator(ctx sdk.Context, epoch uint64, stakeEntry types.StakeEntry, idx uint64) { + key := collections.Join3(epoch, stakeEntry.Chain, collections.Join(idx, stakeEntry.Address)) + err := k.stakeEntries.Set(ctx, key, stakeEntry) + if err != nil { + panic(err) + } +} + +// the legacy StakeStorage store used keys that were built like this: +// strconv.FormatUint(block, 10) + chainID +func extractEpochFromStakeStorageKey(key string) (uint64, error) { + number := "" + for _, char := range key { + if !unicode.IsDigit(char) { + break + } + number += string(char) + } + // Attempt conversion to uint64, return 0 and false if fails + parsedUint, err := strconv.ParseUint(number, 10, 64) + if err != nil { + return 0, err + } + return parsedUint, nil +} + +func (m Migrator) isUnstakeStakeStorageKey(key string) bool { + key, found := strings.CutSuffix(key, "/") + if !found { + return false + } + + return key == v3.StakeStorageKeyUnstakeConst +} + +func (m Migrator) isCurrentStakeStorageKey(ctx sdk.Context, key string) bool { + // the legacy StakeStorage key (both regular and current) had a "/" which should be cut off + key, found := strings.CutSuffix(key, "/") + if !found { + return false + } + _, found, _ = m.keeper.specKeeper.IsSpecFoundAndActive(ctx, key) + return found +} + +func (m Migrator) SetEpochHashForMigrator(ctx sdk.Context, epoch uint64, hash []byte) { + err := m.keeper.epochHashes.Set(ctx, epoch, hash) + if err != nil { + panic(err) + } +} diff --git a/x/epochstorage/keeper/msg_server.go b/x/epochstorage/keeper/msg_server.go index fb94ab1962..9a811f9969 100644 --- a/x/epochstorage/keeper/msg_server.go +++ b/x/epochstorage/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) type msgServer struct { diff --git a/x/epochstorage/keeper/msg_server_test.go b/x/epochstorage/keeper/msg_server_test.go index 58a3626892..d7f40361f3 100644 --- a/x/epochstorage/keeper/msg_server_test.go +++ b/x/epochstorage/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/epochstorage/keeper/params.go b/x/epochstorage/keeper/params.go index aeb6b7d3bd..609a09fe8b 100644 --- a/x/epochstorage/keeper/params.go +++ b/x/epochstorage/keeper/params.go @@ -4,18 +4,16 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // GetParams get all parameters as types.Params func (k Keeper) GetParams(ctx sdk.Context) types.Params { return types.NewParams( - k.UnstakeHoldBlocksRaw(ctx), k.EpochBlocksRaw(ctx), k.EpochsToSaveRaw(ctx), k.LatestParamChange(ctx), - k.UnstakeHoldBlocksStaticRaw(ctx), ) } @@ -24,37 +22,6 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { k.paramstore.SetParamSet(ctx, ¶ms) } -func (k Keeper) UnstakeHoldBlocks(ctx sdk.Context, block uint64) (res uint64) { - // Unstake Hold Blocks is always used for the latest, but we want to use the fixated - k.GetParamForBlock(ctx, string(types.KeyUnstakeHoldBlocks), block, &res) - return -} - -// UnstakeHoldBlocksRaw returns the UnstakeHoldBlocks param -func (k Keeper) UnstakeHoldBlocksRaw(ctx sdk.Context) (res uint64) { - // Unstake Hold Blocks is always used for the latest, but we want to use the fixated - k.paramstore.Get(ctx, types.KeyUnstakeHoldBlocks, &res) - return -} - -func (k Keeper) UnstakeHoldBlocksStatic(ctx sdk.Context, block uint64) (res uint64) { - // Unstake Hold Blocks is always used for the latest, but we want to use the fixated - k.GetParamForBlock(ctx, string(types.KeyUnstakeHoldBlocksStatic), block, &res) - return -} - -// UnstakeHoldBlocksRaw returns the UnstakeHoldBlocks param -func (k Keeper) UnstakeHoldBlocksStaticRaw(ctx sdk.Context) (res uint64) { - // Unstake Hold Blocks is always used for the latest, but we want to use the fixated - k.paramstore.Get(ctx, types.KeyUnstakeHoldBlocksStatic, &res) - return -} - -// UnstakeHoldBlocksRaw sets the UnstakeHoldBlocks param -func (k Keeper) SetUnstakeHoldBlocksStaticRaw(ctx sdk.Context, unstakeHoldBlocksStatic uint64) { - k.paramstore.Set(ctx, types.KeyUnstakeHoldBlocksStatic, unstakeHoldBlocksStatic) -} - // EpochBlocks returns the EpochBlocks fixated param func (k Keeper) EpochBlocks(ctx sdk.Context, block uint64) (res uint64, err error) { err = k.GetParamForBlock(ctx, string(types.KeyEpochBlocks), block, &res) diff --git a/x/epochstorage/keeper/params_test.go b/x/epochstorage/keeper/params_test.go index 96215d9669..fe8cb35223 100644 --- a/x/epochstorage/keeper/params_test.go +++ b/x/epochstorage/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) @@ -15,8 +15,6 @@ func TestGetParams(t *testing.T) { k.SetParams(ctx, params) require.EqualValues(t, params, k.GetParams(ctx)) - require.EqualValues(t, params.UnstakeHoldBlocks, k.UnstakeHoldBlocksRaw(ctx)) - require.EqualValues(t, params.UnstakeHoldBlocksStatic, k.UnstakeHoldBlocksStaticRaw(ctx)) require.EqualValues(t, params.EpochBlocks, k.EpochBlocksRaw(ctx)) require.EqualValues(t, params.EpochsToSave, k.EpochsToSaveRaw(ctx)) } diff --git a/x/epochstorage/keeper/stake_entries.go b/x/epochstorage/keeper/stake_entries.go new file mode 100644 index 0000000000..0c4a49630f --- /dev/null +++ b/x/epochstorage/keeper/stake_entries.go @@ -0,0 +1,240 @@ +package keeper + +import ( + "fmt" + "sort" + "strconv" + + "cosmossdk.io/collections" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/epochstorage/types" +) + +/* ########## StakeEntry ############ */ + +// GetStakeEntry gets a specific stake entry from the stake entries KV store +// Since the stake entries KV store's key includes the provider's stake (which is not known), we iterate over all +// the providers with the same epoch and chainID and compare the requested address to find the provider +func (k Keeper) GetStakeEntry(ctx sdk.Context, epoch uint64, chainID string, provider string) (types.StakeEntry, bool) { + pk, err := k.stakeEntries.Indexes.Index.MatchExact(ctx, collections.Join3(epoch, chainID, provider)) + if err != nil { + utils.LavaFormatWarning("GetStakeEntry: MatchExact with ref key failed", err, + utils.LogAttr("epoch", epoch), + utils.LogAttr("chain_id", chainID), + utils.LogAttr("provider", provider), + ) + return types.StakeEntry{}, false + } + + entry, err := k.stakeEntries.Get(ctx, pk) + if err != nil { + utils.LavaFormatError("GetStakeEntry: Get with primary key failed", err, + utils.LogAttr("epoch", epoch), + utils.LogAttr("chain_id", chainID), + utils.LogAttr("provider", provider), + ) + return types.StakeEntry{}, false + } + + return entry, true +} + +// Set stake entry +func (k Keeper) SetStakeEntry(ctx sdk.Context, epoch uint64, stakeEntry types.StakeEntry) { + stake := uint64(0) + if !stakeEntry.Stake.IsNil() && stakeEntry.Stake.Amount.IsUint64() { + stake = stakeEntry.Stake.Amount.Uint64() + } + key := collections.Join3(epoch, stakeEntry.Chain, collections.Join(stake, stakeEntry.Address)) + err := k.stakeEntries.Set(ctx, key, stakeEntry) + if err != nil { + panic(fmt.Errorf("SetStakeEntry: Failed to set entry with key %v, error: %w", key, err)) + } +} + +// RemoveAllStakeEntriesForEpoch removes all the stake entries of a specific epoch +func (k Keeper) RemoveAllStakeEntriesForEpoch(ctx sdk.Context, epoch uint64) { + rng := collections.NewPrefixedTripleRange[uint64, string, collections.Pair[uint64, string]](epoch) + iter, err := k.stakeEntries.Iterate(ctx, rng) + if err != nil { + panic(fmt.Errorf("RemoveAllStakeEntriesForEpoch: Failed to create iterator for epoch %d, error: %w", epoch, err)) + } + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + key, err := iter.Key() + if err != nil { + panic(fmt.Errorf("RemoveAllStakeEntriesForEpoch: Failed to get key from iterator for epoch %d, error: %w", epoch, err)) + } + + err = k.stakeEntries.Remove(ctx, key) + if err != nil { + panic(fmt.Errorf("RemoveAllStakeEntriesForEpoch: Failed to remove entry with key %v, error: %w", key, err)) + } + } +} + +// GetAllStakeEntries gets all the stake entries of a specific epoch +func (k Keeper) GetAllStakeEntriesForGenesis(ctx sdk.Context) []types.StakeStorage { + iter, err := k.stakeEntries.Iterate(ctx, nil) + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesForGenesis: Failed to create iterator, error: %w", err)) + } + defer iter.Close() + + storagesMap := map[uint64]types.StakeStorage{} + for ; iter.Valid(); iter.Next() { + key, err := iter.Key() + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesForGenesis: Failed to get key from iterator, error: %w", err)) + } + epoch := key.K1() + + entry, err := iter.Value() + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesForGenesis: Failed to get value from iterator for epoch %d, error: %w", epoch, err)) + } + if _, ok := storagesMap[epoch]; !ok { + storagesMap[epoch] = types.StakeStorage{ + Index: strconv.FormatUint(epoch, 10), + EpochBlockHash: k.GetEpochHash(ctx, epoch), + } + } + storage := storagesMap[epoch] + storage.StakeEntries = append(storage.StakeEntries, entry) + storagesMap[epoch] = storage + } + + var storages []types.StakeStorage + var keys []uint64 + for key := range storagesMap { + keys = append(keys, key) + } + sort.Slice(keys, func(i, j int) bool { + return keys[i] < keys[j] + }) + + for _, key := range keys { + storages = append(storages, storagesMap[key]) + } + + currentEntries := k.GetAllStakeEntriesCurrent(ctx) + storages = append(storages, types.StakeStorage{Index: "", StakeEntries: currentEntries}) // empty index for genesis + + return storages +} + +// GetAllStakeEntriesForEpoch gets all the stake entries of a specific epoch +func (k Keeper) GetAllStakeEntriesForEpoch(ctx sdk.Context, epoch uint64) []types.StakeEntry { + rng := collections.NewPrefixedTripleRange[uint64, string, collections.Pair[uint64, string]](epoch) + iter, err := k.stakeEntries.Iterate(ctx, rng) + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesForEpoch: Failed to create iterator for epoch %d, error: %w", epoch, err)) + } + defer iter.Close() + + entries, err := iter.Values() + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesForEpoch: Failed to get entries for epoch %d, error: %w", epoch, err)) + } + return entries +} + +// GetAllStakeEntriesForEpochChainId gets all the stake entries of a specific epoch and a specific chain +func (k Keeper) GetAllStakeEntriesForEpochChainId(ctx sdk.Context, epoch uint64, chainID string) []types.StakeEntry { + rng := collections.NewSuperPrefixedTripleRange[uint64, string, collections.Pair[uint64, string]](epoch, chainID) + iter, err := k.stakeEntries.Iterate(ctx, rng) + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesForEpochChainId: Failed to create iterator for epoch %d and chain ID %s, error: %w", epoch, chainID, err)) + } + defer iter.Close() + + entries, err := iter.Values() + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesForEpochChainId: Failed to get entries for epoch %d and chain ID %s, error: %w", epoch, chainID, err)) + } + return entries +} + +/* ########## Current StakeEntry ############ */ + +// GetStakeEntryCurrent returns a specific current stake entry (with both vault/provider) +func (k Keeper) GetStakeEntryCurrent(ctx sdk.Context, chainID string, provider string) (val types.StakeEntry, found bool) { + key := collections.Join(chainID, provider) + entry, err := k.stakeEntriesCurrent.Get(ctx, key) + if err == nil { + return entry, true + } + + // try to find the stake entry by the vault address + return k.GetStakeEntryCurrentForChainIdByVault(ctx, chainID, provider) +} + +// SetStakeEntryCurrent sets a current stake entry in the store +func (k Keeper) SetStakeEntryCurrent(ctx sdk.Context, stakeEntry types.StakeEntry) { + key := collections.Join(stakeEntry.Chain, stakeEntry.Address) + err := k.stakeEntriesCurrent.Set(ctx, key, stakeEntry) + if err != nil { + panic(fmt.Errorf("SetStakeEntryCurrent: Failed to set entry for key %v, error: %w", key, err)) + } +} + +// RemoveStakeEntryCurrent deletes a current stake entry from the store +func (k Keeper) RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, provider string) { + key := collections.Join(chainID, provider) + err := k.stakeEntriesCurrent.Remove(ctx, key) + if err != nil { + panic(fmt.Errorf("RemoveStakeEntryCurrent: Failed to remove entry with key %v, error: %w", key, err)) + } +} + +// GetAllStakeEntriesCurrent gets all the current stake entries +func (k Keeper) GetAllStakeEntriesCurrent(ctx sdk.Context) []types.StakeEntry { + iter, err := k.stakeEntriesCurrent.Iterate(ctx, nil) + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesCurrent: Failed to create iterator, error: %w", err)) + } + defer iter.Close() + + entries, err := iter.Values() + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesCurrent: Failed to get entries, error: %w", err)) + } + return entries +} + +// GetAllStakeEntriesCurrentForChainId gets all the current stake entries for a specific chain +func (k Keeper) GetAllStakeEntriesCurrentForChainId(ctx sdk.Context, chainID string) []types.StakeEntry { + rng := collections.NewPrefixedPairRange[string, string](chainID) + iter, err := k.stakeEntriesCurrent.Iterate(ctx, rng) + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesCurrentForChainId: Failed to create iterator for chain ID %s, error: %w", chainID, err)) + } + defer iter.Close() + + entries, err := iter.Values() + if err != nil { + panic(fmt.Errorf("GetAllStakeEntriesCurrentForChainId: Failed to get entries for chain ID %s, error: %w", chainID, err)) + } + return entries +} + +// GetStakeEntryCurrentForChainIdByVault gets all the current stake entry for a specific chain by vault address +func (k Keeper) GetStakeEntryCurrentForChainIdByVault(ctx sdk.Context, chainID string, vault string) (val types.StakeEntry, found bool) { + pk, err := k.stakeEntriesCurrent.Indexes.Index.MatchExact(ctx, collections.Join(chainID, vault)) + if err != nil { + return types.StakeEntry{}, false + } + + entry, err := k.stakeEntriesCurrent.Get(ctx, pk) + if err != nil { + utils.LavaFormatError("GetStakeEntryCurrentForChainIdByVault: Get with primary key failed", err, + utils.LogAttr("chain_id", chainID), + utils.LogAttr("vault", vault), + ) + return types.StakeEntry{}, false + } + + return entry, true +} diff --git a/x/epochstorage/keeper/stake_entries_test.go b/x/epochstorage/keeper/stake_entries_test.go new file mode 100644 index 0000000000..6ab51ad5a9 --- /dev/null +++ b/x/epochstorage/keeper/stake_entries_test.go @@ -0,0 +1,124 @@ +package keeper_test + +import ( + "strconv" + "testing" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/stretchr/testify/require" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +/* ########## StakeEntry ############ */ + +func createNStakeEntries(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.StakeEntry { + items := make([]types.StakeEntry, n) + for i := range items { + items[i] = types.StakeEntry{ + Stake: sdk.NewCoin("token", math.NewInt(int64(i))), + Address: strconv.Itoa(i), + Chain: strconv.Itoa(i), + } + keeper.SetStakeEntry(ctx, uint64(i), items[i]) + } + return items +} + +func TestGetStakeEntry(t *testing.T) { + keeper, ctx := keepertest.EpochstorageKeeper(t) + items := createNStakeEntries(keeper, ctx, 10) + for i, item := range items { + entry, found := keeper.GetStakeEntry(ctx, uint64(i), strconv.Itoa(i), strconv.Itoa(i)) + require.True(t, found) + require.True(t, item.Stake.IsEqual(entry.Stake)) + } +} + +func TestRemoveAllStakeEntriesForEpoch(t *testing.T) { + keeper, ctx := keepertest.EpochstorageKeeper(t) + items := createNStakeEntries(keeper, ctx, 10) + epoch := uint64(1) + keeper.SetStakeEntry(ctx, epoch, types.StakeEntry{}) // set another stake entry on epoch=1 + keeper.RemoveAllStakeEntriesForEpoch(ctx, epoch) + for i := range items { + entries := keeper.GetAllStakeEntriesForEpoch(ctx, uint64(i)) + if i == 1 { + require.Len(t, entries, 0) // on epoch 1 there should be no entries + } else { + require.Len(t, entries, 1) // every other epoch is unaffected - there should be one entry + } + } +} + +func TestGetAllStakeEntriesForEpoch(t *testing.T) { + keeper, ctx := keepertest.EpochstorageKeeper(t) + items := createNStakeEntries(keeper, ctx, 10) + epoch := uint64(1) + keeper.SetStakeEntry(ctx, epoch, types.StakeEntry{}) // set another stake entry on epoch=1 + for i := range items { + entries := keeper.GetAllStakeEntriesForEpoch(ctx, uint64(i)) + if i == 1 { + require.Len(t, entries, 2) // on epoch 1 there should be two entries + } else { + require.Len(t, entries, 1) // every other epoch is unaffected - there should be one entry + } + } +} + +func TestGetAllStakeEntriesForEpochChainId(t *testing.T) { + keeper, ctx := keepertest.EpochstorageKeeper(t) + items := createNStakeEntries(keeper, ctx, 10) + epoch := uint64(1) + + // set two entries on epoch=1: one with the same chain as items, and another with a different chain + keeper.SetStakeEntry(ctx, epoch, types.StakeEntry{Chain: items[1].Chain}) + keeper.SetStakeEntry(ctx, epoch, types.StakeEntry{Chain: "otherChain"}) + + // there should be 3 entries on epoch=1: two of items[1].Chain and one of "otherChain" + entries := keeper.GetAllStakeEntriesForEpochChainId(ctx, epoch, items[1].Chain) + require.Len(t, entries, 2) + entries = keeper.GetAllStakeEntriesForEpochChainId(ctx, epoch, "otherChain") + require.Len(t, entries, 1) +} + +/* ########## Current StakeEntry ############ */ + +func createNStakeEntriesCurrent(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.StakeEntry { + items := make([]types.StakeEntry, n) + for i := range items { + items[i] = types.StakeEntry{ + Stake: sdk.NewCoin("token", math.NewInt(int64(i))), + Address: strconv.Itoa(i), + Vault: strconv.Itoa(i), + Chain: strconv.Itoa(i), + } + keeper.SetStakeEntryCurrent(ctx, items[i]) + } + return items +} + +func TestGetStakeEntryCurrent(t *testing.T) { + keeper, ctx := keepertest.EpochstorageKeeper(t) + items := createNStakeEntriesCurrent(keeper, ctx, 10) + for i, item := range items { + entry, found := keeper.GetStakeEntryCurrent(ctx, strconv.Itoa(i), strconv.Itoa(i)) + require.True(t, found) + require.True(t, item.Stake.IsEqual(entry.Stake)) + } +} + +func TestRemoveStakeEntryCurrent(t *testing.T) { + keeper, ctx := keepertest.EpochstorageKeeper(t) + items := createNStakeEntriesCurrent(keeper, ctx, 10) + for i := range items { + keeper.RemoveStakeEntryCurrent(ctx, strconv.Itoa(i), strconv.Itoa(i)) + _, found := keeper.GetStakeEntryCurrent(ctx, strconv.Itoa(i), strconv.Itoa(i)) + require.False(t, found) + } +} diff --git a/x/epochstorage/keeper/stake_storage.go b/x/epochstorage/keeper/stake_storage.go deleted file mode 100644 index c3d2eab247..0000000000 --- a/x/epochstorage/keeper/stake_storage.go +++ /dev/null @@ -1,412 +0,0 @@ -package keeper - -import ( - "fmt" - "sort" - "strconv" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/epochstorage/types" - spectypes "github.com/lavanet/lava/x/spec/types" -) - -// SetStakeStorage set a specific stakeStorage in the store from its index -func (k Keeper) SetStakeStorage(ctx sdk.Context, stakeStorage types.StakeStorage) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StakeStorageKeyPrefix)) - b := k.cdc.MustMarshal(&stakeStorage) - store.Set(types.StakeStorageKey( - stakeStorage.Index, - ), b) -} - -// GetStakeStorage returns a stakeStorage from its index -func (k Keeper) GetStakeStorage( - ctx sdk.Context, - index string, -) (val types.StakeStorage, found bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StakeStorageKeyPrefix)) - - b := store.Get(types.StakeStorageKey( - index, - )) - if b == nil { - return val, false - } - - k.cdc.MustUnmarshal(b, &val) - return val, true -} - -// RemoveStakeStorage removes a stakeStorage from the store -func (k Keeper) RemoveStakeStorage( - ctx sdk.Context, - index string, -) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StakeStorageKeyPrefix)) - store.Delete(types.StakeStorageKey( - index, - )) -} - -// GetAllStakeStorage returns all stakeStorage -func (k Keeper) GetAllStakeStorage(ctx sdk.Context) (list []types.StakeStorage) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.StakeStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var val types.StakeStorage - k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, val) - } - - return -} - -func (k Keeper) RemoveOldEpochData(ctx sdk.Context) { - for _, block := range k.GetDeletedEpochs(ctx) { - allChainIDs := k.specKeeper.GetAllChainIDs(ctx) - for _, chainID := range allChainIDs { - k.RemoveStakeStorageByBlockAndChain(ctx, block, chainID) - } - } -} - -func (k *Keeper) UpdateEarliestEpochstart(ctx sdk.Context) { - currentBlock := uint64(ctx.BlockHeight()) - earliestEpochBlock := k.GetEarliestEpochStart(ctx) - - // we take the epochs memory size at earliestEpochBlock, and not the current one - blocksToSaveAtEarliestEpoch, err := k.BlocksToSave(ctx, earliestEpochBlock) - if err != nil { - // panic:ok: critical, no recovery, avoid further corruption - utils.LavaFormatPanic("critical: failed to advance EarliestEpochstart", err, - utils.LogAttr("earliestEpochBlock", earliestEpochBlock), - utils.LogAttr("fixations", k.GetAllFixatedParams(ctx)), - ) - } - - if currentBlock <= blocksToSaveAtEarliestEpoch { - return - } - - lastBlockInMemory := currentBlock - blocksToSaveAtEarliestEpoch - - deletedEpochs := []uint64{} - for earliestEpochBlock < lastBlockInMemory { - deletedEpochs = append(deletedEpochs, earliestEpochBlock) - earliestEpochBlock, err = k.GetNextEpoch(ctx, earliestEpochBlock) - if err != nil { - // panic:ok: critical, no recovery, avoid further corruption - utils.LavaFormatPanic("critical: failed to advance EarliestEpochstart", err, - utils.LogAttr("earliestEpochBlock", earliestEpochBlock), - utils.LogAttr("fixations", k.GetAllFixatedParams(ctx)), - ) - } - } - - if len(deletedEpochs) == 0 { - return - } - - utils.LogLavaEvent(ctx, k.Logger(ctx), types.EarliestEpochEventName, - map[string]string{"block": strconv.FormatUint(earliestEpochBlock, 10)}, - "updated earliest epoch block") - - // now update the earliest epoch start - k.SetEarliestEpochStart(ctx, earliestEpochBlock, deletedEpochs) -} - -func (k Keeper) StakeStorageKey(block uint64, chainID string) string { - return strconv.FormatUint(block, 10) + chainID -} - -func (k Keeper) RemoveStakeStorageByBlockAndChain(ctx sdk.Context, block uint64, chainID string) { - key := k.StakeStorageKey(block, chainID) - k.RemoveStakeStorage(ctx, key) -} - -// -------------------------------------------------- current staking list -------------------------------------------- - -func (k Keeper) stakeStorageKeyCurrent(chainID string) string { - return chainID -} - -// used to get the latest -func (k Keeper) GetStakeStorageCurrent(ctx sdk.Context, chainID string) (types.StakeStorage, bool) { - return k.GetStakeStorage(ctx, k.stakeStorageKeyCurrent(chainID)) -} - -func (k Keeper) SetStakeStorageCurrent(ctx sdk.Context, chainID string, stakeStorage types.StakeStorage) { - stakeStorage.Index = k.stakeStorageKeyCurrent(chainID) - k.SetStakeStorage(ctx, stakeStorage) -} - -func (k Keeper) GetStakeEntryByAddressCurrent(ctx sdk.Context, chainID string, address string) (types.StakeEntry, bool) { - if !utils.IsBech32Address(address) { - utils.LavaFormatWarning("cannot get stake entry of invalid address", fmt.Errorf("invalid address"), - utils.LogAttr("address", address), - ) - } - stakeStorage, found := k.GetStakeStorageCurrent(ctx, chainID) - if !found { - return types.StakeEntry{}, false - } - - return stakeStorage.GetStakeEntryByAddressFromStorage(address) -} - -func (k Keeper) RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, address string) error { - if !utils.IsBech32Address(address) { - utils.LavaFormatWarning("cannot get stake entry of invalid address", fmt.Errorf("invalid address"), - utils.LogAttr("address", address), - ) - } - stakeStorage, found := k.GetStakeStorageCurrent(ctx, chainID) - if !found { - return legacyerrors.ErrNotFound - } - - for i, entry := range stakeStorage.StakeEntries { - if entry.IsAddressVaultOrProvider(address) { - stakeStorage.StakeEntries = append(stakeStorage.StakeEntries[:i], stakeStorage.StakeEntries[i+1:]...) - k.SetStakeStorageCurrent(ctx, chainID, stakeStorage) - return nil - } - } - - return legacyerrors.ErrNotFound -} - -func (k Keeper) AppendStakeEntryFromStorage(ctx sdk.Context, stakeStorageIndex string, stakeEntry types.StakeEntry, isUnstake bool) { - stakeStorage, found := k.GetStakeStorage(ctx, stakeStorageIndex) - var entries []types.StakeEntry - if !found { - entries = []types.StakeEntry{stakeEntry} - // create a new one - stakeStorage = types.StakeStorage{Index: stakeStorageIndex, StakeEntries: entries, EpochBlockHash: nil} - } else { - // the following code inserts stakeEntry into the existing entries by stake - entries = stakeStorage.StakeEntries - // sort func needs to return true if the inserted entry is less than the existing entry - sortFunc := func(i int) bool { - return stakeEntry.StakeAppliedBlock <= entries[i].StakeAppliedBlock - } - if !isUnstake { - sortFunc = func(i int) bool { - return stakeEntry.EffectiveStake().LT(entries[i].EffectiveStake()) - } - } - - // returns the smallest index in which the sort func is true - index := sort.Search(len(entries), sortFunc) - if index < len(entries) { - entries = append(entries[:index+1], entries[index:]...) - entries[index] = stakeEntry - } else { - // put in the end - entries = append(entries, stakeEntry) - } - } - stakeStorage.StakeEntries = entries - k.SetStakeStorage(ctx, stakeStorage) -} - -func (k Keeper) AppendStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry types.StakeEntry) { - k.AppendStakeEntryFromStorage(ctx, k.stakeStorageKeyCurrent(chainID), stakeEntry, false) -} - -func (k Keeper) ModifyStakeEntryCurrentFromStorage(ctx sdk.Context, stakeStorage types.StakeStorage, stakeEntry types.StakeEntry) { - // TODO: more efficient: only create a new list once, after the second index is identified - // remove the given index, then store the new entry in the sorted list at the right place - entries := []types.StakeEntry{} - for i, entry := range stakeStorage.StakeEntries { - if entry.Address == stakeEntry.Address && entry.Vault == stakeEntry.Vault { - entries = append(entries, stakeStorage.StakeEntries[:i]...) - entries = append(entries, stakeStorage.StakeEntries[i+1:]...) - break - } - } - // the following code inserts stakeEntry into the existing entries by stake - // sort func needs to return true if the inserted entry is less than the existing entry - sortFunc := func(i int) bool { - return stakeEntry.EffectiveStake().LT(entries[i].EffectiveStake()) - } - // returns the smallest index in which the sort func is true - index := sort.Search(len(entries), sortFunc) - if index < len(entries) { - entries = append(entries[:index+1], entries[index:]...) - entries[index] = stakeEntry - } else { - entries = append(entries, stakeEntry) - } - stakeStorage.StakeEntries = entries - k.SetStakeStorage(ctx, stakeStorage) -} - -func (k Keeper) ModifyStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry types.StakeEntry) { - // this stake storage entries are sorted by stake amount - stakeStorage, found := k.GetStakeStorageCurrent(ctx, chainID) - if !found { - // should not happen since caller is expected to validate chainID first; - // do nothing and return to avoid panic. - utils.LavaFormatError("critical: ModifyStakeEntryCurrent with unknown chain", legacyerrors.ErrNotFound, - utils.LogAttr("chainID", chainID), - utils.LogAttr("stakeAddr", stakeEntry.Address), - ) - return - } - k.ModifyStakeEntryCurrentFromStorage(ctx, stakeStorage, stakeEntry) -} - -// -------------------------------------------------- unstaking list -------------------------------------------- - -// used to get the unstaking entries -func (k Keeper) GetStakeStorageUnstake(ctx sdk.Context) (types.StakeStorage, bool) { - return k.GetStakeStorage(ctx, types.StakeStorageKeyUnstakeConst) -} - -func (k Keeper) SetStakeStorageUnstake(ctx sdk.Context, stakeStorage types.StakeStorage) { - stakeStorage.Index = types.StakeStorageKeyUnstakeConst - k.SetStakeStorage(ctx, stakeStorage) -} - -func (k Keeper) UnstakeEntryByAddress(ctx sdk.Context, address string) (value types.StakeEntry, found bool) { - if !utils.IsBech32Address(address) { - utils.LavaFormatWarning("cannot get stake entry of invalid address", fmt.Errorf("invalid address"), - utils.LogAttr("address", address), - ) - } - stakeStorage, found := k.GetStakeStorageUnstake(ctx) - if !found { - return types.StakeEntry{}, false - } - return stakeStorage.GetStakeEntryByAddressFromStorage(address) -} - -func (k Keeper) ModifyUnstakeEntry(ctx sdk.Context, stakeEntry types.StakeEntry) { - // this stake storage entries are sorted by stake amount - stakeStorage, found := k.GetStakeStorageUnstake(ctx) - if !found { - // should not happen since stake storage must always exist; do nothing to avoid panic - utils.LavaFormatError("critical: ModifyUnstakeEntry failed to get stakeStorage", legacyerrors.ErrNotFound, - utils.LogAttr("stakeAddr", stakeEntry.Address), - ) - return - } - k.ModifyStakeEntryCurrentFromStorage(ctx, stakeStorage, stakeEntry) -} - -func (k Keeper) AppendUnstakeEntry(ctx sdk.Context, stakeEntry types.StakeEntry, unstakeHoldBlocks uint64) { - // update unstake stakeAppliedBlock to the higher among params (unstakeholdblocks and blockstosave) - blockHeight := uint64(ctx.BlockHeight()) - stakeEntry.StakeAppliedBlock = blockHeight + unstakeHoldBlocks - k.AppendStakeEntryFromStorage(ctx, types.StakeStorageKeyUnstakeConst, stakeEntry, true) -} - -// Returns the unstaking Entry if its stakeAppliedBlock is lower than the provided block -func (k Keeper) PopUnstakeEntries(ctx sdk.Context, block uint64) (value []types.StakeEntry) { - stakeStorage, found := k.GetStakeStorageUnstake(ctx) - if !found { - // utils.LavaError(ctx, k.Logger(ctx), "emptyStakeStorage", map[string]string{"storageType": storageType}, "stakeStorageUnstake Empty!") - return nil - } - found_idx := -1 - // the unstaking is a sorted list so just chekcing until an entry stakeAppliedBlock is too big - for idx, entry := range stakeStorage.StakeEntries { - if entry.StakeAppliedBlock <= block { - // found an enrty that its stakeAppliedBlock is less equal to the wanted block number - value = append(value, entry) - // remove from the unstaking stakeStorage everything before this index - found_idx = idx - } else { - // no need to keep iterating the sorted list - break - } - } - if found_idx >= 0 { - stakeStorage.StakeEntries = stakeStorage.StakeEntries[found_idx+1:] - k.SetStakeStorageUnstake(ctx, stakeStorage) - return - } - return nil -} - -// ------------------------------------------------ - -// takes the current stake storage and puts it in epoch storage -func (k Keeper) StoreCurrentEpochStakeStorage(ctx sdk.Context, block uint64) { - allChainIDs := k.specKeeper.GetAllChainIDs(ctx) - for _, chainID := range allChainIDs { - tmpStorage, found := k.GetStakeStorageCurrent(ctx, chainID) - if !found { - // no storage for this spec yet - continue - } - newStorage := tmpStorage.Copy() - newStorage.Index = k.StakeStorageKey(block, chainID) - newStorage.EpochBlockHash = ctx.HeaderHash() // set the current block hash for pairing to work without accessing history - k.SetStakeStorage(ctx, newStorage) - } -} - -func (k Keeper) GetStakeStorageEpoch(ctx sdk.Context, block uint64, chainID string) (stakeStorage types.StakeStorage, found bool) { - key := k.StakeStorageKey(block, chainID) - return k.GetStakeStorage(ctx, key) -} - -func (k Keeper) GetStakeEntryForProviderEpoch(ctx sdk.Context, chainID string, address string, epoch uint64) (types.StakeEntry, bool) { - if !utils.IsBech32Address(address) { - utils.LavaFormatWarning("cannot get stake entry of invalid address", fmt.Errorf("invalid address"), - utils.LogAttr("address", address), - ) - } - stakeStorage, found := k.GetStakeStorageEpoch(ctx, epoch, chainID) - if !found { - return types.StakeEntry{}, false - } - return stakeStorage.GetStakeEntryByAddressFromStorage(address) -} - -func (k Keeper) GetStakeEntryForAllProvidersEpoch(ctx sdk.Context, chainID string, epoch uint64) (entrys *[]types.StakeEntry, err error) { - stakeStorage, found := k.GetStakeStorageEpoch(ctx, epoch, chainID) - if !found { - return nil, fmt.Errorf("could not find stakeStorage - epoch %d, chainID %s", epoch, chainID) - } - - return &stakeStorage.StakeEntries, nil -} - -func (k Keeper) GetEpochStakeEntries(ctx sdk.Context, block uint64, chainID string) (entries []types.StakeEntry, found bool, epochHash []byte) { - key := k.StakeStorageKey(block, chainID) - stakeStorage, found := k.GetStakeStorage(ctx, key) - if !found { - return nil, false, nil - } - return stakeStorage.StakeEntries, true, stakeStorage.EpochBlockHash -} - -func (k Keeper) GetUnstakeHoldBlocks(ctx sdk.Context, chainID string) uint64 { - _, found, providerType := k.specKeeper.IsSpecFoundAndActive(ctx, chainID) - if !found { - utils.LavaFormatError("critical: failed to get spec for chainID", - fmt.Errorf("unknown chainID"), - utils.Attribute{Key: "chainID", Value: chainID}, - ) - } - - // note: if spec was not found, the default choice is Spec_dynamic == 0 - - block := uint64(ctx.BlockHeight()) - if providerType == spectypes.Spec_static { - return k.UnstakeHoldBlocksStatic(ctx, block) - } else { - return k.UnstakeHoldBlocks(ctx, block) - } - - // NOT REACHED -} diff --git a/x/epochstorage/keeper/stake_storage_test.go b/x/epochstorage/keeper/stake_storage_test.go deleted file mode 100644 index 001d52a3fa..0000000000 --- a/x/epochstorage/keeper/stake_storage_test.go +++ /dev/null @@ -1,138 +0,0 @@ -package keeper_test - -import ( - "strconv" - "strings" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/epochstorage/keeper" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/stretchr/testify/require" -) - -// Prevent strconv unused error -var _ = strconv.IntSize - -const ( - advanceFewEpochs = 4 - stakeStorageSlots = 10 -) - -func createNStakeStorage(keeper *keeper.Keeper, ctx sdk.Context, n int) []epochstoragetypes.StakeStorage { - items := make([]epochstoragetypes.StakeStorage, n) - for i := range items { - items[i].Index = strconv.Itoa(i) - - keeper.SetStakeStorage(ctx, items[i]) - } - return items -} - -func TestStakeStorageGet(t *testing.T) { - keeper, ctx := testkeeper.EpochstorageKeeper(t) - items := createNStakeStorage(keeper, ctx, 10) - for _, item := range items { - rst, found := keeper.GetStakeStorage(ctx, - item.Index, - ) - require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&rst), - ) - } -} - -func TestStakeStorageRemove(t *testing.T) { - keeper, ctx := testkeeper.EpochstorageKeeper(t) - items := createNStakeStorage(keeper, ctx, stakeStorageSlots) - for _, item := range items { - keeper.RemoveStakeStorage(ctx, - item.Index, - ) - _, found := keeper.GetStakeStorage(ctx, - item.Index, - ) - require.False(t, found) - } -} - -func removeAllEntriesBeforeBlock(keeper keeper.Keeper, ctx sdk.Context, block uint64, allChainID []string) { - allStorage := keeper.GetAllStakeStorage(ctx) - for _, chainId := range allChainID { - for _, entry := range allStorage { - if strings.Contains(entry.Index, chainId) { - storageBlock := entry.Index[:(len(entry.Index) - len(chainId))] - blockHeight, err := strconv.ParseUint(storageBlock, 10, 64) - if err != nil { - if storageBlock == "" { - // empty storageBlock means stake entry current, so skip it - continue - } - panic("failed to decode storage block: " + strconv.Itoa(int(block)) + - "chainID: " + chainId + "index: " + entry.Index) - } - if blockHeight < block { - keeper.RemoveStakeStorage(ctx, entry.Index) - } - } - } - } -} - -func TestStakeStorageRemoveAllPriorToBlock(t *testing.T) { - // keeper, ctx := keepertest.EpochstorageKeeper(t) - _, allkeepers, ctxx := testkeeper.InitAllKeepers(t) - - keeper := allkeepers.Epochstorage - ctx := sdk.UnwrapSDKContext(ctxx) - - items := make([]epochstoragetypes.StakeStorage, stakeStorageSlots) - chainID := "ETH1" - for i := 0; i < len(items); i++ { - items[i].Index = keeper.StakeStorageKey(uint64(i), chainID) - keeper.SetStakeStorage(ctx, items[i]) - } - - for i := 0; i < advanceFewEpochs; i++ { - testkeeper.AdvanceEpoch(ctxx, allkeepers) - } - - removeAllEntriesBeforeBlock(keeper, ctx, 10, []string{"OSMOSISETH1LAV1OSMOSIST"}) - allStorage := keeper.GetAllStakeStorage(ctx) - require.Equal(t, len(allStorage), stakeStorageSlots) // no entry was removed - - removeAllEntriesBeforeBlock(keeper, ctx, 10, []string{"OSMOSIS"}) - allStorage = keeper.GetAllStakeStorage(ctx) - require.Equal(t, len(allStorage), stakeStorageSlots) // no entry was removed - - removeAllEntriesBeforeBlock(keeper, ctx, 0, []string{chainID}) - allStorage = keeper.GetAllStakeStorage(ctx) - require.Equal(t, len(allStorage), stakeStorageSlots) // no entry was removed - - removeAllEntriesBeforeBlock(keeper, ctx, 9, []string{chainID}) - allStorage = keeper.GetAllStakeStorage(ctx) - require.Equal(t, len(allStorage), 1) // one provider - - removeAllEntriesBeforeBlock(keeper, ctx, 10, []string{chainID}) - allStorage = keeper.GetAllStakeStorage(ctx) - require.Equal(t, len(allStorage), 0) // zero entries left - - items[0].Index = strconv.FormatUint(uint64(10), 10) + "" - keeper.SetStakeStorage(ctx, items[0]) - removeAllEntriesBeforeBlock(keeper, ctx, 11, []string{""}) - allStorage = keeper.GetAllStakeStorage(ctx) - require.Equal(t, len(allStorage), 0) // zero entries left -} - -func TestStakeStorageGetAll(t *testing.T) { - keeper, ctx := testkeeper.EpochstorageKeeper(t) - items := createNStakeStorage(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllStakeStorage(ctx)), - ) -} diff --git a/x/epochstorage/module.go b/x/epochstorage/module.go index 79dfdf4a45..75a6aac06a 100644 --- a/x/epochstorage/module.go +++ b/x/epochstorage/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/epochstorage/client/cli" - "github.com/lavanet/lava/x/epochstorage/keeper" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/client/cli" + "github.com/lavanet/lava/v2/x/epochstorage/keeper" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) var ( @@ -130,21 +130,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v2 -> v3 migration - if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.Migrate2to3); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) - } - // register v3 -> v4 migration - if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.Migrate3to4); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) - } - // register v4 -> v5 migration - if err := cfg.RegisterMigration(types.ModuleName, 4, migrator.Migrate4to5); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v5: %w", types.ModuleName, err)) - } // register v5 -> v6 migration if err := cfg.RegisterMigration(types.ModuleName, 5, migrator.Migrate5to6); err != nil { // panic:ok: at start up, migration cannot proceed anyhow @@ -156,6 +141,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // panic:ok: at start up, migration cannot proceed anyhow panic(fmt.Errorf("%s: failed to register migration to v7: %w", types.ModuleName, err)) } + + // register v7 -> v8 migration + if err := cfg.RegisterMigration(types.ModuleName, 7, migrator.Migrate7to8); err != nil { + // panic:ok: at start up, migration cannot proceed anyhow + panic(fmt.Errorf("%s: failed to register migration to v8: %w", types.ModuleName, err)) + } } // RegisterInvariants registers the capability module's invariants. @@ -180,7 +171,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 7 } +func (AppModule) ConsensusVersion() uint64 { return 8 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { diff --git a/x/epochstorage/module_simulation.go b/x/epochstorage/module_simulation.go index d9ea2c57ea..934134aa09 100644 --- a/x/epochstorage/module_simulation.go +++ b/x/epochstorage/module_simulation.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - epochstoragesimulation "github.com/lavanet/lava/x/epochstorage/simulation" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/testutil/sample" + epochstoragesimulation "github.com/lavanet/lava/v2/x/epochstorage/simulation" + "github.com/lavanet/lava/v2/x/epochstorage/types" ) // avoid unused import issue diff --git a/x/epochstorage/types/endpoint.pb.go b/x/epochstorage/types/endpoint.pb.go index c609678ca0..f8a1755eb4 100644 --- a/x/epochstorage/types/endpoint.pb.go +++ b/x/epochstorage/types/endpoint.pb.go @@ -107,7 +107,7 @@ func init() { } var fileDescriptor_acb18a6b0d300ae9 = []byte{ - // 250 bytes of a gzipped FileDescriptorProto + // 253 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xc8, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0xa9, 0xfa, 0xa9, 0x79, 0x29, 0x05, 0xf9, 0x99, 0x79, 0x25, 0x7a, 0x05, 0x45, 0xf9, @@ -119,11 +119,11 @@ var fileDescriptor_acb18a6b0d300ae9 = []byte{ 0xe5, 0xe2, 0x4b, 0x2c, 0xc8, 0x8c, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0x4a, 0x4b, 0x4c, 0x4e, 0x2d, 0x96, 0x60, 0x05, 0xcb, 0xf3, 0x26, 0x16, 0x64, 0x7a, 0xc2, 0x05, 0x85, 0xe4, 0xb8, 0xb8, 0x52, 0x2b, 0x4a, 0x52, 0xf3, 0x8a, 0x33, 0x41, 0x46, 0xb0, 0x81, 0x95, 0x20, 0x89, 0x78, 0xb1, 0x70, - 0x30, 0x09, 0x30, 0x3b, 0xb9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, + 0x30, 0x09, 0x30, 0x3b, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, - 0x4e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x4a, 0xa8, 0x54, 0xa0, - 0x86, 0x4b, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x54, 0x8c, 0x01, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xf3, 0xac, 0x09, 0xa5, 0x41, 0x01, 0x00, 0x00, + 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x4a, 0xa8, 0x94, 0x19, + 0xe9, 0x57, 0xa0, 0x06, 0x4d, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x60, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x21, 0xfe, 0x6a, 0xaa, 0x44, 0x01, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/epoch_details.pb.go b/x/epochstorage/types/epoch_details.pb.go index 7ce975ad56..0be9ebbb24 100644 --- a/x/epochstorage/types/epoch_details.pb.go +++ b/x/epochstorage/types/epoch_details.pb.go @@ -91,7 +91,7 @@ func init() { } var fileDescriptor_5a742d00b5f6efc1 = []byte{ - // 204 bytes of a gzipped FileDescriptorProto + // 207 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcd, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0xa9, 0x10, 0x4e, 0x7c, 0x4a, 0x6a, 0x49, 0x62, 0x66, 0x4e, 0xb1, 0x5e, 0x41, 0x51, @@ -100,11 +100,11 @@ var fileDescriptor_5a742d00b5f6efc1 = []byte{ 0xe5, 0xe4, 0x27, 0x67, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0x21, 0x89, 0x08, 0xa9, 0x70, 0xf1, 0xa6, 0x26, 0x16, 0xe5, 0x64, 0xa6, 0x16, 0x97, 0x04, 0x83, 0x44, 0x25, 0x98, 0xc0, 0x4a, 0x50, 0x05, 0x41, 0xaa, 0x52, 0x52, 0x73, 0x52, 0x4b, 0x52, 0x53, 0xc0, 0x86, 0x17, 0x4b, 0x30, - 0x2b, 0x30, 0x83, 0x54, 0xa1, 0x08, 0x3a, 0xb9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, + 0x2b, 0x30, 0x83, 0x54, 0xa1, 0x08, 0x3a, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, - 0x1c, 0x43, 0x94, 0x4e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x8a, - 0x57, 0x2b, 0x50, 0x3d, 0x5b, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xa5, 0x31, 0x20, - 0x00, 0x00, 0xff, 0xff, 0x37, 0x31, 0xf4, 0x7c, 0x16, 0x01, 0x00, 0x00, + 0x1c, 0x43, 0x94, 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x8a, + 0x57, 0xcb, 0x8c, 0xf4, 0x2b, 0x50, 0xfd, 0x5b, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, + 0xa8, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x92, 0xba, 0x2f, 0x3b, 0x19, 0x01, 0x00, 0x00, } func (m *EpochDetails) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/expected_keepers.go b/x/epochstorage/types/expected_keepers.go index f1ce24f801..906c332fe8 100644 --- a/x/epochstorage/types/expected_keepers.go +++ b/x/epochstorage/types/expected_keepers.go @@ -3,7 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - spectypes "github.com/lavanet/lava/x/spec/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type SpecKeeper interface { diff --git a/x/epochstorage/types/fixated_params.pb.go b/x/epochstorage/types/fixated_params.pb.go index ff8ac4ff02..3781a17d32 100644 --- a/x/epochstorage/types/fixated_params.pb.go +++ b/x/epochstorage/types/fixated_params.pb.go @@ -92,7 +92,7 @@ func init() { } var fileDescriptor_fa13bd82b46f86d2 = []byte{ - // 225 bytes of a gzipped FileDescriptorProto + // 228 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcb, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0xa9, 0xfa, 0x69, 0x99, 0x15, 0x89, 0x25, 0xa9, 0x29, 0xf1, 0x05, 0x89, 0x45, 0x89, @@ -102,12 +102,12 @@ var fileDescriptor_fa13bd82b46f86d2 = []byte{ 0xc2, 0xc5, 0x9a, 0x99, 0x97, 0x92, 0x5a, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe1, 0x08, 0xc9, 0x70, 0x71, 0x82, 0xb5, 0xa5, 0x96, 0xa4, 0x16, 0x49, 0x30, 0x29, 0x30, 0x6a, 0xf0, 0x04, 0x21, 0x04, 0x84, 0x54, 0xb8, 0x78, 0xc1, 0xae, 0xce, 0xcc, 0xcf, 0x73, 0xca, 0xc9, 0x4f, - 0xce, 0x96, 0x60, 0x56, 0x60, 0xd4, 0x60, 0x09, 0x42, 0x15, 0x74, 0x72, 0x3b, 0xf1, 0x48, 0x8e, + 0xce, 0x96, 0x60, 0x56, 0x60, 0xd4, 0x60, 0x09, 0x42, 0x15, 0x74, 0xf2, 0x3c, 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, 0x9d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0x7d, 0x14, 0x77, 0x57, 0xa0, 0xba, 0xbc, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, - 0xec, 0x72, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x8c, 0x24, 0xab, 0x44, 0x01, 0x00, - 0x00, + 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, + 0xfc, 0x5c, 0x7d, 0x14, 0x77, 0x97, 0x19, 0xe9, 0x57, 0xa0, 0x3a, 0xbe, 0xa4, 0xb2, 0x20, 0xb5, + 0x38, 0x89, 0x0d, 0xec, 0x78, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x2d, 0x1a, 0x1b, + 0x47, 0x01, 0x00, 0x00, } func (m *FixatedParams) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/genesis.go b/x/epochstorage/types/genesis.go index ab72171faf..180bce6ac6 100644 --- a/x/epochstorage/types/genesis.go +++ b/x/epochstorage/types/genesis.go @@ -25,11 +25,10 @@ func (gs GenesisState) Validate() error { stakeStorageIndexMap := make(map[string]struct{}) for _, elem := range gs.StakeStorageList { - index := string(StakeStorageKey(elem.Index)) - if _, ok := stakeStorageIndexMap[index]; ok { + if _, ok := stakeStorageIndexMap[elem.Index]; ok { return fmt.Errorf("duplicated index for stakeStorage") } - stakeStorageIndexMap[index] = struct{}{} + stakeStorageIndexMap[elem.Index] = struct{}{} } // Check for duplicated index in fixatedParams fixatedParamsIndexMap := make(map[string]struct{}) diff --git a/x/epochstorage/types/genesis.pb.go b/x/epochstorage/types/genesis.pb.go index 123bd1a991..cd25936c68 100644 --- a/x/epochstorage/types/genesis.pb.go +++ b/x/epochstorage/types/genesis.pb.go @@ -101,7 +101,7 @@ func init() { } var fileDescriptor_6b4c1a9bc1f09c0e = []byte{ - // 315 bytes of a gzipped FileDescriptorProto + // 318 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcf, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0xa9, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, @@ -117,11 +117,11 @@ var fileDescriptor_6b4c1a9bc1f09c0e = []byte{ 0x0b, 0xd4, 0x40, 0x0c, 0x63, 0x84, 0xbc, 0xb9, 0x78, 0xc0, 0x9a, 0x5c, 0x20, 0x5e, 0x96, 0x60, 0x06, 0xbb, 0x10, 0x9f, 0xb1, 0xae, 0x48, 0xca, 0x83, 0x50, 0x34, 0x0b, 0xc5, 0x70, 0x09, 0x42, 0x43, 0x04, 0xe2, 0x0d, 0xb0, 0x43, 0x59, 0xc0, 0x0e, 0xd5, 0xc0, 0x63, 0xa2, 0x1b, 0xb2, 0x1e, - 0xa8, 0x4b, 0x31, 0x0d, 0x72, 0x72, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, + 0xa8, 0x4b, 0x31, 0x0d, 0x72, 0xf2, 0x3c, 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, 0x9d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0xc8, 0xaa, - 0x40, 0x8d, 0xae, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x34, 0x19, 0x03, 0x02, 0x00, - 0x00, 0xff, 0xff, 0xb0, 0xc2, 0x6e, 0xab, 0xb8, 0x02, 0x00, 0x00, + 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0xc8, 0x2a, + 0x33, 0xd2, 0xaf, 0x40, 0x8d, 0xb1, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x4c, 0x19, + 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x64, 0x7f, 0x1e, 0xf0, 0xbb, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/genesis_test.go b/x/epochstorage/types/genesis_test.go index 8045a757a4..8e34d45e9a 100644 --- a/x/epochstorage/types/genesis_test.go +++ b/x/epochstorage/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/epochstorage/types/key_stake_storage.go b/x/epochstorage/types/key_stake_storage.go deleted file mode 100644 index bf87de822e..0000000000 --- a/x/epochstorage/types/key_stake_storage.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import "encoding/binary" - -var _ binary.ByteOrder - -const ( - // StakeStorageKeyPrefix is the prefix to retrieve all StakeStorage - StakeStorageKeyPrefix = "StakeStorage/value/" -) - -// StakeStorageKey returns the store key to retrieve a StakeStorage from the index fields -func StakeStorageKey( - index string, -) []byte { - var key []byte - - indexBytes := []byte(index) - key = append(key, indexBytes...) - key = append(key, []byte("/")...) - - return key -} diff --git a/x/epochstorage/types/migrations/v3/keys.go b/x/epochstorage/types/migrations/v3/keys.go index 04373a6d26..a618f4a591 100644 --- a/x/epochstorage/types/migrations/v3/keys.go +++ b/x/epochstorage/types/migrations/v3/keys.go @@ -22,5 +22,6 @@ func KeyPrefix(p string) []byte { } const ( - EpochDetailsKey = "EpochDetails-value-" + EpochDetailsKey = "EpochDetails-value-" + StakeStorageKeyUnstakeConst = "Unstake" ) diff --git a/x/epochstorage/types/migrations/v4/endpoint.pb.go b/x/epochstorage/types/migrations/v4/endpoint.pb.go deleted file mode 100644 index 93263871ba..0000000000 --- a/x/epochstorage/types/migrations/v4/endpoint.pb.go +++ /dev/null @@ -1,522 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/endpoint.proto - -package v4 - -import ( - fmt "fmt" - 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 - -type Endpoint struct { - IPPORT string `protobuf:"bytes,1,opt,name=iPPORT,proto3" json:"iPPORT,omitempty"` - Geolocation int32 `protobuf:"varint,3,opt,name=geolocation,proto3" json:"geolocation,omitempty"` - Addons []string `protobuf:"bytes,4,rep,name=addons,proto3" json:"addons,omitempty"` - ApiInterfaces []string `protobuf:"bytes,5,rep,name=api_interfaces,json=apiInterfaces,proto3" json:"api_interfaces,omitempty"` - Extensions []string `protobuf:"bytes,6,rep,name=extensions,proto3" json:"extensions,omitempty"` -} - -func (m *Endpoint) Reset() { *m = Endpoint{} } -func (m *Endpoint) String() string { return proto.CompactTextString(m) } -func (*Endpoint) ProtoMessage() {} -func (*Endpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_acb18a6b0d300ae9, []int{0} -} -func (m *Endpoint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Endpoint.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 *Endpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endpoint.Merge(m, src) -} -func (m *Endpoint) XXX_Size() int { - return m.Size() -} -func (m *Endpoint) XXX_DiscardUnknown() { - xxx_messageInfo_Endpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_Endpoint proto.InternalMessageInfo - -func (m *Endpoint) GetIPPORT() string { - if m != nil { - return m.IPPORT - } - return "" -} - -func (m *Endpoint) GetGeolocation() int32 { - if m != nil { - return m.Geolocation - } - return 0 -} - -func (m *Endpoint) GetAddons() []string { - if m != nil { - return m.Addons - } - return nil -} - -func (m *Endpoint) GetApiInterfaces() []string { - if m != nil { - return m.ApiInterfaces - } - return nil -} - -func (m *Endpoint) GetExtensions() []string { - if m != nil { - return m.Extensions - } - return nil -} - -func init() { - proto.RegisterType((*Endpoint)(nil), "lavanet.lava.epochstorage.EndpointV4") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/endpoint.proto", fileDescriptor_acb18a6b0d300ae9) -} - -var fileDescriptor_acb18a6b0d300ae9 = []byte{ - // 250 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xc8, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, - 0x89, 0xe9, 0xa9, 0xfa, 0xa9, 0x79, 0x29, 0x05, 0xf9, 0x99, 0x79, 0x25, 0x7a, 0x05, 0x45, 0xf9, - 0x25, 0xf9, 0x42, 0x92, 0x50, 0x95, 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0xa5, 0xd2, 0x4a, 0x46, 0x2e, - 0x0e, 0x57, 0xa8, 0x6a, 0x21, 0x31, 0x2e, 0xb6, 0xcc, 0x80, 0x00, 0xff, 0xa0, 0x10, 0x09, 0x46, - 0x05, 0x46, 0x0d, 0xce, 0x20, 0x28, 0x4f, 0x48, 0x81, 0x8b, 0x3b, 0x3d, 0x35, 0x3f, 0x27, 0x3f, - 0x39, 0xb1, 0x24, 0x33, 0x3f, 0x4f, 0x82, 0x59, 0x81, 0x51, 0x83, 0x35, 0x08, 0x59, 0x08, 0xa4, - 0x33, 0x31, 0x25, 0x25, 0x3f, 0xaf, 0x58, 0x82, 0x45, 0x81, 0x19, 0xa4, 0x13, 0xc2, 0x13, 0x52, - 0xe5, 0xe2, 0x4b, 0x2c, 0xc8, 0x8c, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0x4a, 0x4b, 0x4c, 0x4e, 0x2d, - 0x96, 0x60, 0x05, 0xcb, 0xf3, 0x26, 0x16, 0x64, 0x7a, 0xc2, 0x05, 0x85, 0xe4, 0xb8, 0xb8, 0x52, - 0x2b, 0x4a, 0x52, 0xf3, 0x8a, 0x33, 0x41, 0x46, 0xb0, 0x81, 0x95, 0x20, 0x89, 0x78, 0xb1, 0x70, - 0x30, 0x09, 0x30, 0x3b, 0xb9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, - 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, - 0x4e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x4a, 0xa8, 0x54, 0xa0, - 0x86, 0x4b, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x54, 0x8c, 0x01, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xf3, 0xac, 0x09, 0xa5, 0x41, 0x01, 0x00, 0x00, -} - -func (m *Endpoint) 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 *Endpoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Extensions) > 0 { - for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Extensions[iNdEx]) - copy(dAtA[i:], m.Extensions[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.Extensions[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.ApiInterfaces) > 0 { - for iNdEx := len(m.ApiInterfaces) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ApiInterfaces[iNdEx]) - copy(dAtA[i:], m.ApiInterfaces[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.ApiInterfaces[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Addons) > 0 { - for iNdEx := len(m.Addons) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Addons[iNdEx]) - copy(dAtA[i:], m.Addons[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.Addons[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if m.Geolocation != 0 { - i = encodeVarintEndpoint(dAtA, i, uint64(m.Geolocation)) - i-- - dAtA[i] = 0x18 - } - if len(m.IPPORT) > 0 { - i -= len(m.IPPORT) - copy(dAtA[i:], m.IPPORT) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.IPPORT))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEndpoint(dAtA []byte, offset int, v uint64) int { - offset -= sovEndpoint(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Endpoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.IPPORT) - if l > 0 { - n += 1 + l + sovEndpoint(uint64(l)) - } - if m.Geolocation != 0 { - n += 1 + sovEndpoint(uint64(m.Geolocation)) - } - if len(m.Addons) > 0 { - for _, s := range m.Addons { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - if len(m.ApiInterfaces) > 0 { - for _, s := range m.ApiInterfaces { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - if len(m.Extensions) > 0 { - for _, s := range m.Extensions { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - return n -} - -func sovEndpoint(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEndpoint(x uint64) (n int) { - return sovEndpoint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Endpoint) 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 ErrIntOverflowEndpoint - } - 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: Endpoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPPORT", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IPPORT = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Geolocation", wireType) - } - m.Geolocation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Geolocation |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addons", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addons = append(m.Addons, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApiInterfaces", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApiInterfaces = append(m.ApiInterfaces, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extensions = append(m.Extensions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEndpoint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEndpoint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEndpoint(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, ErrIntOverflowEndpoint - } - 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, ErrIntOverflowEndpoint - } - 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, ErrIntOverflowEndpoint - } - 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, ErrInvalidLengthEndpoint - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEndpoint - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEndpoint - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEndpoint = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEndpoint = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEndpoint = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/epochstorage/types/migrations/v4/stake_entry.pb.go b/x/epochstorage/types/migrations/v4/stake_entry.pb.go deleted file mode 100644 index 9b24feb2c5..0000000000 --- a/x/epochstorage/types/migrations/v4/stake_entry.pb.go +++ /dev/null @@ -1,763 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/stake_entry.proto - -package v4 - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "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 - -type StakeEntry struct { - Stake types.Coin `protobuf:"bytes,1,opt,name=stake,proto3" json:"stake"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - StakeAppliedBlock uint64 `protobuf:"varint,3,opt,name=stake_applied_block,json=stakeAppliedBlock,proto3" json:"stake_applied_block,omitempty"` - Endpoints []Endpoint `protobuf:"bytes,4,rep,name=endpoints,proto3" json:"endpoints"` - Geolocation int32 `protobuf:"varint,5,opt,name=geolocation,proto3" json:"geolocation,omitempty"` - Chain string `protobuf:"bytes,6,opt,name=chain,proto3" json:"chain,omitempty"` - Moniker string `protobuf:"bytes,8,opt,name=moniker,proto3" json:"moniker,omitempty"` - DelegateTotal types.Coin `protobuf:"bytes,9,opt,name=delegate_total,json=delegateTotal,proto3" json:"delegate_total"` - DelegateLimit types.Coin `protobuf:"bytes,10,opt,name=delegate_limit,json=delegateLimit,proto3" json:"delegate_limit"` - DelegateCommission uint64 `protobuf:"varint,11,opt,name=delegate_commission,json=delegateCommission,proto3" json:"delegate_commission,omitempty"` -} - -func (m *StakeEntry) Reset() { *m = StakeEntry{} } -func (m *StakeEntry) String() string { return proto.CompactTextString(m) } -func (*StakeEntry) ProtoMessage() {} -func (*StakeEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_df6302d6b53c056e, []int{0} -} -func (m *StakeEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StakeEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StakeEntry.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 *StakeEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_StakeEntry.Merge(m, src) -} -func (m *StakeEntry) XXX_Size() int { - return m.Size() -} -func (m *StakeEntry) XXX_DiscardUnknown() { - xxx_messageInfo_StakeEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_StakeEntry proto.InternalMessageInfo - -func (m *StakeEntry) GetStake() types.Coin { - if m != nil { - return m.Stake - } - return types.Coin{} -} - -func (m *StakeEntry) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *StakeEntry) GetStakeAppliedBlock() uint64 { - if m != nil { - return m.StakeAppliedBlock - } - return 0 -} - -func (m *StakeEntry) GetEndpoints() []Endpoint { - if m != nil { - return m.Endpoints - } - return nil -} - -func (m *StakeEntry) GetGeolocation() int32 { - if m != nil { - return m.Geolocation - } - return 0 -} - -func (m *StakeEntry) GetChain() string { - if m != nil { - return m.Chain - } - return "" -} - -func (m *StakeEntry) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *StakeEntry) GetDelegateTotal() types.Coin { - if m != nil { - return m.DelegateTotal - } - return types.Coin{} -} - -func (m *StakeEntry) GetDelegateLimit() types.Coin { - if m != nil { - return m.DelegateLimit - } - return types.Coin{} -} - -func (m *StakeEntry) GetDelegateCommission() uint64 { - if m != nil { - return m.DelegateCommission - } - return 0 -} - -func init() { - proto.RegisterType((*StakeEntry)(nil), "lavanet.lava.epochstorage.StakeEntryV4") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/stake_entry.proto", fileDescriptor_df6302d6b53c056e) -} - -var fileDescriptor_df6302d6b53c056e = []byte{ - // 422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xc1, 0x6e, 0x13, 0x31, - 0x10, 0xcd, 0x92, 0xa4, 0x4d, 0x1c, 0x81, 0xc0, 0xed, 0xc1, 0xed, 0x61, 0x59, 0xc1, 0x65, 0x25, - 0x90, 0xad, 0x16, 0xf1, 0x01, 0xa4, 0x6a, 0x91, 0x10, 0xa7, 0xc0, 0x89, 0x4b, 0xe4, 0xf5, 0x8e, - 0x36, 0x56, 0x76, 0x3d, 0xab, 0xb5, 0xa9, 0xe8, 0x5f, 0xf0, 0x59, 0x3d, 0xf6, 0xc8, 0x09, 0xa1, - 0xe4, 0x03, 0xf8, 0x05, 0xe4, 0xf5, 0x6e, 0x69, 0x0e, 0x91, 0xe0, 0x64, 0xcf, 0xbc, 0x79, 0x4f, - 0xef, 0x8d, 0x86, 0xbc, 0x2a, 0xe5, 0xb5, 0x34, 0xe0, 0x84, 0x7f, 0x05, 0xd4, 0xa8, 0x56, 0xd6, - 0x61, 0x23, 0x0b, 0x10, 0xd6, 0xc9, 0x35, 0x2c, 0xc1, 0xb8, 0xe6, 0x86, 0xd7, 0x0d, 0x3a, 0xa4, - 0x27, 0xdd, 0x30, 0xf7, 0x2f, 0x7f, 0x38, 0x7c, 0x9a, 0xee, 0xd7, 0x01, 0x93, 0xd7, 0xa8, 0x8d, - 0x0b, 0x22, 0xa7, 0xc7, 0x05, 0x16, 0xd8, 0x7e, 0x85, 0xff, 0x75, 0xdd, 0x58, 0xa1, 0xad, 0xd0, - 0x8a, 0x4c, 0x5a, 0x10, 0xd7, 0x67, 0x19, 0x38, 0x79, 0x26, 0x14, 0x6a, 0x13, 0xf0, 0x17, 0xbf, - 0x87, 0x84, 0x7c, 0xf2, 0x86, 0x2e, 0xbd, 0x1f, 0xfa, 0x96, 0x8c, 0x5b, 0x7b, 0x2c, 0x4a, 0xa2, - 0x74, 0x76, 0x7e, 0xc2, 0x03, 0x9d, 0x7b, 0x3a, 0xef, 0xe8, 0xfc, 0x02, 0xb5, 0x99, 0x8f, 0x6e, - 0x7f, 0x3e, 0x1f, 0x2c, 0xc2, 0x34, 0x65, 0xe4, 0x50, 0xe6, 0x79, 0x03, 0xd6, 0xb2, 0x47, 0x49, - 0x94, 0x4e, 0x17, 0x7d, 0x49, 0x39, 0x39, 0x0a, 0x79, 0x65, 0x5d, 0x97, 0x1a, 0xf2, 0x65, 0x56, - 0xa2, 0x5a, 0xb3, 0x61, 0x12, 0xa5, 0xa3, 0xc5, 0xb3, 0x16, 0x7a, 0x17, 0x90, 0xb9, 0x07, 0xe8, - 0x7b, 0x32, 0xed, 0x73, 0x59, 0x36, 0x4a, 0x86, 0xe9, 0xec, 0xfc, 0x25, 0xdf, 0xbb, 0x1e, 0x7e, - 0xd9, 0xcd, 0x76, 0x76, 0xfe, 0x72, 0x69, 0x42, 0x66, 0x05, 0x60, 0x89, 0x4a, 0x3a, 0x8d, 0x86, - 0x8d, 0x93, 0x28, 0x1d, 0x2f, 0x1e, 0xb6, 0xe8, 0x31, 0x19, 0xab, 0x95, 0xd4, 0x86, 0x1d, 0xb4, - 0x96, 0x43, 0xe1, 0xa3, 0x54, 0x68, 0xf4, 0x1a, 0x1a, 0x36, 0x09, 0x51, 0xba, 0x92, 0x5e, 0x91, - 0x27, 0x39, 0x94, 0x50, 0x48, 0x07, 0x4b, 0x87, 0x4e, 0x96, 0x6c, 0xfa, 0x6f, 0x4b, 0x7a, 0xdc, - 0xd3, 0x3e, 0x7b, 0xd6, 0x8e, 0x4e, 0xa9, 0x2b, 0xed, 0x18, 0xf9, 0x4f, 0x9d, 0x8f, 0x9e, 0x45, - 0x05, 0x39, 0xba, 0xd7, 0x51, 0x58, 0x55, 0xda, 0x5a, 0x9f, 0x74, 0xd6, 0xae, 0x96, 0xf6, 0xd0, - 0xc5, 0x3d, 0xf2, 0x61, 0x34, 0x39, 0x7c, 0x3a, 0x99, 0x5f, 0xdd, 0x6e, 0xe2, 0xe8, 0x6e, 0x13, - 0x47, 0xbf, 0x36, 0x71, 0xf4, 0x7d, 0x1b, 0x0f, 0xee, 0xb6, 0xf1, 0xe0, 0xc7, 0x36, 0x1e, 0x7c, - 0x79, 0x5d, 0x68, 0xb7, 0xfa, 0x9a, 0x71, 0x85, 0x95, 0xd8, 0x39, 0xbb, 0x6f, 0xbb, 0x87, 0xe7, - 0x6e, 0x6a, 0xb0, 0xd9, 0x41, 0x7b, 0x40, 0x6f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x45, - 0x2d, 0xb5, 0xea, 0x02, 0x00, 0x00, -} - -func (m *StakeEntry) 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 *StakeEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StakeEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DelegateCommission != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.DelegateCommission)) - i-- - dAtA[i] = 0x58 - } - { - size, err := m.DelegateLimit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - { - size, err := m.DelegateTotal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0x42 - } - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Chain))) - i-- - dAtA[i] = 0x32 - } - if m.Geolocation != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.Geolocation)) - i-- - dAtA[i] = 0x28 - } - if len(m.Endpoints) > 0 { - for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.StakeAppliedBlock != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.StakeAppliedBlock)) - i-- - dAtA[i] = 0x18 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintStakeEntry(dAtA []byte, offset int, v uint64) int { - offset -= sovStakeEntry(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StakeEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Stake.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - if m.StakeAppliedBlock != 0 { - n += 1 + sovStakeEntry(uint64(m.StakeAppliedBlock)) - } - if len(m.Endpoints) > 0 { - for _, e := range m.Endpoints { - l = e.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - } - } - if m.Geolocation != 0 { - n += 1 + sovStakeEntry(uint64(m.Geolocation)) - } - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - l = m.DelegateTotal.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - l = m.DelegateLimit.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - if m.DelegateCommission != 0 { - n += 1 + sovStakeEntry(uint64(m.DelegateCommission)) - } - return n -} - -func sovStakeEntry(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStakeEntry(x uint64) (n int) { - return sovStakeEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StakeEntry) 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 ErrIntOverflowStakeEntry - } - 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: StakeEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakeEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - 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 ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeAppliedBlock", wireType) - } - m.StakeAppliedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StakeAppliedBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Endpoints = append(m.Endpoints, Endpoint{}) - if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Geolocation", wireType) - } - m.Geolocation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Geolocation |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - 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 ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - 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 ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateTotal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DelegateTotal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DelegateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateCommission", wireType) - } - m.DelegateCommission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DelegateCommission |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStakeEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStakeEntry(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, ErrIntOverflowStakeEntry - } - 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, ErrIntOverflowStakeEntry - } - 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, ErrIntOverflowStakeEntry - } - 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, ErrInvalidLengthStakeEntry - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStakeEntry - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStakeEntry - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStakeEntry = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStakeEntry = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStakeEntry = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/epochstorage/types/migrations/v4/stake_storage.pb.go b/x/epochstorage/types/migrations/v4/stake_storage.pb.go deleted file mode 100644 index 431a10618b..0000000000 --- a/x/epochstorage/types/migrations/v4/stake_storage.pb.go +++ /dev/null @@ -1,438 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/stake_storage.proto - -package v4 - -import ( - fmt "fmt" - _ "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 - -type StakeStorage struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - StakeEntries []StakeEntry `protobuf:"bytes,2,rep,name=stakeEntries,proto3" json:"stakeEntries"` - EpochBlockHash []byte `protobuf:"bytes,3,opt,name=epochBlockHash,proto3" json:"epochBlockHash,omitempty"` -} - -func (m *StakeStorage) Reset() { *m = StakeStorage{} } -func (m *StakeStorage) String() string { return proto.CompactTextString(m) } -func (*StakeStorage) ProtoMessage() {} -func (*StakeStorage) Descriptor() ([]byte, []int) { - return fileDescriptor_be7b78aecc265fd4, []int{0} -} -func (m *StakeStorage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StakeStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StakeStorage.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 *StakeStorage) XXX_Merge(src proto.Message) { - xxx_messageInfo_StakeStorage.Merge(m, src) -} -func (m *StakeStorage) XXX_Size() int { - return m.Size() -} -func (m *StakeStorage) XXX_DiscardUnknown() { - xxx_messageInfo_StakeStorage.DiscardUnknown(m) -} - -var xxx_messageInfo_StakeStorage proto.InternalMessageInfo - -func (m *StakeStorage) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *StakeStorage) GetStakeEntries() []StakeEntry { - if m != nil { - return m.StakeEntries - } - return nil -} - -func (m *StakeStorage) GetEpochBlockHash() []byte { - if m != nil { - return m.EpochBlockHash - } - return nil -} - -func init() { - proto.RegisterType((*StakeStorage)(nil), "lavanet.lava.epochstorage.StakeStorageV4") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/stake_storage.proto", fileDescriptor_be7b78aecc265fd4) -} - -var fileDescriptor_be7b78aecc265fd4 = []byte{ - // 246 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcd, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, - 0x89, 0xe9, 0xa9, 0xfa, 0xc5, 0x25, 0x89, 0xd9, 0xa9, 0xf1, 0x50, 0x9e, 0x5e, 0x41, 0x51, 0x7e, - 0x49, 0xbe, 0x90, 0x24, 0x54, 0xb9, 0x1e, 0x88, 0xd6, 0x43, 0x56, 0x2e, 0xa5, 0x4d, 0xc8, 0xa4, - 0xd4, 0xbc, 0x92, 0xa2, 0x4a, 0x88, 0x39, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, - 0x88, 0x05, 0x11, 0x55, 0x9a, 0xcb, 0xc8, 0xc5, 0x13, 0x0c, 0x52, 0x1b, 0x0c, 0xd1, 0x28, 0x24, - 0xc2, 0xc5, 0x9a, 0x99, 0x97, 0x92, 0x5a, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe1, - 0x08, 0xf9, 0x73, 0xf1, 0x80, 0x4d, 0x74, 0xcd, 0x2b, 0x29, 0xca, 0x4c, 0x2d, 0x96, 0x60, 0x52, - 0x60, 0xd6, 0xe0, 0x36, 0x52, 0xd5, 0xc3, 0xe9, 0x36, 0xbd, 0x60, 0x98, 0xf2, 0x4a, 0x27, 0x96, - 0x13, 0xf7, 0xe4, 0x19, 0x82, 0x50, 0x0c, 0x10, 0x52, 0xe3, 0xe2, 0x03, 0x2b, 0x77, 0xca, 0xc9, - 0x4f, 0xce, 0xf6, 0x48, 0x2c, 0xce, 0x90, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, 0x42, 0x13, 0x75, - 0x72, 0x3b, 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, 0x9d, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x70, 0xa8, 0x40, 0x0d, 0x89, 0x92, 0xca, - 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x77, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x2d, - 0xbc, 0x7a, 0x7d, 0x01, 0x00, 0x00, -} - -func (m *StakeStorage) 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 *StakeStorage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StakeStorage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.EpochBlockHash) > 0 { - i -= len(m.EpochBlockHash) - copy(dAtA[i:], m.EpochBlockHash) - i = encodeVarintStakeStorage(dAtA, i, uint64(len(m.EpochBlockHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.StakeEntries) > 0 { - for iNdEx := len(m.StakeEntries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StakeEntries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeStorage(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintStakeStorage(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintStakeStorage(dAtA []byte, offset int, v uint64) int { - offset -= sovStakeStorage(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StakeStorage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovStakeStorage(uint64(l)) - } - if len(m.StakeEntries) > 0 { - for _, e := range m.StakeEntries { - l = e.Size() - n += 1 + l + sovStakeStorage(uint64(l)) - } - } - l = len(m.EpochBlockHash) - if l > 0 { - n += 1 + l + sovStakeStorage(uint64(l)) - } - return n -} - -func sovStakeStorage(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStakeStorage(x uint64) (n int) { - return sovStakeStorage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StakeStorage) 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 ErrIntOverflowStakeStorage - } - 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: StakeStorage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakeStorage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - 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 ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeEntries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StakeEntries = append(m.StakeEntries, StakeEntry{}) - if err := m.StakeEntries[len(m.StakeEntries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochBlockHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EpochBlockHash = append(m.EpochBlockHash[:0], dAtA[iNdEx:postIndex]...) - if m.EpochBlockHash == nil { - m.EpochBlockHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStakeStorage(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeStorage - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStakeStorage(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, ErrIntOverflowStakeStorage - } - 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, ErrIntOverflowStakeStorage - } - 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, ErrIntOverflowStakeStorage - } - 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, ErrInvalidLengthStakeStorage - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStakeStorage - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStakeStorage - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStakeStorage = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStakeStorage = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStakeStorage = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/epochstorage/types/migrations/v5/endpoint.pb.go b/x/epochstorage/types/migrations/v5/endpoint.pb.go deleted file mode 100644 index b9ed97f2f7..0000000000 --- a/x/epochstorage/types/migrations/v5/endpoint.pb.go +++ /dev/null @@ -1,522 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/endpoint.proto - -package types - -import ( - fmt "fmt" - 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 - -type Endpoint struct { - IPPORT string `protobuf:"bytes,1,opt,name=iPPORT,proto3" json:"iPPORT,omitempty"` - Geolocation int32 `protobuf:"varint,3,opt,name=geolocation,proto3" json:"geolocation,omitempty"` - Addons []string `protobuf:"bytes,4,rep,name=addons,proto3" json:"addons,omitempty"` - ApiInterfaces []string `protobuf:"bytes,5,rep,name=api_interfaces,json=apiInterfaces,proto3" json:"api_interfaces,omitempty"` - Extensions []string `protobuf:"bytes,6,rep,name=extensions,proto3" json:"extensions,omitempty"` -} - -func (m *Endpoint) Reset() { *m = Endpoint{} } -func (m *Endpoint) String() string { return proto.CompactTextString(m) } -func (*Endpoint) ProtoMessage() {} -func (*Endpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_acb18a6b0d300ae9, []int{0} -} -func (m *Endpoint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Endpoint.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 *Endpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endpoint.Merge(m, src) -} -func (m *Endpoint) XXX_Size() int { - return m.Size() -} -func (m *Endpoint) XXX_DiscardUnknown() { - xxx_messageInfo_Endpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_Endpoint proto.InternalMessageInfo - -func (m *Endpoint) GetIPPORT() string { - if m != nil { - return m.IPPORT - } - return "" -} - -func (m *Endpoint) GetGeolocation() int32 { - if m != nil { - return m.Geolocation - } - return 0 -} - -func (m *Endpoint) GetAddons() []string { - if m != nil { - return m.Addons - } - return nil -} - -func (m *Endpoint) GetApiInterfaces() []string { - if m != nil { - return m.ApiInterfaces - } - return nil -} - -func (m *Endpoint) GetExtensions() []string { - if m != nil { - return m.Extensions - } - return nil -} - -func init() { - proto.RegisterType((*Endpoint)(nil), "lavanet.lava.epochstorage.EndpointV5") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/endpoint.proto", fileDescriptor_acb18a6b0d300ae9) -} - -var fileDescriptor_acb18a6b0d300ae9 = []byte{ - // 250 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xc8, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, - 0x89, 0xe9, 0xa9, 0xfa, 0xa9, 0x79, 0x29, 0x05, 0xf9, 0x99, 0x79, 0x25, 0x7a, 0x05, 0x45, 0xf9, - 0x25, 0xf9, 0x42, 0x92, 0x50, 0x95, 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0xa5, 0xd2, 0x4a, 0x46, 0x2e, - 0x0e, 0x57, 0xa8, 0x6a, 0x21, 0x31, 0x2e, 0xb6, 0xcc, 0x80, 0x00, 0xff, 0xa0, 0x10, 0x09, 0x46, - 0x05, 0x46, 0x0d, 0xce, 0x20, 0x28, 0x4f, 0x48, 0x81, 0x8b, 0x3b, 0x3d, 0x35, 0x3f, 0x27, 0x3f, - 0x39, 0xb1, 0x24, 0x33, 0x3f, 0x4f, 0x82, 0x59, 0x81, 0x51, 0x83, 0x35, 0x08, 0x59, 0x08, 0xa4, - 0x33, 0x31, 0x25, 0x25, 0x3f, 0xaf, 0x58, 0x82, 0x45, 0x81, 0x19, 0xa4, 0x13, 0xc2, 0x13, 0x52, - 0xe5, 0xe2, 0x4b, 0x2c, 0xc8, 0x8c, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0x4a, 0x4b, 0x4c, 0x4e, 0x2d, - 0x96, 0x60, 0x05, 0xcb, 0xf3, 0x26, 0x16, 0x64, 0x7a, 0xc2, 0x05, 0x85, 0xe4, 0xb8, 0xb8, 0x52, - 0x2b, 0x4a, 0x52, 0xf3, 0x8a, 0x33, 0x41, 0x46, 0xb0, 0x81, 0x95, 0x20, 0x89, 0x78, 0xb1, 0x70, - 0x30, 0x09, 0x30, 0x3b, 0xb9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, - 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, - 0x4e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x4a, 0xa8, 0x54, 0xa0, - 0x86, 0x4b, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x54, 0x8c, 0x01, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xf3, 0xac, 0x09, 0xa5, 0x41, 0x01, 0x00, 0x00, -} - -func (m *Endpoint) 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 *Endpoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Extensions) > 0 { - for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Extensions[iNdEx]) - copy(dAtA[i:], m.Extensions[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.Extensions[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.ApiInterfaces) > 0 { - for iNdEx := len(m.ApiInterfaces) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ApiInterfaces[iNdEx]) - copy(dAtA[i:], m.ApiInterfaces[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.ApiInterfaces[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Addons) > 0 { - for iNdEx := len(m.Addons) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Addons[iNdEx]) - copy(dAtA[i:], m.Addons[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.Addons[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if m.Geolocation != 0 { - i = encodeVarintEndpoint(dAtA, i, uint64(m.Geolocation)) - i-- - dAtA[i] = 0x18 - } - if len(m.IPPORT) > 0 { - i -= len(m.IPPORT) - copy(dAtA[i:], m.IPPORT) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.IPPORT))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEndpoint(dAtA []byte, offset int, v uint64) int { - offset -= sovEndpoint(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Endpoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.IPPORT) - if l > 0 { - n += 1 + l + sovEndpoint(uint64(l)) - } - if m.Geolocation != 0 { - n += 1 + sovEndpoint(uint64(m.Geolocation)) - } - if len(m.Addons) > 0 { - for _, s := range m.Addons { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - if len(m.ApiInterfaces) > 0 { - for _, s := range m.ApiInterfaces { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - if len(m.Extensions) > 0 { - for _, s := range m.Extensions { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - return n -} - -func sovEndpoint(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEndpoint(x uint64) (n int) { - return sovEndpoint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Endpoint) 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 ErrIntOverflowEndpoint - } - 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: Endpoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPPORT", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IPPORT = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Geolocation", wireType) - } - m.Geolocation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Geolocation |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addons", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addons = append(m.Addons, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApiInterfaces", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApiInterfaces = append(m.ApiInterfaces, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - 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 ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extensions = append(m.Extensions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEndpoint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEndpoint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEndpoint(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, ErrIntOverflowEndpoint - } - 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, ErrIntOverflowEndpoint - } - 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, ErrIntOverflowEndpoint - } - 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, ErrInvalidLengthEndpoint - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEndpoint - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEndpoint - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEndpoint = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEndpoint = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEndpoint = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/epochstorage/types/migrations/v5/stake_entry.pb.go b/x/epochstorage/types/migrations/v5/stake_entry.pb.go deleted file mode 100644 index d7e9806ed4..0000000000 --- a/x/epochstorage/types/migrations/v5/stake_entry.pb.go +++ /dev/null @@ -1,1055 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/stake_entry.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "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 - -type StakeEntry struct { - Stake types.Coin `protobuf:"bytes,1,opt,name=stake,proto3" json:"stake"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - StakeAppliedBlock uint64 `protobuf:"varint,3,opt,name=stake_applied_block,json=stakeAppliedBlock,proto3" json:"stake_applied_block,omitempty"` - Endpoints []Endpoint `protobuf:"bytes,4,rep,name=endpoints,proto3" json:"endpoints"` - Geolocation int32 `protobuf:"varint,5,opt,name=geolocation,proto3" json:"geolocation,omitempty"` - Chain string `protobuf:"bytes,6,opt,name=chain,proto3" json:"chain,omitempty"` - Moniker string `protobuf:"bytes,8,opt,name=moniker,proto3" json:"moniker,omitempty"` - DelegateTotal types.Coin `protobuf:"bytes,9,opt,name=delegate_total,json=delegateTotal,proto3" json:"delegate_total"` - DelegateLimit types.Coin `protobuf:"bytes,10,opt,name=delegate_limit,json=delegateLimit,proto3" json:"delegate_limit"` - DelegateCommission uint64 `protobuf:"varint,11,opt,name=delegate_commission,json=delegateCommission,proto3" json:"delegate_commission,omitempty"` - LastChange uint64 `protobuf:"varint,12,opt,name=last_change,json=lastChange,proto3" json:"last_change,omitempty"` - BlockReport *BlockReport `protobuf:"bytes,13,opt,name=block_report,json=blockReport,proto3" json:"block_report,omitempty"` -} - -func (m *StakeEntry) Reset() { *m = StakeEntry{} } -func (m *StakeEntry) String() string { return proto.CompactTextString(m) } -func (*StakeEntry) ProtoMessage() {} -func (*StakeEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_df6302d6b53c056e, []int{0} -} -func (m *StakeEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StakeEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StakeEntry.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 *StakeEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_StakeEntry.Merge(m, src) -} -func (m *StakeEntry) XXX_Size() int { - return m.Size() -} -func (m *StakeEntry) XXX_DiscardUnknown() { - xxx_messageInfo_StakeEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_StakeEntry proto.InternalMessageInfo - -func (m *StakeEntry) GetStake() types.Coin { - if m != nil { - return m.Stake - } - return types.Coin{} -} - -func (m *StakeEntry) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *StakeEntry) GetStakeAppliedBlock() uint64 { - if m != nil { - return m.StakeAppliedBlock - } - return 0 -} - -func (m *StakeEntry) GetEndpoints() []Endpoint { - if m != nil { - return m.Endpoints - } - return nil -} - -func (m *StakeEntry) GetGeolocation() int32 { - if m != nil { - return m.Geolocation - } - return 0 -} - -func (m *StakeEntry) GetChain() string { - if m != nil { - return m.Chain - } - return "" -} - -func (m *StakeEntry) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *StakeEntry) GetDelegateTotal() types.Coin { - if m != nil { - return m.DelegateTotal - } - return types.Coin{} -} - -func (m *StakeEntry) GetDelegateLimit() types.Coin { - if m != nil { - return m.DelegateLimit - } - return types.Coin{} -} - -func (m *StakeEntry) GetDelegateCommission() uint64 { - if m != nil { - return m.DelegateCommission - } - return 0 -} - -func (m *StakeEntry) GetLastChange() uint64 { - if m != nil { - return m.LastChange - } - return 0 -} - -func (m *StakeEntry) GetBlockReport() *BlockReport { - if m != nil { - return m.BlockReport - } - return nil -} - -// BlockReport holds the most up-to-date info regarding blocks of the provider -// It is set in the relay payment TX logic -// used by the consumer to calculate the provider's sync score -type BlockReport struct { - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - LatestBlock uint64 `protobuf:"varint,2,opt,name=latest_block,json=latestBlock,proto3" json:"latest_block,omitempty"` -} - -func (m *BlockReport) Reset() { *m = BlockReport{} } -func (m *BlockReport) String() string { return proto.CompactTextString(m) } -func (*BlockReport) ProtoMessage() {} -func (*BlockReport) Descriptor() ([]byte, []int) { - return fileDescriptor_df6302d6b53c056e, []int{1} -} -func (m *BlockReport) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockReport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockReport.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 *BlockReport) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockReport.Merge(m, src) -} -func (m *BlockReport) XXX_Size() int { - return m.Size() -} -func (m *BlockReport) XXX_DiscardUnknown() { - xxx_messageInfo_BlockReport.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockReport proto.InternalMessageInfo - -func (m *BlockReport) GetEpoch() uint64 { - if m != nil { - return m.Epoch - } - return 0 -} - -func (m *BlockReport) GetLatestBlock() uint64 { - if m != nil { - return m.LatestBlock - } - return 0 -} - -func init() { - proto.RegisterType((*StakeEntry)(nil), "lavanet.lava.epochstorage.StakeEntryV5") - proto.RegisterType((*BlockReport)(nil), "lavanet.lava.epochstorage.BlockReportV5") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/stake_entry.proto", fileDescriptor_df6302d6b53c056e) -} - -var fileDescriptor_df6302d6b53c056e = []byte{ - // 498 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0xb6, 0x74, 0x6b, 0x9d, 0x0e, 0x81, 0xb7, 0x83, 0xb7, 0x43, 0x16, 0x86, 0x84, 0x22, - 0x81, 0x1c, 0x6d, 0x88, 0x1f, 0x40, 0xab, 0x15, 0x81, 0x38, 0x05, 0x4e, 0x5c, 0x2a, 0x27, 0xb1, - 0x52, 0xab, 0x89, 0x5f, 0x14, 0x9b, 0x89, 0xfd, 0x0b, 0x7e, 0xd6, 0x8e, 0x3b, 0x22, 0x21, 0x21, - 0xd4, 0xfe, 0x11, 0x64, 0x3b, 0xdd, 0xda, 0xc3, 0x10, 0x3b, 0xd9, 0xef, 0x7d, 0xdf, 0xf7, 0xf4, - 0xbd, 0xe7, 0x67, 0xf4, 0xaa, 0x62, 0x57, 0x4c, 0x72, 0x9d, 0x98, 0x33, 0xe1, 0x0d, 0xe4, 0x73, - 0xa5, 0xa1, 0x65, 0x25, 0x4f, 0x94, 0x66, 0x0b, 0x3e, 0xe3, 0x52, 0xb7, 0xd7, 0xb4, 0x69, 0x41, - 0x03, 0x3e, 0xee, 0xc8, 0xd4, 0x9c, 0x74, 0x93, 0x7c, 0x12, 0x3f, 0x5c, 0x87, 0xcb, 0xa2, 0x01, - 0x21, 0xb5, 0x2b, 0x72, 0x72, 0x54, 0x42, 0x09, 0xf6, 0x9a, 0x98, 0x5b, 0x97, 0x0d, 0x73, 0x50, - 0x35, 0xa8, 0x24, 0x63, 0x8a, 0x27, 0x57, 0xe7, 0x19, 0xd7, 0xec, 0x3c, 0xc9, 0x41, 0x48, 0x87, - 0x9f, 0xfd, 0xf2, 0x11, 0xfa, 0x6c, 0x0c, 0x5d, 0x1a, 0x3f, 0xf8, 0x2d, 0xea, 0x5b, 0x7b, 0xc4, - 0x8b, 0xbc, 0x38, 0xb8, 0x38, 0xa6, 0x4e, 0x4e, 0x8d, 0x9c, 0x76, 0x72, 0x3a, 0x01, 0x21, 0xc7, - 0xfe, 0xcd, 0xef, 0xd3, 0x5e, 0xea, 0xd8, 0x98, 0xa0, 0x7d, 0x56, 0x14, 0x2d, 0x57, 0x8a, 0xec, - 0x44, 0x5e, 0x3c, 0x4c, 0xd7, 0x21, 0xa6, 0xe8, 0xd0, 0xf5, 0xcb, 0x9a, 0xa6, 0x12, 0xbc, 0x98, - 0x65, 0x15, 0xe4, 0x0b, 0xb2, 0x1b, 0x79, 0xb1, 0x9f, 0x3e, 0xb3, 0xd0, 0x3b, 0x87, 0x8c, 0x0d, - 0x80, 0xdf, 0xa3, 0xe1, 0xba, 0x2f, 0x45, 0xfc, 0x68, 0x37, 0x0e, 0x2e, 0x5e, 0xd0, 0x07, 0xc7, - 0x43, 0x2f, 0x3b, 0x6e, 0x67, 0xe7, 0x5e, 0x8b, 0x23, 0x14, 0x94, 0x1c, 0x2a, 0xc8, 0x99, 0x16, - 0x20, 0x49, 0x3f, 0xf2, 0xe2, 0x7e, 0xba, 0x99, 0xc2, 0x47, 0xa8, 0x9f, 0xcf, 0x99, 0x90, 0x64, - 0xcf, 0x5a, 0x76, 0x81, 0x69, 0xa5, 0x06, 0x29, 0x16, 0xbc, 0x25, 0x03, 0xd7, 0x4a, 0x17, 0xe2, - 0x29, 0x7a, 0x52, 0xf0, 0x8a, 0x97, 0x4c, 0xf3, 0x99, 0x06, 0xcd, 0x2a, 0x32, 0xfc, 0xbf, 0x21, - 0x1d, 0xac, 0x65, 0x5f, 0x8c, 0x6a, 0xab, 0x4e, 0x25, 0x6a, 0xa1, 0x09, 0x7a, 0x64, 0x9d, 0x4f, - 0x46, 0x85, 0x13, 0x74, 0x78, 0x57, 0x27, 0x87, 0xba, 0x16, 0x4a, 0x99, 0x4e, 0x03, 0x3b, 0x5a, - 0xbc, 0x86, 0x26, 0x77, 0x08, 0x3e, 0x45, 0x41, 0xc5, 0x94, 0x9e, 0xe5, 0x73, 0x26, 0x4b, 0x4e, - 0x46, 0x96, 0x88, 0x4c, 0x6a, 0x62, 0x33, 0xf8, 0x03, 0x1a, 0xd9, 0xe7, 0x99, 0xb5, 0xbc, 0x81, - 0x56, 0x93, 0x03, 0xeb, 0xeb, 0xe5, 0x3f, 0xe6, 0x6f, 0x1f, 0x2d, 0xb5, 0xec, 0x34, 0xc8, 0xee, - 0x83, 0x8f, 0xfe, 0x60, 0xff, 0xe9, 0xe0, 0x6c, 0x8a, 0x82, 0x0d, 0x86, 0x99, 0xb8, 0x55, 0xdb, - 0xed, 0xf2, 0x53, 0x17, 0xe0, 0xe7, 0x68, 0x54, 0x31, 0xcd, 0x95, 0xee, 0x76, 0x63, 0xc7, 0x82, - 0x81, 0xcb, 0x59, 0xf9, 0x78, 0x7a, 0xb3, 0x0c, 0xbd, 0xdb, 0x65, 0xe8, 0xfd, 0x59, 0x86, 0xde, - 0x8f, 0x55, 0xd8, 0xbb, 0x5d, 0x85, 0xbd, 0x9f, 0xab, 0xb0, 0xf7, 0xf5, 0x75, 0x29, 0xf4, 0xfc, - 0x5b, 0x46, 0x73, 0xa8, 0x93, 0xad, 0xaf, 0xf2, 0x7d, 0xfb, 0xb3, 0xe8, 0xeb, 0x86, 0xab, 0x6c, - 0xcf, 0x2e, 0xfd, 0x9b, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x58, 0x95, 0x4a, 0xd0, 0x9e, 0x03, - 0x00, 0x00, -} - -func (m *StakeEntry) 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 *StakeEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StakeEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BlockReport != nil { - { - size, err := m.BlockReport.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if m.LastChange != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.LastChange)) - i-- - dAtA[i] = 0x60 - } - if m.DelegateCommission != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.DelegateCommission)) - i-- - dAtA[i] = 0x58 - } - { - size, err := m.DelegateLimit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - { - size, err := m.DelegateTotal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0x42 - } - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Chain))) - i-- - dAtA[i] = 0x32 - } - if m.Geolocation != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.Geolocation)) - i-- - dAtA[i] = 0x28 - } - if len(m.Endpoints) > 0 { - for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.StakeAppliedBlock != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.StakeAppliedBlock)) - i-- - dAtA[i] = 0x18 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *BlockReport) 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 *BlockReport) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LatestBlock != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.LatestBlock)) - i-- - dAtA[i] = 0x10 - } - if m.Epoch != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.Epoch)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintStakeEntry(dAtA []byte, offset int, v uint64) int { - offset -= sovStakeEntry(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StakeEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Stake.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - if m.StakeAppliedBlock != 0 { - n += 1 + sovStakeEntry(uint64(m.StakeAppliedBlock)) - } - if len(m.Endpoints) > 0 { - for _, e := range m.Endpoints { - l = e.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - } - } - if m.Geolocation != 0 { - n += 1 + sovStakeEntry(uint64(m.Geolocation)) - } - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - l = m.DelegateTotal.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - l = m.DelegateLimit.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - if m.DelegateCommission != 0 { - n += 1 + sovStakeEntry(uint64(m.DelegateCommission)) - } - if m.LastChange != 0 { - n += 1 + sovStakeEntry(uint64(m.LastChange)) - } - if m.BlockReport != nil { - l = m.BlockReport.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - } - return n -} - -func (m *BlockReport) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Epoch != 0 { - n += 1 + sovStakeEntry(uint64(m.Epoch)) - } - if m.LatestBlock != 0 { - n += 1 + sovStakeEntry(uint64(m.LatestBlock)) - } - return n -} - -func sovStakeEntry(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStakeEntry(x uint64) (n int) { - return sovStakeEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StakeEntry) 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 ErrIntOverflowStakeEntry - } - 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: StakeEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakeEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - 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 ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeAppliedBlock", wireType) - } - m.StakeAppliedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StakeAppliedBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Endpoints = append(m.Endpoints, Endpoint{}) - if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Geolocation", wireType) - } - m.Geolocation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Geolocation |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - 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 ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - 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 ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateTotal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DelegateTotal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DelegateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateCommission", wireType) - } - m.DelegateCommission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DelegateCommission |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastChange", wireType) - } - m.LastChange = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastChange |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockReport", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockReport == nil { - m.BlockReport = &BlockReport{} - } - if err := m.BlockReport.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStakeEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockReport) 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 ErrIntOverflowStakeEntry - } - 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: BlockReport: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockReport: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) - } - m.Epoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Epoch |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LatestBlock", wireType) - } - m.LatestBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LatestBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStakeEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStakeEntry(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, ErrIntOverflowStakeEntry - } - 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, ErrIntOverflowStakeEntry - } - 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, ErrIntOverflowStakeEntry - } - 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, ErrInvalidLengthStakeEntry - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStakeEntry - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStakeEntry - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStakeEntry = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStakeEntry = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStakeEntry = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/epochstorage/types/migrations/v5/stake_storage.pb.go b/x/epochstorage/types/migrations/v5/stake_storage.pb.go deleted file mode 100644 index dd257db346..0000000000 --- a/x/epochstorage/types/migrations/v5/stake_storage.pb.go +++ /dev/null @@ -1,438 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/stake_storage.proto - -package types - -import ( - fmt "fmt" - _ "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 - -type StakeStorage struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - StakeEntries []StakeEntry `protobuf:"bytes,2,rep,name=stakeEntries,proto3" json:"stakeEntries"` - EpochBlockHash []byte `protobuf:"bytes,3,opt,name=epochBlockHash,proto3" json:"epochBlockHash,omitempty"` -} - -func (m *StakeStorage) Reset() { *m = StakeStorage{} } -func (m *StakeStorage) String() string { return proto.CompactTextString(m) } -func (*StakeStorage) ProtoMessage() {} -func (*StakeStorage) Descriptor() ([]byte, []int) { - return fileDescriptor_be7b78aecc265fd4, []int{0} -} -func (m *StakeStorage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StakeStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StakeStorage.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 *StakeStorage) XXX_Merge(src proto.Message) { - xxx_messageInfo_StakeStorage.Merge(m, src) -} -func (m *StakeStorage) XXX_Size() int { - return m.Size() -} -func (m *StakeStorage) XXX_DiscardUnknown() { - xxx_messageInfo_StakeStorage.DiscardUnknown(m) -} - -var xxx_messageInfo_StakeStorage proto.InternalMessageInfo - -func (m *StakeStorage) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *StakeStorage) GetStakeEntries() []StakeEntry { - if m != nil { - return m.StakeEntries - } - return nil -} - -func (m *StakeStorage) GetEpochBlockHash() []byte { - if m != nil { - return m.EpochBlockHash - } - return nil -} - -func init() { - proto.RegisterType((*StakeStorage)(nil), "lavanet.lava.epochstorage.StakeStorageV5") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/stake_storage.proto", fileDescriptor_be7b78aecc265fd4) -} - -var fileDescriptor_be7b78aecc265fd4 = []byte{ - // 246 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcd, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, - 0x89, 0xe9, 0xa9, 0xfa, 0xc5, 0x25, 0x89, 0xd9, 0xa9, 0xf1, 0x50, 0x9e, 0x5e, 0x41, 0x51, 0x7e, - 0x49, 0xbe, 0x90, 0x24, 0x54, 0xb9, 0x1e, 0x88, 0xd6, 0x43, 0x56, 0x2e, 0xa5, 0x4d, 0xc8, 0xa4, - 0xd4, 0xbc, 0x92, 0xa2, 0x4a, 0x88, 0x39, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, - 0x88, 0x05, 0x11, 0x55, 0x9a, 0xcb, 0xc8, 0xc5, 0x13, 0x0c, 0x52, 0x1b, 0x0c, 0xd1, 0x28, 0x24, - 0xc2, 0xc5, 0x9a, 0x99, 0x97, 0x92, 0x5a, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe1, - 0x08, 0xf9, 0x73, 0xf1, 0x80, 0x4d, 0x74, 0xcd, 0x2b, 0x29, 0xca, 0x4c, 0x2d, 0x96, 0x60, 0x52, - 0x60, 0xd6, 0xe0, 0x36, 0x52, 0xd5, 0xc3, 0xe9, 0x36, 0xbd, 0x60, 0x98, 0xf2, 0x4a, 0x27, 0x96, - 0x13, 0xf7, 0xe4, 0x19, 0x82, 0x50, 0x0c, 0x10, 0x52, 0xe3, 0xe2, 0x03, 0x2b, 0x77, 0xca, 0xc9, - 0x4f, 0xce, 0xf6, 0x48, 0x2c, 0xce, 0x90, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, 0x42, 0x13, 0x75, - 0x72, 0x3b, 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, 0x9d, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x70, 0xa8, 0x40, 0x0d, 0x89, 0x92, 0xca, - 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x77, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x2d, - 0xbc, 0x7a, 0x7d, 0x01, 0x00, 0x00, -} - -func (m *StakeStorage) 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 *StakeStorage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StakeStorage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.EpochBlockHash) > 0 { - i -= len(m.EpochBlockHash) - copy(dAtA[i:], m.EpochBlockHash) - i = encodeVarintStakeStorage(dAtA, i, uint64(len(m.EpochBlockHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.StakeEntries) > 0 { - for iNdEx := len(m.StakeEntries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StakeEntries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeStorage(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintStakeStorage(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintStakeStorage(dAtA []byte, offset int, v uint64) int { - offset -= sovStakeStorage(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StakeStorage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovStakeStorage(uint64(l)) - } - if len(m.StakeEntries) > 0 { - for _, e := range m.StakeEntries { - l = e.Size() - n += 1 + l + sovStakeStorage(uint64(l)) - } - } - l = len(m.EpochBlockHash) - if l > 0 { - n += 1 + l + sovStakeStorage(uint64(l)) - } - return n -} - -func sovStakeStorage(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStakeStorage(x uint64) (n int) { - return sovStakeStorage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StakeStorage) 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 ErrIntOverflowStakeStorage - } - 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: StakeStorage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakeStorage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - 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 ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeEntries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StakeEntries = append(m.StakeEntries, StakeEntry{}) - if err := m.StakeEntries[len(m.StakeEntries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochBlockHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EpochBlockHash = append(m.EpochBlockHash[:0], dAtA[iNdEx:postIndex]...) - if m.EpochBlockHash == nil { - m.EpochBlockHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStakeStorage(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeStorage - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStakeStorage(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, ErrIntOverflowStakeStorage - } - 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, ErrIntOverflowStakeStorage - } - 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, ErrIntOverflowStakeStorage - } - 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, ErrInvalidLengthStakeStorage - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStakeStorage - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStakeStorage - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStakeStorage = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStakeStorage = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStakeStorage = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/epochstorage/types/migrations/v6/endpoint.pb.go b/x/epochstorage/types/migrations/v6/endpoint.pb.go index 576ee1e357..ed0ac20326 100644 --- a/x/epochstorage/types/migrations/v6/endpoint.pb.go +++ b/x/epochstorage/types/migrations/v6/endpoint.pb.go @@ -519,4 +519,4 @@ var ( ErrInvalidLengthEndpoint = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEndpoint = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupEndpoint = fmt.Errorf("proto: unexpected end of group") -) +) \ No newline at end of file diff --git a/x/epochstorage/types/migrations/v6/stake_entry.pb.go b/x/epochstorage/types/migrations/v6/stake_entry.pb.go index 1e807c5351..ae92f42631 100644 --- a/x/epochstorage/types/migrations/v6/stake_entry.pb.go +++ b/x/epochstorage/types/migrations/v6/stake_entry.pb.go @@ -1103,4 +1103,4 @@ var ( ErrInvalidLengthStakeEntry = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowStakeEntry = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupStakeEntry = fmt.Errorf("proto: unexpected end of group") -) +) \ No newline at end of file diff --git a/x/epochstorage/types/migrations/v6/stake_storage.pb.go b/x/epochstorage/types/migrations/v6/stake_storage.pb.go index 3e68d424ab..bf34c57f4b 100644 --- a/x/epochstorage/types/migrations/v6/stake_storage.pb.go +++ b/x/epochstorage/types/migrations/v6/stake_storage.pb.go @@ -435,4 +435,4 @@ var ( ErrInvalidLengthStakeStorage = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowStakeStorage = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupStakeStorage = fmt.Errorf("proto: unexpected end of group") -) +) \ No newline at end of file diff --git a/x/epochstorage/types/params.go b/x/epochstorage/types/params.go index 3acf9439db..f6c42e3381 100644 --- a/x/epochstorage/types/params.go +++ b/x/epochstorage/types/params.go @@ -9,11 +9,6 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) -var ( - KeyUnstakeHoldBlocks = []byte("UnstakeHoldBlocks") - DefaultUnstakeHoldBlocks uint64 = 210 -) - var ( KeyEpochBlocks = []byte("EpochBlocks") DefaultEpochBlocks uint64 = 20 @@ -29,11 +24,6 @@ var ( DefaultLatestParamChange uint64 = 0 ) -var ( - KeyUnstakeHoldBlocksStatic = []byte("UnstakeHoldBlocksStatic") - DefaultUnstakeHoldBlocksStatic uint64 = 400 -) - // ParamKeyTable the param key table for launch module func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) @@ -41,49 +31,37 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams( - unstakeHoldBlocks uint64, epochBlocks uint64, epochsToSave uint64, latestParamChange uint64, - unstakeHoldBlocksStatic uint64, ) Params { return Params{ - UnstakeHoldBlocks: unstakeHoldBlocks, - EpochBlocks: epochBlocks, - EpochsToSave: epochsToSave, - LatestParamChange: latestParamChange, - UnstakeHoldBlocksStatic: unstakeHoldBlocksStatic, + EpochBlocks: epochBlocks, + EpochsToSave: epochsToSave, + LatestParamChange: latestParamChange, } } // DefaultParams returns a default set of parameters func DefaultParams() Params { return NewParams( - DefaultUnstakeHoldBlocks, DefaultEpochBlocks, DefaultEpochsToSave, DefaultLatestParamChange, - DefaultUnstakeHoldBlocksStatic, ) } // ParamSetPairs get the params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyUnstakeHoldBlocks, &p.UnstakeHoldBlocks, validateUnstakeHoldBlocks), paramtypes.NewParamSetPair(KeyEpochBlocks, &p.EpochBlocks, validateEpochBlocks), paramtypes.NewParamSetPair(KeyEpochsToSave, &p.EpochsToSave, validateEpochsToSave), paramtypes.NewParamSetPair(KeyLatestParamChange, &p.LatestParamChange, validateLatestParamChange), - paramtypes.NewParamSetPair(KeyUnstakeHoldBlocksStatic, &p.UnstakeHoldBlocksStatic, validateUnstakeHoldBlocksStatic), } } // Validate validates the set of params func (p Params) Validate() error { - if err := validateUnstakeHoldBlocks(p.UnstakeHoldBlocks); err != nil { - return err - } - if err := validateEpochBlocks(p.EpochBlocks); err != nil { return err } @@ -92,14 +70,6 @@ func (p Params) Validate() error { return err } - if err := validateUnstakeHoldBlocksStatic(p.UnstakeHoldBlocksStatic); err != nil { - return err - } - - if err := validateBlocksParams(p.UnstakeHoldBlocks, p.UnstakeHoldBlocksStatic, p.EpochBlocks*p.EpochsToSave); err != nil { - return err - } - return nil } @@ -109,19 +79,6 @@ func (p Params) String() string { return string(out) } -// validateUnstakeHoldBlocks validates the UnstakeHoldBlocks param -func validateUnstakeHoldBlocks(v interface{}) error { - unstakeHoldBlocks, ok := v.(uint64) - if !ok { - return fmt.Errorf("invalid parameter type: %T", v) - } - - // TODO implement validation - _ = unstakeHoldBlocks - - return nil -} - // validateEpochBlocks validates the EpochBlocks param func validateEpochBlocks(v interface{}) error { epochBlocks, ok := v.(uint64) @@ -159,25 +116,3 @@ func validateLatestParamChange(v interface{}) error { return nil } - -// validateUnstakeHoldBlocks validates the UnstakeHoldBlocks param -func validateUnstakeHoldBlocksStatic(v interface{}) error { - unstakeHoldBlocks, ok := v.(uint64) - if !ok { - return fmt.Errorf("invalid parameter type: %T", v) - } - - // TODO implement validation - _ = unstakeHoldBlocks - - return nil -} - -// validateUnstakeHoldBlocks validates the UnstakeHoldBlocks param -func validateBlocksParams(unstakeHoldBlocks, unstakeHoldBlocksStatic, blocksToSave uint64) error { - if !(unstakeHoldBlocksStatic > unstakeHoldBlocks && unstakeHoldBlocks > blocksToSave) { - return fmt.Errorf("parameters do not follow the rule of: unstakeHoldBlocksStatic > unstakeHoldBlocks > blocksToSave") - } - - return nil -} diff --git a/x/epochstorage/types/params.pb.go b/x/epochstorage/types/params.pb.go index a9226e0e1d..e9068a9939 100644 --- a/x/epochstorage/types/params.pb.go +++ b/x/epochstorage/types/params.pb.go @@ -25,11 +25,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - UnstakeHoldBlocks uint64 `protobuf:"varint,1,opt,name=unstakeHoldBlocks,proto3" json:"unstakeHoldBlocks,omitempty" yaml:"unstake_hold_blocks"` - EpochBlocks uint64 `protobuf:"varint,2,opt,name=epochBlocks,proto3" json:"epochBlocks,omitempty" yaml:"epoch_blocks"` - EpochsToSave uint64 `protobuf:"varint,3,opt,name=epochsToSave,proto3" json:"epochsToSave,omitempty" yaml:"epochs_to_save"` - LatestParamChange uint64 `protobuf:"varint,4,opt,name=latestParamChange,proto3" json:"latestParamChange,omitempty" yaml:"latest_param_change"` - UnstakeHoldBlocksStatic uint64 `protobuf:"varint,5,opt,name=unstakeHoldBlocksStatic,proto3" json:"unstakeHoldBlocksStatic,omitempty" yaml:"unstake_hold_blocks_static"` + EpochBlocks uint64 `protobuf:"varint,2,opt,name=epochBlocks,proto3" json:"epochBlocks,omitempty" yaml:"epoch_blocks"` + EpochsToSave uint64 `protobuf:"varint,3,opt,name=epochsToSave,proto3" json:"epochsToSave,omitempty" yaml:"epochs_to_save"` + LatestParamChange uint64 `protobuf:"varint,4,opt,name=latestParamChange,proto3" json:"latestParamChange,omitempty" yaml:"latest_param_change"` } func (m *Params) Reset() { *m = Params{} } @@ -64,13 +62,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetUnstakeHoldBlocks() uint64 { - if m != nil { - return m.UnstakeHoldBlocks - } - return 0 -} - func (m *Params) GetEpochBlocks() uint64 { if m != nil { return m.EpochBlocks @@ -92,13 +83,6 @@ func (m *Params) GetLatestParamChange() uint64 { return 0 } -func (m *Params) GetUnstakeHoldBlocksStatic() uint64 { - if m != nil { - return m.UnstakeHoldBlocksStatic - } - return 0 -} - func init() { proto.RegisterType((*Params)(nil), "lavanet.lava.epochstorage.Params") } @@ -108,29 +92,26 @@ func init() { } var fileDescriptor_09513f4cf6e403e6 = []byte{ - // 339 bytes of a gzipped FileDescriptorProto + // 290 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcb, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0xa9, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x92, 0x50, 0x75, 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0x9d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, - 0x58, 0x95, 0x3e, 0x88, 0x05, 0xd1, 0xa0, 0xd4, 0xca, 0xcc, 0xc5, 0x16, 0x00, 0x36, 0x41, 0xc8, - 0x87, 0x4b, 0xb0, 0x34, 0xaf, 0xb8, 0x24, 0x31, 0x3b, 0xd5, 0x23, 0x3f, 0x27, 0xc5, 0x29, 0x27, - 0x3f, 0x39, 0xbb, 0x58, 0x82, 0x51, 0x81, 0x51, 0x83, 0xc5, 0x49, 0xee, 0xd3, 0x3d, 0x79, 0xa9, - 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0xa8, 0x92, 0xf8, 0x8c, 0xfc, 0x9c, 0x94, 0xf8, 0x24, 0xb0, - 0x22, 0xa5, 0x20, 0x4c, 0x8d, 0x42, 0x96, 0x5c, 0xdc, 0x60, 0xeb, 0xa1, 0xe6, 0x30, 0x81, 0xcd, - 0x11, 0xff, 0x74, 0x4f, 0x5e, 0x18, 0x62, 0x0e, 0x58, 0x12, 0x6e, 0x00, 0xb2, 0x5a, 0x21, 0x5b, - 0x2e, 0x1e, 0x88, 0xcb, 0x43, 0xf2, 0x83, 0x13, 0xcb, 0x52, 0x25, 0x98, 0xc1, 0x7a, 0x25, 0x3f, - 0xdd, 0x93, 0x17, 0x45, 0xd2, 0x5b, 0x1c, 0x5f, 0x92, 0x1f, 0x5f, 0x9c, 0x58, 0x96, 0xaa, 0x14, - 0x84, 0xa2, 0x1c, 0xe4, 0x8f, 0x9c, 0xc4, 0x92, 0xd4, 0xe2, 0x12, 0xb0, 0xbf, 0x9c, 0x33, 0x12, - 0xf3, 0xd2, 0x53, 0x25, 0x58, 0xd0, 0xfd, 0x01, 0x51, 0x12, 0x0f, 0x0e, 0xbd, 0xf8, 0x64, 0xb0, - 0x22, 0xa5, 0x20, 0x4c, 0x8d, 0x42, 0xf1, 0x5c, 0xe2, 0x18, 0x9e, 0x0b, 0x2e, 0x49, 0x2c, 0xc9, - 0x4c, 0x96, 0x60, 0x05, 0x9b, 0xa9, 0xfa, 0xe9, 0x9e, 0xbc, 0x22, 0xce, 0xb0, 0x89, 0x2f, 0x06, - 0xab, 0x55, 0x0a, 0xc2, 0x65, 0x8a, 0x15, 0xcb, 0x8c, 0x05, 0xf2, 0x0c, 0x4e, 0x6e, 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, 0x93, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, - 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0x92, 0x0a, 0x2a, 0x50, 0xd3, 0x41, 0x49, 0x65, 0x41, 0x6a, 0x71, - 0x12, 0x1b, 0x38, 0x5a, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x49, 0x7a, 0x21, 0x66, 0x31, - 0x02, 0x00, 0x00, + 0x58, 0x95, 0x3e, 0x88, 0x05, 0xd1, 0xa0, 0xf4, 0x88, 0x91, 0x8b, 0x2d, 0x00, 0x6c, 0x82, 0x90, + 0x25, 0x17, 0x37, 0x58, 0x83, 0x53, 0x4e, 0x7e, 0x72, 0x76, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, + 0x8b, 0x93, 0xf8, 0xa7, 0x7b, 0xf2, 0xc2, 0x95, 0x89, 0xb9, 0x39, 0x56, 0x4a, 0x60, 0xc9, 0xf8, + 0x24, 0xb0, 0xac, 0x52, 0x10, 0xb2, 0x5a, 0x21, 0x5b, 0x2e, 0x1e, 0x88, 0x5d, 0x21, 0xf9, 0xc1, + 0x89, 0x65, 0xa9, 0x12, 0xcc, 0x60, 0xbd, 0x92, 0x9f, 0xee, 0xc9, 0x8b, 0x22, 0xe9, 0x2d, 0x8e, + 0x2f, 0xc9, 0x8f, 0x2f, 0x4e, 0x2c, 0x4b, 0x55, 0x0a, 0x42, 0x51, 0x2e, 0xe4, 0xc3, 0x25, 0x98, + 0x93, 0x58, 0x92, 0x5a, 0x5c, 0x02, 0x76, 0x89, 0x73, 0x46, 0x62, 0x5e, 0x7a, 0xaa, 0x04, 0x0b, + 0xd8, 0x0c, 0xb9, 0x4f, 0xf7, 0xe4, 0xa5, 0x20, 0x66, 0x40, 0x94, 0xc4, 0x83, 0xfd, 0x1b, 0x9f, + 0x0c, 0x56, 0xa4, 0x14, 0x84, 0xa9, 0xd1, 0x8a, 0x65, 0xc6, 0x02, 0x79, 0x06, 0x2f, 0x16, 0x0e, + 0x46, 0x01, 0x26, 0x2f, 0x16, 0x0e, 0x56, 0x01, 0x36, 0x27, 0xcf, 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, 0xd2, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, + 0xd5, 0x47, 0x09, 0xe2, 0x32, 0x23, 0xfd, 0x0a, 0xd4, 0x70, 0x2e, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, + 0x62, 0x03, 0x07, 0x9b, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x9c, 0xe6, 0x8e, 0x91, 0x01, + 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -153,11 +134,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.UnstakeHoldBlocksStatic != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.UnstakeHoldBlocksStatic)) - i-- - dAtA[i] = 0x28 - } if m.LatestParamChange != 0 { i = encodeVarintParams(dAtA, i, uint64(m.LatestParamChange)) i-- @@ -173,11 +149,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if m.UnstakeHoldBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.UnstakeHoldBlocks)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } @@ -198,9 +169,6 @@ func (m *Params) Size() (n int) { } var l int _ = l - if m.UnstakeHoldBlocks != 0 { - n += 1 + sovParams(uint64(m.UnstakeHoldBlocks)) - } if m.EpochBlocks != 0 { n += 1 + sovParams(uint64(m.EpochBlocks)) } @@ -210,9 +178,6 @@ func (m *Params) Size() (n int) { if m.LatestParamChange != 0 { n += 1 + sovParams(uint64(m.LatestParamChange)) } - if m.UnstakeHoldBlocksStatic != 0 { - n += 1 + sovParams(uint64(m.UnstakeHoldBlocksStatic)) - } return n } @@ -251,25 +216,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { 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 UnstakeHoldBlocks", wireType) - } - m.UnstakeHoldBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnstakeHoldBlocks |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field EpochBlocks", wireType) @@ -327,25 +273,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnstakeHoldBlocksStatic", wireType) - } - m.UnstakeHoldBlocksStatic = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnstakeHoldBlocksStatic |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/epochstorage/types/query.pb.go b/x/epochstorage/types/query.pb.go index 59a9c99841..3a6786bb67 100644 --- a/x/epochstorage/types/query.pb.go +++ b/x/epochstorage/types/query.pb.go @@ -582,51 +582,51 @@ func init() { } var fileDescriptor_60112e15fc266719 = []byte{ - // 700 bytes of a gzipped FileDescriptorProto + // 703 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x4f, 0xd4, 0x40, - 0x14, 0xc7, 0x77, 0x40, 0x88, 0x8e, 0x10, 0xcd, 0xc8, 0x41, 0x57, 0xa8, 0x52, 0x23, 0x02, 0xca, - 0x0c, 0x0b, 0x46, 0xf1, 0x64, 0x20, 0x0a, 0x57, 0x58, 0x8c, 0x07, 0x2f, 0x64, 0x76, 0x19, 0x4a, - 0x63, 0xe9, 0x94, 0xed, 0x2c, 0x81, 0x18, 0x2f, 0x7e, 0x02, 0xa3, 0x9f, 0xc4, 0xc4, 0x83, 0x9a, - 0xc8, 0x99, 0x23, 0x89, 0x17, 0x4f, 0xc6, 0x80, 0x1f, 0xc4, 0x74, 0x66, 0xd6, 0xce, 0x84, 0x76, - 0x5b, 0x84, 0xd3, 0x6e, 0xa7, 0xef, 0xfd, 0xdf, 0xef, 0x3f, 0xf3, 0xfa, 0x5a, 0x78, 0x37, 0xa0, - 0x3b, 0x34, 0x64, 0x82, 0x24, 0xbf, 0x84, 0x45, 0xbc, 0xb9, 0x19, 0x0b, 0xde, 0xa2, 0x1e, 0x23, - 0xdb, 0x6d, 0xd6, 0xda, 0xc3, 0x51, 0x8b, 0x0b, 0x8e, 0x6e, 0xe8, 0x30, 0x9c, 0xfc, 0x62, 0x33, - 0xac, 0x3a, 0xec, 0x71, 0xee, 0x05, 0x8c, 0xd0, 0xc8, 0x27, 0x34, 0x0c, 0xb9, 0xa0, 0xc2, 0xe7, - 0x61, 0xac, 0x12, 0xab, 0x93, 0x4d, 0x1e, 0x6f, 0xf1, 0x98, 0x34, 0x68, 0xac, 0x15, 0xc9, 0x4e, - 0xad, 0xc1, 0x04, 0xad, 0x91, 0x88, 0x7a, 0x7e, 0x28, 0x83, 0x75, 0xec, 0x58, 0x3e, 0x4b, 0x44, - 0x5b, 0x74, 0xab, 0xa3, 0x39, 0x95, 0x1f, 0x17, 0x0b, 0xfa, 0x9a, 0xad, 0xe9, 0xab, 0xe2, 0x70, - 0x79, 0xb1, 0xb6, 0xce, 0x04, 0xf5, 0x83, 0x8e, 0x3a, 0xce, 0x0f, 0xdf, 0xf0, 0x77, 0xa9, 0x60, - 0xeb, 0x6b, 0x16, 0x8d, 0x63, 0x3a, 0xec, 0x78, 0x6b, 0x72, 0xbf, 0xe3, 0x6a, 0xc8, 0xe3, 0x1e, - 0x97, 0x7f, 0x49, 0xf2, 0x4f, 0xad, 0xba, 0x43, 0x10, 0xad, 0x24, 0xbb, 0xb1, 0x2c, 0xa5, 0xea, - 0x6c, 0xbb, 0xcd, 0x62, 0xe1, 0xbe, 0x84, 0xd7, 0xac, 0xd5, 0x38, 0xe2, 0x61, 0xcc, 0xd0, 0x53, - 0xd8, 0xaf, 0x4a, 0x5e, 0x07, 0xb7, 0xc1, 0xf8, 0xe5, 0x99, 0x51, 0x9c, 0x7b, 0x1c, 0x58, 0xa5, - 0x2e, 0x5c, 0x38, 0xf8, 0x75, 0xab, 0x52, 0xd7, 0x69, 0xee, 0x2c, 0xbc, 0x29, 0x75, 0x97, 0x98, - 0x58, 0x4d, 0x76, 0x68, 0x55, 0x05, 0xeb, 0xb2, 0x68, 0x08, 0xf6, 0xf9, 0xe1, 0x3a, 0xdb, 0x95, - 0xf2, 0x97, 0xea, 0xea, 0xc2, 0xdd, 0x86, 0xc3, 0xd9, 0x49, 0x9a, 0x6a, 0x05, 0x0e, 0xc4, 0xc6, - 0xba, 0x66, 0xbb, 0xd7, 0x85, 0xcd, 0x94, 0xd1, 0x84, 0x96, 0x84, 0xcb, 0x34, 0xe7, 0x7c, 0x10, - 0x64, 0x71, 0x2e, 0x42, 0x98, 0x36, 0x8d, 0xae, 0x37, 0x86, 0xd5, 0xfe, 0xe3, 0x64, 0xff, 0xb1, - 0xea, 0x59, 0x7d, 0x0a, 0x78, 0x39, 0xcd, 0xad, 0x1b, 0x99, 0xee, 0x37, 0xa0, 0xad, 0x9d, 0xa8, - 0x93, 0x6b, 0xad, 0xf7, 0x8c, 0xd6, 0xd0, 0x92, 0xc5, 0xde, 0xa3, 0xf7, 0xaa, 0x88, 0x5d, 0xf1, - 0x58, 0xf0, 0x23, 0xe9, 0x59, 0x3e, 0x4f, 0x08, 0x9e, 0xa9, 0xee, 0xed, 0xb4, 0x90, 0x71, 0x6a, - 0xf6, 0xed, 0xd4, 0x9a, 0xb9, 0x5e, 0xe2, 0xd4, 0xcc, 0xf0, 0x8e, 0x35, 0x73, 0xcd, 0x7d, 0x98, - 0x96, 0x5c, 0x54, 0x4f, 0x88, 0xd5, 0xd5, 0x39, 0xed, 0xd5, 0x86, 0x23, 0x39, 0x59, 0x9a, 0xf4, - 0x05, 0x1c, 0xdc, 0x30, 0x6f, 0x68, 0xd4, 0xf1, 0x2e, 0xa8, 0x96, 0x90, 0x66, 0xb5, 0x45, 0xdc, - 0x8d, 0xf4, 0xe8, 0x33, 0x61, 0xcf, 0xab, 0xc7, 0xf6, 0x81, 0xf6, 0x77, 0xb2, 0x50, 0xbe, 0xbf, - 0xde, 0x33, 0xfb, 0x3b, 0xb7, 0x3e, 0x9b, 0xd9, 0xbf, 0x08, 0xfb, 0xa4, 0x01, 0xf4, 0x01, 0xc0, - 0x7e, 0xad, 0x3e, 0xd5, 0x05, 0xee, 0xe4, 0x3c, 0xab, 0xe2, 0xb2, 0xe1, 0xaa, 0xbe, 0x3b, 0xf1, - 0xee, 0xc7, 0x9f, 0x8f, 0x3d, 0x77, 0xd0, 0x28, 0x29, 0x7a, 0x15, 0xa0, 0xaf, 0x00, 0x0e, 0x98, - 0x0f, 0x1d, 0x7a, 0x54, 0x54, 0x2b, 0x7b, 0xf8, 0x55, 0x1f, 0x9f, 0x3a, 0x4f, 0xc3, 0xce, 0x49, - 0xd8, 0x19, 0x34, 0x4d, 0x4a, 0xbe, 0x8f, 0xc8, 0x1b, 0xd9, 0xf9, 0x6f, 0xd1, 0x67, 0x00, 0xaf, - 0x98, 0x92, 0xf3, 0x41, 0x50, 0x8c, 0x9f, 0x3d, 0x13, 0x8b, 0xf1, 0x73, 0x66, 0x9c, 0x3b, 0x2d, - 0xf1, 0x27, 0xd1, 0x78, 0x59, 0x7c, 0xf4, 0x09, 0xd8, 0xb3, 0xa3, 0xd4, 0x96, 0x67, 0xcc, 0xa8, - 0x52, 0x5b, 0x9e, 0x35, 0xbc, 0x4a, 0x31, 0x5b, 0xef, 0x74, 0xf4, 0x1d, 0xc0, 0x41, 0xeb, 0xa9, - 0x41, 0x65, 0x8a, 0x67, 0x4d, 0x86, 0xea, 0xdc, 0xe9, 0x13, 0x35, 0xf6, 0x13, 0x89, 0x3d, 0x8b, - 0x6a, 0xa4, 0xec, 0xb7, 0xc5, 0xbf, 0x56, 0xf9, 0x02, 0xe0, 0x55, 0x4b, 0x34, 0xe9, 0x95, 0x32, - 0x67, 0xfe, 0x7f, 0x16, 0xf2, 0x86, 0x95, 0x5b, 0x93, 0x16, 0xee, 0xa3, 0x89, 0xd2, 0x16, 0x16, - 0x16, 0x0f, 0x8e, 0x1c, 0x70, 0x78, 0xe4, 0x80, 0xdf, 0x47, 0x0e, 0x78, 0x7f, 0xec, 0x54, 0x0e, - 0x8f, 0x9d, 0xca, 0xcf, 0x63, 0xa7, 0xf2, 0xea, 0x81, 0xe7, 0x8b, 0xcd, 0x76, 0x03, 0x37, 0xf9, - 0x96, 0x2d, 0xb7, 0x6b, 0x0b, 0x8a, 0xbd, 0x88, 0xc5, 0x8d, 0x7e, 0xf9, 0xc5, 0x34, 0xfb, 0x37, - 0x00, 0x00, 0xff, 0xff, 0xab, 0x9f, 0x18, 0x9d, 0xab, 0x0a, 0x00, 0x00, + 0x14, 0xc7, 0x77, 0x40, 0x88, 0x8e, 0x10, 0xcd, 0xc8, 0x41, 0x57, 0xa8, 0x52, 0x23, 0x02, 0x86, + 0x19, 0x76, 0x31, 0x8a, 0x27, 0x03, 0x51, 0x88, 0x37, 0x58, 0x8c, 0x07, 0x2f, 0x64, 0x76, 0x19, + 0x4a, 0x63, 0xe9, 0x94, 0xed, 0x2c, 0x81, 0x18, 0x2f, 0x7e, 0x02, 0xa3, 0x9f, 0xc4, 0xc4, 0x83, + 0x9a, 0xc8, 0x99, 0x23, 0x89, 0x17, 0x4f, 0xc6, 0x80, 0x1f, 0xc4, 0x74, 0x66, 0xd6, 0xce, 0x84, + 0x96, 0x16, 0xe1, 0xb4, 0xdb, 0xe9, 0x7b, 0xff, 0xf7, 0xfb, 0xcf, 0xbc, 0xbe, 0x16, 0xde, 0x0d, + 0xe8, 0x36, 0x0d, 0x99, 0x20, 0xc9, 0x2f, 0x61, 0x11, 0x6f, 0x6d, 0xc4, 0x82, 0xb7, 0xa9, 0xc7, + 0xc8, 0x56, 0x87, 0xb5, 0x77, 0x71, 0xd4, 0xe6, 0x82, 0xa3, 0x1b, 0x3a, 0x0c, 0x27, 0xbf, 0xd8, + 0x0c, 0xab, 0x0e, 0x7b, 0x9c, 0x7b, 0x01, 0x23, 0x34, 0xf2, 0x09, 0x0d, 0x43, 0x2e, 0xa8, 0xf0, + 0x79, 0x18, 0xab, 0xc4, 0xea, 0x64, 0x8b, 0xc7, 0x9b, 0x3c, 0x26, 0x4d, 0x1a, 0x6b, 0x45, 0xb2, + 0x5d, 0x6b, 0x32, 0x41, 0x6b, 0x24, 0xa2, 0x9e, 0x1f, 0xca, 0x60, 0x1d, 0x3b, 0x96, 0xcf, 0x12, + 0xd1, 0x36, 0xdd, 0xec, 0x6a, 0x4e, 0xe5, 0xc7, 0xc5, 0x82, 0xbe, 0x66, 0xab, 0xfa, 0xaa, 0x38, + 0x5c, 0x5e, 0xac, 0xae, 0x31, 0x41, 0xfd, 0xa0, 0xab, 0x8e, 0xf3, 0xc3, 0xd7, 0xfd, 0x1d, 0x2a, + 0xd8, 0xda, 0xaa, 0x45, 0xe3, 0x98, 0x0e, 0xbb, 0xde, 0x5a, 0xdc, 0xef, 0xba, 0x1a, 0xf2, 0xb8, + 0xc7, 0xe5, 0x5f, 0x92, 0xfc, 0x53, 0xab, 0xee, 0x10, 0x44, 0xcb, 0xc9, 0x6e, 0x2c, 0x49, 0xa9, + 0x06, 0xdb, 0xea, 0xb0, 0x58, 0xb8, 0x2f, 0xe1, 0x35, 0x6b, 0x35, 0x8e, 0x78, 0x18, 0x33, 0xf4, + 0x04, 0xf6, 0xab, 0x92, 0xd7, 0xc1, 0x6d, 0x30, 0x7e, 0xb9, 0x3e, 0x8a, 0x73, 0x8f, 0x03, 0xab, + 0xd4, 0xf9, 0x0b, 0xfb, 0xbf, 0x6e, 0x55, 0x1a, 0x3a, 0xcd, 0x9d, 0x81, 0x37, 0xa5, 0xee, 0x22, + 0x13, 0x2b, 0xc9, 0x0e, 0xad, 0xa8, 0x60, 0x5d, 0x16, 0x0d, 0xc1, 0x3e, 0x3f, 0x5c, 0x63, 0x3b, + 0x52, 0xfe, 0x52, 0x43, 0x5d, 0xb8, 0x5b, 0x70, 0x38, 0x3b, 0x49, 0x53, 0x2d, 0xc3, 0x81, 0xd8, + 0x58, 0xd7, 0x6c, 0xf7, 0x4e, 0x60, 0x33, 0x65, 0x34, 0xa1, 0x25, 0xe1, 0x32, 0xcd, 0x39, 0x17, + 0x04, 0x59, 0x9c, 0x0b, 0x10, 0xa6, 0x4d, 0xa3, 0xeb, 0x8d, 0x61, 0xb5, 0xff, 0x38, 0xd9, 0x7f, + 0xac, 0x7a, 0x56, 0x9f, 0x02, 0x5e, 0x4a, 0x73, 0x1b, 0x46, 0xa6, 0xfb, 0x0d, 0x68, 0x6b, 0xc7, + 0xea, 0xe4, 0x5a, 0xeb, 0x3d, 0xa3, 0x35, 0xb4, 0x68, 0xb1, 0xf7, 0xe8, 0xbd, 0x2a, 0x62, 0x57, + 0x3c, 0x16, 0xfc, 0x48, 0x7a, 0x96, 0xcf, 0x12, 0x82, 0xa7, 0xaa, 0x7b, 0xbb, 0x2d, 0x64, 0x9c, + 0x9a, 0x7d, 0x3b, 0xb5, 0x66, 0xae, 0x97, 0x38, 0x35, 0x33, 0xbc, 0x6b, 0xcd, 0x5c, 0x73, 0x1f, + 0xa4, 0x25, 0x17, 0xd4, 0x13, 0x62, 0x75, 0x75, 0x4e, 0x7b, 0x75, 0xe0, 0x48, 0x4e, 0x96, 0x26, + 0x7d, 0x01, 0x07, 0xd7, 0xcd, 0x1b, 0x1a, 0x75, 0xfc, 0x04, 0x54, 0x4b, 0x48, 0xb3, 0xda, 0x22, + 0xee, 0x7a, 0x7a, 0xf4, 0x99, 0xb0, 0xe7, 0xd5, 0x63, 0x7b, 0x40, 0xfb, 0x3b, 0x5e, 0x28, 0xdf, + 0x5f, 0xef, 0x99, 0xfd, 0x9d, 0x5b, 0x9f, 0xd5, 0xf7, 0x2e, 0xc2, 0x3e, 0x69, 0x00, 0x7d, 0x00, + 0xb0, 0x5f, 0xab, 0x4f, 0x9d, 0x00, 0x77, 0x7c, 0x9e, 0x55, 0x71, 0xd9, 0x70, 0x55, 0xdf, 0x9d, + 0x78, 0xf7, 0xe3, 0xcf, 0xc7, 0x9e, 0x3b, 0x68, 0x94, 0x14, 0xbd, 0x0a, 0xd0, 0x57, 0x00, 0x07, + 0xcc, 0x87, 0x0e, 0x3d, 0x2c, 0xaa, 0x95, 0x3d, 0xfc, 0xaa, 0x8f, 0x4e, 0x9d, 0xa7, 0x61, 0x67, + 0x25, 0x6c, 0x1d, 0x4d, 0x93, 0x92, 0xef, 0x23, 0xf2, 0x46, 0x76, 0xfe, 0x5b, 0xf4, 0x19, 0xc0, + 0x2b, 0xa6, 0xe4, 0x5c, 0x10, 0x14, 0xe3, 0x67, 0xcf, 0xc4, 0x62, 0xfc, 0x9c, 0x19, 0xe7, 0x4e, + 0x4b, 0xfc, 0x49, 0x34, 0x5e, 0x16, 0x1f, 0x7d, 0x02, 0xf6, 0xec, 0x28, 0xb5, 0xe5, 0x19, 0x33, + 0xaa, 0xd4, 0x96, 0x67, 0x0d, 0xaf, 0x52, 0xcc, 0xd6, 0x3b, 0x1d, 0x7d, 0x07, 0x70, 0xd0, 0x7a, + 0x6a, 0x50, 0x99, 0xe2, 0x59, 0x93, 0xa1, 0x3a, 0x7b, 0xfa, 0x44, 0x8d, 0xfd, 0x58, 0x62, 0xcf, + 0xa0, 0x1a, 0x29, 0xfb, 0x6d, 0xf1, 0xaf, 0x55, 0xbe, 0x00, 0x78, 0xd5, 0x12, 0x4d, 0x7a, 0xa5, + 0xcc, 0x99, 0xff, 0x9f, 0x85, 0xbc, 0x61, 0xe5, 0xd6, 0xa4, 0x85, 0xfb, 0x68, 0xa2, 0xb4, 0x85, + 0xf9, 0xe7, 0xfb, 0x87, 0x0e, 0x38, 0x38, 0x74, 0xc0, 0xef, 0x43, 0x07, 0xbc, 0x3f, 0x72, 0x2a, + 0x07, 0x47, 0x4e, 0xe5, 0xe7, 0x91, 0x53, 0x79, 0x45, 0x3c, 0x5f, 0x6c, 0x74, 0x9a, 0xb8, 0xc5, + 0x37, 0x6d, 0xb9, 0xed, 0x3a, 0xd9, 0xb1, 0x35, 0xc5, 0x6e, 0xc4, 0xe2, 0x66, 0xbf, 0xfc, 0x68, + 0x9a, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xc4, 0x1e, 0x56, 0xae, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/epochstorage/types/stake_entries.go b/x/epochstorage/types/stake_entries.go new file mode 100644 index 0000000000..18e34282c8 --- /dev/null +++ b/x/epochstorage/types/stake_entries.go @@ -0,0 +1,114 @@ +package types + +import ( + "fmt" + + regmath "math" + + "cosmossdk.io/collections" + "cosmossdk.io/collections/indexes" + "cosmossdk.io/math" + "github.com/lavanet/lava/v2/utils" +) + +var ( + StakeEntriesPrefix = collections.NewPrefix([]byte("StakeEntries/")) + StakeEntriesCurrentPrefix = collections.NewPrefix([]byte("StakeEntriesCurrent/")) + EpochChainIdProviderIndexesPrefix = collections.NewPrefix([]byte("EpochChainIdProviderIndexes/")) + ChainIdVaultIndexesPrefix = collections.NewPrefix([]byte("ChainIdVaultIndexes/")) + EpochHashesPrefix = collections.NewPrefix([]byte("EpochHash/")) +) + +// EpochChainIdProviderIndexes defines a secondary unique index for the keeper's stakeEntries indexed map +// Normally, a stake entry can be accessed with the primary key: [epoch, chainID, stake, address] +// The new set of indexes, EpochChainIdProviderIndexes, allows accessing the stake entries with [epoch, chainID, address] +type EpochChainIdProviderIndexes struct { + Index *indexes.Unique[collections.Triple[uint64, string, string], collections.Triple[uint64, string, collections.Pair[uint64, string]], StakeEntry] +} + +func (e EpochChainIdProviderIndexes) IndexesList() []collections.Index[collections.Triple[uint64, string, collections.Pair[uint64, string]], StakeEntry] { + return []collections.Index[collections.Triple[uint64, string, collections.Pair[uint64, string]], StakeEntry]{e.Index} +} + +func NewEpochChainIdProviderIndexes(sb *collections.SchemaBuilder) EpochChainIdProviderIndexes { + return EpochChainIdProviderIndexes{ + Index: indexes.NewUnique(sb, EpochChainIdProviderIndexesPrefix, "stake_entry_by_epoch_chain_address", + collections.TripleKeyCodec(collections.Uint64Key, collections.StringKey, collections.StringKey), + collections.TripleKeyCodec(collections.Uint64Key, collections.StringKey, + collections.PairKeyCodec(collections.Uint64Key, collections.StringKey)), + func(pk collections.Triple[uint64, string, collections.Pair[uint64, string]], _ StakeEntry) (collections.Triple[uint64, string, string], error) { + return collections.Join3(pk.K1(), pk.K2(), pk.K3().K2()), nil + }, + ), + } +} + +// ChainIdVaultIndexes defines a secondary unique index for the keeper's stakeEntriesCurrent indexed map +// Normally, a current stake entry can be accessed with the primary key: [chainID, address] +// The new set of indexes, ChainIdVaultIndexes, allows accessing the stake entries with [chainID, vault] +type ChainIdVaultIndexes struct { + Index *indexes.Unique[collections.Pair[string, string], collections.Pair[string, string], StakeEntry] +} + +func (c ChainIdVaultIndexes) IndexesList() []collections.Index[collections.Pair[string, string], StakeEntry] { + return []collections.Index[collections.Pair[string, string], StakeEntry]{c.Index} +} + +func NewChainIdVaultIndexes(sb *collections.SchemaBuilder) ChainIdVaultIndexes { + return ChainIdVaultIndexes{ + Index: indexes.NewUnique(sb, ChainIdVaultIndexesPrefix, "stake_entry_current_by_chain_vault", + collections.PairKeyCodec(collections.StringKey, collections.StringKey), + collections.PairKeyCodec(collections.StringKey, collections.StringKey), + func(pk collections.Pair[string, string], entry StakeEntry) (collections.Pair[string, string], error) { + if entry.Vault == "" { + return collections.Pair[string, string]{}, + utils.LavaFormatError("NewChainIdVaultIndexes: cannot create new ChainIdVault index", + fmt.Errorf("empty vault address"), + utils.LogAttr("provider", entry.Address), + utils.LogAttr("chain_id", entry.Chain), + ) + } + return collections.Join(pk.K1(), entry.Vault), nil + }, + ), + } +} + +// StakeEntry methods + +func (se StakeEntry) EffectiveStake() math.Int { + effective := se.Stake.Amount + if se.DelegateLimit.Amount.LT(se.DelegateTotal.Amount) { + effective = effective.Add(se.DelegateLimit.Amount) + } else { + effective = effective.Add(se.DelegateTotal.Amount) + } + return effective +} + +// Frozen provider block const +const FROZEN_BLOCK = regmath.MaxInt64 + +func (stakeEntry *StakeEntry) Freeze() { + stakeEntry.StakeAppliedBlock = FROZEN_BLOCK +} + +func (stakeEntry *StakeEntry) UnFreeze(currentBlock uint64) { + stakeEntry.StakeAppliedBlock = currentBlock +} + +func (stakeEntry *StakeEntry) IsFrozen() bool { + return stakeEntry.StakeAppliedBlock == FROZEN_BLOCK +} + +func (stakeEntry *StakeEntry) IsJailed(time int64) bool { + return stakeEntry.JailEndTime > time +} + +func (stakeEntry *StakeEntry) IsAddressVaultAndNotProvider(address string) bool { + return address != stakeEntry.Address && address == stakeEntry.Vault +} + +func (stakeEntry *StakeEntry) IsAddressVaultOrProvider(address string) bool { + return address == stakeEntry.Address || address == stakeEntry.Vault +} diff --git a/x/epochstorage/types/stake_entry.go b/x/epochstorage/types/stake_entry.go deleted file mode 100644 index dad926835c..0000000000 --- a/x/epochstorage/types/stake_entry.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/stake_entry.proto - -package types - -import ( - "cosmossdk.io/math" - regmath "math" -) - -func (se StakeEntry) EffectiveStake() math.Int { - effective := se.Stake.Amount - if se.DelegateLimit.Amount.LT(se.DelegateTotal.Amount) { - effective = effective.Add(se.DelegateLimit.Amount) - } else { - effective = effective.Add(se.DelegateTotal.Amount) - } - return effective -} - -// Frozen provider block const -const FROZEN_BLOCK = regmath.MaxInt64 - -func (stakeEntry *StakeEntry) Freeze() { - stakeEntry.StakeAppliedBlock = FROZEN_BLOCK -} - -func (stakeEntry *StakeEntry) UnFreeze(currentBlock uint64) { - stakeEntry.StakeAppliedBlock = currentBlock -} - -func (stakeEntry *StakeEntry) IsFrozen() bool { - return stakeEntry.StakeAppliedBlock == FROZEN_BLOCK -} - -func (stakeEntry *StakeEntry) IsJailed(time int64) bool { - return stakeEntry.JailEndTime > time -} - -func (stakeEntry *StakeEntry) IsAddressVaultAndNotProvider(address string) bool { - return address != stakeEntry.Address && address == stakeEntry.Vault -} - -func (stakeEntry *StakeEntry) IsAddressVaultOrProvider(address string) bool { - return address == stakeEntry.Address || address == stakeEntry.Vault -} \ No newline at end of file diff --git a/x/epochstorage/types/stake_entry.pb.go b/x/epochstorage/types/stake_entry.pb.go index 1eb9867989..e1fcb13f97 100644 --- a/x/epochstorage/types/stake_entry.pb.go +++ b/x/epochstorage/types/stake_entry.pb.go @@ -255,45 +255,46 @@ func init() { } var fileDescriptor_df6302d6b53c056e = []byte{ - // 607 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x6e, 0xd3, 0x30, - 0x18, 0x6f, 0xb6, 0x76, 0x5b, 0x9d, 0x6d, 0x6c, 0xde, 0x0e, 0xde, 0x0e, 0x59, 0xe8, 0x10, 0x8a, - 0x00, 0x25, 0xda, 0x10, 0x0f, 0x40, 0x4b, 0x8b, 0x40, 0x1c, 0x50, 0xd8, 0x89, 0x4b, 0xe4, 0x24, - 0x56, 0x6a, 0x9a, 0xd8, 0x51, 0xec, 0x55, 0xec, 0x2d, 0x78, 0x0c, 0x8e, 0x3c, 0xc6, 0x8e, 0x3b, - 0x72, 0x42, 0xa8, 0x3d, 0xf0, 0x14, 0x48, 0xc8, 0x76, 0xd2, 0x3f, 0x87, 0x21, 0xb8, 0x34, 0xfe, - 0xbe, 0xef, 0xf7, 0xfd, 0xfc, 0xfd, 0x7e, 0x76, 0x0d, 0x9e, 0xe6, 0x78, 0x8a, 0x19, 0x91, 0x81, - 0xfa, 0x06, 0xa4, 0xe4, 0xc9, 0x58, 0x48, 0x5e, 0xe1, 0x8c, 0x04, 0x42, 0xe2, 0x09, 0x89, 0x08, - 0x93, 0xd5, 0x8d, 0x5f, 0x56, 0x5c, 0x72, 0x78, 0x52, 0x83, 0x7d, 0xf5, 0xf5, 0x57, 0xc1, 0xa7, - 0xde, 0xfd, 0x3c, 0x84, 0xa5, 0x25, 0xa7, 0x4c, 0x1a, 0x92, 0xd3, 0xe3, 0x8c, 0x67, 0x5c, 0x2f, - 0x03, 0xb5, 0xaa, 0xb3, 0x4e, 0xc2, 0x45, 0xc1, 0x45, 0x10, 0x63, 0x41, 0x82, 0xe9, 0x45, 0x4c, - 0x24, 0xbe, 0x08, 0x12, 0x4e, 0x59, 0x5d, 0x7f, 0x54, 0xd7, 0xd5, 0x50, 0x94, 0x65, 0x0b, 0x48, - 0x1d, 0xd7, 0xa8, 0x43, 0x5c, 0x50, 0xc6, 0x03, 0xfd, 0x6b, 0x52, 0xbd, 0xdf, 0x1d, 0x00, 0x3e, - 0x28, 0x25, 0x43, 0x25, 0x04, 0xbe, 0x00, 0x1d, 0xad, 0x0b, 0x59, 0xae, 0xe5, 0xd9, 0x97, 0x27, - 0xbe, 0xe1, 0xf5, 0xd5, 0xbe, 0x7e, 0x4d, 0xea, 0x0f, 0x38, 0x65, 0xfd, 0xf6, 0xed, 0x8f, 0xb3, - 0x56, 0x68, 0xd0, 0x10, 0x81, 0x6d, 0x9c, 0xa6, 0x15, 0x11, 0x02, 0x6d, 0xb8, 0x96, 0xd7, 0x0d, - 0x9b, 0x10, 0xfa, 0xe0, 0xc8, 0x18, 0x85, 0xcb, 0x32, 0xa7, 0x24, 0x8d, 0xe2, 0x9c, 0x27, 0x13, - 0xb4, 0xe9, 0x5a, 0x5e, 0x3b, 0x3c, 0xd4, 0xa5, 0x97, 0xa6, 0xd2, 0x57, 0x05, 0xf8, 0x1a, 0x74, - 0x1b, 0x43, 0x04, 0x6a, 0xbb, 0x9b, 0x9e, 0x7d, 0x79, 0xee, 0xdf, 0xeb, 0xab, 0x3f, 0xac, 0xb1, - 0xf5, 0x38, 0xcb, 0x5e, 0xe8, 0x02, 0x3b, 0x23, 0x3c, 0xe7, 0x09, 0x96, 0x94, 0x33, 0xd4, 0x71, - 0x2d, 0xaf, 0x13, 0xae, 0xa6, 0xe0, 0x31, 0xe8, 0x24, 0x63, 0x4c, 0x19, 0xda, 0xd2, 0x23, 0x9b, - 0x40, 0x49, 0x29, 0x38, 0xa3, 0x13, 0x52, 0xa1, 0x1d, 0x23, 0xa5, 0x0e, 0xe1, 0x08, 0xec, 0xa7, - 0x24, 0x27, 0x19, 0x96, 0x24, 0x92, 0x5c, 0xe2, 0x1c, 0x75, 0xff, 0xcd, 0xa4, 0xbd, 0xa6, 0xed, - 0x4a, 0x75, 0xad, 0xf1, 0xe4, 0xb4, 0xa0, 0x12, 0x81, 0xff, 0xe4, 0x79, 0xa7, 0xba, 0x60, 0x00, - 0x8e, 0x16, 0x3c, 0x09, 0x2f, 0x0a, 0x2a, 0x84, 0x52, 0x6a, 0x6b, 0x6b, 0x61, 0x53, 0x1a, 0x2c, - 0x2a, 0xf0, 0x0c, 0xd8, 0x39, 0x16, 0x32, 0x4a, 0xc6, 0x98, 0x65, 0x04, 0xed, 0x6a, 0x20, 0x50, - 0xa9, 0x81, 0xce, 0xc0, 0x37, 0x60, 0x57, 0x1f, 0x4f, 0x54, 0x91, 0x92, 0x57, 0x12, 0xed, 0xe9, - 0xb9, 0x1e, 0xff, 0xc5, 0x7f, 0x7d, 0x68, 0xa1, 0x46, 0x87, 0x76, 0xbc, 0x0c, 0x94, 0xb9, 0x53, - 0x7c, 0x9d, 0x4b, 0xb4, 0x6f, 0xcc, 0xd5, 0x01, 0x7c, 0x0f, 0xec, 0x94, 0x88, 0xa4, 0xa2, 0xa5, - 0x3e, 0x94, 0x07, 0x9a, 0xff, 0xbc, 0xd1, 0xdd, 0x5c, 0xd6, 0x46, 0xfa, 0xab, 0x25, 0xb4, 0xdf, - 0x55, 0x0e, 0x7c, 0xfd, 0xf5, 0xed, 0x89, 0x15, 0xae, 0x52, 0xa8, 0x7d, 0x3e, 0x61, 0x9a, 0x0b, - 0x74, 0xa0, 0xd5, 0x98, 0x00, 0xf6, 0xc0, 0x9e, 0x5a, 0x44, 0x84, 0xa5, 0x91, 0xa4, 0x05, 0x41, - 0x87, 0xae, 0xe5, 0x6d, 0x86, 0xb6, 0x4a, 0x0e, 0x59, 0x7a, 0x45, 0x0b, 0xf2, 0xb6, 0xbd, 0xb3, - 0x7d, 0xb0, 0xd3, 0x1b, 0x01, 0xbb, 0xbf, 0x3e, 0xb6, 0xd6, 0xa7, 0xef, 0x7f, 0x3b, 0x34, 0x01, - 0x7c, 0x08, 0x76, 0x73, 0x2c, 0x89, 0x90, 0xf5, 0xed, 0xdd, 0xd0, 0x45, 0xdb, 0xe4, 0x74, 0x7b, - 0x7f, 0x74, 0x3b, 0x73, 0xac, 0xbb, 0x99, 0x63, 0xfd, 0x9c, 0x39, 0xd6, 0x97, 0xb9, 0xd3, 0xba, - 0x9b, 0x3b, 0xad, 0xef, 0x73, 0xa7, 0xf5, 0xf1, 0x59, 0x46, 0xe5, 0xf8, 0x3a, 0xf6, 0x13, 0x5e, - 0x04, 0x6b, 0xaf, 0xc0, 0xe7, 0xf5, 0x77, 0x40, 0xde, 0x94, 0x44, 0xc4, 0x5b, 0xfa, 0x6f, 0xf9, - 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x42, 0x11, 0xd6, 0x4d, 0x79, 0x04, 0x00, 0x00, + // 609 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4d, 0x6e, 0xd4, 0x30, + 0x14, 0x9e, 0xb4, 0x33, 0x6d, 0xc7, 0x69, 0x4b, 0xeb, 0x76, 0xe1, 0x76, 0x91, 0x86, 0x16, 0xa1, + 0x08, 0xa4, 0x58, 0x2d, 0xe2, 0x00, 0x4c, 0x69, 0x51, 0x11, 0x0b, 0x14, 0xba, 0x62, 0x13, 0x39, + 0x89, 0x95, 0x31, 0x93, 0xd8, 0x51, 0xec, 0x8e, 0xe8, 0x2d, 0x38, 0x06, 0x4b, 0x8e, 0xd1, 0x65, + 0x97, 0xac, 0x10, 0x9a, 0x59, 0x70, 0x0a, 0x24, 0x64, 0x3b, 0x99, 0x9f, 0x45, 0x11, 0x6c, 0x26, + 0x7e, 0xef, 0x7d, 0xef, 0xf3, 0xfb, 0x3e, 0x7b, 0x0c, 0x9e, 0x17, 0x64, 0x4c, 0x38, 0x55, 0x58, + 0x7f, 0x31, 0xad, 0x44, 0x3a, 0x94, 0x4a, 0xd4, 0x24, 0xa7, 0x58, 0x2a, 0x32, 0xa2, 0x31, 0xe5, + 0xaa, 0xbe, 0x0d, 0xab, 0x5a, 0x28, 0x01, 0x0f, 0x1a, 0x70, 0xa8, 0xbf, 0xe1, 0x22, 0xf8, 0x30, + 0x78, 0x98, 0x87, 0xf2, 0xac, 0x12, 0x8c, 0x2b, 0x4b, 0x72, 0xb8, 0x9f, 0x8b, 0x5c, 0x98, 0x25, + 0xd6, 0xab, 0x26, 0xeb, 0xa5, 0x42, 0x96, 0x42, 0xe2, 0x84, 0x48, 0x8a, 0xc7, 0xa7, 0x09, 0x55, + 0xe4, 0x14, 0xa7, 0x82, 0xf1, 0xa6, 0xfe, 0xa4, 0xa9, 0xeb, 0xa1, 0x18, 0xcf, 0x67, 0x90, 0x26, + 0x6e, 0x50, 0xbb, 0xa4, 0x64, 0x5c, 0x60, 0xf3, 0x6b, 0x53, 0xc7, 0xbf, 0x7b, 0x00, 0x7c, 0xd0, + 0x4a, 0x2e, 0xb4, 0x10, 0xf8, 0x12, 0xf4, 0x8c, 0x2e, 0xe4, 0xf8, 0x4e, 0xe0, 0x9e, 0x1d, 0x84, + 0x96, 0x37, 0xd4, 0xfb, 0x86, 0x0d, 0x69, 0x78, 0x2e, 0x18, 0x1f, 0x74, 0xef, 0x7e, 0x1c, 0x75, + 0x22, 0x8b, 0x86, 0x08, 0xac, 0x93, 0x2c, 0xab, 0xa9, 0x94, 0x68, 0xc5, 0x77, 0x82, 0x7e, 0xd4, + 0x86, 0x30, 0x04, 0x7b, 0xd6, 0x28, 0x52, 0x55, 0x05, 0xa3, 0x59, 0x9c, 0x14, 0x22, 0x1d, 0xa1, + 0x55, 0xdf, 0x09, 0xba, 0xd1, 0xae, 0x29, 0xbd, 0xb2, 0x95, 0x81, 0x2e, 0xc0, 0x37, 0xa0, 0xdf, + 0x1a, 0x22, 0x51, 0xd7, 0x5f, 0x0d, 0xdc, 0xb3, 0x93, 0xf0, 0x41, 0x5f, 0xc3, 0x8b, 0x06, 0xdb, + 0x8c, 0x33, 0xef, 0x85, 0x3e, 0x70, 0x73, 0x2a, 0x0a, 0x91, 0x12, 0xc5, 0x04, 0x47, 0x3d, 0xdf, + 0x09, 0x7a, 0xd1, 0x62, 0x0a, 0xee, 0x83, 0x5e, 0x3a, 0x24, 0x8c, 0xa3, 0x35, 0x33, 0xb2, 0x0d, + 0xb4, 0x94, 0x52, 0x70, 0x36, 0xa2, 0x35, 0xda, 0xb0, 0x52, 0x9a, 0x10, 0x5e, 0x82, 0xed, 0x8c, + 0x16, 0x34, 0x27, 0x8a, 0xc6, 0x4a, 0x28, 0x52, 0xa0, 0xfe, 0xbf, 0x99, 0xb4, 0xd5, 0xb6, 0x5d, + 0xeb, 0xae, 0x25, 0x9e, 0x82, 0x95, 0x4c, 0x21, 0xf0, 0x9f, 0x3c, 0xef, 0x74, 0x17, 0xc4, 0x60, + 0x6f, 0xc6, 0x93, 0x8a, 0xb2, 0x64, 0x52, 0x6a, 0xa5, 0xae, 0xb1, 0x16, 0xb6, 0xa5, 0xf3, 0x59, + 0x05, 0x1e, 0x01, 0xb7, 0x20, 0x52, 0xc5, 0xe9, 0x90, 0xf0, 0x9c, 0xa2, 0x4d, 0x03, 0x04, 0x3a, + 0x75, 0x6e, 0x32, 0xf0, 0x0a, 0x6c, 0x9a, 0xe3, 0x89, 0x6b, 0x5a, 0x89, 0x5a, 0xa1, 0x2d, 0x33, + 0xd7, 0xd3, 0xbf, 0xf8, 0x6f, 0x0e, 0x2d, 0x32, 0xe8, 0xc8, 0x4d, 0xe6, 0x81, 0x36, 0x77, 0x4c, + 0x6e, 0x0a, 0x85, 0xb6, 0xad, 0xb9, 0x26, 0x80, 0xef, 0x81, 0x9b, 0x51, 0x99, 0xd6, 0xac, 0x32, + 0x87, 0xf2, 0xc8, 0xf0, 0x9f, 0xb4, 0xba, 0xdb, 0xcb, 0xda, 0x4a, 0x7f, 0x3d, 0x87, 0x0e, 0xfa, + 0xda, 0x81, 0xaf, 0xbf, 0xbe, 0x3d, 0x73, 0xa2, 0x45, 0x0a, 0xbd, 0xcf, 0x27, 0xc2, 0x0a, 0x89, + 0x76, 0x8c, 0x1a, 0x1b, 0xc0, 0x63, 0xb0, 0xa5, 0x17, 0x31, 0xe5, 0x59, 0xac, 0x58, 0x49, 0xd1, + 0xae, 0xef, 0x04, 0xab, 0x91, 0xab, 0x93, 0x17, 0x3c, 0xbb, 0x66, 0x25, 0x7d, 0xdb, 0xdd, 0x58, + 0xdf, 0xd9, 0x38, 0xbe, 0x04, 0xee, 0x60, 0x79, 0x6c, 0xa3, 0xcf, 0xdc, 0xff, 0x6e, 0x64, 0x03, + 0xf8, 0x18, 0x6c, 0x16, 0x44, 0x51, 0xa9, 0x9a, 0xdb, 0xbb, 0x62, 0x8a, 0xae, 0xcd, 0x99, 0xf6, + 0xc1, 0xd5, 0xdd, 0xc4, 0x73, 0xee, 0x27, 0x9e, 0xf3, 0x73, 0xe2, 0x39, 0x5f, 0xa6, 0x5e, 0xe7, + 0x7e, 0xea, 0x75, 0xbe, 0x4f, 0xbd, 0xce, 0x47, 0x9c, 0x33, 0x35, 0xbc, 0x49, 0xc2, 0x54, 0x94, + 0x78, 0xe9, 0x15, 0x18, 0x9f, 0xe1, 0xcf, 0xcb, 0x4f, 0x81, 0xba, 0xad, 0xa8, 0x4c, 0xd6, 0xcc, + 0x3f, 0xf3, 0xc5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x75, 0xf1, 0x29, 0x7c, 0x04, 0x00, + 0x00, } func (m *StakeEntry) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/stake_storage.go b/x/epochstorage/types/stake_storage.go deleted file mode 100644 index 0bdb9eb3f6..0000000000 --- a/x/epochstorage/types/stake_storage.go +++ /dev/null @@ -1,36 +0,0 @@ -package types - -import ( - fmt "fmt" - - "github.com/lavanet/lava/utils" -) - -func (ss StakeStorage) GetStakeEntryByAddressFromStorage(address string) (StakeEntry, bool) { - if !utils.IsBech32Address(address) { - utils.LavaFormatWarning("address is not Bech32", fmt.Errorf("invalid address"), - utils.LogAttr("address", address), - ) - return StakeEntry{}, false - } - - for _, entry := range ss.StakeEntries { - if !utils.IsBech32Address(entry.Address) || !utils.IsBech32Address(entry.Vault) { - // this should not happen; to avoid panic we simply skip this one (thus - // freeze the situation so it can be investigated and orderly resolved). - utils.LavaFormatError("critical: invalid account address inside StakeStorage", fmt.Errorf("invalid address"), - utils.LogAttr("provider", entry.Address), - utils.LogAttr("vault", entry.Vault), - utils.LogAttr("chainID", entry.Chain), - ) - continue - } - - if entry.IsAddressVaultOrProvider(address) { - // found the right entry - return entry, true - } - } - - return StakeEntry{}, false -} diff --git a/x/epochstorage/types/stake_storage.pb.go b/x/epochstorage/types/stake_storage.pb.go index a2d012438d..3de6dcd29f 100644 --- a/x/epochstorage/types/stake_storage.pb.go +++ b/x/epochstorage/types/stake_storage.pb.go @@ -92,7 +92,7 @@ func init() { } var fileDescriptor_be7b78aecc265fd4 = []byte{ - // 246 bytes of a gzipped FileDescriptorProto + // 249 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcd, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0xa9, 0xfa, 0xc5, 0x25, 0x89, 0xd9, 0xa9, 0xf1, 0x50, 0x9e, 0x5e, 0x41, 0x51, 0x7e, @@ -104,11 +104,11 @@ var fileDescriptor_be7b78aecc265fd4 = []byte{ 0x60, 0xd6, 0xe0, 0x36, 0x52, 0xd5, 0xc3, 0xe9, 0x36, 0xbd, 0x60, 0x98, 0xf2, 0x4a, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0x50, 0x0c, 0x10, 0x52, 0xe3, 0xe2, 0x03, 0x2b, 0x77, 0xca, 0xc9, 0x4f, 0xce, 0xf6, 0x48, 0x2c, 0xce, 0x90, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, 0x42, 0x13, 0x75, - 0x72, 0x3b, 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, 0x9d, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x70, 0xa8, 0x40, 0x0d, 0x89, 0x92, 0xca, - 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x77, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x2d, - 0xbc, 0x7a, 0x7d, 0x01, 0x00, 0x00, + 0xf2, 0x3c, 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, 0xfd, 0xf4, 0xcc, 0x92, + 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x70, 0x28, 0x33, 0xd2, 0xaf, 0x40, 0x0d, + 0x8c, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x8f, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x82, 0xbe, 0xa5, 0xcb, 0x80, 0x01, 0x00, 0x00, } func (m *StakeStorage) Marshal() (dAtA []byte, err error) { diff --git a/x/epochstorage/types/tx.pb.go b/x/epochstorage/types/tx.pb.go index 5f05f837e7..6c7989aa65 100644 --- a/x/epochstorage/types/tx.pb.go +++ b/x/epochstorage/types/tx.pb.go @@ -28,16 +28,16 @@ func init() { } var fileDescriptor_7051565dcc1777fe = []byte{ - // 130 bytes of a gzipped FileDescriptorProto + // 133 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xca, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0xa9, 0xfa, 0x25, 0x15, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x92, 0x50, 0x35, - 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0x8d, 0x11, 0x2b, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x93, 0xdb, 0x89, + 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0x8d, 0x11, 0x2b, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x93, 0xe7, 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, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x58, 0x55, 0x81, 0x66, 0x59, 0x65, 0x41, 0x6a, 0x71, 0x12, - 0x1b, 0xd8, 0x42, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0xd2, 0x13, 0xe8, 0x96, 0x00, - 0x00, 0x00, + 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x58, 0x55, 0x66, 0xa4, 0x5f, 0x81, 0x66, 0x5f, 0x65, 0x41, + 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x4e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x05, 0x8a, 0x4a, + 0x01, 0x99, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/fixationstore/client/cli/query.go b/x/fixationstore/client/cli/query.go index 8b8670efda..69bdb726ea 100644 --- a/x/fixationstore/client/cli/query.go +++ b/x/fixationstore/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/fixationstore/client/cli/query_all_indices.go b/x/fixationstore/client/cli/query_all_indices.go index ad6003edc4..53231273d0 100644 --- a/x/fixationstore/client/cli/query_all_indices.go +++ b/x/fixationstore/client/cli/query_all_indices.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/client/cli/query_entry.go b/x/fixationstore/client/cli/query_entry.go index 233f860625..8da2d6792e 100644 --- a/x/fixationstore/client/cli/query_entry.go +++ b/x/fixationstore/client/cli/query_entry.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/client/cli/query_store_keys.go b/x/fixationstore/client/cli/query_store_keys.go index 0714da49ab..7990562598 100644 --- a/x/fixationstore/client/cli/query_store_keys.go +++ b/x/fixationstore/client/cli/query_store_keys.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/client/cli/query_versions.go b/x/fixationstore/client/cli/query_versions.go index b0394c23de..ddc34a6e06 100644 --- a/x/fixationstore/client/cli/query_versions.go +++ b/x/fixationstore/client/cli/query_versions.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/keeper/grpc_query_all_indices.go b/x/fixationstore/keeper/grpc_query_all_indices.go index 4fd3a4476d..903ba27ca5 100644 --- a/x/fixationstore/keeper/grpc_query_all_indices.go +++ b/x/fixationstore/keeper/grpc_query_all_indices.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/grpc_query_entry.go b/x/fixationstore/keeper/grpc_query_entry.go index 1b4dd05f3c..31daf5d088 100644 --- a/x/fixationstore/keeper/grpc_query_entry.go +++ b/x/fixationstore/keeper/grpc_query_entry.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/grpc_query_store_keys.go b/x/fixationstore/keeper/grpc_query_store_keys.go index 7e178d89ee..0dc78b89d5 100644 --- a/x/fixationstore/keeper/grpc_query_store_keys.go +++ b/x/fixationstore/keeper/grpc_query_store_keys.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/grpc_query_versions.go b/x/fixationstore/keeper/grpc_query_versions.go index fc79d78673..84aa3eb83f 100644 --- a/x/fixationstore/keeper/grpc_query_versions.go +++ b/x/fixationstore/keeper/grpc_query_versions.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/fixationstore/keeper/keeper.go b/x/fixationstore/keeper/keeper.go index 30c4545b18..600970801b 100644 --- a/x/fixationstore/keeper/keeper.go +++ b/x/fixationstore/keeper/keeper.go @@ -4,8 +4,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/fixationstore/types" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" + "github.com/lavanet/lava/v2/x/fixationstore/types" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" ) func NewKeeper(cdc codec.BinaryCodec, tsKeeper *timerstorekeeper.Keeper, getStaleBlocks types.GetStaleBlocks) *Keeper { diff --git a/x/fixationstore/module.go b/x/fixationstore/module.go index faa2657cc6..e88507fa05 100644 --- a/x/fixationstore/module.go +++ b/x/fixationstore/module.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/lavanet/lava/x/fixationstore/client/cli" - "github.com/lavanet/lava/x/fixationstore/keeper" - "github.com/lavanet/lava/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/fixationstore/client/cli" + "github.com/lavanet/lava/v2/x/fixationstore/keeper" + "github.com/lavanet/lava/v2/x/fixationstore/types" "github.com/spf13/cobra" ) diff --git a/x/fixationstore/types/fixation.go b/x/fixationstore/types/fixation.go index b8f006ef63..334c12dddd 100644 --- a/x/fixationstore/types/fixation.go +++ b/x/fixationstore/types/fixation.go @@ -4,7 +4,7 @@ import ( "math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils/common/types" + "github.com/lavanet/lava/v2/utils/common/types" ) // SafeIndex is a sanitized string, i.e. contains only visible ascii characters diff --git a/x/fixationstore/types/fixation.pb.go b/x/fixationstore/types/fixation.pb.go index aa0220d4bc..1f4455937b 100644 --- a/x/fixationstore/types/fixation.pb.go +++ b/x/fixationstore/types/fixation.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/timerstore/types" + types "github.com/lavanet/lava/v2/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -247,33 +247,33 @@ func init() { } var fileDescriptor_872ca3cbd39027a3 = []byte{ - // 413 bytes of a gzipped FileDescriptorProto + // 415 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xcd, 0x8e, 0xd3, 0x30, 0x10, 0x8e, 0xb7, 0x69, 0x93, 0xf5, 0xae, 0x38, 0x58, 0x2b, 0x61, 0x82, 0x14, 0x42, 0x11, 0x52, - 0x40, 0x22, 0x91, 0x96, 0x27, 0xe8, 0x4a, 0x68, 0x25, 0xd8, 0x53, 0xb8, 0x71, 0x59, 0xb9, 0xed, - 0xb4, 0x58, 0xa4, 0x71, 0x15, 0x4f, 0xa3, 0xf6, 0xca, 0x13, 0xf0, 0x38, 0x5c, 0xb9, 0xf5, 0xd8, - 0x23, 0x27, 0x84, 0xda, 0x17, 0x41, 0xb1, 0xfb, 0x97, 0x4a, 0xe5, 0xe4, 0xf9, 0x3c, 0xf3, 0x7d, - 0x33, 0x9f, 0x3d, 0xf4, 0x4d, 0x2e, 0x2a, 0x51, 0x00, 0xa6, 0xf5, 0x99, 0x8e, 0xe4, 0x5c, 0xa0, - 0x54, 0x85, 0x46, 0x55, 0xc2, 0x1e, 0x25, 0xd3, 0x52, 0xa1, 0x62, 0xc1, 0xb6, 0x34, 0xa9, 0xcf, - 0xa4, 0x51, 0x1a, 0xdc, 0x8c, 0xd5, 0x58, 0x99, 0xb2, 0xb4, 0x8e, 0x2c, 0x23, 0x78, 0xd5, 0x10, - 0x47, 0x39, 0x81, 0xd2, 0x2a, 0x9b, 0xd0, 0x16, 0x75, 0x7f, 0x12, 0xda, 0xfe, 0x50, 0x60, 0xb9, - 0x60, 0x37, 0xb4, 0x2d, 0x8b, 0x21, 0xcc, 0x39, 0x89, 0x48, 0x7c, 0x99, 0x59, 0x50, 0xdf, 0xf6, - 0x73, 0x35, 0xf8, 0xc6, 0x2f, 0x22, 0x12, 0xbb, 0x99, 0x05, 0xec, 0x19, 0xf5, 0x35, 0x8a, 0x1c, - 0x1e, 0x05, 0xf2, 0x96, 0x49, 0x78, 0x06, 0xf7, 0x90, 0x05, 0xd4, 0x2f, 0x61, 0x34, 0x50, 0xb3, - 0x02, 0xb9, 0x6b, 0x52, 0x7b, 0xcc, 0x18, 0x75, 0x87, 0x02, 0x05, 0x6f, 0x47, 0x24, 0xbe, 0xce, - 0x4c, 0xcc, 0x9e, 0xd3, 0xcb, 0x21, 0xe4, 0x80, 0x46, 0xab, 0x63, 0x09, 0xf6, 0xa2, 0x87, 0x75, - 0x52, 0xea, 0xc7, 0x5c, 0x20, 0x68, 0xe4, 0x5e, 0x44, 0x62, 0x3f, 0xf3, 0xa5, 0x7e, 0x30, 0xb8, - 0xfb, 0x9d, 0xd0, 0x27, 0xf7, 0x50, 0x80, 0x96, 0xba, 0x76, 0x20, 0x41, 0x9f, 0xf1, 0xf0, 0x94, - 0x7a, 0xb5, 0x8a, 0xac, 0xc0, 0xb8, 0xf0, 0xb3, 0x8e, 0xd4, 0x0f, 0xb2, 0x02, 0xd6, 0xa3, 0x1e, - 0x58, 0x26, 0x6f, 0x45, 0xad, 0xf8, 0xea, 0xf6, 0x65, 0x72, 0xfe, 0x95, 0x13, 0xf3, 0x4c, 0x77, + 0xe0, 0x90, 0xa0, 0xf2, 0x04, 0x5d, 0x09, 0x21, 0x2d, 0x7b, 0x0a, 0x37, 0x2e, 0x2b, 0xb7, 0x9d, + 0x2d, 0x16, 0x69, 0x5c, 0xc5, 0xd3, 0xa8, 0xbd, 0xf2, 0x04, 0x3c, 0x0e, 0x57, 0x6e, 0x3d, 0xf6, + 0xc8, 0x09, 0xa1, 0xf6, 0x45, 0x50, 0xec, 0xfe, 0xa5, 0x52, 0x39, 0x79, 0x3e, 0xcf, 0x7c, 0xdf, + 0xcc, 0x67, 0x0f, 0x7d, 0x93, 0x8b, 0x4a, 0x14, 0x80, 0x69, 0x7d, 0xa6, 0x8f, 0x72, 0x2e, 0x50, + 0xaa, 0x42, 0xa3, 0x2a, 0x61, 0x8f, 0x92, 0x69, 0xa9, 0x50, 0xb1, 0x60, 0x5b, 0x9a, 0xd4, 0x67, + 0xd2, 0x28, 0x0d, 0x6e, 0xc6, 0x6a, 0xac, 0x4c, 0x59, 0x5a, 0x47, 0x96, 0x11, 0xbc, 0x6a, 0x88, + 0xa3, 0x9c, 0x40, 0x69, 0x95, 0x4d, 0x68, 0x8b, 0xba, 0x3f, 0x09, 0x6d, 0x7f, 0x28, 0xb0, 0x5c, + 0xb0, 0x1b, 0xda, 0x96, 0xc5, 0x08, 0xe6, 0x9c, 0x44, 0x24, 0xbe, 0xcc, 0x2c, 0xa8, 0x6f, 0x07, + 0xb9, 0x1a, 0x7e, 0xe3, 0x17, 0x11, 0x89, 0xdd, 0xcc, 0x02, 0xf6, 0x8c, 0xfa, 0x1a, 0x45, 0x0e, + 0x0f, 0x02, 0x79, 0xcb, 0x24, 0x3c, 0x83, 0xfb, 0xc8, 0x02, 0xea, 0x97, 0xf0, 0x38, 0x54, 0xb3, + 0x02, 0xb9, 0x6b, 0x52, 0x7b, 0xcc, 0x18, 0x75, 0x47, 0x02, 0x05, 0x6f, 0x47, 0x24, 0xbe, 0xce, + 0x4c, 0xcc, 0x9e, 0xd3, 0xcb, 0x11, 0xe4, 0x80, 0x46, 0xab, 0x63, 0x09, 0xf6, 0xa2, 0x8f, 0x75, + 0x52, 0xea, 0x87, 0x5c, 0x20, 0x68, 0xe4, 0x5e, 0x44, 0x62, 0x3f, 0xf3, 0xa5, 0xbe, 0x37, 0xb8, + 0xfb, 0x9d, 0xd0, 0x27, 0x1f, 0xa1, 0x00, 0x2d, 0x75, 0xed, 0x40, 0x82, 0x3e, 0xe3, 0xe1, 0x29, + 0xf5, 0x6a, 0x15, 0x59, 0x81, 0x71, 0xe1, 0x67, 0x1d, 0xa9, 0xef, 0x65, 0x05, 0xac, 0x4f, 0x3d, + 0xb0, 0x4c, 0xde, 0x8a, 0x5a, 0xf1, 0x55, 0xef, 0x65, 0x72, 0xfe, 0x95, 0x13, 0xf3, 0x4c, 0xb7, 0xee, 0xf2, 0xcf, 0x0b, 0x27, 0xdb, 0xf1, 0xba, 0xbf, 0x08, 0xbd, 0xde, 0x0e, 0xf1, 0x19, 0x05, - 0x02, 0xe3, 0xd4, 0xab, 0xa0, 0xd4, 0x52, 0x15, 0x66, 0x08, 0x37, 0xdb, 0x41, 0xf6, 0xf1, 0xd0, - 0xed, 0xc2, 0x74, 0x7b, 0xfb, 0xbf, 0x6e, 0x4d, 0x67, 0x27, 0x6d, 0xd9, 0x27, 0x4a, 0x0f, 0x1f, - 0x6a, 0xbe, 0xe0, 0xea, 0xf6, 0x75, 0x53, 0xee, 0x90, 0x4f, 0x8e, 0x07, 0xdc, 0x2a, 0x1d, 0xd1, - 0xef, 0xee, 0x97, 0xeb, 0x90, 0xac, 0xd6, 0x21, 0xf9, 0xbb, 0x0e, 0xc9, 0x8f, 0x4d, 0xe8, 0xac, - 0x36, 0xa1, 0xf3, 0x7b, 0x13, 0x3a, 0x5f, 0xde, 0x8d, 0x25, 0x7e, 0x9d, 0xf5, 0x93, 0x81, 0x9a, - 0xa4, 0x8d, 0x6d, 0x9a, 0x9f, 0x2c, 0x2b, 0x2e, 0xa6, 0xa0, 0xfb, 0x1d, 0xb3, 0x53, 0xef, 0xff, - 0x05, 0x00, 0x00, 0xff, 0xff, 0x22, 0x3d, 0x26, 0x19, 0xd7, 0x02, 0x00, 0x00, + 0x02, 0xe3, 0xd4, 0xab, 0xa0, 0xd4, 0x52, 0x15, 0x66, 0x08, 0x37, 0xdb, 0x41, 0x76, 0x77, 0xe8, + 0x76, 0x61, 0xba, 0xbd, 0xfd, 0x5f, 0xb7, 0xa6, 0xb3, 0x93, 0xb6, 0xec, 0x13, 0xa5, 0x87, 0x0f, + 0x35, 0x5f, 0x70, 0xd5, 0x7b, 0xdd, 0x94, 0x3b, 0xe4, 0x93, 0xe3, 0x01, 0xb7, 0x4a, 0x47, 0xf4, + 0xdb, 0xbb, 0xe5, 0x3a, 0x24, 0xab, 0x75, 0x48, 0xfe, 0xae, 0x43, 0xf2, 0x63, 0x13, 0x3a, 0xab, + 0x4d, 0xe8, 0xfc, 0xde, 0x84, 0xce, 0x97, 0x77, 0x63, 0x89, 0x5f, 0x67, 0x83, 0x64, 0xa8, 0x26, + 0x69, 0x63, 0x9b, 0xaa, 0x5e, 0x3a, 0x3f, 0xd9, 0x57, 0x5c, 0x4c, 0x41, 0x0f, 0x3a, 0x66, 0xad, + 0xde, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xd6, 0xd9, 0x1e, 0xda, 0x02, 0x00, 0x00, } func (m *Entry) Marshal() (dAtA []byte, err error) { diff --git a/x/fixationstore/types/fixationstore.go b/x/fixationstore/types/fixationstore.go index a9510ef055..a7cfd5f64a 100644 --- a/x/fixationstore/types/fixationstore.go +++ b/x/fixationstore/types/fixationstore.go @@ -10,8 +10,8 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/utils" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) // FixationStore manages lists of entries with versions in the store. diff --git a/x/fixationstore/types/fixationstore_test.go b/x/fixationstore/types/fixationstore_test.go index 13463e7da7..dfd92d6ca4 100644 --- a/x/fixationstore/types/fixationstore_test.go +++ b/x/fixationstore/types/fixationstore_test.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/stretchr/testify/require" ) diff --git a/x/fixationstore/types/query.pb.go b/x/fixationstore/types/query.pb.go index 1ea42b3c36..1fe38c15d5 100644 --- a/x/fixationstore/types/query.pb.go +++ b/x/fixationstore/types/query.pb.go @@ -514,47 +514,47 @@ func init() { } var fileDescriptor_300bcc00a24e7b21 = []byte{ - // 636 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xc7, 0xb3, 0x6d, 0xdc, 0x26, 0xd3, 0xcb, 0xaf, 0xab, 0xfe, 0x5a, 0xcb, 0x20, 0x37, 0xf8, - 0x50, 0x85, 0x43, 0x6d, 0x9a, 0x1e, 0xb8, 0x20, 0x50, 0xaa, 0x42, 0x41, 0x80, 0x04, 0x46, 0xe2, - 0x50, 0x09, 0x55, 0x6e, 0xb3, 0x75, 0xad, 0x1a, 0x6f, 0x6a, 0x6f, 0xaa, 0x58, 0x51, 0x2e, 0x3c, - 0x01, 0x12, 0x6f, 0xc0, 0x03, 0x70, 0xe2, 0x80, 0xc4, 0x0b, 0xf4, 0x58, 0x89, 0x0b, 0x07, 0x84, - 0x50, 0xc2, 0x83, 0xa0, 0xfd, 0xe3, 0x34, 0x4d, 0x8b, 0xd3, 0x00, 0xa7, 0x78, 0x67, 0xe7, 0x3b, - 0xdf, 0xcf, 0xec, 0xee, 0x28, 0xb0, 0x12, 0x7a, 0xc7, 0x5e, 0x44, 0x98, 0xc3, 0x7f, 0x9d, 0xfd, - 0xa0, 0xed, 0xb1, 0x80, 0x46, 0x09, 0xa3, 0x31, 0x71, 0x8e, 0x5a, 0x24, 0x4e, 0xed, 0x66, 0x4c, - 0x19, 0xc5, 0x86, 0xca, 0xb3, 0xf9, 0xaf, 0x7d, 0x2e, 0xcf, 0x58, 0xf0, 0xa9, 0x4f, 0x45, 0x9a, - 0xc3, 0xbf, 0xa4, 0xc2, 0xb8, 0xee, 0x53, 0xea, 0x87, 0xc4, 0xf1, 0x9a, 0x81, 0xe3, 0x45, 0x11, - 0x65, 0x52, 0xa1, 0x76, 0x6f, 0xe6, 0xf8, 0x66, 0x2b, 0x99, 0x6a, 0x3d, 0x85, 0xc5, 0xe7, 0x9c, - 0xa4, 0x1e, 0x86, 0x8f, 0xa2, 0x46, 0xb0, 0x47, 0x12, 0x97, 0x1c, 0xb5, 0x48, 0xc2, 0xf0, 0x35, - 0x28, 0x0b, 0xc5, 0xce, 0x21, 0x49, 0x75, 0x54, 0x41, 0xd5, 0xb2, 0x5b, 0x12, 0x81, 0xc7, 0x24, - 0xc5, 0x8b, 0x30, 0xd3, 0x8c, 0xc9, 0x7e, 0xd0, 0xd6, 0xa7, 0xc4, 0x8e, 0x5a, 0x59, 0xeb, 0xb0, - 0x74, 0xa1, 0x5c, 0xd2, 0xa4, 0x51, 0x42, 0xb0, 0x0e, 0xb3, 0x81, 0x0c, 0xe9, 0xa8, 0x32, 0x5d, - 0x2d, 0xbb, 0xd9, 0xd2, 0x5a, 0x82, 0xff, 0x85, 0xe8, 0x85, 0xaa, 0x9e, 0x21, 0x58, 0x0f, 0x61, - 0x3e, 0x8b, 0xd5, 0xa3, 0xc6, 0x33, 0x61, 0xf1, 0x67, 0x5c, 0x9e, 0x6a, 0x73, 0xc8, 0x42, 0x61, - 0x6d, 0x41, 0xf1, 0x90, 0xa4, 0x92, 0x69, 0xae, 0xb6, 0x6a, 0xff, 0xfe, 0x2a, 0xec, 0x0b, 0x2c, - 0x1b, 0xc5, 0x93, 0xef, 0xcb, 0x05, 0x57, 0x14, 0xb0, 0x5e, 0xc1, 0x82, 0xb0, 0x78, 0x49, 0xe2, - 0x84, 0x4b, 0xfe, 0xe6, 0x1c, 0xf1, 0x7f, 0x30, 0xcd, 0xd3, 0xa7, 0x45, 0x90, 0x7f, 0x5a, 0xdb, - 0xea, 0x90, 0xce, 0xca, 0xab, 0x06, 0xea, 0x30, 0x4b, 0x22, 0x16, 0x07, 0x24, 0xeb, 0xe1, 0x46, - 0x5e, 0x0f, 0xf7, 0x23, 0x16, 0xa7, 0x8a, 0x3b, 0xd3, 0x59, 0x1f, 0x10, 0xcc, 0x8b, 0xe2, 0x62, - 0xf7, 0xdf, 0x82, 0xe3, 0x05, 0xd0, 0x76, 0x43, 0xba, 0x77, 0xa8, 0x17, 0x2b, 0xa8, 0x5a, 0x74, - 0xe5, 0x82, 0x17, 0x3f, 0x08, 0x1a, 0x64, 0xa7, 0xe1, 0x31, 0x4f, 0xd7, 0x2a, 0xa8, 0x5a, 0x72, - 0x4b, 0x3c, 0xb0, 0xe9, 0x31, 0x0f, 0x2f, 0xc3, 0x5c, 0xc2, 0xe2, 0x20, 0xf2, 0xe5, 0xf6, 0x8c, - 0xd8, 0x06, 0x19, 0xe2, 0x09, 0x56, 0x04, 0x78, 0x98, 0x57, 0x9d, 0xc4, 0x6d, 0xd0, 0x78, 0x47, - 0x12, 0xf6, 0x2a, 0xe7, 0xe0, 0xca, 0xfc, 0x51, 0x3f, 0xd9, 0xd1, 0x90, 0x5f, 0xed, 0x9b, 0x06, - 0x9a, 0x30, 0xc4, 0x9f, 0x11, 0xc0, 0xd9, 0xe3, 0xc6, 0xb5, 0x3c, 0x8f, 0xcb, 0x07, 0xcb, 0x58, - 0x9f, 0x48, 0x23, 0x7b, 0xb3, 0x36, 0xdf, 0x7c, 0xf9, 0xf9, 0x6e, 0xea, 0x2e, 0xbe, 0xe3, 0xe4, - 0xcc, 0xb6, 0x17, 0x86, 0x3b, 0x6a, 0xa8, 0x9c, 0xce, 0xe0, 0xee, 0xba, 0x4e, 0x47, 0x5e, 0x4e, - 0x17, 0xbf, 0x47, 0x50, 0x1e, 0x8c, 0x00, 0x5e, 0x1b, 0x0b, 0x32, 0x3a, 0x91, 0x46, 0x6d, 0x12, - 0x89, 0x42, 0xb7, 0x05, 0x7a, 0x15, 0xaf, 0xe4, 0xa1, 0x0f, 0x68, 0x13, 0xfc, 0x09, 0x41, 0x29, - 0x7b, 0xe5, 0xf8, 0xd6, 0x58, 0xc3, 0x91, 0x79, 0x33, 0xd6, 0x26, 0x50, 0x28, 0xc2, 0x2d, 0x41, - 0x58, 0xc7, 0xf7, 0xf2, 0x08, 0x8f, 0x95, 0xea, 0xd2, 0x93, 0x75, 0x3a, 0x7c, 0x89, 0x3f, 0x22, - 0xd0, 0xc4, 0xcb, 0xc2, 0xab, 0x63, 0x29, 0x86, 0x67, 0xcd, 0xb0, 0xaf, 0x9a, 0xae, 0x88, 0x9f, - 0x08, 0xe2, 0x07, 0x78, 0x33, 0x8f, 0x58, 0x48, 0x72, 0x70, 0x9d, 0x8e, 0x98, 0xc5, 0xee, 0xc6, - 0xd6, 0x49, 0xcf, 0x44, 0xa7, 0x3d, 0x13, 0xfd, 0xe8, 0x99, 0xe8, 0x6d, 0xdf, 0x2c, 0x9c, 0xf6, - 0xcd, 0xc2, 0xd7, 0xbe, 0x59, 0xd8, 0x5e, 0xf5, 0x03, 0x76, 0xd0, 0xda, 0xb5, 0xf7, 0xe8, 0xeb, - 0xf3, 0x4e, 0xed, 0x11, 0x2f, 0x96, 0x36, 0x49, 0xb2, 0x3b, 0x23, 0xfe, 0x54, 0xd6, 0x7f, 0x05, - 0x00, 0x00, 0xff, 0xff, 0x56, 0x77, 0xab, 0x81, 0xf9, 0x06, 0x00, 0x00, + // 639 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xc7, 0x3b, 0xd0, 0x85, 0xf6, 0xe1, 0xf2, 0x63, 0xc2, 0x0f, 0x36, 0xab, 0x59, 0xea, 0x1e, + 0x48, 0x3d, 0xb0, 0x03, 0xe5, 0xe0, 0xc5, 0x68, 0x4a, 0x50, 0xfc, 0x9b, 0xe8, 0x9a, 0x78, 0x20, + 0x31, 0x64, 0xa1, 0xc3, 0xb2, 0x61, 0xdd, 0x29, 0xbb, 0x03, 0x61, 0xd3, 0x70, 0xf1, 0x15, 0x98, + 0xf8, 0x0e, 0x7c, 0x01, 0x9e, 0x3c, 0x98, 0xf8, 0x06, 0x38, 0x92, 0x78, 0xf1, 0x60, 0x8c, 0x01, + 0x5f, 0x88, 0x99, 0x3f, 0x5b, 0x4a, 0xc1, 0x2d, 0x55, 0x4f, 0xdd, 0x79, 0xe6, 0xf9, 0x3e, 0xdf, + 0xcf, 0x33, 0x33, 0x4f, 0x0a, 0x73, 0x91, 0xbf, 0xef, 0xc7, 0x94, 0x13, 0xf1, 0x4b, 0xb6, 0xc2, + 0x03, 0x9f, 0x87, 0x2c, 0x4e, 0x39, 0x4b, 0x28, 0xd9, 0xdd, 0xa3, 0x49, 0xe6, 0xb6, 0x13, 0xc6, + 0x19, 0xb6, 0x74, 0x9e, 0x2b, 0x7e, 0xdd, 0x73, 0x79, 0xd6, 0x54, 0xc0, 0x02, 0x26, 0xd3, 0x88, + 0xf8, 0x52, 0x0a, 0xeb, 0x7a, 0xc0, 0x58, 0x10, 0x51, 0xe2, 0xb7, 0x43, 0xe2, 0xc7, 0x31, 0xe3, + 0x4a, 0xa1, 0x77, 0x6f, 0x16, 0xf8, 0xe6, 0x2b, 0x95, 0xea, 0x3c, 0x85, 0xe9, 0xe7, 0x82, 0xa4, + 0x19, 0x45, 0x0f, 0xe3, 0x56, 0xb8, 0x49, 0x53, 0x8f, 0xee, 0xee, 0xd1, 0x94, 0xe3, 0x6b, 0x50, + 0x95, 0x8a, 0xf5, 0x1d, 0x9a, 0x99, 0xa8, 0x86, 0xea, 0x55, 0xaf, 0x22, 0x03, 0x8f, 0x69, 0x86, + 0xa7, 0x61, 0xac, 0x9d, 0xd0, 0xad, 0xf0, 0xc0, 0x1c, 0x91, 0x3b, 0x7a, 0xe5, 0x2c, 0xc1, 0xcc, + 0x85, 0x72, 0x69, 0x9b, 0xc5, 0x29, 0xc5, 0x26, 0x8c, 0x87, 0x2a, 0x64, 0xa2, 0xda, 0x68, 0xbd, + 0xea, 0xe5, 0x4b, 0x67, 0x06, 0xfe, 0x97, 0xa2, 0x17, 0xba, 0x7a, 0x8e, 0xe0, 0x3c, 0x80, 0xc9, + 0x3c, 0xd6, 0x8c, 0x5b, 0xcf, 0xa4, 0xc5, 0x9f, 0x71, 0xf9, 0xba, 0xcd, 0x1e, 0x0b, 0x8d, 0xb5, + 0x0a, 0xe5, 0x1d, 0x9a, 0x29, 0xa6, 0x89, 0xc6, 0xbc, 0xfb, 0xfb, 0xab, 0x70, 0x2f, 0xb0, 0x2c, + 0x97, 0x8f, 0xbe, 0xcf, 0x96, 0x3c, 0x59, 0xc0, 0x79, 0x05, 0x53, 0xd2, 0xe2, 0x25, 0x4d, 0x52, + 0x21, 0xf9, 0x9b, 0x73, 0xc4, 0xff, 0xc1, 0xa8, 0x48, 0x1f, 0x95, 0x41, 0xf1, 0xe9, 0xac, 0xe9, + 0x43, 0x3a, 0x2b, 0xaf, 0x1b, 0x68, 0xc2, 0x38, 0x8d, 0x79, 0x12, 0xd2, 0xbc, 0x87, 0x1b, 0x45, + 0x3d, 0xdc, 0x8b, 0x79, 0x92, 0x69, 0xee, 0x5c, 0xe7, 0x7c, 0x40, 0x30, 0x29, 0x8b, 0xcb, 0xdd, + 0x7f, 0x0b, 0x8e, 0xa7, 0xc0, 0xd8, 0x88, 0xd8, 0xe6, 0x8e, 0x59, 0xae, 0xa1, 0x7a, 0xd9, 0x53, + 0x0b, 0x51, 0x7c, 0x3b, 0x6c, 0xd1, 0xf5, 0x96, 0xcf, 0x7d, 0xd3, 0xa8, 0xa1, 0x7a, 0xc5, 0xab, + 0x88, 0xc0, 0x8a, 0xcf, 0x7d, 0x3c, 0x0b, 0x13, 0x29, 0x4f, 0xc2, 0x38, 0x50, 0xdb, 0x63, 0x72, + 0x1b, 0x54, 0x48, 0x24, 0x38, 0x31, 0xe0, 0x5e, 0x5e, 0x7d, 0x12, 0xb7, 0xc0, 0x10, 0x1d, 0x29, + 0xd8, 0xab, 0x9c, 0x83, 0xa7, 0xf2, 0xfb, 0xfd, 0x54, 0x47, 0x3d, 0x7e, 0x8d, 0x6f, 0x06, 0x18, + 0xd2, 0x10, 0x7f, 0x46, 0x00, 0x67, 0x8f, 0x1b, 0x37, 0x8a, 0x3c, 0x2e, 0x1f, 0x2c, 0x6b, 0x69, + 0x28, 0x8d, 0xea, 0xcd, 0x59, 0x79, 0xf3, 0xe5, 0xe7, 0xbb, 0x91, 0x3b, 0xf8, 0x36, 0x29, 0x98, + 0x6d, 0x3f, 0x8a, 0xd6, 0xf5, 0x50, 0x91, 0x4e, 0xf7, 0xee, 0x0e, 0x49, 0x47, 0x5d, 0xce, 0x21, + 0x7e, 0x8f, 0xa0, 0xda, 0x1d, 0x01, 0xbc, 0x38, 0x10, 0xa4, 0x7f, 0x22, 0xad, 0xc6, 0x30, 0x12, + 0x8d, 0xee, 0x4a, 0xf4, 0x3a, 0x9e, 0x2b, 0x42, 0xef, 0xd2, 0xa6, 0xf8, 0x13, 0x82, 0x4a, 0xfe, + 0xca, 0xf1, 0xc2, 0x40, 0xc3, 0xbe, 0x79, 0xb3, 0x16, 0x87, 0x50, 0x68, 0xc2, 0x55, 0x49, 0xd8, + 0xc4, 0x77, 0x8b, 0x08, 0xf7, 0xb5, 0xea, 0xd2, 0x93, 0x25, 0x1d, 0xb1, 0xc4, 0x1f, 0x11, 0x18, + 0xf2, 0x65, 0xe1, 0xf9, 0x81, 0x14, 0xbd, 0xb3, 0x66, 0xb9, 0x57, 0x4d, 0xd7, 0xc4, 0x4f, 0x24, + 0xf1, 0x7d, 0xbc, 0x52, 0x44, 0x2c, 0x25, 0x05, 0xb8, 0xa4, 0x23, 0x67, 0xf1, 0x70, 0xf9, 0xd1, + 0xd1, 0x89, 0x8d, 0x8e, 0x4f, 0x6c, 0xf4, 0xe3, 0xc4, 0x46, 0x6f, 0x4f, 0xed, 0xd2, 0xf1, 0xa9, + 0x5d, 0xfa, 0x7a, 0x6a, 0x97, 0xd6, 0x16, 0x82, 0x90, 0x6f, 0xef, 0x6d, 0xb8, 0x9b, 0xec, 0xf5, + 0x79, 0xa7, 0xfd, 0x06, 0x39, 0xe8, 0xb3, 0xe3, 0x59, 0x9b, 0xa6, 0x1b, 0x63, 0xf2, 0x7f, 0x65, + 0xe9, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x4e, 0xbe, 0xd4, 0xfc, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/client/cli/query.go b/x/pairing/client/cli/query.go index 37e62cb0e0..b8ec234478 100644 --- a/x/pairing/client/cli/query.go +++ b/x/pairing/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/pairing/client/cli/query_account_info.go b/x/pairing/client/cli/query_account_info.go index 6008849594..02c5861c95 100644 --- a/x/pairing/client/cli/query_account_info.go +++ b/x/pairing/client/cli/query_account_info.go @@ -7,14 +7,14 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - projecttypes "github.com/lavanet/lava/x/projects/types" - spectypes "github.com/lavanet/lava/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + projecttypes "github.com/lavanet/lava/v2/x/projects/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_debug_query.go b/x/pairing/client/cli/query_debug_query.go index d23b96dd1d..a48a9a9f3e 100644 --- a/x/pairing/client/cli/query_debug_query.go +++ b/x/pairing/client/cli/query_debug_query.go @@ -10,11 +10,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - "github.com/lavanet/lava/x/pairing/types" - rewardstypes "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/pairing/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_effective_policy.go b/x/pairing/client/cli/query_effective_policy.go index 50ea7407a2..1664e45d7b 100644 --- a/x/pairing/client/cli/query_effective_policy.go +++ b/x/pairing/client/cli/query_effective_policy.go @@ -3,9 +3,9 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_get_pairing.go b/x/pairing/client/cli/query_get_pairing.go index 62c53ad52b..71becad040 100644 --- a/x/pairing/client/cli/query_get_pairing.go +++ b/x/pairing/client/cli/query_get_pairing.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_params.go b/x/pairing/client/cli/query_params.go index 4a9c9a1e3f..c6844365f8 100644 --- a/x/pairing/client/cli/query_params.go +++ b/x/pairing/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_provider.go b/x/pairing/client/cli/query_provider.go index c02dfe68ba..f1c6b3e374 100644 --- a/x/pairing/client/cli/query_provider.go +++ b/x/pairing/client/cli/query_provider.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_provider_monthly_payout.go b/x/pairing/client/cli/query_provider_monthly_payout.go index b6c21cc6d1..169901b656 100644 --- a/x/pairing/client/cli/query_provider_monthly_payout.go +++ b/x/pairing/client/cli/query_provider_monthly_payout.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_provider_pairing_chance.go b/x/pairing/client/cli/query_provider_pairing_chance.go index bf316ad80f..1f105217c1 100644 --- a/x/pairing/client/cli/query_provider_pairing_chance.go +++ b/x/pairing/client/cli/query_provider_pairing_chance.go @@ -3,9 +3,9 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_providers.go b/x/pairing/client/cli/query_providers.go index dbf3703bf6..96728e7000 100644 --- a/x/pairing/client/cli/query_providers.go +++ b/x/pairing/client/cli/query_providers.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_providers_epoch_cu.go b/x/pairing/client/cli/query_providers_epoch_cu.go index 09690a638d..d4e27f5e81 100644 --- a/x/pairing/client/cli/query_providers_epoch_cu.go +++ b/x/pairing/client/cli/query_providers_epoch_cu.go @@ -3,7 +3,7 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_sdk_pairing.go b/x/pairing/client/cli/query_sdk_pairing.go index 844008c356..5fb5f1bcc7 100644 --- a/x/pairing/client/cli/query_sdk_pairing.go +++ b/x/pairing/client/cli/query_sdk_pairing.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_static_providers_list.go b/x/pairing/client/cli/query_static_providers_list.go index e87f0eb782..78df4157af 100644 --- a/x/pairing/client/cli/query_static_providers_list.go +++ b/x/pairing/client/cli/query_static_providers_list.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_subscription_monthly_payout.go b/x/pairing/client/cli/query_subscription_monthly_payout.go index fc7157a47c..03bb5187e5 100644 --- a/x/pairing/client/cli/query_subscription_monthly_payout.go +++ b/x/pairing/client/cli/query_subscription_monthly_payout.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_user_entry.go b/x/pairing/client/cli/query_user_entry.go index eb44deec9b..d95a57d230 100644 --- a/x/pairing/client/cli/query_user_entry.go +++ b/x/pairing/client/cli/query_user_entry.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/query_verify_pairing.go b/x/pairing/client/cli/query_verify_pairing.go index b6d9e60ac2..214a6551eb 100644 --- a/x/pairing/client/cli/query_verify_pairing.go +++ b/x/pairing/client/cli/query_verify_pairing.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx.go b/x/pairing/client/cli/tx.go index 5e8186b5ce..38b34dc193 100644 --- a/x/pairing/client/cli/tx.go +++ b/x/pairing/client/cli/tx.go @@ -15,12 +15,12 @@ import ( "github.com/spf13/cobra" // "github.com/cosmos/cosmos-sdk/client/flags" - lavautils "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - dualstakingTypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/client/utils" - "github.com/lavanet/lava/x/pairing/types" + lavautils "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + dualstakingTypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/client/utils" + "github.com/lavanet/lava/v2/x/pairing/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/pairing/client/cli/tx_freeze.go b/x/pairing/client/cli/tx_freeze.go index e6df5c0846..69b3f5211b 100644 --- a/x/pairing/client/cli/tx_freeze.go +++ b/x/pairing/client/cli/tx_freeze.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_modify_provider.go b/x/pairing/client/cli/tx_modify_provider.go index 8c86596d3d..393ee75723 100644 --- a/x/pairing/client/cli/tx_modify_provider.go +++ b/x/pairing/client/cli/tx_modify_provider.go @@ -2,6 +2,7 @@ package cli import ( "context" + "fmt" "strconv" "strings" @@ -10,12 +11,12 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/spf13/cobra" ) @@ -109,6 +110,8 @@ func CmdModifyProvider() *cobra.Command { if providerEntry == nil { return utils.LavaFormatError("provider isn't staked on chainID, no address match", nil) } + + validator := getValidator(clientCtx, clientCtx.GetFromAddress().String()) newAmount, err := cmd.Flags().GetString(AmountFlagName) if err != nil { return err @@ -118,6 +121,17 @@ func CmdModifyProvider() *cobra.Command { if err != nil { return err } + + if !providerEntry.Stake.IsEqual(newStake) { + if cmd.Flags().Changed(ValidatorFlag) { + validator, err = cmd.Flags().GetString(types.FlagMoniker) + if err != nil { + return err + } + } else { + return fmt.Errorf("increasing or decreasing stake must be accompanied with validator flag") + } + } providerEntry.Stake = newStake } var geolocation int32 @@ -167,16 +181,6 @@ func CmdModifyProvider() *cobra.Command { } } - var validator string - if cmd.Flags().Changed(ValidatorFlag) { - validator, err = cmd.Flags().GetString(types.FlagMoniker) - if err != nil { - return err - } - } else { - validator = getValidator(clientCtx, clientCtx.GetFromAddress().String()) - } - identity, err := cmd.Flags().GetString(types.FlagIdentity) if err != nil { return err diff --git a/x/pairing/client/cli/tx_relay_payment.go b/x/pairing/client/cli/tx_relay_payment.go index fc6860ca09..8cfdf8bd42 100644 --- a/x/pairing/client/cli/tx_relay_payment.go +++ b/x/pairing/client/cli/tx_relay_payment.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_simulate_relay_payment.go b/x/pairing/client/cli/tx_simulate_relay_payment.go index fa2081d317..78b9964e28 100644 --- a/x/pairing/client/cli/tx_simulate_relay_payment.go +++ b/x/pairing/client/cli/tx_simulate_relay_payment.go @@ -9,10 +9,10 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_stake_provider.go b/x/pairing/client/cli/tx_stake_provider.go index 2ee247f316..e8ef034f71 100644 --- a/x/pairing/client/cli/tx_stake_provider.go +++ b/x/pairing/client/cli/tx_stake_provider.go @@ -14,12 +14,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/feegrant" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - conflicttypes "github.com/lavanet/lava/x/conflict/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + conflicttypes "github.com/lavanet/lava/v2/x/conflict/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_unfreeze.go b/x/pairing/client/cli/tx_unfreeze.go index cd20d1226f..a1b7ca74ea 100644 --- a/x/pairing/client/cli/tx_unfreeze.go +++ b/x/pairing/client/cli/tx_unfreeze.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) diff --git a/x/pairing/client/cli/tx_unstake_provider.go b/x/pairing/client/cli/tx_unstake_provider.go index 9e4aea6914..9e21d04c53 100644 --- a/x/pairing/client/cli/tx_unstake_provider.go +++ b/x/pairing/client/cli/tx_unstake_provider.go @@ -10,10 +10,10 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/feegrant" - "github.com/lavanet/lava/utils" - dualstakingclient "github.com/lavanet/lava/x/dualstaking/client/cli" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + dualstakingclient "github.com/lavanet/lava/v2/x/dualstaking/client/cli" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/spf13/cobra" ) @@ -134,6 +134,10 @@ func CreateRevokeFeeGrantMsg(clientCtx client.Context, chainID string) (*feegran feegrantQuerier := feegrant.NewQueryClient(clientCtx) res, err := feegrantQuerier.Allowance(ctx, &feegrant.QueryAllowanceRequest{Granter: vault, Grantee: providerEntry.Address}) if err != nil { + if strings.Contains(err.Error(), "fee-grant not found") { + // fee grant not found, do nothing + return nil, nil //nolint + } return nil, utils.LavaFormatError("failed querying feegrant for gas fees for granter", err, utils.LogAttr("granter", vault), ) diff --git a/x/pairing/client/proposal_handler.go b/x/pairing/client/proposal_handler.go index 7d16fc8285..786d4c9bf2 100644 --- a/x/pairing/client/proposal_handler.go +++ b/x/pairing/client/proposal_handler.go @@ -2,7 +2,7 @@ package client import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/lavanet/lava/x/pairing/client/cli" + "github.com/lavanet/lava/v2/x/pairing/client/cli" ) var PairingUnstakeProposal = govclient.NewProposalHandler(cli.NewSubmitUnstakeProposalTxCmd) diff --git a/x/pairing/client/utils/utils.go b/x/pairing/client/utils/utils.go index 61863adc72..a9467cc648 100755 --- a/x/pairing/client/utils/utils.go +++ b/x/pairing/client/utils/utils.go @@ -4,7 +4,7 @@ import ( "os" "github.com/cosmos/cosmos-sdk/codec" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) type ( diff --git a/x/pairing/genesis.go b/x/pairing/genesis.go index be5aa45283..a1c0c190b7 100644 --- a/x/pairing/genesis.go +++ b/x/pairing/genesis.go @@ -2,8 +2,8 @@ package pairing import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/pairing/genesis_test.go b/x/pairing/genesis_test.go index 2dbc5b612a..b50356dd65 100644 --- a/x/pairing/genesis_test.go +++ b/x/pairing/genesis_test.go @@ -3,10 +3,10 @@ package pairing_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing" - "github.com/lavanet/lava/x/pairing/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/pairing" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/handler.go b/x/pairing/handler.go index 3b35ef806f..39e8d73443 100644 --- a/x/pairing/handler.go +++ b/x/pairing/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) // NewHandler ... diff --git a/x/pairing/keeper/badge_used_cu.go b/x/pairing/keeper/badge_used_cu.go index d5bc1100b4..50ceb20db2 100644 --- a/x/pairing/keeper/badge_used_cu.go +++ b/x/pairing/keeper/badge_used_cu.go @@ -5,9 +5,9 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" - timertypes "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" + timertypes "github.com/lavanet/lava/v2/x/timerstore/types" ) // SetBadgeUsedCu set a specific badgeUsedCu in the store from its index diff --git a/x/pairing/keeper/badge_used_cu_test.go b/x/pairing/keeper/badge_used_cu_test.go index e0ddf3bb5f..bfa4d4ec0e 100644 --- a/x/pairing/keeper/badge_used_cu_test.go +++ b/x/pairing/keeper/badge_used_cu_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/cu_tracker_test.go b/x/pairing/keeper/cu_tracker_test.go index a80af513fe..7911ce154e 100644 --- a/x/pairing/keeper/cu_tracker_test.go +++ b/x/pairing/keeper/cu_tracker_test.go @@ -6,12 +6,12 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/testutil/common" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) @@ -145,11 +145,11 @@ func TestTrackedCuWithDelegations(t *testing.T) { providerAcct, provider := ts.GetAccount(common.PROVIDER, 0) // change the provider's delegation limit and commission - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() // delegate testStake/2 (with commission=0) -> provider should get 66% of the reward @@ -486,11 +486,11 @@ func TestProviderMonthlyPayoutQuery(t *testing.T) { ts.AdvanceEpoch() // change the provider's delegation limit and commission - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() // delegate testStake/2 (with commission=0) -> provider should get 66% of the reward @@ -606,11 +606,11 @@ func TestProviderMonthlyPayoutQueryWithContributor(t *testing.T) { ts.AdvanceEpoch() // change the provider's delegation limit and commission - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() // delegate testStake/2 (with commission=0) -> provider should get 66% of the reward diff --git a/x/pairing/keeper/delegator_rewards_test.go b/x/pairing/keeper/delegator_rewards_test.go index db72f778b9..a6aa073fb3 100644 --- a/x/pairing/keeper/delegator_rewards_test.go +++ b/x/pairing/keeper/delegator_rewards_test.go @@ -5,12 +5,12 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - "github.com/lavanet/lava/x/pairing/types" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + "github.com/lavanet/lava/v2/x/pairing/types" + subscriptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) @@ -99,13 +99,13 @@ func TestProviderDelegatorsRewards(t *testing.T) { ts.AdvanceEpoch() // apply delegations // change delegation traits of stake entry and get the modified one - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(tt.limit*testStake/100)) stakeEntry.DelegateCommission = tt.commission - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) // check that there are two delegators @@ -216,15 +216,15 @@ func TestDelegationLimitAffectingProviderReward(t *testing.T) { require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) // modify the stake entry to have a delegation limit higher than the total delegations stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(2*testStake)) stakeEntry.DelegateCommission = 50 - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) res, err := ts.QueryDualstakingProviderDelegators(provider, false) @@ -236,7 +236,7 @@ func TestDelegationLimitAffectingProviderReward(t *testing.T) { // modify the stake entry to have a delegation limit lower than the total delegations stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() relayPaymentMessage = sendRelay(ts, provider, clientAcc, []string{ts.spec.Index}) @@ -263,16 +263,16 @@ func TestProviderRewardWithCommission(t *testing.T) { require.NoError(t, err) ts.AdvanceEpoch() // apply delegations - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) // ** provider's commission is 100% ** // stakeEntry.DelegateCommission = 100 stakeEntry.DelegateLimit = delegationAmount1 - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) res, err := ts.QueryDualstakingProviderDelegators(provider, false) @@ -283,7 +283,7 @@ func TestProviderRewardWithCommission(t *testing.T) { currentTimestamp := ts.Ctx.BlockTime().UTC().Unix() relevantDelegations := lavaslices.Filter(res.Delegations, func(d dualstakingtypes.Delegation) bool { - return d.ChainID == ts.spec.Index && d.IsFirstMonthPassed(currentTimestamp) + return d.ChainID == ts.spec.Index && d.IsFirstWeekPassed(currentTimestamp) }) totalReward := sdk.NewCoins(sdk.NewCoin(ts.TokenDenom(), math.NewInt(int64(relayCuSum)))) providerReward, _ := ts.Keepers.Dualstaking.CalcRewards(ts.Ctx, stakeEntry, totalReward, relevantDelegations) @@ -301,7 +301,7 @@ func TestProviderRewardWithCommission(t *testing.T) { // ** provider's commission is 0% ** // stakeEntry.DelegateCommission = 0 - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() // the expected reward for the provider with 0% commission is half of the total rewards @@ -484,11 +484,11 @@ func TestVaultProviderDelegatorRewardsQuery(t *testing.T) { } func makeProviderCommissionZero(ts *tester, chainID string, provider string) { - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, chainID, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, chainID, provider) require.True(ts.T, found) stakeEntry.DelegateCommission = 0 stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(testStake)) - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, stakeEntry.Chain, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() } @@ -547,10 +547,10 @@ func TestDelegationFirstMonthPairing(t *testing.T) { _, delegator := ts.GetAccount(common.CONSUMER, 1) // increase delegation limit of stake entry - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(10*testStake)) - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() // delegate and check the delegation's timestamp is equal than nowPlusMonthTime @@ -589,10 +589,10 @@ func TestDelegationFirstMonthReward(t *testing.T) { _, delegator := ts.GetAccount(common.CONSUMER, 1) // increase delegation limit and zero commission of stake entry - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(10*testStake)) - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() makeProviderCommissionZero(ts, ts.spec.Index, provider) @@ -640,15 +640,15 @@ func TestRedelegationFirstMonthReward(t *testing.T) { _, delegator := ts.GetAccount(common.CONSUMER, 1) // increase delegation limit and zero commission of both stake entries - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(10*testStake)) - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider1) + stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider1) require.True(t, found) stakeEntry.DelegateLimit = sdk.NewCoin(ts.TokenDenom(), sdk.NewInt(10*testStake)) - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() makeProviderCommissionZero(ts, ts.spec.Index, provider1) makeProviderCommissionZero(ts, ts.spec.Index, provider) diff --git a/x/pairing/keeper/discipline.go b/x/pairing/keeper/discipline.go index 5c5523289f..a37d5d620d 100644 --- a/x/pairing/keeper/discipline.go +++ b/x/pairing/keeper/discipline.go @@ -4,7 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" + "github.com/lavanet/lava/v2/utils" ) func (k Keeper) JailEntry(ctx sdk.Context, address string, chainID string, jailStartBlock, jailBlocks uint64, bail sdk.Coin) error { diff --git a/x/pairing/keeper/epoch_cu.go b/x/pairing/keeper/epoch_cu.go index c9b9135e2c..c5f1d3dc24 100644 --- a/x/pairing/keeper/epoch_cu.go +++ b/x/pairing/keeper/epoch_cu.go @@ -4,8 +4,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/cachekv" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" ) // UniqueEpochSession is used to detect double spend attacks @@ -36,7 +36,7 @@ func (k Keeper) IsUniqueEpochSessionExists(ctx sdk.Context, epoch uint64, provid // RemoveAllUniqueEpochSession removes all the UniqueEpochSession objects from the store for a specific epoch func (k Keeper) RemoveAllUniqueEpochSession(ctx sdk.Context, epoch uint64) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { store.Delete(iterator.Key()) @@ -47,7 +47,7 @@ func (k Keeper) RemoveAllUniqueEpochSession(ctx sdk.Context, epoch uint64) { func (k Keeper) GetAllUniqueEpochSessionForEpoch(ctx sdk.Context, epoch uint64) []string { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.UniqueEpochSessionKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) // Get an iterator with no prefix to iterate over all keys + iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) // Get an iterator with no prefix to iterate over all keys defer iterator.Close() var keys []string @@ -105,7 +105,7 @@ func (k Keeper) GetProviderEpochCu(ctx sdk.Context, epoch uint64, provider strin // RemoveProviderEpochCu removes a ProviderEpochCu from the store func (k Keeper) RemoveAllProviderEpochCu(ctx sdk.Context, epoch uint64) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { store.Delete(iterator.Key()) @@ -167,7 +167,7 @@ func (k Keeper) RemoveProviderEpochComplainerCu(ctx sdk.Context, epoch uint64, p // RemoveProviderEpochComplainerCu removes a ProviderEpochCu from the store func (k Keeper) RemoveAllProviderEpochComplainerCu(ctx sdk.Context, epoch uint64) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderEpochComplainerCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { store.Delete(iterator.Key()) @@ -230,7 +230,7 @@ func (k Keeper) RemoveProviderConsumerEpochCu(ctx sdk.Context, epoch uint64, pro func (k Keeper) GetAllProviderConsumerEpochCu(ctx sdk.Context, epoch uint64) []types.ProviderConsumerEpochCuGenesis { providerConsumerEpochCus := []types.ProviderConsumerEpochCuGenesis{} store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ProviderConsumerEpochCuKeyPrefix()) - iterator := sdk.KVStorePrefixIterator(store, types.EncodeBlock(epoch)) + iterator := sdk.KVStorePrefixIterator(store, utils.Serialize(epoch)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { epoch, provider, project, chainID, err := types.DecodeProviderConsumerEpochCuKey(string(iterator.Key())) diff --git a/x/pairing/keeper/epoch_cu_test.go b/x/pairing/keeper/epoch_cu_test.go index 7acc9a5a88..a3314fcf52 100644 --- a/x/pairing/keeper/epoch_cu_test.go +++ b/x/pairing/keeper/epoch_cu_test.go @@ -5,10 +5,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/epoch_payment.go b/x/pairing/keeper/epoch_payment.go index f1a6235bcb..598dbaa7bd 100644 --- a/x/pairing/keeper/epoch_payment.go +++ b/x/pairing/keeper/epoch_payment.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) // AddEpochPayment adds a new epoch payment and returns the updated CU used between provider and project diff --git a/x/pairing/keeper/filters/addon_filter.go b/x/pairing/keeper/filters/addon_filter.go index 80eec9b67e..30b8057002 100644 --- a/x/pairing/keeper/filters/addon_filter.go +++ b/x/pairing/keeper/filters/addon_filter.go @@ -4,9 +4,9 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) type AddonFilter struct { diff --git a/x/pairing/keeper/filters/filter.go b/x/pairing/keeper/filters/filter.go index 6ca23aceaa..b7689c46d5 100644 --- a/x/pairing/keeper/filters/filter.go +++ b/x/pairing/keeper/filters/filter.go @@ -4,11 +4,11 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingscores "github.com/lavanet/lava/x/pairing/keeper/scores" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingscores "github.com/lavanet/lava/v2/x/pairing/keeper/scores" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) // The Filter interface allows creating filters that filter out providers in the pairing process. @@ -83,7 +83,10 @@ func SetupScores(ctx sdk.Context, filters []Filter, providers []epochstoragetype // create providerScore array with all possible providers providerScores := []*pairingscores.PairingScore{} - for j := 0; j < len(providers); j++ { + // currently, the providers are sorted by stake with increasing order + // the pairing mechanism works best if we iterate over the largest stake + // providers first, so we iterate in reverse order + for j := len(providers) - 1; j >= 0; j-- { result := true slotFiltering := map[int]struct{}{} // for mix filters // check provider for each filter diff --git a/x/pairing/keeper/filters/filter_test.go b/x/pairing/keeper/filters/filter_test.go index 0834aa76f1..296461c2de 100644 --- a/x/pairing/keeper/filters/filter_test.go +++ b/x/pairing/keeper/filters/filter_test.go @@ -5,8 +5,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/filters/frozen_providers_filter.go b/x/pairing/keeper/filters/frozen_providers_filter.go index a2845f7d73..c20b302a63 100644 --- a/x/pairing/keeper/filters/frozen_providers_filter.go +++ b/x/pairing/keeper/filters/frozen_providers_filter.go @@ -2,8 +2,8 @@ package filters import ( sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) type FrozenProvidersFilter struct{} diff --git a/x/pairing/keeper/filters/geolocation_filter.go b/x/pairing/keeper/filters/geolocation_filter.go index fbedb7685f..489427aa19 100644 --- a/x/pairing/keeper/filters/geolocation_filter.go +++ b/x/pairing/keeper/filters/geolocation_filter.go @@ -2,8 +2,8 @@ package filters import ( sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) // TODO: This filter is disabled (InitFilter always returns false) diff --git a/x/pairing/keeper/filters/selected_providers_filter.go b/x/pairing/keeper/filters/selected_providers_filter.go index 0b641edee0..1e17f921bb 100644 --- a/x/pairing/keeper/filters/selected_providers_filter.go +++ b/x/pairing/keeper/filters/selected_providers_filter.go @@ -2,8 +2,8 @@ package filters import ( sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) type SelectedProvidersFilter struct { diff --git a/x/pairing/keeper/fixation_test.go b/x/pairing/keeper/fixation_test.go index 759522b26d..474ca2a330 100644 --- a/x/pairing/keeper/fixation_test.go +++ b/x/pairing/keeper/fixation_test.go @@ -4,9 +4,9 @@ import ( "strconv" "testing" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/grpc_query.go b/x/pairing/keeper/grpc_query.go index 1c5fe84859..75b5485f4f 100644 --- a/x/pairing/keeper/grpc_query.go +++ b/x/pairing/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/pairing/keeper/grpc_query_effective_policy.go b/x/pairing/keeper/grpc_query_effective_policy.go index c7228595e9..934dfd1804 100644 --- a/x/pairing/keeper/grpc_query_effective_policy.go +++ b/x/pairing/keeper/grpc_query_effective_policy.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" - projectstypes "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/pairing/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_effective_policy_test.go b/x/pairing/keeper/grpc_query_effective_policy_test.go index 080bd6ec2a..8b21fba0e8 100644 --- a/x/pairing/keeper/grpc_query_effective_policy_test.go +++ b/x/pairing/keeper/grpc_query_effective_policy_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/testutil/common" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/testutil/common" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/grpc_query_get_pairing.go b/x/pairing/keeper/grpc_query_get_pairing.go index a4a75e4c75..429b1f1ae1 100644 --- a/x/pairing/keeper/grpc_query_get_pairing.go +++ b/x/pairing/keeper/grpc_query_get_pairing.go @@ -6,9 +6,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_params.go b/x/pairing/keeper/grpc_query_params.go index 9a45d8f372..c88e6c6b88 100644 --- a/x/pairing/keeper/grpc_query_params.go +++ b/x/pairing/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_params_test.go b/x/pairing/keeper/grpc_query_params_test.go index afa94bcd71..759dd9e03c 100644 --- a/x/pairing/keeper/grpc_query_params_test.go +++ b/x/pairing/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/pairing/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/grpc_query_provider.go b/x/pairing/keeper/grpc_query_provider.go index eb8c1cc7fa..086b843023 100644 --- a/x/pairing/keeper/grpc_query_provider.go +++ b/x/pairing/keeper/grpc_query_provider.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -24,7 +24,7 @@ func (k Keeper) Provider(goCtx context.Context, req *types.QueryProviderRequest) stakeEntries := []epochstoragetypes.StakeEntry{} for _, chain := range chains { - stakeEntry, found := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chain, req.Address) + stakeEntry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chain, req.Address) if !found { continue } diff --git a/x/pairing/keeper/grpc_query_provider_monthly_payout.go b/x/pairing/keeper/grpc_query_provider_monthly_payout.go index 329908c921..a21a91bc02 100644 --- a/x/pairing/keeper/grpc_query_provider_monthly_payout.go +++ b/x/pairing/keeper/grpc_query_provider_monthly_payout.go @@ -5,10 +5,10 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" - subsciption "github.com/lavanet/lava/x/subscription/keeper" - subsciptiontypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" + subsciption "github.com/lavanet/lava/v2/x/subscription/keeper" + subsciptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_provider_pairing_chance.go b/x/pairing/keeper/grpc_query_provider_pairing_chance.go index 0fded38b84..33da88a670 100644 --- a/x/pairing/keeper/grpc_query_provider_pairing_chance.go +++ b/x/pairing/keeper/grpc_query_provider_pairing_chance.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_providers.go b/x/pairing/keeper/grpc_query_providers.go index 8e645706f0..ccdb4fec87 100644 --- a/x/pairing/keeper/grpc_query_providers.go +++ b/x/pairing/keeper/grpc_query_providers.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -17,22 +17,16 @@ func (k Keeper) Providers(goCtx context.Context, req *types.QueryProvidersReques ctx := sdk.UnwrapSDKContext(goCtx) - stakeStorage, found := k.epochStorageKeeper.GetStakeStorageCurrent(ctx, req.ChainID) - if !found { - stakeStorage = epochstoragetypes.StakeStorage{} - } - - stakeEntries := stakeStorage.GetStakeEntries() - for i := range stakeEntries { - stakeEntries[i].Moniker = stakeEntries[i].Description.Moniker - } + stakeEntries := k.epochStorageKeeper.GetAllStakeEntriesCurrentForChainId(ctx, req.ChainID) if !req.ShowFrozen { stakeEntriesNoFrozen := []epochstoragetypes.StakeEntry{} - for _, stakeEntry := range stakeEntries { + for i := range stakeEntries { + stakeEntries[i].Moniker = stakeEntries[i].Description.Moniker + // show providers with valid stakeAppliedBlock (frozen providers have stakeAppliedBlock = MaxUint64) - if stakeEntry.GetStakeAppliedBlock() <= uint64(ctx.BlockHeight()) { - stakeEntriesNoFrozen = append(stakeEntriesNoFrozen, stakeEntry) + if stakeEntries[i].GetStakeAppliedBlock() <= uint64(ctx.BlockHeight()) { + stakeEntriesNoFrozen = append(stakeEntriesNoFrozen, stakeEntries[i]) } } stakeEntries = stakeEntriesNoFrozen diff --git a/x/pairing/keeper/grpc_query_providers_epoch_cu.go b/x/pairing/keeper/grpc_query_providers_epoch_cu.go index ec34d870fc..eb189e0ec5 100644 --- a/x/pairing/keeper/grpc_query_providers_epoch_cu.go +++ b/x/pairing/keeper/grpc_query_providers_epoch_cu.go @@ -5,7 +5,7 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_static_providers_list.go b/x/pairing/keeper/grpc_query_static_providers_list.go index 89cce70e4d..68cb318a20 100644 --- a/x/pairing/keeper/grpc_query_static_providers_list.go +++ b/x/pairing/keeper/grpc_query_static_providers_list.go @@ -5,9 +5,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -28,11 +28,7 @@ func (k Keeper) StaticProvidersList(goCtx context.Context, req *types.QueryStati } epoch := k.epochStorageKeeper.GetEpochStart(ctx) - stakes, found, _ := k.epochStorageKeeper.GetEpochStakeEntries(ctx, epoch, req.GetChainID()) - - if !found { - return &types.QueryStaticProvidersListResponse{}, nil - } + stakes := k.epochStorageKeeper.GetAllStakeEntriesForEpochChainId(ctx, epoch, req.ChainID) finalProviders := []epochstoragetypes.StakeEntry{} for _, stake := range stakes { diff --git a/x/pairing/keeper/grpc_query_subscription_monthly_payout.go b/x/pairing/keeper/grpc_query_subscription_monthly_payout.go index f209f96352..8552bf29b3 100644 --- a/x/pairing/keeper/grpc_query_subscription_monthly_payout.go +++ b/x/pairing/keeper/grpc_query_subscription_monthly_payout.go @@ -6,10 +6,10 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" - subsciption "github.com/lavanet/lava/x/subscription/keeper" - subsciptiontypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" + subsciption "github.com/lavanet/lava/v2/x/subscription/keeper" + subsciptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_user_entry.go b/x/pairing/keeper/grpc_query_user_entry.go index fa939442e2..0c6cb3e960 100644 --- a/x/pairing/keeper/grpc_query_user_entry.go +++ b/x/pairing/keeper/grpc_query_user_entry.go @@ -5,9 +5,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/grpc_query_verify_pairing.go b/x/pairing/keeper/grpc_query_verify_pairing.go index 196c7e13a3..a443804224 100644 --- a/x/pairing/keeper/grpc_query_verify_pairing.go +++ b/x/pairing/keeper/grpc_query_verify_pairing.go @@ -6,7 +6,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/helpers_test.go b/x/pairing/keeper/helpers_test.go index 585e494b18..f8456cffe1 100644 --- a/x/pairing/keeper/helpers_test.go +++ b/x/pairing/keeper/helpers_test.go @@ -5,13 +5,13 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - testutil "github.com/lavanet/lava/testutil/keeper" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" - rewardstypes "github.com/lavanet/lava/x/rewards/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/common" + testutil "github.com/lavanet/lava/v2/testutil/keeper" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/keeper.go b/x/pairing/keeper/keeper.go index ee8bce49ff..81d96d5492 100644 --- a/x/pairing/keeper/keeper.go +++ b/x/pairing/keeper/keeper.go @@ -4,15 +4,16 @@ import ( "fmt" storetypes "github.com/cosmos/cosmos-sdk/store/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - "github.com/lavanet/lava/x/pairing/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) type ( @@ -34,6 +35,8 @@ type ( downtimeKeeper types.DowntimeKeeper dualstakingKeeper types.DualstakingKeeper stakingKeeper types.StakingKeeper + + pairingQueryCache *map[string][]epochstoragetypes.StakeEntry } ) @@ -71,6 +74,8 @@ func NewKeeper( ps = ps.WithKeyTable(types.ParamKeyTable()) } + emptypairingQueryCache := map[string][]epochstoragetypes.StakeEntry{} + keeper := &Keeper{ cdc: cdc, storeKey: storeKey, @@ -86,6 +91,7 @@ func NewKeeper( downtimeKeeper: downtimeKeeper, dualstakingKeeper: dualstakingKeeper, stakingKeeper: stakingKeeper, + pairingQueryCache: &emptypairingQueryCache, } // note that the timer and badgeUsedCu keys are the same (so we can use only the second arg) @@ -107,10 +113,10 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) BeginBlock(ctx sdk.Context) { if k.epochStorageKeeper.IsEpochStart(ctx) { + // reset pairing query cache every epoch + *k.pairingQueryCache = map[string][]epochstoragetypes.StakeEntry{} // remove old session payments k.RemoveOldEpochPayments(ctx) - // unstake any unstaking providers - k.CheckUnstakingForCommit(ctx) // unstake/jail unresponsive providers k.PunishUnresponsiveProviders(ctx, types.EPOCHS_NUM_TO_CHECK_CU_FOR_UNRESPONSIVE_PROVIDER, @@ -118,6 +124,11 @@ func (k Keeper) BeginBlock(ctx sdk.Context) { } } +func (k Keeper) EndBlock(ctx sdk.Context) { + // reset pairing relay cache every block + k.ResetPairingRelayCache(ctx) +} + func (k Keeper) InitProviderQoS(ctx sdk.Context, gs fixationtypes.GenesisState) { k.providerQosFS.Init(ctx, gs) } diff --git a/x/pairing/keeper/limitConsumer.go b/x/pairing/keeper/limitConsumer.go index ac62fb401a..801ad48798 100644 --- a/x/pairing/keeper/limitConsumer.go +++ b/x/pairing/keeper/limitConsumer.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) func (k Keeper) EnforceClientCUsUsageInEpoch(ctx sdk.Context, relayCU, epochAllowedCU, totalCUInEpochForUserProvider uint64, clientAddr sdk.AccAddress, chainID string, epoch uint64) (uint64, error) { diff --git a/x/pairing/keeper/limitConsumer_test.go b/x/pairing/keeper/limitConsumer_test.go index 3c6eac76b7..5d6b63be3e 100644 --- a/x/pairing/keeper/limitConsumer_test.go +++ b/x/pairing/keeper/limitConsumer_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/migrations.go b/x/pairing/keeper/migrations.go index 94c0aa7738..c7d3cee690 100644 --- a/x/pairing/keeper/migrations.go +++ b/x/pairing/keeper/migrations.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v2 "github.com/lavanet/lava/x/pairing/migrations/v2" + v2 "github.com/lavanet/lava/v2/x/pairing/migrations/v2" ) type Migrator struct { diff --git a/x/pairing/keeper/msg_server.go b/x/pairing/keeper/msg_server.go index a32c11186c..e8b3964d31 100644 --- a/x/pairing/keeper/msg_server.go +++ b/x/pairing/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) type msgServer struct { diff --git a/x/pairing/keeper/msg_server_freeze.go b/x/pairing/keeper/msg_server_freeze.go index 8b547c6364..9e343e863a 100644 --- a/x/pairing/keeper/msg_server_freeze.go +++ b/x/pairing/keeper/msg_server_freeze.go @@ -7,9 +7,9 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) func (k msgServer) FreezeProvider(goCtx context.Context, msg *types.MsgFreezeProvider) (*types.MsgFreezeProviderResponse, error) { @@ -34,14 +34,14 @@ func (k Keeper) FreezeProvider(ctx sdk.Context, provider string, chainIDs []stri } for _, chainId := range chainIDs { - stakeEntry, found := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainId, provider) + stakeEntry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainId, provider) if !found { return utils.LavaFormatWarning("Freeze_cant_get_stake_entry", types.FreezeStakeEntryNotFoundError, []utils.Attribute{{Key: "chainID", Value: chainId}, {Key: "providerAddress", Value: provider}}...) } // freeze the provider by making the StakeAppliedBlock be max. This will remove the provider from the pairing list in the next epoch stakeEntry.Freeze() - k.epochStorageKeeper.ModifyStakeEntryCurrent(ctx, chainId, stakeEntry) + k.epochStorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) } utils.LogLavaEvent(ctx, ctx.Logger(), "freeze_provider", map[string]string{"providerAddress": provider, "chainIDs": strings.Join(chainIDs, ","), "freezeRequestBlock": strconv.FormatInt(ctx.BlockHeight(), 10), "freezeReason": reason}, "Provider Freeze") diff --git a/x/pairing/keeper/msg_server_freeze_test.go b/x/pairing/keeper/msg_server_freeze_test.go index 55564e2bdf..27192897ed 100644 --- a/x/pairing/keeper/msg_server_freeze_test.go +++ b/x/pairing/keeper/msg_server_freeze_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/msg_server_relay_payment.go b/x/pairing/keeper/msg_server_relay_payment.go index c5138bbf01..c3f7c75212 100644 --- a/x/pairing/keeper/msg_server_relay_payment.go +++ b/x/pairing/keeper/msg_server_relay_payment.go @@ -8,13 +8,12 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" ) type BadgeData struct { @@ -72,7 +71,6 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen var rejectedCu uint64 // aggregated rejected CU (due to badge CU overuse or provider double spending) rejected_relays_num := len(msg.Relays) - validatePairingCache := map[string][]epochstoragetypes.StakeEntry{} for relayIdx, relay := range msg.Relays { rejectedCu += relay.CuSum providerAddr, err := sdk.AccAddressFromBech32(relay.Provider) @@ -180,44 +178,28 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen ) } - // generate validate pairing cache key with CuTrackerKey() to reuse code (doesn't relate to CU tracking at all) - validatePairingKey := subscriptiontypes.CuTrackerKey(clientAddr.String(), relay.Provider, relay.SpecId) var providers []epochstoragetypes.StakeEntry allowedCU := uint64(0) - val, ok := validatePairingCache[validatePairingKey] - if ok { - providers = val - strictestPolicy, _, err := k.GetProjectStrictestPolicy(ctx, project, relay.SpecId, epochStart) - if err != nil { - return nil, utils.LavaFormatError("strictest policy calculation for pairing validation cache failed", err, - utils.LogAttr("project", project.Index), - utils.LogAttr("chainID", relay.SpecId), - utils.LogAttr("block", strconv.FormatUint(epochStart, 10)), - ) - } - allowedCU = strictestPolicy.EpochCuLimit - } else { - isValidPairing := false - isValidPairing, allowedCU, providers, err = k.Keeper.ValidatePairingForClient( - ctx, - relay.SpecId, - providerAddr, - uint64(relay.Epoch), - project, + + isValidPairing := false + isValidPairing, allowedCU, providers, err = k.Keeper.ValidatePairingForClient( + ctx, + relay.SpecId, + providerAddr, + uint64(relay.Epoch), + project, + ) + if err != nil { + return nil, utils.LavaFormatWarning("invalid pairing on proof of relay", err, + utils.Attribute{Key: "client", Value: clientAddr.String()}, + utils.Attribute{Key: "provider", Value: providerAddr.String()}, + ) + } + if !isValidPairing { + return nil, utils.LavaFormatWarning("invalid pairing on proof of relay", fmt.Errorf("pairing result doesn't include provider"), + utils.Attribute{Key: "client", Value: clientAddr.String()}, + utils.Attribute{Key: "provider", Value: providerAddr.String()}, ) - if err != nil { - return nil, utils.LavaFormatWarning("invalid pairing on proof of relay", err, - utils.Attribute{Key: "client", Value: clientAddr.String()}, - utils.Attribute{Key: "provider", Value: providerAddr.String()}, - ) - } - if !isValidPairing { - return nil, utils.LavaFormatWarning("invalid pairing on proof of relay", fmt.Errorf("pairing result doesn't include provider"), - utils.Attribute{Key: "client", Value: clientAddr.String()}, - utils.Attribute{Key: "provider", Value: providerAddr.String()}, - ) - } - validatePairingCache[validatePairingKey] = providers } rewardedCU, err := k.Keeper.EnforceClientCUsUsageInEpoch(ctx, relay.CuSum, allowedCU, totalCUInEpochForUserProvider, clientAddr, relay.SpecId, uint64(relay.Epoch)) @@ -239,7 +221,16 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen if len(msg.DescriptionString) > 20 { msg.DescriptionString = msg.DescriptionString[:20] } - details := map[string]string{"chainID": fmt.Sprintf(relay.SpecId), "epoch": strconv.FormatInt(relay.Epoch, 10), "client": clientAddr.String(), "provider": providerAddr.String(), "CU": strconv.FormatUint(relay.CuSum, 10), "totalCUInEpoch": strconv.FormatUint(totalCUInEpochForUserProvider, 10), "uniqueIdentifier": strconv.FormatUint(relay.SessionId, 10), "descriptionString": msg.DescriptionString} + details := map[string]string{ + "chainID": relay.SpecId, + "epoch": strconv.FormatInt(relay.Epoch, 10), + "client": clientAddr.String(), + "provider": providerAddr.String(), + "CU": strconv.FormatUint(relay.CuSum, 10), + "totalCUInEpoch": strconv.FormatUint(totalCUInEpochForUserProvider, 10), + "uniqueIdentifier": strconv.FormatUint(relay.SessionId, 10), + "descriptionString": msg.DescriptionString, + } details["rewardedCU"] = strconv.FormatUint(relay.CuSum, 10) if relay.QosReport != nil { @@ -332,13 +323,13 @@ func (k msgServer) RelayPayment(goCtx context.Context, msg *types.MsgRelayPaymen } func (k msgServer) setStakeEntryBlockReport(ctx sdk.Context, providerAddr string, chainID string, latestBlock uint64) { - stakeEntry, found := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, providerAddr) + stakeEntry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, providerAddr) if found { stakeEntry.BlockReport = &epochstoragetypes.BlockReport{ Epoch: k.epochStorageKeeper.GetEpochStart(ctx), LatestBlock: latestBlock, } - k.epochStorageKeeper.ModifyStakeEntryCurrent(ctx, chainID, stakeEntry) + k.epochStorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) } } diff --git a/x/pairing/keeper/msg_server_relay_payment_gov_test.go b/x/pairing/keeper/msg_server_relay_payment_gov_test.go index 78a8d4f178..f1b4499bfb 100644 --- a/x/pairing/keeper/msg_server_relay_payment_gov_test.go +++ b/x/pairing/keeper/msg_server_relay_payment_gov_test.go @@ -5,11 +5,11 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) @@ -497,10 +497,6 @@ func TestStakePaymentUnstake(t *testing.T) { paramVal = "\"" + strconv.FormatUint(10, 10) + "\"" err = ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) require.NoError(t, err) - paramKey = string(epochstoragetypes.KeyUnstakeHoldBlocks) - paramVal = "\"" + strconv.FormatUint(210, 10) + "\"" - err = ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) - require.NoError(t, err) // Advance an epoch to apply EpochBlocks change ts.AdvanceEpoch() // blockHeight = 20 diff --git a/x/pairing/keeper/msg_server_relay_payment_test.go b/x/pairing/keeper/msg_server_relay_payment_test.go index 1bd29daebd..576ae4d5f0 100644 --- a/x/pairing/keeper/msg_server_relay_payment_test.go +++ b/x/pairing/keeper/msg_server_relay_payment_test.go @@ -4,13 +4,13 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - commonconsts "github.com/lavanet/lava/testutil/common/consts" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/testutil/common" + commonconsts "github.com/lavanet/lava/v2/testutil/common/consts" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) @@ -166,9 +166,7 @@ func TestRelayPaymentNotUnstakingProviderForUnresponsivenessIfNoEpochInformation require.NoError(t, err) // test that the provider was not unstaked - _, unStakeStoragefound := ts.Keepers.Epochstorage.UnstakeEntryByAddress(ts.Ctx, provider2) - require.False(t, unStakeStoragefound) - _, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Name, provider2) + _, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Name, provider2) require.True(t, stakeStorageFound) } @@ -270,9 +268,7 @@ func TestRelayPaymentNotUnstakingProviderForUnresponsivenessBecauseOfServices(t require.NoError(t, err) // test that the provider was not unstaked. - _, unStakeStoragefound := ts.Keepers.Epochstorage.UnstakeEntryByAddress(ts.Ctx, provider2) - require.False(t, unStakeStoragefound) - _, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Name, provider2) + _, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Name, provider2) require.True(t, stakeStorageFound) } diff --git a/x/pairing/keeper/msg_server_stake_provider.go b/x/pairing/keeper/msg_server_stake_provider.go index 7ced508a60..9a9890f38a 100644 --- a/x/pairing/keeper/msg_server_stake_provider.go +++ b/x/pairing/keeper/msg_server_stake_provider.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" ) func (k msgServer) StakeProvider(goCtx context.Context, msg *types.MsgStakeProvider) (*types.MsgStakeProviderResponse, error) { diff --git a/x/pairing/keeper/msg_server_stake_provider_test.go b/x/pairing/keeper/msg_server_stake_provider_test.go index 5562e43c78..ecdee17001 100644 --- a/x/pairing/keeper/msg_server_stake_provider_test.go +++ b/x/pairing/keeper/msg_server_stake_provider_test.go @@ -7,11 +7,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/testutil/common" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/client/cli" - "github.com/lavanet/lava/x/pairing/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/common" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/client/cli" + "github.com/lavanet/lava/v2/x/pairing/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -27,7 +27,7 @@ func TestModifyStakeProviderWithDescription(t *testing.T) { providerAcct, providerAddr := ts.GetAccount(common.PROVIDER, 0) // Get the stake entry and check the provider is staked - stakeEntry, foundProvider := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, providerAddr) + stakeEntry, foundProvider := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, providerAddr) require.True(t, foundProvider) require.True(t, stakeEntry.Description.Equal(common.MockDescription())) @@ -38,7 +38,7 @@ func TestModifyStakeProviderWithDescription(t *testing.T) { ts.AdvanceEpoch() // Get the stake entry and check the provider is staked - stakeEntry, foundProvider = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, providerAddr) + stakeEntry, foundProvider = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, providerAddr) require.True(t, foundProvider) require.True(t, stakeEntry.Description.Equal(dNew)) } @@ -661,7 +661,7 @@ func TestStakeEndpoints(t *testing.T) { if play.success { require.NoError(t, err) - providerEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, providerAddr) + providerEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, providerAddr) require.True(t, found) addons := 0 extensions := 0 @@ -720,7 +720,7 @@ func TestStakeProviderLimits(t *testing.T) { return } require.NoError(t, err) - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, addr) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, addr) require.True(t, found) require.Equal(t, tt.isFrozen, stakeEntry.IsFrozen()) }) @@ -743,7 +743,7 @@ func TestUnfreezeWithDelegations(t *testing.T) { providerAcc, provider := ts.AddAccount(common.PROVIDER, 1, minSelfDelegation.Amount.Int64()+1) err := ts.StakeProviderExtra(providerAcc.GetVaultAddr(), provider, ts.spec, minSelfDelegation.Amount.Int64()+1, nil, 0, "", "", "", "", "") require.NoError(t, err) - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) require.True(t, stakeEntry.IsFrozen()) require.Equal(t, minSelfDelegation.Amount.AddRaw(1), stakeEntry.EffectiveStake()) @@ -753,10 +753,10 @@ func TestUnfreezeWithDelegations(t *testing.T) { require.Error(t, err) // increase delegation limit of stake entry from 0 to MinStakeProvider + 100 - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) stakeEntry.DelegateLimit = ts.spec.MinStakeProvider.AddAmount(math.NewInt(100)) - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() // add delegator and delegate to provider so its effective stake is MinStakeProvider+MinSelfDelegation+1 @@ -765,7 +765,7 @@ func TestUnfreezeWithDelegations(t *testing.T) { _, err = ts.TxDualstakingDelegate(consumer, provider, ts.spec.Index, ts.spec.MinStakeProvider) require.NoError(t, err) ts.AdvanceEpoch() // apply delegation - stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, provider) + stakeEntry, found = ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, provider) require.True(t, found) require.True(t, stakeEntry.IsFrozen()) require.Equal(t, ts.spec.MinStakeProvider.Add(minSelfDelegation).Amount.AddRaw(1), stakeEntry.EffectiveStake()) @@ -811,6 +811,10 @@ func TestCommisionChange(t *testing.T) { _, err = ts.TxPairingStakeProviderFull(provider, provider, ts.spec.Index, ts.spec.MinStakeProvider, nil, 0, 61, 139, "", "", "", "", "") require.NoError(t, err) + // same values, should pass + _, err = ts.TxPairingStakeProviderFull(provider, provider, ts.spec.Index, ts.spec.MinStakeProvider, nil, 0, 61, 139, "", "", "", "", "") + require.NoError(t, err) + _, err = ts.TxPairingStakeProviderFull(provider, provider, ts.spec.Index, ts.spec.MinStakeProvider, nil, 0, 62, 138, "", "", "", "", "") require.Error(t, err) @@ -877,7 +881,7 @@ func TestVaultProviderNewStakeEntry(t *testing.T) { require.Equal(t, providerBefore, providerAfter) // stake entry - _, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) + _, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) require.True(t, found) // should be found because provider is registered in a vaild stake entry // delegations @@ -896,7 +900,7 @@ func TestVaultProviderNewStakeEntry(t *testing.T) { } // stake entry - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) require.True(t, found) require.Equal(t, testStake, stakeEntry.Stake.Amount.Int64()) require.Equal(t, int64(0), stakeEntry.DelegateTotal.Amount.Int64()) @@ -956,7 +960,7 @@ func TestVaultProviderExistingStakeEntry(t *testing.T) { require.Equal(t, beforeProvider, afterProvider) // stake entry - _, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) + _, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) require.True(t, found) // should be found because provider is registered in a vaild stake entry // delegations @@ -975,7 +979,7 @@ func TestVaultProviderExistingStakeEntry(t *testing.T) { } // stake entry - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, tt.spec.Index, tt.provider.String()) require.True(t, found) require.Equal(t, testStake+100, stakeEntry.Stake.Amount.Int64()) require.Equal(t, int64(0), stakeEntry.DelegateTotal.Amount.Int64()) @@ -1007,7 +1011,7 @@ func TestVaultProviderModifyStakeEntry(t *testing.T) { vault := acc.GetVaultAddr() valAcc, _ := ts.GetAccount(common.VALIDATOR, 0) - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, acc.Addr.String()) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, acc.Addr.String()) require.True(t, found) // consts for stake entry changes @@ -1096,7 +1100,7 @@ func TestVaultProviderModifyStakeEntry(t *testing.T) { } // reset stake entry - ts.Keepers.Epochstorage.ModifyStakeEntryCurrent(ts.Ctx, ts.spec.Index, stakeEntry) + ts.Keepers.Epochstorage.SetStakeEntryCurrent(ts.Ctx, stakeEntry) ts.AdvanceEpoch() }) } @@ -1211,7 +1215,7 @@ func TestDelegatorAfterProviderUnstakeAndStake(t *testing.T) { // apple should be able to unbond. After this, banana has one delegation: orange->banana err = ts.StakeProvider(orange, banana, ts.spec, testBalance/4) require.NoError(t, err) - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, orange) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, orange) require.True(t, found) require.NotZero(t, stakeEntry.DelegateTotal.Amount.Int64()) @@ -1229,7 +1233,7 @@ func TestDelegatorAfterProviderUnstakeAndStake(t *testing.T) { // apple should be able to unbond. After this, banana has no delegations err = ts.StakeProvider(banana, orange, ts.spec, testBalance/4) require.NoError(t, err) - stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Index, banana) + stakeEntry, found := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Index, banana) require.True(t, found) require.Zero(t, stakeEntry.DelegateTotal.Amount.Int64()) diff --git a/x/pairing/keeper/msg_server_stake_unstake_gov_test.go b/x/pairing/keeper/msg_server_stake_unstake_gov_test.go index 9deb354fbf..aa519df090 100644 --- a/x/pairing/keeper/msg_server_stake_unstake_gov_test.go +++ b/x/pairing/keeper/msg_server_stake_unstake_gov_test.go @@ -4,8 +4,7 @@ import ( "strconv" "testing" - "github.com/lavanet/lava/testutil/common" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/stretchr/testify/require" ) @@ -49,19 +48,18 @@ func TestStakeGovEpochBlocksDecrease(t *testing.T) { // define tests tests := []struct { - name string - epoch uint64 - shouldBeStaked bool + name string + epoch uint64 }{ - {"ShouldntBeStaked", epochShouldntBeStaked, true}, // 11 blocks have passed since the stake - not enough blocks - {"ShouldBeStaked", epochShouldBeStaked, true}, // 21 blocks have passed - enough blocks + {"ShouldntBeStaked", epochShouldntBeStaked}, // 11 blocks have passed since the stake - not enough blocks + {"ShouldBeStaked", epochShouldBeStaked}, // 21 blocks have passed - enough blocks } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // check if the provider/client are staked - _, foundProvider, _ := ts.Keepers.Epochstorage.GetEpochStakeEntries(ts.Ctx, tt.epoch, ts.spec.GetIndex()) - require.Equal(t, tt.shouldBeStaked, foundProvider) + entries := ts.Keepers.Epochstorage.GetAllStakeEntriesForEpoch(ts.Ctx, tt.epoch) + require.Len(t, entries, 1) }) } } @@ -118,106 +116,12 @@ func TestStakeGovEpochBlocksIncrease(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // check if the provider/client are staked - _, found, _ := ts.Keepers.Epochstorage.GetEpochStakeEntries(ts.Ctx, tt.epoch, ts.spec.GetIndex()) - require.Equal(t, tt.shouldBeStaked, found) + entries := ts.Keepers.Epochstorage.GetAllStakeEntriesForEpoch(ts.Ctx, tt.epoch) + if tt.shouldBeStaked { + require.Len(t, entries, 1) + } else { + require.Len(t, entries, 0) + } }) } } - -// Test that if UnstakeHoldBlocks decreases then the provider gets the funds back only by the original -// value (return_funds_block = next_epoch(current_block + max(UnstakeHoldBlocks, BlocksToSave))) -func TestUnstakeGovUnstakeHoldBlocksDecrease(t *testing.T) { - ts := newTester(t) - ts.setupForPayments(1, 0, 0) // 1 provider, 0 client, default providers-to-pair - - providerAcct, _ := ts.GetAccount(common.PROVIDER, 0) - - // make sure EpochBlocks default value is 20 and UnstakeHoldBlocks is 210 - paramKey := string(epochstoragetypes.KeyEpochBlocks) - paramVal := "\"" + strconv.FormatUint(20, 10) + "\"" - err := ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) - require.NoError(t, err) - - paramKey = string(epochstoragetypes.KeyUnstakeHoldBlocks) - paramVal = "\"" + strconv.FormatUint(210, 10) + "\"" - err = ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) - require.NoError(t, err) - - // Advance an epoch to apply the changes - ts.AdvanceEpoch() // blockHeight = 20 - - // change the UnstakeHoldBlocks parameter to 60 - paramKey = string(epochstoragetypes.KeyUnstakeHoldBlocks) - paramVal = "\"" + strconv.FormatUint(60, 10) + "\"" - err = ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) - require.NoError(t, err) - - // Advance to blockHeight = 39, one block before the UnstakeHoldBlocks change apply - ts.AdvanceBlocks(19) - - // Unstake the provider: - // should get the funds on block #260 (39+210 = 249 -> next epoch start in 260) - _, err = ts.TxPairingUnstakeProvider(providerAcct.GetVaultAddr(), ts.spec.Index) - require.NoError(t, err) - - // Advance a block to complete the epoch and apply UnstakeHoldBlocks change to 60 - // if the unstaking refers to 60 (wrongly, since they unstaked before the change applied), - // they are supposed to get the funds back on block #240 (39+200(=BlockToSave) = 240 -> - // this is a start of a new epoch) - ts.AdvanceBlock() // blockHeight = 40 - - // Advance 10 epochs to get to block #240. At this point, they shouldn't get their funds back - ts.AdvanceEpochs(10) - - // Advance another epoch to block #260. Now they should get their funds back - ts.AdvanceEpoch() // blockHeight = 260 -} - -// Test that if the UnstakeHoldBlocks param increases make then the provider gets the funds back only -// by the original value (return_funds_block = next_epoch(current_block + max(UnstakeHoldBlocks, BlocksToSave))) -func TestUnstakeGovUnstakeHoldBlocksIncrease(t *testing.T) { - ts := newTester(t) - ts.setupForPayments(1, 0, 0) // 1 provider, 0 client, default providers-to-pair - - providerAcct, _ := ts.GetAccount(common.PROVIDER, 0) - - // make sure EpochBlocks default value is 20 and UnstakeHoldBlocks is 210 - paramKey := string(epochstoragetypes.KeyEpochBlocks) - paramVal := "\"" + strconv.FormatUint(20, 10) + "\"" - err := ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) - require.NoError(t, err) - - paramKey = string(epochstoragetypes.KeyUnstakeHoldBlocks) - paramVal = "\"" + strconv.FormatUint(210, 10) + "\"" - err = ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) - require.NoError(t, err) - - // Advance an epoch to apply the changes. - ts.AdvanceEpoch() // blockHeight = 20 - - // change the UnstakeHoldBlocks parameter to 280 - paramKey = string(epochstoragetypes.KeyUnstakeHoldBlocks) - paramVal = "\"" + strconv.FormatUint(280, 10) + "\"" - err = ts.TxProposalChangeParam(epochstoragetypes.ModuleName, paramKey, paramVal) - require.NoError(t, err) - - // Advance to blockHeight = 39, one block before the UnstakeHoldBlocks change apply - ts.AdvanceBlocks(19) - - // Unstake the provider: - // should get the funds back on block #260 (39+210 = 249 -> next epoch start in 260) - _, err = ts.TxPairingUnstakeProvider(providerAcct.GetVaultAddr(), ts.spec.Index) - require.NoError(t, err) - - // Advance a block to complete the epoch and apply UnstakeHoldBlocks change to 280 - // if the unstaking refers to 280 (wrongly, since they unstaked before the change applied), - // they are supposed to get the funds back on block #320 (40+280 = 320 -> - // this is a start of a new epoch) - ts.AdvanceBlock() // blockHeight = 40 - - // Advance 11 epochs to get to block #260. At this point, they should get their funds back - ts.AdvanceEpochs(11) - - // Advance 3 more epoch to block #320. Now they definitely should get their funds back - ts.AdvanceEpochs(14) -} diff --git a/x/pairing/keeper/msg_server_test.go b/x/pairing/keeper/msg_server_test.go index 29a517d670..1611552345 100644 --- a/x/pairing/keeper/msg_server_test.go +++ b/x/pairing/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) // TODO: use or delete this function diff --git a/x/pairing/keeper/msg_server_unfreeze.go b/x/pairing/keeper/msg_server_unfreeze.go index 3cd2da1061..35bbda74cd 100644 --- a/x/pairing/keeper/msg_server_unfreeze.go +++ b/x/pairing/keeper/msg_server_unfreeze.go @@ -5,8 +5,8 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" ) func (k msgServer) UnfreezeProvider(goCtx context.Context, msg *types.MsgUnfreezeProvider) (*types.MsgUnfreezeProviderResponse, error) { @@ -15,7 +15,7 @@ func (k msgServer) UnfreezeProvider(goCtx context.Context, msg *types.MsgUnfreez unfreezeBlock := k.epochStorageKeeper.GetCurrentNextEpoch(ctx) + 1 unfrozen_chains := []string{} for _, chainId := range msg.GetChainIds() { - stakeEntry, found := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainId, msg.Creator) + stakeEntry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainId, msg.Creator) if !found { return nil, utils.LavaFormatWarning("Unfreeze_cant_get_stake_entry", types.FreezeStakeEntryNotFoundError, []utils.Attribute{{Key: "chainID", Value: chainId}, {Key: "providerAddress", Value: msg.GetCreator()}}...) } @@ -49,7 +49,7 @@ func (k msgServer) UnfreezeProvider(goCtx context.Context, msg *types.MsgUnfreez stakeEntry.UnFreeze(unfreezeBlock) stakeEntry.JailEndTime = 0 stakeEntry.Jails = 0 - k.epochStorageKeeper.ModifyStakeEntryCurrent(ctx, chainId, stakeEntry) + k.epochStorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) unfrozen_chains = append(unfrozen_chains, chainId) } utils.LogLavaEvent(ctx, ctx.Logger(), "unfreeze_provider", map[string]string{"providerAddress": msg.GetCreator(), "chainIDs": strings.Join(unfrozen_chains, ",")}, "Provider Unfreeze") diff --git a/x/pairing/keeper/msg_server_unstake_provider.go b/x/pairing/keeper/msg_server_unstake_provider.go index e2f4275421..09a4fe1866 100644 --- a/x/pairing/keeper/msg_server_unstake_provider.go +++ b/x/pairing/keeper/msg_server_unstake_provider.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) func (k msgServer) UnstakeProvider(goCtx context.Context, msg *types.MsgUnstakeProvider) (*types.MsgUnstakeProviderResponse, error) { diff --git a/x/pairing/keeper/msg_server_unstake_provider_test.go b/x/pairing/keeper/msg_server_unstake_provider_test.go index 71d48db5b9..e58960b196 100644 --- a/x/pairing/keeper/msg_server_unstake_provider_test.go +++ b/x/pairing/keeper/msg_server_unstake_provider_test.go @@ -3,43 +3,10 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/testutil/common" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/common" "github.com/stretchr/testify/require" ) -func TestUnstakeStaticProvider(t *testing.T) { - ts := newTester(t) - - // will overwrite the default "mock" spec - ts.spec.ProvidersTypes = spectypes.Spec_static - ts.AddSpec("mock", ts.spec) - - balance := 5 * ts.spec.MinStakeProvider.Amount.Int64() - providerAcct, provider := ts.AddAccount(common.PROVIDER, 0, balance) - - err := ts.StakeProvider(providerAcct.GetVaultAddr(), provider, ts.spec, balance/2) - require.NoError(t, err) - - ts.AdvanceEpoch() - - unstakeHoldBlocks := ts.Keepers.Epochstorage.UnstakeHoldBlocks(ts.Ctx, ts.BlockHeight()) - unstakeHoldBlocksStatic := ts.Keepers.Epochstorage.UnstakeHoldBlocksStatic(ts.Ctx, ts.BlockHeight()) - - _, err = ts.TxPairingUnstakeProvider(providerAcct.GetVaultAddr(), ts.spec.Index) - require.NoError(t, err) - - ts.AdvanceBlocks(unstakeHoldBlocks) - - _, found := ts.Keepers.Epochstorage.UnstakeEntryByAddress(ts.Ctx, provider) - require.True(t, found) - - ts.AdvanceBlocks(unstakeHoldBlocksStatic - unstakeHoldBlocks) - - _, found = ts.Keepers.Epochstorage.UnstakeEntryByAddress(ts.Ctx, provider) - require.False(t, found) -} - // TestVaultProviderUnstake tests that only the vault address can unstake. // Scenarios: // 1. unstake with vault -> should work diff --git a/x/pairing/keeper/pairing.go b/x/pairing/keeper/pairing.go index a1a9a57f82..62c91d477f 100644 --- a/x/pairing/keeper/pairing.go +++ b/x/pairing/keeper/pairing.go @@ -7,14 +7,14 @@ import ( cosmosmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingfilters "github.com/lavanet/lava/x/pairing/keeper/filters" - pairingscores "github.com/lavanet/lava/x/pairing/keeper/scores" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingfilters "github.com/lavanet/lava/v2/x/pairing/keeper/filters" + pairingscores "github.com/lavanet/lava/v2/x/pairing/keeper/scores" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) func (k Keeper) VerifyPairingData(ctx sdk.Context, chainID string, block uint64) (epoch uint64, providersType spectypes.Spec_ProvidersTypes, errorRet error) { @@ -80,7 +80,8 @@ func (k Keeper) GetPairingForClient(ctx sdk.Context, chainID string, clientAddre return nil, fmt.Errorf("invalid user for pairing: %s", err.Error()) } - providers, _, _, err = k.getPairingForClient(ctx, chainID, block, strictestPolicy, cluster, project.Index, false) + providers, _, _, err = k.getPairingForClient(ctx, chainID, block, strictestPolicy, cluster, project.Index, false, true) + return providers, err } @@ -89,7 +90,7 @@ func (k Keeper) CalculatePairingChance(ctx sdk.Context, provider string, chainID totalScore := cosmosmath.ZeroUint() providerScore := cosmosmath.ZeroUint() - _, _, scores, err := k.getPairingForClient(ctx, chainID, uint64(ctx.BlockHeight()), policy, cluster, "dummy", true) + _, _, scores, err := k.getPairingForClient(ctx, chainID, uint64(ctx.BlockHeight()), policy, cluster, "dummy", true, false) if err != nil { return cosmosmath.LegacyZeroDec(), err } @@ -116,15 +117,27 @@ func (k Keeper) CalculatePairingChance(ctx sdk.Context, provider string, chainID // function used to get a new pairing from provider and client // first argument has all metadata, second argument is only the addresses -func (k Keeper) getPairingForClient(ctx sdk.Context, chainID string, block uint64, policy *planstypes.Policy, cluster string, projectIndex string, calcChance bool) (providers []epochstoragetypes.StakeEntry, allowedCU uint64, providerScores []*pairingscores.PairingScore, errorRet error) { +// useCache is a boolean argument that is used to determine whether pairing cache should be used +// Note: useCache should only be true for queries! functions that write to the state and use this function should never put useCache=true +func (k Keeper) getPairingForClient(ctx sdk.Context, chainID string, block uint64, policy *planstypes.Policy, cluster string, projectIndex string, calcChance bool, useCache bool) (providers []epochstoragetypes.StakeEntry, allowedCU uint64, providerScores []*pairingscores.PairingScore, errorRet error) { epoch, providersType, err := k.VerifyPairingData(ctx, chainID, block) if err != nil { return nil, 0, nil, fmt.Errorf("invalid pairing data: %s", err) } - stakeEntries, found, epochHash := k.epochStorageKeeper.GetEpochStakeEntries(ctx, epoch, chainID) - if !found { + + // to be used only in queries as this changes gas calculations, and therefore must not be part of consensus + if useCache { + providers, found := k.GetPairingQueryCache(projectIndex, chainID, epoch) + if found { + return providers, policy.EpochCuLimit, nil, nil + } + } + + stakeEntries := k.epochStorageKeeper.GetAllStakeEntriesForEpochChainId(ctx, epoch, chainID) + if len(stakeEntries) == 0 { return nil, 0, nil, fmt.Errorf("did not find providers for pairing: epoch:%d, chainID: %s", block, chainID) } + epochHash := k.epochStorageKeeper.GetEpochHash(ctx, epoch) if providersType == spectypes.Spec_static { frozenFilter := pairingfilters.FrozenProvidersFilter{} @@ -136,6 +149,9 @@ func (k Keeper) getPairingForClient(ctx sdk.Context, chainID string, block uint6 stakeEntriesFiltered = append(stakeEntriesFiltered, stakeEntries[i]) } } + if useCache { + k.SetPairingQueryCache(projectIndex, chainID, epoch, stakeEntriesFiltered) + } return stakeEntriesFiltered, policy.EpochCuLimit, nil, nil } @@ -155,6 +171,9 @@ func (k Keeper) getPairingForClient(ctx sdk.Context, chainID string, block uint6 for _, score := range providerScores { filteredEntries = append(filteredEntries, *score.Provider) } + if useCache { + k.SetPairingQueryCache(projectIndex, chainID, epoch, filteredEntries) + } return filteredEntries, policy.EpochCuLimit, nil, nil } @@ -175,7 +194,11 @@ func (k Keeper) getPairingForClient(ctx sdk.Context, chainID string, block uint6 prevGroupSlot = group } - return providers, policy.EpochCuLimit, providerScores, err + if useCache { + k.SetPairingQueryCache(projectIndex, chainID, epoch, providers) + } + + return providers, policy.EpochCuLimit, providerScores, nil } func (k Keeper) GetProjectStrictestPolicy(ctx sdk.Context, project projectstypes.Project, chainID string, block uint64) (*planstypes.Policy, string, error) { @@ -314,19 +337,23 @@ func (k Keeper) ValidatePairingForClient(ctx sdk.Context, chainID string, provid if epoch != reqEpoch { return false, allowedCU, []epochstoragetypes.StakeEntry{}, utils.LavaFormatError("requested block is not an epoch start", nil, utils.Attribute{Key: "epoch", Value: epoch}, utils.Attribute{Key: "requested", Value: reqEpoch}) } - clientAddr, err := sdk.AccAddressFromBech32(project.Subscription) - if err != nil { - return false, allowedCU, []epochstoragetypes.StakeEntry{}, err - } - strictestPolicy, cluster, err := k.GetProjectStrictestPolicy(ctx, project, chainID, reqEpoch) - if err != nil { - return false, allowedCU, []epochstoragetypes.StakeEntry{}, fmt.Errorf("invalid user for pairing: %s", err.Error()) - } + validAddresses, allowedCU, ok := k.GetPairingRelayCache(ctx, project.Index, chainID, epoch) + if !ok { + _, err := sdk.AccAddressFromBech32(project.Subscription) + if err != nil { + return false, allowedCU, []epochstoragetypes.StakeEntry{}, err + } - validAddresses, allowedCU, _, err := k.getPairingForClient(ctx, chainID, epoch, strictestPolicy, cluster, project.Index, false) - if err != nil { - return false, allowedCU, []epochstoragetypes.StakeEntry{}, err + strictestPolicy, cluster, err := k.GetProjectStrictestPolicy(ctx, project, chainID, reqEpoch) + if err != nil { + return false, allowedCU, []epochstoragetypes.StakeEntry{}, fmt.Errorf("invalid user for pairing: %s", err.Error()) + } + + validAddresses, allowedCU, _, err = k.getPairingForClient(ctx, chainID, epoch, strictestPolicy, cluster, project.Index, false, false) + if err != nil { + return false, allowedCU, []epochstoragetypes.StakeEntry{}, err + } } for _, possibleAddr := range validAddresses { @@ -335,13 +362,17 @@ func (k Keeper) ValidatePairingForClient(ctx sdk.Context, chainID string, provid // panic:ok: provider address saved on chain must be valid utils.LavaFormatPanic("critical: invalid provider address for payment", err, utils.Attribute{Key: "chainID", Value: chainID}, - utils.Attribute{Key: "client", Value: clientAddr.String()}, + utils.Attribute{Key: "client", Value: project.Subscription}, utils.Attribute{Key: "provider", Value: providerAccAddr.String()}, utils.Attribute{Key: "epochBlock", Value: strconv.FormatUint(epoch, 10)}, ) } if providerAccAddr.Equals(providerAddress) { + if !ok { + // if we had a cache miss, set cache + k.SetPairingRelayCache(ctx, project.Index, chainID, epoch, validAddresses, allowedCU) + } return true, allowedCU, validAddresses, nil } } diff --git a/x/pairing/keeper/pairing_cache.go b/x/pairing/keeper/pairing_cache.go new file mode 100644 index 0000000000..c0fed2c608 --- /dev/null +++ b/x/pairing/keeper/pairing_cache.go @@ -0,0 +1,64 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" +) + +func (k Keeper) SetPairingRelayCache(ctx sdk.Context, project string, chainID string, epoch uint64, pairedProviders []epochstoragetypes.StakeEntry, allowedCu uint64) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PairingRelayCachePrefix) + cache := types.PairingRelayCache{Entries: pairedProviders, AllowedCu: allowedCu} + b := k.cdc.MustMarshal(&cache) + store.Set([]byte(types.NewPairingCacheKey(project, chainID, epoch)), b) +} + +func (k Keeper) GetPairingRelayCache(ctx sdk.Context, project string, chainID string, epoch uint64) ([]epochstoragetypes.StakeEntry, uint64, bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PairingRelayCachePrefix) + b := store.Get([]byte(types.NewPairingCacheKey(project, chainID, epoch))) + if b == nil { + return []epochstoragetypes.StakeEntry{}, 0, false + } + var cache types.PairingRelayCache + k.cdc.MustUnmarshal(b, &cache) + return cache.Entries, cache.AllowedCu, true +} + +// ResetPairingRelayCache is used to remove all entries from the PairingRelayCache KV store +// this function is called in the module's EndBlock so the data written in the KV store +// will be deleted before it's written to the state +func (k Keeper) ResetPairingRelayCache(ctx sdk.Context) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.PairingRelayCachePrefix) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + store.Delete(iterator.Key()) + } +} + +// the cache used for the query, does not write into state +func (k Keeper) SetPairingQueryCache(project string, chainID string, epoch uint64, pairedProviders []epochstoragetypes.StakeEntry) { + if k.pairingQueryCache == nil { + // pairing cache is not initialized, will be in next epoch so simply skip + return + } + key := types.NewPairingCacheKey(project, chainID, epoch) + + (*k.pairingQueryCache)[key] = pairedProviders +} + +func (k Keeper) GetPairingQueryCache(project string, chainID string, epoch uint64) ([]epochstoragetypes.StakeEntry, bool) { + if k.pairingQueryCache == nil { + // pairing cache is not initialized, will be in next epoch so simply skip + return nil, false + } + key := types.NewPairingCacheKey(project, chainID, epoch) + if providers, ok := (*k.pairingQueryCache)[key]; ok { + return providers, true + } + + return nil, false +} diff --git a/x/pairing/keeper/pairing_cache_test.go b/x/pairing/keeper/pairing_cache_test.go new file mode 100644 index 0000000000..4e2758e3b0 --- /dev/null +++ b/x/pairing/keeper/pairing_cache_test.go @@ -0,0 +1,121 @@ +package keeper_test + +import ( + "testing" + + "github.com/lavanet/lava/v2/testutil/common" + "github.com/stretchr/testify/require" +) + +// TestPairingQueryCache tests the following: +// 1. The pairing query cache is reset every epoch +// 2. Getting pairing with a query using an existent cache entry consumes fewer gas than without one +func TestPairingQueryCache(t *testing.T) { + ts := newTester(t) + ts.setupForPayments(1, 1, 0) // 1 provider, 1 client, default providers-to-pair + + _, consumer := ts.GetAccount(common.CONSUMER, 0) + + getPairingGas := func(ts *tester) uint64 { + gm := ts.Ctx.GasMeter() + before := gm.GasConsumed() + _, err := ts.QueryPairingGetPairing(ts.spec.Index, consumer) + require.NoError(t, err) + return gm.GasConsumed() - before + } + + // query for pairing for the first time - empty cache + emptyCacheGas := getPairingGas(ts) + + // query for pairing for the second time - non-empty cache + filledCacheGas := getPairingGas(ts) + + // second time gas should be smaller than first time + require.Less(t, filledCacheGas, emptyCacheGas) + + // advance block to test it stays the same (should still be less than empty cache gas) + ts.AdvanceBlock() + filledAfterBlockCacheGas := getPairingGas(ts) + require.Less(t, filledAfterBlockCacheGas, emptyCacheGas) + + // advance epoch to reset the cache + ts.AdvanceEpoch() + emptyCacheAgainGas := getPairingGas(ts) + require.Equal(t, emptyCacheGas, emptyCacheAgainGas) +} + +// TestPairingQueryCache tests the following: +// 1. The pairing relay cache is reset every block +// 2. Getting pairing in relay payment using an existent cache entry consumes fewer gas than without one +func TestPairingRelayCache(t *testing.T) { + ts := newTester(t) + ts.setupForPayments(1, 1, 0) // 1 provider, 1 client, default providers-to-pair + + consumer, _ := ts.GetAccount(common.CONSUMER, 0) + provider, _ := ts.GetAccount(common.PROVIDER, 0) + + getRelayPairingGas := func(ts *tester) uint64 { + gm := ts.Ctx.GasMeter() + before := gm.GasConsumed() + relayPayment := sendRelay(ts, provider.Addr.String(), consumer, []string{ts.spec.Index}) + _, err := ts.TxPairingRelayPayment(relayPayment.Creator, relayPayment.Relays[0]) + require.NoError(t, err) + return gm.GasConsumed() - before + } + + // query for pairing for the first time - empty cache + emptyCacheGas := getRelayPairingGas(ts) + + // query for pairing for the second time - non-empty cache + filledCacheGas := getRelayPairingGas(ts) + + // second time gas should be smaller than first time + require.Less(t, filledCacheGas, emptyCacheGas) + + // advance block to to reset the cache + ts.AdvanceBlock() + emptyCacheAgainGas := getRelayPairingGas(ts) + require.InEpsilon(t, emptyCacheGas, emptyCacheAgainGas, 0.05) +} + +// TestPairingRelayCacheReset tests that the pairing relay cache reset truly returns the state to its previous +// empty cache state by verifying the gas is exactly the same when running the same test with different testers +func TestPairingRelayCacheReset(t *testing.T) { + firstEmptyCache, firstNonEmptyCache, secondEmptyCache, secondNonEmptyCache := uint64(0), uint64(0), uint64(0), uint64(0) + for i := 0; i < 2; i++ { + ts := newTester(t) + ts.setupForPayments(1, 1, 0) // 1 provider, 1 client, default providers-to-pair + + consumer, _ := ts.GetAccount(common.CONSUMER, 0) + provider, _ := ts.GetAccount(common.PROVIDER, 0) + + getRelayPairingGas := func(ts *tester) uint64 { + gm := ts.Ctx.GasMeter() + before := gm.GasConsumed() + relayPayment := sendRelay(ts, provider.Addr.String(), consumer, []string{ts.spec.Index}) + _, err := ts.TxPairingRelayPayment(relayPayment.Creator, relayPayment.Relays[0]) + require.NoError(t, err) + return gm.GasConsumed() - before + } + + // query for pairing for the first time - empty cache + emptyCacheGas := getRelayPairingGas(ts) + + // query for pairing for the second time - non-empty cache + filledCacheGas := getRelayPairingGas(ts) + + // second time gas should be smaller than first time + require.Less(t, filledCacheGas, emptyCacheGas) + + if i == 0 { + firstEmptyCache = emptyCacheGas + firstNonEmptyCache = filledCacheGas + } else { + secondEmptyCache = emptyCacheGas + secondNonEmptyCache = filledCacheGas + } + } + + require.Equal(t, firstEmptyCache, secondEmptyCache) + require.Equal(t, firstNonEmptyCache, secondNonEmptyCache) +} diff --git a/x/pairing/keeper/pairing_immediately_test.go b/x/pairing/keeper/pairing_immediately_test.go index 51a44fccb6..a445bb3d80 100644 --- a/x/pairing/keeper/pairing_immediately_test.go +++ b/x/pairing/keeper/pairing_immediately_test.go @@ -3,9 +3,9 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/lavaslices" - projectTypes "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/lavaslices" + projectTypes "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/pairing_next_epoch_time_block.go b/x/pairing/keeper/pairing_next_epoch_time_block.go index b5d192d317..5d242d2274 100644 --- a/x/pairing/keeper/pairing_next_epoch_time_block.go +++ b/x/pairing/keeper/pairing_next_epoch_time_block.go @@ -7,8 +7,8 @@ import ( "github.com/cometbft/cometbft/rpc/core" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) const ( diff --git a/x/pairing/keeper/pairing_subscription_test.go b/x/pairing/keeper/pairing_subscription_test.go index 45c79272b0..b037d88f39 100644 --- a/x/pairing/keeper/pairing_subscription_test.go +++ b/x/pairing/keeper/pairing_subscription_test.go @@ -3,11 +3,11 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/pairing_test.go b/x/pairing/keeper/pairing_test.go index 94339ffca4..a9cf57336b 100644 --- a/x/pairing/keeper/pairing_test.go +++ b/x/pairing/keeper/pairing_test.go @@ -8,15 +8,16 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingscores "github.com/lavanet/lava/x/pairing/keeper/scores" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/common" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingscores "github.com/lavanet/lava/v2/x/pairing/keeper/scores" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -517,9 +518,8 @@ func TestAddonPairing(t *testing.T) { err = ts.addProviderEndpoints(2, optionalSupportingEndpoints) // this errors out require.Error(t, err) - stakeStorage, found := ts.Keepers.Epochstorage.GetStakeStorageCurrent(ts.Ctx, ts.spec.Index) - require.True(t, found) - require.Len(t, stakeStorage.StakeEntries, 12) + entries := ts.Keepers.Epochstorage.GetAllStakeEntriesCurrentForChainId(ts.Ctx, ts.spec.Index) + require.Len(t, entries, 12) for _, tt := range templates { t.Run(tt.name, func(t *testing.T) { @@ -1967,9 +1967,8 @@ func TestExtensionAndAddonPairing(t *testing.T) { err = ts.addProviderEndpoints(2, optionalExtSupportingEndpoints) // this errors as it doesnt implement mandatory require.Error(t, err) - stakeStorage, found := ts.Keepers.Epochstorage.GetStakeStorageCurrent(ts.Ctx, ts.spec.Index) - require.True(t, found) - require.Len(t, stakeStorage.StakeEntries, 26) // one for stub and 25 others + entries := ts.Keepers.Epochstorage.GetAllStakeEntriesCurrentForChainId(ts.Ctx, ts.spec.Index) + require.Len(t, entries, 26) // one for stub and 25 others for _, tt := range templates { t.Run(tt.name, func(t *testing.T) { @@ -2214,7 +2213,7 @@ func TestMixBothExetensionAndAddonPairing(t *testing.T) { func TestMixSelectedProvidersAndArchivePairing(t *testing.T) { ts := newTester(t) ts.setupForPayments(1, 0, 0) // 1 provider, 0 client, default providers-to-pair - specEth, err := testkeeper.GetASpec("ETH1", "../../../", nil, nil) + specEth, err := specutils.GetASpec("ETH1", "../../../", nil, nil) if err != nil { require.NoError(t, err) } diff --git a/x/pairing/keeper/params.go b/x/pairing/keeper/params.go index 0ce67366c8..3b076a6917 100644 --- a/x/pairing/keeper/params.go +++ b/x/pairing/keeper/params.go @@ -4,8 +4,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" ) // GetParams get all parameters as types.Params diff --git a/x/pairing/keeper/params_test.go b/x/pairing/keeper/params_test.go index b7f0a1d0a9..b187cb0581 100644 --- a/x/pairing/keeper/params_test.go +++ b/x/pairing/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/pairing/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/qos_excellence.go b/x/pairing/keeper/qos_excellence.go index eca781c944..0f9d367066 100644 --- a/x/pairing/keeper/qos_excellence.go +++ b/x/pairing/keeper/qos_excellence.go @@ -4,8 +4,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) // TODO: implement UpdateProviderQos(payments) diff --git a/x/pairing/keeper/query_sdk_pairing.go b/x/pairing/keeper/query_sdk_pairing.go index 83df033676..03e2457578 100644 --- a/x/pairing/keeper/query_sdk_pairing.go +++ b/x/pairing/keeper/query_sdk_pairing.go @@ -5,7 +5,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/pairing/keeper/scores/geo_req.go b/x/pairing/keeper/scores/geo_req.go index 0783ac5e8d..66953c4f6e 100644 --- a/x/pairing/keeper/scores/geo_req.go +++ b/x/pairing/keeper/scores/geo_req.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) // geo requirement that implements the ScoreReq interface diff --git a/x/pairing/keeper/scores/geo_req_test.go b/x/pairing/keeper/scores/geo_req_test.go index 481144dcb9..73de028ba4 100644 --- a/x/pairing/keeper/scores/geo_req_test.go +++ b/x/pairing/keeper/scores/geo_req_test.go @@ -3,9 +3,9 @@ package scores import ( "testing" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/keeper/scores/pairing_score.go b/x/pairing/keeper/scores/pairing_score.go index 3ad2bbeaca..3b5716021b 100644 --- a/x/pairing/keeper/scores/pairing_score.go +++ b/x/pairing/keeper/scores/pairing_score.go @@ -2,8 +2,8 @@ package scores import ( "cosmossdk.io/math" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" ) const ( diff --git a/x/pairing/keeper/scores/qos_req.go b/x/pairing/keeper/scores/qos_req.go index 7448e22385..7ecb4174d5 100644 --- a/x/pairing/keeper/scores/qos_req.go +++ b/x/pairing/keeper/scores/qos_req.go @@ -3,8 +3,8 @@ package scores import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) const qosReqName = "qos-req" diff --git a/x/pairing/keeper/scores/score.go b/x/pairing/keeper/scores/score.go index 5418316e3a..9aeea8b44a 100644 --- a/x/pairing/keeper/scores/score.go +++ b/x/pairing/keeper/scores/score.go @@ -42,10 +42,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/rand" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/rand" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) var uniformStrategy ScoreStrategy diff --git a/x/pairing/keeper/scores/score_req.go b/x/pairing/keeper/scores/score_req.go index e3cd02a0ec..84daf68307 100644 --- a/x/pairing/keeper/scores/score_req.go +++ b/x/pairing/keeper/scores/score_req.go @@ -2,7 +2,7 @@ package scores import ( "cosmossdk.io/math" - planstypes "github.com/lavanet/lava/x/plans/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) // ScoreReq is an interface for pairing requirement scoring diff --git a/x/pairing/keeper/scores/stake_req.go b/x/pairing/keeper/scores/stake_req.go index ff0302e156..c7b2144d98 100644 --- a/x/pairing/keeper/scores/stake_req.go +++ b/x/pairing/keeper/scores/stake_req.go @@ -3,7 +3,7 @@ package scores import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - planstypes "github.com/lavanet/lava/x/plans/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) const stakeReqName = "stake-req" diff --git a/x/pairing/keeper/staking.go b/x/pairing/keeper/staking.go index 8a350f6f1d..5cfab4fb38 100644 --- a/x/pairing/keeper/staking.go +++ b/x/pairing/keeper/staking.go @@ -7,11 +7,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" ) const ( @@ -78,7 +78,7 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin // new staking takes effect from the next block stakeAppliedBlock := uint64(ctx.BlockHeight()) + 1 - existingEntry, entryExists := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, creator) + existingEntry, entryExists := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, creator) if entryExists { // modify the entry (check who's modifying - vault/provider) isProvider := false @@ -166,7 +166,7 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin existingEntry.DelegateLimit = delegationLimit existingEntry.LastChange = uint64(ctx.BlockTime().UTC().Unix()) - k.epochStorageKeeper.ModifyStakeEntryCurrent(ctx, chainID, existingEntry) + k.epochStorageKeeper.SetStakeEntryCurrent(ctx, existingEntry) if amount.Amount.GT(existingEntry.Stake.Amount) { // delegate the difference @@ -203,7 +203,7 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin // check that the configured provider is not used by another vault (when the provider and creator (vault) addresses are not equal) if provider != creator { - providerStakeEntry, entryExists := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, provider) + providerStakeEntry, entryExists := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) if entryExists { return utils.LavaFormatWarning("configured provider exists", fmt.Errorf("new provider not staked"), utils.LogAttr("provider", provider), @@ -263,7 +263,7 @@ func (k Keeper) StakeNewEntry(ctx sdk.Context, validator, creator, chainID strin LastChange: uint64(ctx.BlockTime().UTC().Unix()), } - k.epochStorageKeeper.AppendStakeEntryCurrent(ctx, chainID, stakeEntry) + k.epochStorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) err = k.dualstakingKeeper.DelegateFull(ctx, stakeEntry.Vault, validator, stakeEntry.Address, chainID, amount) if err != nil { @@ -345,7 +345,7 @@ func (k Keeper) validateGeoLocationAndApiInterfaces(endpoints []epochstoragetype } func (k Keeper) GetStakeEntry(ctx sdk.Context, chainID string, provider string) (epochstoragetypes.StakeEntry, error) { - stakeEntry, found := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, provider) + stakeEntry, found := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) if !found { return epochstoragetypes.StakeEntry{}, utils.LavaFormatWarning("provider not staked on chain", fmt.Errorf("cannot get stake entry"), utils.Attribute{Key: "chainID", Value: chainID}, diff --git a/x/pairing/keeper/unresponsive_provider.go b/x/pairing/keeper/unresponsive_provider.go index 1025a4529a..d34a2da4de 100644 --- a/x/pairing/keeper/unresponsive_provider.go +++ b/x/pairing/keeper/unresponsive_provider.go @@ -8,9 +8,9 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) const ( @@ -53,10 +53,9 @@ func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUF return } - // Get the current stake storages (from all chains). - // Stake storages contain a list of stake entries (each for a different chain). - providerStakeStorageList := k.getCurrentProviderStakeStorageList(ctx) - if len(providerStakeStorageList) == 0 { + // Get the current stake entries (from all chains). + currentStakeEntries := k.epochStorageKeeper.GetAllStakeEntriesCurrent(ctx) + if len(currentStakeEntries) == 0 { // no provider is staked -> no one to punish return } @@ -78,21 +77,15 @@ func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUF } } - ProviderChainID := func(provider, chainID string) string { - return provider + " " + chainID - } - // check all supported providers from all geolocations prior to making decisions existingProviders := map[string]uint64{} - stakeEntries := map[string]epochstoragetypes.StakeEntry{} - for _, providerStakeStorage := range providerStakeStorageList { - providerStakeEntriesForChain := providerStakeStorage.GetStakeEntries() - // count providers per geolocation - for _, providerStakeEntry := range providerStakeEntriesForChain { - if !providerStakeEntry.IsFrozen() { - existingProviders[providerStakeEntry.GetChain()]++ - } - stakeEntries[ProviderChainID(providerStakeEntry.Address, providerStakeEntry.Chain)] = providerStakeEntry + currentStakeEntriesMap := map[string]epochstoragetypes.StakeEntry{} + + // count providers per geolocation + for _, entry := range currentStakeEntries { + if !entry.IsFrozen() { + existingProviders[entry.GetChain()]++ + currentStakeEntriesMap[stakeEntriesMapKey(entry.Chain, entry.Address)] = entry } } @@ -102,7 +95,8 @@ func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUF pecsDetailed := k.GetAllProviderEpochComplainerCuStore(ctx) complainedProviders := map[string]map[uint64]types.ProviderEpochComplainerCu{} // map[provider chainID]map[epoch]ProviderEpochComplainerCu for _, pec := range pecsDetailed { - entry, ok := stakeEntries[ProviderChainID(pec.Provider, pec.ChainId)] + key := stakeEntriesMapKey(pec.ChainId, pec.Provider) + entry, ok := currentStakeEntriesMap[key] if ok { if minHistoryBlock < entry.StakeAppliedBlock && entry.Jails == 0 { // this staked provider has too short history (either since staking @@ -113,8 +107,6 @@ func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUF continue } - key := ProviderChainID(pec.Provider, pec.ChainId) - if _, ok := complainedProviders[key]; !ok { complainedProviders[key] = map[uint64]types.ProviderEpochComplainerCu{pec.Epoch: pec.ProviderEpochComplainerCu} keys = append(keys, key) @@ -133,8 +125,8 @@ func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUF // go over all the providers, count the complainers CU and punish providers for _, key := range keys { components := strings.Split(key, " ") - provider := components[0] - chainID := components[1] + chainID := components[0] + provider := components[1] // update the CU count for this provider in providerCuCounterForUnreponsivenessMap epochs, complaintCU, servicedCU, err := k.countCuForUnresponsiveness(ctx, provider, chainID, minPaymentBlock, epochsNumToCheckCUForUnresponsiveProvider, epochsNumToCheckCUForComplainers, complainedProviders[key]) if err != nil { @@ -146,7 +138,7 @@ func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUF // providerPaymentStorageKeyList is not empty -> provider should be punished if len(epochs) != 0 && existingProviders[chainID] > minProviders { - entry, ok := stakeEntries[key] + entry, ok := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) if !ok { utils.LavaFormatError("Jail_cant_get_stake_entry", types.FreezeStakeEntryNotFoundError, []utils.Attribute{{Key: "chainID", Value: chainID}, {Key: "providerAddress", Value: provider}}...) continue @@ -162,6 +154,10 @@ func (k Keeper) PunishUnresponsiveProviders(ctx sdk.Context, epochsNumToCheckCUF } } +func stakeEntriesMapKey(chainID string, address string) string { + return chainID + " " + address +} + // getBlockEpochsAgo returns the block numEpochs back from the given blockHeight func (k Keeper) getBlockEpochsAgo(ctx sdk.Context, blockHeight, numEpochs uint64) (uint64, error) { for counter := 0; counter < int(numEpochs); counter++ { @@ -222,25 +218,6 @@ func (k Keeper) countCuForUnresponsiveness(ctx sdk.Context, provider, chainId st return nil, complainersCu, servicedCu, nil } -// Function that return the current stake storage for all chains -func (k Keeper) getCurrentProviderStakeStorageList(ctx sdk.Context) []epochstoragetypes.StakeStorage { - var stakeStorageList []epochstoragetypes.StakeStorage - - // get all chain IDs - chainIdList := k.specKeeper.GetAllChainIDs(ctx) - - // go over all chain IDs and keep their stake storage. If there is no stake storage for a specific chain, continue to the next one - for _, chainID := range chainIdList { - stakeStorage, found := k.epochStorageKeeper.GetStakeStorageCurrent(ctx, chainID) - if !found { - continue - } - stakeStorageList = append(stakeStorageList, stakeStorage) - } - - return stakeStorageList -} - // Function that punishes providers. Current punishment is freeze func (k Keeper) punishUnresponsiveProvider(ctx sdk.Context, epochs []uint64, stakeEntry epochstoragetypes.StakeEntry, complaintCU uint64, servicedCU uint64) error { // if last jail was more than 24H ago, reset the jails counter @@ -275,7 +252,7 @@ func (k Keeper) punishUnresponsiveProvider(ctx sdk.Context, epochs []uint64, sta utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProviderTemporaryJailedEventName, details, "Unresponsive provider was jailed due to unresponsiveness") } - k.epochStorageKeeper.ModifyStakeEntryCurrent(ctx, stakeEntry.Chain, stakeEntry) + k.epochStorageKeeper.SetStakeEntryCurrent(ctx, stakeEntry) // reset the provider's complainer CU (so he won't get punished for the same complaints twice) k.resetComplainersCU(ctx, epochs, stakeEntry.Address, stakeEntry.Chain) diff --git a/x/pairing/keeper/unresponsive_provider_test.go b/x/pairing/keeper/unresponsive_provider_test.go index 6484af6a16..62a8d75d86 100644 --- a/x/pairing/keeper/unresponsive_provider_test.go +++ b/x/pairing/keeper/unresponsive_provider_test.go @@ -4,17 +4,17 @@ import ( "testing" "time" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/utils/rand" - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/utils/rand" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) func (ts *tester) checkProviderJailed(provider string, shouldFreeze bool) { - stakeEntry, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Name, provider) + stakeEntry, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Name, provider) require.True(ts.T, stakeStorageFound) require.Equal(ts.T, shouldFreeze, stakeEntry.IsJailed(ts.Ctx.BlockTime().UTC().Unix())) if shouldFreeze { @@ -34,9 +34,7 @@ func (ts *tester) checkComplainerReset(provider string, epoch uint64) { } func (ts *tester) checkProviderStaked(provider string) { - _, unstakeStoragefound := ts.Keepers.Epochstorage.UnstakeEntryByAddress(ts.Ctx, provider) - require.False(ts.T, unstakeStoragefound) - _, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryByAddressCurrent(ts.Ctx, ts.spec.Name, provider) + _, stakeStorageFound := ts.Keepers.Epochstorage.GetStakeEntryCurrent(ts.Ctx, ts.spec.Name, provider) require.True(ts.T, stakeStorageFound) } diff --git a/x/pairing/keeper/unstaking.go b/x/pairing/keeper/unstaking.go index 03cf72fde9..8caa313f38 100644 --- a/x/pairing/keeper/unstaking.go +++ b/x/pairing/keeper/unstaking.go @@ -6,8 +6,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/types" ) func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unstakeDescription string) error { @@ -28,7 +28,7 @@ func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unsta ) } - existingEntry, entryExists := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, creator) + existingEntry, entryExists := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, creator) if !entryExists { return utils.LavaFormatWarning("can't unstake Entry, stake entry not found for address", fmt.Errorf("stake entry not found"), utils.Attribute{Key: "provider", Value: creator}, @@ -45,6 +45,7 @@ func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unsta ) } + // the stake entry is removed inside UnbondFull err := k.dualstakingKeeper.UnbondFull(ctx, existingEntry.Vault, validator, existingEntry.Address, existingEntry.GetChain(), existingEntry.Stake, true) if err != nil { return utils.LavaFormatWarning("can't unbond self delegation", err, @@ -53,18 +54,6 @@ func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unsta ) } - // index might have changed in the unbond - _, found = k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, existingEntry.Address) - if found { - err = k.epochStorageKeeper.RemoveStakeEntryCurrent(ctx, chainID, creator) - if err != nil { - return utils.LavaFormatWarning("can't remove stake Entry, stake entry not found", err, - utils.Attribute{Key: "provider", Value: creator}, - utils.Attribute{Key: "spec", Value: chainID}, - ) - } - } - details := map[string]string{ "address": existingEntry.GetAddress(), "chainID": existingEntry.GetChain(), @@ -75,16 +64,9 @@ func (k Keeper) UnstakeEntry(ctx sdk.Context, validator, chainID, creator, unsta } utils.LogLavaEvent(ctx, logger, types.ProviderUnstakeEventName, details, unstakeDescription) - unstakeHoldBlocks := k.epochStorageKeeper.GetUnstakeHoldBlocks(ctx, existingEntry.Chain) - k.epochStorageKeeper.AppendUnstakeEntry(ctx, existingEntry, unstakeHoldBlocks) return nil } -func (k Keeper) CheckUnstakingForCommit(ctx sdk.Context) { - // this pops all the entries that had their deadline pass - k.epochStorageKeeper.PopUnstakeEntries(ctx, uint64(ctx.BlockHeight())) -} - func (k Keeper) UnstakeEntryForce(ctx sdk.Context, chainID, provider, unstakeDescription string) error { providerAddr, err := sdk.AccAddressFromBech32(provider) if err != nil { @@ -93,7 +75,7 @@ func (k Keeper) UnstakeEntryForce(ctx sdk.Context, chainID, provider, unstakeDes ) } - existingEntry, entryExists := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, provider) + existingEntry, entryExists := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) if !entryExists { return utils.LavaFormatWarning("can't unstake Entry, stake entry not found for address", fmt.Errorf("stake entry not found"), utils.Attribute{Key: "provider", Value: provider}, @@ -123,14 +105,8 @@ func (k Keeper) UnstakeEntryForce(ctx sdk.Context, chainID, provider, unstakeDes } if totalAmount.IsZero() { - existingEntry, _ := k.epochStorageKeeper.GetStakeEntryByAddressCurrent(ctx, chainID, provider) - err = k.epochStorageKeeper.RemoveStakeEntryCurrent(ctx, chainID, provider) - if err != nil { - return utils.LavaFormatWarning("can't remove stake Entry, stake entry not found", err, - utils.Attribute{Key: "provider", Value: provider}, - utils.Attribute{Key: "spec", Value: chainID}, - ) - } + existingEntry, _ := k.epochStorageKeeper.GetStakeEntryCurrent(ctx, chainID, provider) + k.epochStorageKeeper.RemoveStakeEntryCurrent(ctx, chainID, existingEntry.Address) details := map[string]string{ "address": existingEntry.GetAddress(), @@ -142,8 +118,6 @@ func (k Keeper) UnstakeEntryForce(ctx sdk.Context, chainID, provider, unstakeDes } utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProviderUnstakeEventName, details, unstakeDescription) - unstakeHoldBlocks := k.epochStorageKeeper.GetUnstakeHoldBlocks(ctx, existingEntry.Chain) - k.epochStorageKeeper.AppendUnstakeEntry(ctx, existingEntry, unstakeHoldBlocks) return nil } } diff --git a/x/pairing/keeper/unstaking_test.go b/x/pairing/keeper/unstaking_test.go index 4a29af5745..242451479c 100644 --- a/x/pairing/keeper/unstaking_test.go +++ b/x/pairing/keeper/unstaking_test.go @@ -5,9 +5,9 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - testutils "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/testutil/common" + testutils "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/migrations/v2/epoch_payments.go b/x/pairing/migrations/v2/epoch_payments.go index 1cdbe3aa3e..a6e2f4e48f 100644 --- a/x/pairing/migrations/v2/epoch_payments.go +++ b/x/pairing/migrations/v2/epoch_payments.go @@ -4,7 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" ) // RemoveAllEpochPayments removes all epochPayments diff --git a/x/pairing/module.go b/x/pairing/module.go index b17698238e..ba70ae06bc 100644 --- a/x/pairing/module.go +++ b/x/pairing/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/pairing/client/cli" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/client/cli" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) var ( @@ -166,6 +166,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + am.keeper.EndBlock(ctx) return []abci.ValidatorUpdate{} } diff --git a/x/pairing/module_simulation.go b/x/pairing/module_simulation.go index e94c797042..8d7bdb2ecc 100644 --- a/x/pairing/module_simulation.go +++ b/x/pairing/module_simulation.go @@ -10,9 +10,9 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" types2 "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - pairingsimulation "github.com/lavanet/lava/x/pairing/simulation" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/testutil/sample" + pairingsimulation "github.com/lavanet/lava/v2/x/pairing/simulation" + "github.com/lavanet/lava/v2/x/pairing/types" ) // avoid unused import issue diff --git a/x/pairing/proposal_handler.go b/x/pairing/proposal_handler.go index de4ae01b18..40b7eb88e3 100644 --- a/x/pairing/proposal_handler.go +++ b/x/pairing/proposal_handler.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) // NewPlanProposalsHandler creates a new governance Handler for a Plan diff --git a/x/pairing/simulation/freeze.go b/x/pairing/simulation/freeze.go index 4f1f0decf8..8ab48a7171 100644 --- a/x/pairing/simulation/freeze.go +++ b/x/pairing/simulation/freeze.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) func SimulateMsgFreeze( diff --git a/x/pairing/simulation/relay_payment.go b/x/pairing/simulation/relay_payment.go index 2e76900d3d..b9e05f3e1d 100644 --- a/x/pairing/simulation/relay_payment.go +++ b/x/pairing/simulation/relay_payment.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) func SimulateMsgRelayPayment( diff --git a/x/pairing/simulation/stake_provider.go b/x/pairing/simulation/stake_provider.go index 97f542744c..f084e7d5ac 100644 --- a/x/pairing/simulation/stake_provider.go +++ b/x/pairing/simulation/stake_provider.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) func SimulateMsgStakeProvider( diff --git a/x/pairing/simulation/unfreeze.go b/x/pairing/simulation/unfreeze.go index 40ba7de140..5450594a2b 100644 --- a/x/pairing/simulation/unfreeze.go +++ b/x/pairing/simulation/unfreeze.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) func SimulateMsgUnfreeze( diff --git a/x/pairing/simulation/unstake_provider.go b/x/pairing/simulation/unstake_provider.go index f98b1bfdb1..fd717ccec0 100644 --- a/x/pairing/simulation/unstake_provider.go +++ b/x/pairing/simulation/unstake_provider.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/pairing/keeper" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/keeper" + "github.com/lavanet/lava/v2/x/pairing/types" ) func SimulateMsgUnstakeProvider( diff --git a/x/pairing/types/account_info.pb.go b/x/pairing/types/account_info.pb.go index 16a55588a9..8bc793441a 100644 --- a/x/pairing/types/account_info.pb.go +++ b/x/pairing/types/account_info.pb.go @@ -8,10 +8,10 @@ import ( types3 "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types4 "github.com/lavanet/lava/x/dualstaking/types" - types "github.com/lavanet/lava/x/epochstorage/types" - types2 "github.com/lavanet/lava/x/projects/types" - types1 "github.com/lavanet/lava/x/subscription/types" + types4 "github.com/lavanet/lava/v2/x/dualstaking/types" + types "github.com/lavanet/lava/v2/x/epochstorage/types" + types2 "github.com/lavanet/lava/v2/x/projects/types" + types1 "github.com/lavanet/lava/v2/x/subscription/types" _ "google.golang.org/protobuf/types/known/wrapperspb" io "io" math "math" @@ -138,38 +138,38 @@ func init() { } var fileDescriptor_5569ac5696c70068 = []byte{ - // 491 bytes of a gzipped FileDescriptorProto + // 494 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x8d, 0x21, 0xa4, 0xc5, 0xe5, 0x00, 0x56, 0x40, 0x56, 0x0f, 0x26, 0x82, 0xa2, 0x44, 0x14, - 0xad, 0xd5, 0x72, 0x47, 0x6a, 0x01, 0x21, 0x6e, 0x6d, 0x2a, 0x71, 0xe0, 0x62, 0xad, 0xed, 0x89, - 0x6b, 0x70, 0x77, 0x56, 0xbb, 0xeb, 0x40, 0xf8, 0x0a, 0x3e, 0xab, 0xc7, 0x1e, 0x39, 0x21, 0x94, - 0x7c, 0x06, 0x17, 0xe4, 0xf5, 0x6e, 0xd8, 0x3d, 0xc2, 0xc9, 0x33, 0x9a, 0x37, 0x6f, 0x66, 0xde, - 0x3e, 0x87, 0xd3, 0x86, 0x2e, 0x29, 0x03, 0x95, 0x76, 0xdf, 0x94, 0xd3, 0x5a, 0xd4, 0xac, 0x4a, - 0x69, 0x51, 0x60, 0xcb, 0x54, 0x56, 0xb3, 0x05, 0x12, 0x2e, 0x50, 0x61, 0x34, 0x36, 0x40, 0xd2, - 0x7d, 0x89, 0x01, 0xee, 0x8f, 0x2b, 0xac, 0x50, 0x03, 0xd2, 0x2e, 0xea, 0xb1, 0xfb, 0x49, 0x85, - 0x58, 0x35, 0x90, 0xea, 0x2c, 0x6f, 0x17, 0xe9, 0x17, 0x41, 0x39, 0x07, 0x21, 0x4d, 0xfd, 0xd0, - 0x1b, 0x0a, 0x1c, 0x8b, 0x4b, 0xa9, 0x50, 0xd0, 0x0a, 0x52, 0xa9, 0xe8, 0x67, 0xc8, 0x80, 0x29, - 0xb1, 0x32, 0x60, 0x7f, 0xc3, 0xb2, 0xa5, 0x4d, 0x87, 0xe9, 0xb6, 0x2c, 0xa1, 0x81, 0x8a, 0x2a, - 0x30, 0xc0, 0x83, 0x02, 0xe5, 0x15, 0xca, 0xd4, 0x96, 0x97, 0x47, 0x39, 0x28, 0x7a, 0x64, 0x73, - 0x83, 0x7a, 0xe1, 0xd1, 0xc9, 0x36, 0x97, 0x85, 0xa8, 0xb9, 0xaa, 0x91, 0x79, 0x89, 0x41, 0x3f, - 0xf5, 0xe5, 0x11, 0xf8, 0x09, 0x0a, 0x25, 0x6d, 0xd0, 0x83, 0x9e, 0xfc, 0x1e, 0x86, 0xf1, 0x79, - 0x0b, 0x62, 0x75, 0xd2, 0xcb, 0xf6, 0x9e, 0x2d, 0x70, 0x0e, 0x92, 0x23, 0x93, 0x10, 0xbd, 0x0b, - 0x77, 0xb9, 0xc0, 0x65, 0x5d, 0x82, 0x88, 0x83, 0xc9, 0xed, 0xd9, 0xde, 0xf1, 0x33, 0xe2, 0x49, - 0xe9, 0x9e, 0x4f, 0x2e, 0xba, 0xf3, 0xdf, 0x76, 0xd7, 0x9f, 0x0e, 0xaf, 0x7f, 0x3e, 0x1e, 0xcc, - 0xb7, 0xcd, 0xd1, 0xeb, 0x70, 0xb4, 0x10, 0xf8, 0x0d, 0x58, 0x7c, 0xeb, 0xdf, 0x69, 0x4c, 0x6b, - 0xb7, 0x4d, 0xcb, 0xb4, 0xc6, 0x65, 0x3c, 0xfc, 0x8f, 0x6d, 0x6c, 0x73, 0x74, 0x1e, 0xde, 0x73, - 0xe5, 0x8a, 0xef, 0x4c, 0x82, 0xd9, 0xde, 0xf1, 0xd4, 0x27, 0xf3, 0x04, 0xbd, 0x70, 0x12, 0x4d, - 0x17, 0xcc, 0x3d, 0x8a, 0xe8, 0x55, 0xb8, 0x63, 0x74, 0x8d, 0x47, 0x9a, 0x2d, 0xf1, 0xd9, 0xac, - 0xfa, 0xe4, 0xac, 0x0f, 0x0c, 0x89, 0x6d, 0x8a, 0xaa, 0xf0, 0x91, 0x71, 0x44, 0x8d, 0x4c, 0x66, - 0x4b, 0xda, 0xd4, 0x25, 0x55, 0x28, 0x64, 0xbc, 0xa3, 0x2f, 0x7d, 0x4e, 0x7a, 0x83, 0x10, 0x6b, - 0x08, 0x63, 0x10, 0xf2, 0x66, 0xdb, 0x65, 0x5f, 0xcd, 0x9c, 0xfb, 0xd0, 0xe1, 0xfb, 0xb0, 0xa5, - 0x8b, 0xb2, 0xd0, 0x2d, 0x64, 0xf6, 0x85, 0x64, 0xbc, 0xab, 0xe7, 0x1c, 0xf8, 0x6b, 0x3b, 0x8e, - 0x75, 0x26, 0x99, 0x09, 0x63, 0x87, 0xe8, 0xcc, 0xf2, 0x44, 0x87, 0xe1, 0x03, 0x85, 0x8a, 0x36, - 0x99, 0x53, 0x8d, 0xef, 0x4e, 0x82, 0xd9, 0x70, 0x7e, 0x5f, 0x17, 0xfe, 0xf2, 0xc8, 0xd3, 0x93, - 0xeb, 0x75, 0x12, 0xdc, 0xac, 0x93, 0xe0, 0xd7, 0x3a, 0x09, 0xbe, 0x6f, 0x92, 0xc1, 0xcd, 0x26, - 0x19, 0xfc, 0xd8, 0x24, 0x83, 0x8f, 0xd3, 0xaa, 0x56, 0x97, 0x6d, 0x4e, 0x0a, 0xbc, 0x4a, 0x3d, - 0x1f, 0x7f, 0xdd, 0xfe, 0xe8, 0x6a, 0xc5, 0x41, 0xe6, 0x23, 0xed, 0xe3, 0x97, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x0f, 0x61, 0xdc, 0xe4, 0x0d, 0x04, 0x00, 0x00, + 0x10, 0x8d, 0x21, 0xa4, 0xc5, 0xe5, 0x00, 0x56, 0x40, 0x56, 0x0f, 0x26, 0x82, 0xa2, 0x46, 0x2d, + 0xda, 0x55, 0xc3, 0x1d, 0x89, 0x52, 0x84, 0xb8, 0xb5, 0xa9, 0xc4, 0x81, 0x8b, 0xb5, 0xb6, 0x27, + 0xae, 0xc1, 0xdd, 0xb1, 0x76, 0xd7, 0x86, 0xf0, 0x15, 0x7c, 0x56, 0x8f, 0x39, 0x72, 0x42, 0x28, + 0xf9, 0x0c, 0x2e, 0xc8, 0xf6, 0x6e, 0xd8, 0x3d, 0xd2, 0x93, 0x67, 0x34, 0x6f, 0xde, 0xcc, 0xbc, + 0x7d, 0xf6, 0x0f, 0x4b, 0xd6, 0x30, 0x0e, 0x8a, 0xb6, 0x5f, 0x5a, 0xb1, 0x42, 0x14, 0x3c, 0xa7, + 0x2c, 0x4d, 0xb1, 0xe6, 0x2a, 0x2e, 0xf8, 0x02, 0x49, 0x25, 0x50, 0x61, 0x30, 0xd6, 0x40, 0xd2, + 0x7e, 0x89, 0x06, 0xee, 0x8f, 0x73, 0xcc, 0xb1, 0x03, 0xd0, 0x36, 0xea, 0xb1, 0xfb, 0x51, 0x8e, + 0x98, 0x97, 0x40, 0xbb, 0x2c, 0xa9, 0x17, 0xf4, 0xab, 0x60, 0x55, 0x05, 0x42, 0xea, 0xfa, 0xb1, + 0x33, 0x14, 0x2a, 0x4c, 0xaf, 0xa4, 0x42, 0xc1, 0x72, 0xa0, 0x52, 0xb1, 0x2f, 0x10, 0x03, 0x57, + 0x62, 0xa9, 0xc1, 0xee, 0x86, 0x59, 0xcd, 0xca, 0x16, 0xd3, 0x6e, 0x99, 0x41, 0x09, 0x39, 0x53, + 0xa0, 0x81, 0x07, 0x29, 0xca, 0x6b, 0x94, 0xd4, 0x94, 0x9b, 0x93, 0x04, 0x14, 0x3b, 0x31, 0xb9, + 0x46, 0xbd, 0x74, 0xe8, 0x64, 0x9d, 0xc8, 0x54, 0x14, 0x95, 0x2a, 0x90, 0x3b, 0x89, 0x46, 0x3f, + 0x77, 0xe5, 0x11, 0xf8, 0x19, 0x52, 0x25, 0x4d, 0xd0, 0x83, 0x9e, 0xfd, 0x19, 0xfa, 0xe1, 0x45, + 0x0d, 0x62, 0xf9, 0xa6, 0x97, 0xed, 0x03, 0x5f, 0xe0, 0x1c, 0x64, 0x85, 0x5c, 0x42, 0xf0, 0xde, + 0xdf, 0xad, 0x04, 0x36, 0x45, 0x06, 0x22, 0xf4, 0x26, 0x77, 0xa7, 0x7b, 0xb3, 0x17, 0xc4, 0x91, + 0xd2, 0x3e, 0x9f, 0x5c, 0xb6, 0xe7, 0xbf, 0x6b, 0xaf, 0x3f, 0x1d, 0xde, 0xfc, 0x7a, 0x3a, 0x98, + 0x6f, 0x9b, 0x83, 0xb7, 0xfe, 0x68, 0x21, 0xf0, 0x3b, 0xf0, 0xf0, 0xce, 0xff, 0xd3, 0xe8, 0xd6, + 0x76, 0x9b, 0x9a, 0x77, 0x1a, 0x67, 0xe1, 0xf0, 0x16, 0xdb, 0x98, 0xe6, 0xe0, 0xc2, 0x7f, 0x60, + 0xcb, 0x15, 0xde, 0x9b, 0x78, 0xd3, 0xbd, 0xd9, 0xa1, 0x4b, 0xe6, 0x08, 0x7a, 0x69, 0x25, 0x1d, + 0x9d, 0x37, 0x77, 0x28, 0x82, 0xd7, 0xfe, 0x8e, 0xd6, 0x35, 0x1c, 0x75, 0x6c, 0x91, 0xcb, 0x66, + 0xd4, 0x27, 0xe7, 0x7d, 0xa0, 0x49, 0x4c, 0x53, 0x90, 0xfb, 0x4f, 0xb4, 0x23, 0x0a, 0xe4, 0x32, + 0x6e, 0x58, 0x59, 0x64, 0x4c, 0xa1, 0x90, 0xe1, 0x4e, 0x77, 0xe9, 0x11, 0xe9, 0x0d, 0x42, 0x8c, + 0x21, 0xb4, 0x41, 0xc8, 0xd9, 0xb6, 0xcb, 0xbc, 0x9a, 0x3e, 0xf7, 0xb1, 0xc5, 0xf7, 0x71, 0x4b, + 0x17, 0xc4, 0xbe, 0x5d, 0x88, 0xcd, 0x0b, 0xc9, 0x70, 0xb7, 0x9b, 0x73, 0xe0, 0xae, 0x6d, 0x39, + 0xd6, 0x9a, 0xa4, 0x27, 0x8c, 0x2d, 0xa2, 0x73, 0xc3, 0x13, 0x1c, 0xfb, 0x8f, 0x14, 0x2a, 0x56, + 0xc6, 0x56, 0x35, 0xbc, 0x3f, 0xf1, 0xa6, 0xc3, 0xf9, 0xc3, 0xae, 0xf0, 0x8f, 0x47, 0x9e, 0x9e, + 0xdd, 0xac, 0x23, 0x6f, 0xb5, 0x8e, 0xbc, 0xdf, 0xeb, 0xc8, 0xfb, 0xb1, 0x89, 0x06, 0xab, 0x4d, + 0x34, 0xf8, 0xb9, 0x89, 0x06, 0x9f, 0x8e, 0xf2, 0x42, 0x5d, 0xd5, 0x09, 0x49, 0xf1, 0x9a, 0x3a, + 0x3e, 0x6e, 0x66, 0xf4, 0xdb, 0xf6, 0x5f, 0x57, 0xcb, 0x0a, 0x64, 0x32, 0xea, 0xac, 0xfc, 0xea, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x68, 0xa0, 0x4d, 0x10, 0x04, 0x00, 0x00, } func (m *QueryAccountInfoResponse) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/badge_test.go b/x/pairing/types/badge_test.go index eb8938746e..b9adfb9143 100644 --- a/x/pairing/types/badge_test.go +++ b/x/pairing/types/badge_test.go @@ -3,7 +3,7 @@ package types import ( "testing" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/utils/sigs" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/badges.pb.go b/x/pairing/types/badges.pb.go index 75587c9954..269d435738 100644 --- a/x/pairing/types/badges.pb.go +++ b/x/pairing/types/badges.pb.go @@ -9,8 +9,8 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/x/epochstorage/types" - types "github.com/lavanet/lava/x/spec/types" + _ "github.com/lavanet/lava/v2/x/epochstorage/types" + types "github.com/lavanet/lava/v2/x/spec/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -167,35 +167,35 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/badges.proto", fileDescriptor_5013dfba46b4caa4) } var fileDescriptor_5013dfba46b4caa4 = []byte{ - // 439 bytes of a gzipped FileDescriptorProto + // 442 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0x46, 0x19, 0x9a, 0xc7, 0x38, 0x58, 0x41, 0x54, 0x85, 0x85, 0x51, 0x0e, 0x20, 0x2a, - 0x62, 0x28, 0xbf, 0x60, 0xbd, 0x4c, 0xbb, 0x41, 0x76, 0xe3, 0x12, 0x39, 0xc9, 0xc3, 0xcb, 0x28, - 0xb1, 0x67, 0x3b, 0x40, 0x25, 0x7e, 0x01, 0x27, 0x7e, 0xd6, 0x8e, 0x3b, 0x72, 0x42, 0xa8, 0xfd, - 0x23, 0xc8, 0xcf, 0x6e, 0xa5, 0x40, 0x90, 0x76, 0x49, 0xec, 0xf7, 0x7d, 0xf6, 0xf7, 0xbe, 0xcf, - 0x8f, 0x3c, 0x59, 0xf0, 0xcf, 0xbc, 0x01, 0xcb, 0xdc, 0x9f, 0x29, 0x5e, 0xeb, 0xba, 0x11, 0xac, - 0xe0, 0x95, 0x00, 0x93, 0x2a, 0x2d, 0xad, 0xa4, 0x71, 0xa0, 0xa4, 0xee, 0x9f, 0x06, 0xca, 0xf8, - 0xa8, 0xf7, 0xa0, 0x86, 0x05, 0x5f, 0xfa, 0x73, 0xff, 0x61, 0x5c, 0xb6, 0xa0, 0x37, 0x8c, 0x58, - 0x48, 0x21, 0x71, 0xc9, 0xdc, 0x2a, 0x54, 0x13, 0x21, 0xa5, 0x58, 0x00, 0xc3, 0x5d, 0xd1, 0x7e, - 0x60, 0x5f, 0x34, 0x57, 0x0a, 0x74, 0xe8, 0x67, 0x3c, 0xed, 0xdc, 0x0b, 0x4a, 0x96, 0xe7, 0xc6, - 0x4a, 0xcd, 0x05, 0x30, 0x63, 0xf9, 0x47, 0xc8, 0xa1, 0xb1, 0x5b, 0x89, 0x47, 0x1d, 0xb2, 0x51, - 0x50, 0xe2, 0xc7, 0xa3, 0x93, 0x25, 0x89, 0x4f, 0xa0, 0x01, 0xcd, 0x2d, 0xcc, 0x9d, 0xe5, 0x0c, - 0x2e, 0x5b, 0x30, 0x96, 0x3e, 0x25, 0x07, 0x18, 0x41, 0xce, 0xab, 0x4a, 0x83, 0x31, 0xa3, 0xe8, - 0x28, 0x7a, 0xbe, 0x97, 0xdd, 0xc5, 0xe2, 0xb1, 0xaf, 0xd1, 0x43, 0x42, 0x94, 0x96, 0x17, 0x50, - 0xda, 0xbc, 0xae, 0x46, 0x3b, 0xc8, 0xd8, 0x0b, 0x95, 0xd3, 0x8a, 0x1e, 0x92, 0x3b, 0x4e, 0xc9, - 0x61, 0xb7, 0x1c, 0x36, 0x1f, 0x5e, 0xfd, 0x7a, 0x1c, 0x65, 0xbb, 0xae, 0x78, 0x5a, 0x4d, 0xbe, - 0xef, 0x90, 0xfb, 0x7f, 0x69, 0x1b, 0x25, 0x1b, 0x03, 0xf4, 0x35, 0xb9, 0x8d, 0x3a, 0x28, 0xba, - 0x3f, 0x7b, 0x98, 0xf6, 0xe5, 0x9f, 0xfa, 0x33, 0x9e, 0x49, 0x73, 0x12, 0x0b, 0xb0, 0x79, 0xc0, - 0x72, 0x1d, 0xae, 0xc2, 0xa6, 0xf6, 0x67, 0x2f, 0xfb, 0x6f, 0x78, 0xe7, 0x5e, 0xe2, 0x04, 0xec, - 0x5b, 0xbf, 0xdf, 0xe8, 0x67, 0x54, 0xfc, 0x53, 0xa3, 0xaf, 0x48, 0xec, 0x03, 0x31, 0xb5, 0x68, - 0x40, 0x6f, 0x73, 0x41, 0x67, 0x19, 0x45, 0xec, 0x0c, 0xa1, 0x4d, 0x3a, 0x53, 0x32, 0x74, 0x4e, - 0x47, 0x43, 0x6c, 0xe1, 0x41, 0xb7, 0x05, 0x7c, 0x82, 0x33, 0x05, 0x65, 0x86, 0xa4, 0xd9, 0x37, - 0x72, 0x0f, 0xfd, 0x84, 0x40, 0xa4, 0xa6, 0x17, 0xe4, 0xa0, 0x93, 0x0e, 0x7d, 0xd1, 0x6f, 0xa2, - 0xef, 0xf9, 0xc6, 0xd3, 0x1b, 0x71, 0xbd, 0xb5, 0xc9, 0x60, 0x7e, 0x7c, 0xb5, 0x4a, 0xa2, 0xeb, - 0x55, 0x12, 0xfd, 0x5e, 0x25, 0xd1, 0x8f, 0x75, 0x32, 0xb8, 0x5e, 0x27, 0x83, 0x9f, 0xeb, 0x64, - 0xf0, 0xfe, 0x99, 0xa8, 0xed, 0x79, 0x5b, 0xa4, 0xa5, 0xfc, 0xc4, 0x3a, 0x83, 0xf4, 0x75, 0x3b, - 0xcf, 0x76, 0xa9, 0xc0, 0x14, 0xbb, 0x38, 0x4f, 0x6f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xde, - 0xaa, 0xbd, 0x40, 0x4f, 0x03, 0x00, 0x00, + 0x14, 0x6e, 0x46, 0x19, 0x9a, 0xc7, 0x38, 0x58, 0x41, 0x54, 0x85, 0x85, 0x51, 0x2e, 0x68, 0x15, + 0x31, 0x94, 0x5f, 0x40, 0x85, 0x34, 0xed, 0x06, 0xd9, 0x8d, 0x4b, 0xe4, 0x24, 0x0f, 0x2f, 0xa3, + 0xc4, 0x9e, 0xed, 0x0c, 0x2a, 0xf1, 0x0b, 0x38, 0xf1, 0xb3, 0x76, 0xdc, 0x91, 0x13, 0x42, 0xed, + 0x1f, 0x41, 0x7e, 0x76, 0x2b, 0x05, 0x82, 0xc4, 0x25, 0xb1, 0xdf, 0xf7, 0xd9, 0xdf, 0xfb, 0x3e, + 0x3f, 0xf2, 0x64, 0xc1, 0xaf, 0x78, 0x03, 0x96, 0xb9, 0x3f, 0x53, 0xbc, 0xd6, 0x75, 0x23, 0x58, + 0xc1, 0x2b, 0x01, 0x26, 0x55, 0x5a, 0x5a, 0x49, 0xe3, 0x40, 0x49, 0xdd, 0x3f, 0x0d, 0x94, 0xf1, + 0x51, 0xef, 0x41, 0x0d, 0x0b, 0xbe, 0xf4, 0xe7, 0xfe, 0xc1, 0xb8, 0x6c, 0x41, 0x6f, 0x18, 0xb1, + 0x90, 0x42, 0xe2, 0x92, 0xb9, 0x55, 0xa8, 0x26, 0x42, 0x4a, 0xb1, 0x00, 0x86, 0xbb, 0xa2, 0xfd, + 0xc0, 0x3e, 0x6b, 0xae, 0x14, 0xe8, 0xd0, 0xcf, 0x78, 0xda, 0xb9, 0x17, 0x94, 0x2c, 0xcf, 0x8d, + 0x95, 0x9a, 0x0b, 0x60, 0xc6, 0xf2, 0x8f, 0x90, 0x43, 0x63, 0xb7, 0x12, 0x8f, 0x3a, 0x64, 0xa3, + 0xa0, 0xc4, 0x8f, 0x47, 0x27, 0x4b, 0x12, 0x9f, 0x40, 0x03, 0x9a, 0x5b, 0x98, 0x3b, 0xcb, 0x19, + 0x5c, 0xb6, 0x60, 0x2c, 0x7d, 0x4a, 0x0e, 0x30, 0x82, 0x9c, 0x57, 0x95, 0x06, 0x63, 0x46, 0xd1, + 0x51, 0xf4, 0x6c, 0x2f, 0xbb, 0x8b, 0xc5, 0xd7, 0xbe, 0x46, 0x0f, 0x09, 0x51, 0x5a, 0x5e, 0x40, + 0x69, 0xf3, 0xba, 0x1a, 0xed, 0x20, 0x63, 0x2f, 0x54, 0x4e, 0x2b, 0x7a, 0x48, 0xee, 0x38, 0x25, + 0x87, 0xdd, 0x72, 0xd8, 0x7c, 0x78, 0xfd, 0xf3, 0x71, 0x94, 0xed, 0xba, 0xe2, 0x69, 0x35, 0xf9, + 0xb6, 0x43, 0xee, 0xff, 0xa1, 0x6d, 0x94, 0x6c, 0x0c, 0xd0, 0x97, 0xe4, 0x36, 0xea, 0xa0, 0xe8, + 0xfe, 0xec, 0x61, 0xda, 0x97, 0x7f, 0xea, 0xcf, 0x78, 0x26, 0xcd, 0x49, 0x2c, 0xc0, 0xe6, 0x01, + 0xcb, 0x75, 0xb8, 0x0a, 0x9b, 0xda, 0x9f, 0x3d, 0xef, 0xbf, 0xe1, 0x9d, 0x7b, 0x89, 0x13, 0xb0, + 0x6f, 0xfd, 0x7e, 0xa3, 0x9f, 0x51, 0xf1, 0x57, 0x8d, 0xbe, 0x20, 0xb1, 0x0f, 0xc4, 0xd4, 0xa2, + 0x01, 0xbd, 0xcd, 0x05, 0x9d, 0x65, 0x14, 0xb1, 0x33, 0x84, 0x36, 0xe9, 0x4c, 0xc9, 0xd0, 0x39, + 0x1d, 0x0d, 0xb1, 0x85, 0x07, 0xdd, 0x16, 0xf0, 0x09, 0xce, 0x14, 0x94, 0x19, 0x92, 0x66, 0x5f, + 0xc9, 0x3d, 0xf4, 0x13, 0x02, 0x91, 0x9a, 0x5e, 0x90, 0x83, 0x4e, 0x3a, 0xf4, 0xb8, 0xdf, 0x44, + 0xdf, 0xf3, 0x8d, 0xa7, 0xff, 0xc5, 0xf5, 0xd6, 0x26, 0x83, 0xf9, 0x9b, 0xeb, 0x55, 0x12, 0xdd, + 0xac, 0x92, 0xe8, 0xd7, 0x2a, 0x89, 0xbe, 0xaf, 0x93, 0xc1, 0xcd, 0x3a, 0x19, 0xfc, 0x58, 0x27, + 0x83, 0xf7, 0xc7, 0xa2, 0xb6, 0xe7, 0x6d, 0x91, 0x96, 0xf2, 0x13, 0xeb, 0x0c, 0xd2, 0xd5, 0x8c, + 0x7d, 0xd9, 0x8e, 0xb4, 0x5d, 0x2a, 0x30, 0xc5, 0x2e, 0x8e, 0xd4, 0xab, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xe5, 0x68, 0x50, 0xd3, 0x52, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/types/codec.go b/x/pairing/types/codec.go index 900237bd74..abac0115f6 100644 --- a/x/pairing/types/codec.go +++ b/x/pairing/types/codec.go @@ -3,8 +3,10 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "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" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -45,5 +47,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + ModuleCdc = codec.NewAminoCodec(Amino) + // ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterCodec(Amino) + cryptocodec.RegisterCrypto(Amino) + Amino.Seal() +} diff --git a/x/pairing/types/debug_query.pb.go b/x/pairing/types/debug_query.pb.go index 8a57a5dda2..8bf14b7870 100644 --- a/x/pairing/types/debug_query.pb.go +++ b/x/pairing/types/debug_query.pb.go @@ -8,10 +8,10 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/x/dualstaking/types" - _ "github.com/lavanet/lava/x/epochstorage/types" - _ "github.com/lavanet/lava/x/projects/types" - _ "github.com/lavanet/lava/x/subscription/types" + _ "github.com/lavanet/lava/v2/x/dualstaking/types" + _ "github.com/lavanet/lava/v2/x/epochstorage/types" + _ "github.com/lavanet/lava/v2/x/projects/types" + _ "github.com/lavanet/lava/v2/x/subscription/types" _ "google.golang.org/protobuf/types/known/wrapperspb" io "io" math "math" @@ -154,38 +154,38 @@ func init() { } var fileDescriptor_a315cb51b0edeaef = []byte{ - // 492 bytes of a gzipped FileDescriptorProto + // 494 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0x63, 0xfa, 0x03, 0x9d, 0x22, 0x81, 0x4c, 0x4a, 0xad, 0x20, 0x99, 0xf2, 0x23, 0x5a, - 0x04, 0x8a, 0x89, 0xba, 0x60, 0x81, 0x58, 0x34, 0xaa, 0x58, 0x21, 0x04, 0x59, 0xb2, 0xb1, 0xc6, - 0xf6, 0x8d, 0x63, 0x7a, 0xe3, 0x3b, 0xcc, 0x8c, 0x5d, 0xfa, 0x16, 0x3c, 0x16, 0xcb, 0x2e, 0x59, - 0xa2, 0x64, 0xcd, 0x3b, 0xa0, 0x19, 0x7b, 0x2c, 0x0c, 0x59, 0x79, 0xee, 0x3d, 0xdf, 0x99, 0x13, - 0x1d, 0x4d, 0xd8, 0x33, 0xe4, 0x35, 0x2f, 0x41, 0x47, 0xe6, 0x1b, 0x09, 0x5e, 0xc8, 0xa2, 0xcc, - 0xa3, 0x0c, 0x92, 0x2a, 0x8f, 0xbf, 0x56, 0x20, 0xaf, 0xc6, 0x42, 0x92, 0x26, 0x7f, 0xd8, 0x72, - 0x63, 0xf3, 0x1d, 0xb7, 0xdc, 0x68, 0x98, 0x53, 0x4e, 0x16, 0x88, 0xcc, 0xa9, 0x61, 0x47, 0x61, - 0x4e, 0x94, 0x23, 0x44, 0x76, 0x4a, 0xaa, 0x79, 0x74, 0x29, 0xb9, 0x10, 0x20, 0x55, 0xab, 0xbf, - 0xe8, 0x65, 0x82, 0xa0, 0x74, 0xa1, 0x34, 0x49, 0x9e, 0x43, 0xa4, 0x34, 0xbf, 0x80, 0x18, 0x4a, - 0xed, 0x82, 0x47, 0xc7, 0x3d, 0x38, 0xab, 0x38, 0x1a, 0xa6, 0xf9, 0x91, 0x08, 0x39, 0xd7, 0xd0, - 0x82, 0x4f, 0x53, 0x52, 0x4b, 0x52, 0x91, 0x93, 0xeb, 0x49, 0x02, 0x9a, 0x4f, 0xdc, 0xdc, 0x52, - 0x2f, 0x7b, 0xd7, 0xa9, 0x2a, 0x51, 0xa9, 0x2c, 0x84, 0x2e, 0xa8, 0xec, 0x0d, 0x2d, 0xfd, 0xa4, - 0xdf, 0x8e, 0xa4, 0x2f, 0x90, 0x6a, 0xe5, 0x0e, 0x0d, 0xf4, 0xf8, 0xf7, 0x16, 0x3b, 0xfc, 0x64, - 0xaa, 0x3a, 0x37, 0xad, 0xd9, 0xd3, 0x0c, 0x94, 0xa0, 0x52, 0x81, 0xff, 0x88, 0xdd, 0x4e, 0x90, - 0xd2, 0x8b, 0x58, 0xc2, 0x25, 0x97, 0x59, 0xe0, 0x1d, 0x79, 0x27, 0xdb, 0xb3, 0x7d, 0xbb, 0x9b, - 0xd9, 0x95, 0x3f, 0x61, 0x07, 0x35, 0xc7, 0x38, 0x2b, 0x94, 0x8e, 0x05, 0x11, 0xc6, 0x09, 0x47, - 0x5e, 0xa6, 0x10, 0xdc, 0x38, 0xf2, 0x4e, 0xf6, 0x66, 0x7e, 0xcd, 0xf1, 0xbc, 0x50, 0xfa, 0x23, - 0x11, 0x4e, 0x1b, 0xc5, 0x3f, 0x65, 0xf7, 0x8d, 0x85, 0x23, 0x52, 0xda, 0xf7, 0x6c, 0x59, 0xcf, - 0xbd, 0x9a, 0xe3, 0x99, 0x11, 0xff, 0x36, 0xbd, 0x61, 0x23, 0x21, 0xa9, 0x2e, 0x32, 0x90, 0x1b, - 0xc2, 0xb6, 0xad, 0xf1, 0xd0, 0x11, 0xff, 0x26, 0xbe, 0x65, 0x0f, 0x3a, 0xf3, 0x86, 0xd8, 0x1d, - 0xeb, 0x0e, 0x1c, 0xf2, 0x5f, 0xf6, 0x2b, 0x36, 0xec, 0xec, 0xf3, 0x0a, 0xd1, 0xd5, 0xb1, 0x6b, - 0xeb, 0xf0, 0x9d, 0xf6, 0xae, 0x42, 0x6c, 0x5b, 0x79, 0xcd, 0xba, 0xdb, 0x5a, 0x38, 0x2e, 0x29, - 0x4e, 0xa8, 0xac, 0x54, 0x70, 0xd3, 0xba, 0x0e, 0x9c, 0xde, 0x38, 0x3e, 0xd0, 0xd4, 0x88, 0xfe, - 0x90, 0xed, 0xd8, 0x76, 0x83, 0x5b, 0x96, 0x6a, 0x06, 0xff, 0x21, 0xdb, 0x5f, 0x52, 0xa9, 0x17, - 0x2a, 0x46, 0x98, 0xeb, 0x60, 0xcf, 0x6a, 0xac, 0x59, 0xbd, 0x87, 0xb9, 0xf6, 0x9f, 0xb3, 0xbb, - 0x35, 0xc7, 0x22, 0xe3, 0x9a, 0x5c, 0x60, 0xc0, 0x2c, 0x75, 0xa7, 0xdb, 0x37, 0x41, 0xd3, 0xb3, - 0x1f, 0xab, 0xd0, 0xbb, 0x5e, 0x85, 0xde, 0xaf, 0x55, 0xe8, 0x7d, 0x5f, 0x87, 0x83, 0xeb, 0x75, - 0x38, 0xf8, 0xb9, 0x0e, 0x07, 0x9f, 0x8f, 0xf3, 0x42, 0x2f, 0xaa, 0x64, 0x9c, 0xd2, 0x32, 0xea, - 0xbd, 0x9c, 0x6f, 0xdd, 0x3f, 0x4b, 0x5f, 0x09, 0x50, 0xc9, 0xae, 0x7d, 0x39, 0xa7, 0x7f, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x84, 0xea, 0xd9, 0x17, 0x7e, 0x03, 0x00, 0x00, + 0x14, 0x85, 0x63, 0xfa, 0x03, 0x9d, 0x22, 0x81, 0x4c, 0x4a, 0xad, 0x20, 0x99, 0xf2, 0x23, 0x28, + 0x3f, 0xca, 0x10, 0xba, 0x60, 0x81, 0x58, 0x10, 0x45, 0xac, 0x10, 0x82, 0x2c, 0xd9, 0x58, 0x63, + 0xfb, 0xc6, 0x31, 0xbd, 0xf1, 0x1d, 0x66, 0xc6, 0x2e, 0x7d, 0x0b, 0x1e, 0x8b, 0x65, 0x97, 0x2c, + 0x51, 0xb2, 0xe6, 0x1d, 0x90, 0xc7, 0x1e, 0x0b, 0x43, 0x57, 0x9e, 0x7b, 0xcf, 0x77, 0xe6, 0x44, + 0x47, 0x13, 0xf6, 0x08, 0x45, 0x25, 0x0a, 0x30, 0xbc, 0xfe, 0x72, 0x29, 0x72, 0x95, 0x17, 0x19, + 0x4f, 0x21, 0x2e, 0xb3, 0xe8, 0x6b, 0x09, 0xea, 0x7c, 0x2c, 0x15, 0x19, 0xf2, 0x87, 0x2d, 0x37, + 0xae, 0xbf, 0xe3, 0x96, 0x1b, 0x0d, 0x33, 0xca, 0xc8, 0x02, 0xbc, 0x3e, 0x35, 0xec, 0x28, 0xcc, + 0x88, 0x32, 0x04, 0x6e, 0xa7, 0xb8, 0x5c, 0xf0, 0x33, 0x25, 0xa4, 0x04, 0xa5, 0x5b, 0xfd, 0x59, + 0x2f, 0x13, 0x24, 0x25, 0x4b, 0x6d, 0x48, 0x89, 0x0c, 0xb8, 0x36, 0xe2, 0x14, 0x22, 0x28, 0x8c, + 0x0b, 0x1e, 0x3d, 0xee, 0xc1, 0x69, 0x29, 0xb0, 0x66, 0x9a, 0x1f, 0x89, 0x90, 0x09, 0x03, 0x2d, + 0xf8, 0x30, 0x21, 0xbd, 0x22, 0xcd, 0x9d, 0x5c, 0x4d, 0x62, 0x30, 0x62, 0xe2, 0xe6, 0x96, 0x7a, + 0xde, 0xbb, 0x4e, 0x97, 0xb1, 0x4e, 0x54, 0x2e, 0x4d, 0x4e, 0x45, 0x6f, 0x68, 0xe9, 0x07, 0xfd, + 0x76, 0x14, 0x7d, 0x81, 0xc4, 0x68, 0x77, 0x68, 0xa0, 0xfb, 0xbf, 0xb7, 0xd8, 0xe1, 0xa7, 0xba, + 0xaa, 0x59, 0xdd, 0x9a, 0x3d, 0xcd, 0x41, 0x4b, 0x2a, 0x34, 0xf8, 0xf7, 0xd8, 0xf5, 0x18, 0x29, + 0x39, 0x8d, 0x14, 0x9c, 0x09, 0x95, 0x06, 0xde, 0x91, 0x77, 0xbc, 0x3d, 0xdf, 0xb7, 0xbb, 0xb9, + 0x5d, 0xf9, 0x13, 0x76, 0x50, 0x09, 0x8c, 0xd2, 0x5c, 0x9b, 0x48, 0x12, 0x61, 0x14, 0x0b, 0x14, + 0x45, 0x02, 0xc1, 0x95, 0x23, 0xef, 0x78, 0x6f, 0xee, 0x57, 0x02, 0x67, 0xb9, 0x36, 0x1f, 0x89, + 0x70, 0xda, 0x28, 0xfe, 0x09, 0xbb, 0x5d, 0x5b, 0x04, 0x22, 0x25, 0x7d, 0xcf, 0x96, 0xf5, 0xdc, + 0xaa, 0x04, 0xbe, 0xad, 0xc5, 0xbf, 0x4d, 0xaf, 0xd9, 0x48, 0x2a, 0xaa, 0xf2, 0x14, 0xd4, 0x25, + 0x61, 0xdb, 0xd6, 0x78, 0xe8, 0x88, 0x7f, 0x13, 0xdf, 0xb0, 0x3b, 0x9d, 0xf9, 0x92, 0xd8, 0x1d, + 0xeb, 0x0e, 0x1c, 0xf2, 0x5f, 0xf6, 0x0b, 0x36, 0xec, 0xec, 0x8b, 0x12, 0xd1, 0xd5, 0xb1, 0x6b, + 0xeb, 0xf0, 0x9d, 0xf6, 0xae, 0x44, 0x6c, 0x5b, 0x79, 0xc5, 0xba, 0xdb, 0x5a, 0x38, 0x2a, 0x28, + 0x8a, 0xa9, 0x28, 0x75, 0x70, 0xd5, 0xba, 0x0e, 0x9c, 0xde, 0x38, 0x3e, 0xd0, 0xb4, 0x16, 0xfd, + 0x21, 0xdb, 0xb1, 0xed, 0x06, 0xd7, 0x2c, 0xd5, 0x0c, 0xfe, 0x5d, 0xb6, 0xbf, 0xa2, 0xc2, 0x2c, + 0x75, 0x84, 0xb0, 0x30, 0xc1, 0x9e, 0xd5, 0x58, 0xb3, 0x7a, 0x0f, 0x0b, 0xe3, 0x3f, 0x61, 0x37, + 0x2b, 0x81, 0x79, 0x2a, 0x0c, 0xb9, 0xc0, 0x80, 0x59, 0xea, 0x46, 0xb7, 0x6f, 0x82, 0xa6, 0xb3, + 0x1f, 0xeb, 0xd0, 0xbb, 0x58, 0x87, 0xde, 0xaf, 0x75, 0xe8, 0x7d, 0xdf, 0x84, 0x83, 0x8b, 0x4d, + 0x38, 0xf8, 0xb9, 0x09, 0x07, 0x9f, 0x9f, 0x66, 0xb9, 0x59, 0x96, 0xf1, 0x38, 0xa1, 0x15, 0xef, + 0xbd, 0x9c, 0xea, 0x25, 0xff, 0xd6, 0xfd, 0xb9, 0xcc, 0xb9, 0x04, 0x1d, 0xef, 0xda, 0xc7, 0x73, + 0xf2, 0x27, 0x00, 0x00, 0xff, 0xff, 0x90, 0x29, 0xdd, 0x08, 0x81, 0x03, 0x00, 0x00, } func (m *QueryDebugQueryResponse) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/epoch_cu.go b/x/pairing/types/epoch_cu.go index f9442a7939..470c8ea3f5 100644 --- a/x/pairing/types/epoch_cu.go +++ b/x/pairing/types/epoch_cu.go @@ -1,10 +1,11 @@ package types import ( - "encoding/binary" "fmt" "strconv" "strings" + + "github.com/lavanet/lava/v2/utils" ) const ( @@ -14,26 +15,16 @@ const ( ProviderConsumerEpochCuPrefix = "ProviderConsumerEpochCu/" ) -func EncodeBlock(block uint64) []byte { - encodedKey := make([]byte, 8) - binary.BigEndian.PutUint64(encodedKey[0:8], block) - return encodedKey -} - -func DecodeBlock(encodedKey []byte) uint64 { - return binary.BigEndian.Uint64(encodedKey[0:8]) -} - func UniqueEpochSessionKey(epoch uint64, provider string, chainID string, project string, sessionID uint64) []byte { - return append(EncodeBlock(epoch), []byte(strings.Join([]string{provider, chainID, project, strconv.FormatUint(sessionID, 10)}, " "))...) + return append(utils.Serialize(epoch), []byte(strings.Join([]string{provider, chainID, project, strconv.FormatUint(sessionID, 10)}, " "))...) } func ProviderEpochCuKey(epoch uint64, provider string, chainID string) []byte { - return append(EncodeBlock(epoch), []byte(strings.Join([]string{provider, chainID}, " "))...) + return append(utils.Serialize(epoch), []byte(strings.Join([]string{provider, chainID}, " "))...) } func ProviderConsumerEpochCuKey(epoch uint64, provider string, project string, chainID string) []byte { - return append(EncodeBlock(epoch), []byte(strings.Join([]string{provider, project, chainID}, " "))...) + return append(utils.Serialize(epoch), []byte(strings.Join([]string{provider, project, chainID}, " "))...) } func DecodeUniqueEpochSessionKey(key string) (epoch uint64, provider string, chainID string, project string, sessionID uint64, err error) { @@ -45,7 +36,7 @@ func DecodeUniqueEpochSessionKey(key string) (epoch uint64, provider string, cha if len(split) != 4 { return 0, "", "", "", 0, fmt.Errorf("invalid UniqueEpochSession key: bad structure. key: %s", key) } - epoch = DecodeBlock([]byte(key[:8])) + utils.Deserialize([]byte(key[:8]), &epoch) sessionID, err = strconv.ParseUint(split[3], 10, 64) if err != nil { return 0, "", "", "", 0, fmt.Errorf("invalid UniqueEpochSession key: bad session ID. key: %s", key) @@ -61,7 +52,7 @@ func DecodeProviderEpochCuKey(key string) (epoch uint64, provider string, chainI if len(split) != 2 { return 0, "", "", fmt.Errorf("invalid ProviderEpochCu key: bad structure. key: %s", key) } - epoch = DecodeBlock([]byte(key[:8])) + utils.Deserialize([]byte(key[:8]), &epoch) return epoch, split[0], split[1], nil } @@ -73,7 +64,8 @@ func DecodeProviderConsumerEpochCuKey(key string) (epoch uint64, provider string if len(split) != 3 { return 0, "", "", "", fmt.Errorf("invalid ProviderConsumerEpochCu key: bad structure. key: %s", key) } - epoch = DecodeBlock([]byte(key[:8])) + + utils.Deserialize([]byte(key[:8]), &epoch) return epoch, split[0], split[1], split[2], nil } diff --git a/x/pairing/types/epoch_cu.pb.go b/x/pairing/types/epoch_cu.pb.go index 25b144e06c..a38146ba01 100644 --- a/x/pairing/types/epoch_cu.pb.go +++ b/x/pairing/types/epoch_cu.pb.go @@ -211,7 +211,7 @@ func init() { } var fileDescriptor_c2abb0ec984ffb4c = []byte{ - // 242 bytes of a gzipped FileDescriptorProto + // 245 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x89, 0x99, 0x45, 0x99, 0x79, 0xe9, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xf1, 0xc9, 0xa5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x22, 0x50, @@ -222,12 +222,12 @@ var fileDescriptor_c2abb0ec984ffb4c = []byte{ 0xc4, 0x05, 0x13, 0x72, 0x2e, 0x55, 0x72, 0xe2, 0x92, 0x44, 0xd5, 0x93, 0x9f, 0x5b, 0x90, 0x93, 0x98, 0x99, 0x97, 0x5a, 0xe4, 0x5c, 0x2a, 0xa4, 0xca, 0xc5, 0x97, 0x0c, 0xe7, 0x17, 0x23, 0x0c, 0xe0, 0x45, 0x12, 0x75, 0x2e, 0x55, 0xd2, 0xe4, 0x12, 0x87, 0x99, 0xe1, 0x9c, 0x9f, 0x57, 0x5c, - 0x9a, 0x8b, 0xb0, 0x9f, 0x8f, 0x8b, 0x09, 0xae, 0x8b, 0x29, 0xb9, 0xd4, 0xc9, 0xf1, 0xc4, 0x23, + 0x9a, 0x8b, 0xb0, 0x9f, 0x8f, 0x8b, 0x09, 0xae, 0x8b, 0x29, 0xb9, 0xd4, 0xc9, 0xe5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, - 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, - 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x02, 0xa6, 0x02, 0x1e, 0x34, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, - 0x6c, 0xe0, 0x80, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xf8, 0x2d, 0xe9, 0x3f, 0x01, - 0x00, 0x00, + 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xb4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, + 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x02, 0xa6, 0xcc, 0x48, 0xbf, 0x02, 0x1e, 0x3a, 0x25, 0x95, 0x05, + 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xb0, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xe1, 0x41, + 0xdc, 0x42, 0x01, 0x00, 0x00, } func (m *UniqueEpochSession) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/expected_keepers.go b/x/pairing/types/expected_keepers.go index 562feb1b2b..5daea548e7 100644 --- a/x/pairing/types/expected_keepers.go +++ b/x/pairing/types/expected_keepers.go @@ -8,15 +8,15 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - v1 "github.com/lavanet/lava/x/downtime/v1" - dualstakingtypes "github.com/lavanet/lava/x/dualstaking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/x/fixationstore/types" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - spectypes "github.com/lavanet/lava/x/spec/types" - subscriptiontypes "github.com/lavanet/lava/x/subscription/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v2/x/fixationstore/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + subscriptiontypes "github.com/lavanet/lava/v2/x/subscription/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) type SpecKeeper interface { @@ -35,31 +35,24 @@ type EpochstorageKeeper interface { GetParamForBlock(ctx sdk.Context, fixationKey string, block uint64, param any) error GetEpochStart(ctx sdk.Context) uint64 GetEarliestEpochStart(ctx sdk.Context) uint64 - UnstakeHoldBlocks(ctx sdk.Context, block uint64) (res uint64) - UnstakeHoldBlocksStatic(ctx sdk.Context, block uint64) (res uint64) IsEpochStart(ctx sdk.Context) (res bool) BlocksToSave(ctx sdk.Context, block uint64) (res uint64, erro error) BlocksToSaveRaw(ctx sdk.Context) (res uint64) GetEpochStartForBlock(ctx sdk.Context, block uint64) (epochStart, blockInEpoch uint64, err error) GetPreviousEpochStartForBlock(ctx sdk.Context, block uint64) (previousEpochStart uint64, erro error) - PopUnstakeEntries(ctx sdk.Context, block uint64) (value []epochstoragetypes.StakeEntry) - AppendUnstakeEntry(ctx sdk.Context, stakeEntry epochstoragetypes.StakeEntry, unstakeHoldBlocks uint64) - ModifyUnstakeEntry(ctx sdk.Context, stakeEntry epochstoragetypes.StakeEntry) - GetStakeStorageUnstake(ctx sdk.Context) (epochstoragetypes.StakeStorage, bool) - ModifyStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry epochstoragetypes.StakeEntry) - AppendStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry epochstoragetypes.StakeEntry) - RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, address string) error - GetStakeEntryByAddressCurrent(ctx sdk.Context, chainID string, address string) (epochstoragetypes.StakeEntry, bool) - UnstakeEntryByAddress(ctx sdk.Context, address string) (value epochstoragetypes.StakeEntry, found bool) - GetStakeStorageCurrent(ctx sdk.Context, chainID string) (value epochstoragetypes.StakeStorage, found bool) - GetEpochStakeEntries(ctx sdk.Context, block uint64, chainID string) (entries []epochstoragetypes.StakeEntry, found bool, epochHash []byte) GetNextEpoch(ctx sdk.Context, block uint64) (nextEpoch uint64, erro error) GetCurrentNextEpoch(ctx sdk.Context) (nextEpoch uint64) AddFixationRegistry(fixationKey string, getParamFunction func(sdk.Context) any) GetDeletedEpochs(ctx sdk.Context) []uint64 EpochBlocks(ctx sdk.Context, block uint64) (res uint64, err error) EpochBlocksRaw(ctx sdk.Context) (res uint64) - GetUnstakeHoldBlocks(ctx sdk.Context, chainID string) uint64 + GetStakeEntryCurrent(ctx sdk.Context, chainID string, provider string) (val epochstoragetypes.StakeEntry, found bool) + GetAllStakeEntriesCurrentForChainId(ctx sdk.Context, chainID string) []epochstoragetypes.StakeEntry + GetAllStakeEntriesForEpochChainId(ctx sdk.Context, epoch uint64, chainID string) []epochstoragetypes.StakeEntry + SetStakeEntryCurrent(ctx sdk.Context, stakeEntry epochstoragetypes.StakeEntry) + GetAllStakeEntriesCurrent(ctx sdk.Context) []epochstoragetypes.StakeEntry + RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, provider string) + GetEpochHash(ctx sdk.Context, epoch uint64) []byte } type AccountKeeper interface { @@ -109,7 +102,7 @@ type DowntimeKeeper interface { } type DualstakingKeeper interface { - RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributer bool) (providerReward sdk.Coins, totalRewards sdk.Coins, err error) + RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributor bool) (providerReward sdk.Coins, totalRewards sdk.Coins, err error) DelegateFull(ctx sdk.Context, delegator string, validator string, provider string, chainID string, amount sdk.Coin) error UnbondFull(ctx sdk.Context, delegator string, validator string, provider string, chainID string, amount sdk.Coin, unstake bool) error GetProviderDelegators(ctx sdk.Context, provider string, epoch uint64) ([]dualstakingtypes.Delegation, error) diff --git a/x/pairing/types/genesis.go b/x/pairing/types/genesis.go index 224077aabd..314666182f 100644 --- a/x/pairing/types/genesis.go +++ b/x/pairing/types/genesis.go @@ -3,8 +3,8 @@ package types import ( "fmt" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) // DefaultIndex is the default capability global index diff --git a/x/pairing/types/genesis.pb.go b/x/pairing/types/genesis.pb.go index e8b319a8b9..9cdbc3bf71 100644 --- a/x/pairing/types/genesis.pb.go +++ b/x/pairing/types/genesis.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/lavanet/lava/x/fixationstore/types" - types "github.com/lavanet/lava/x/timerstore/types" + types1 "github.com/lavanet/lava/v2/x/fixationstore/types" + types "github.com/lavanet/lava/v2/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -480,51 +480,51 @@ func init() { } var fileDescriptor_dbd1e49b8b57595b = []byte{ - // 693 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x53, 0xd3, 0x40, - 0x18, 0x6d, 0x68, 0x5a, 0xca, 0x57, 0xd4, 0xb2, 0xa2, 0x84, 0x0a, 0xb1, 0xc4, 0x71, 0x2c, 0x33, - 0x9a, 0xcc, 0xa0, 0xe3, 0xc1, 0x9b, 0x30, 0xca, 0x80, 0x1e, 0xa4, 0x85, 0x71, 0xc6, 0x4b, 0x4c, - 0x93, 0xb5, 0xac, 0xd2, 0xec, 0x9a, 0x4d, 0x18, 0x7a, 0xf2, 0x2f, 0x78, 0xf3, 0xec, 0x1f, 0xf1, - 0xcc, 0x91, 0xa3, 0x27, 0xc7, 0x81, 0x83, 0xbf, 0xc1, 0x9b, 0x93, 0xcd, 0xb6, 0x34, 0x25, 0x41, - 0x71, 0x1c, 0x4f, 0xc9, 0x66, 0xdf, 0xf7, 0xde, 0xf7, 0xb2, 0xef, 0x9b, 0x05, 0x63, 0xcf, 0xd9, - 0x77, 0x7c, 0x1c, 0x5a, 0xf1, 0xd3, 0x62, 0x0e, 0x09, 0x88, 0xdf, 0xb5, 0xba, 0xd8, 0xc7, 0x9c, - 0x70, 0x93, 0x05, 0x34, 0xa4, 0x68, 0x56, 0x62, 0xcc, 0xf8, 0x69, 0x4a, 0x4c, 0x7d, 0xb6, 0x4b, - 0xbb, 0x54, 0x00, 0xac, 0xf8, 0x2d, 0xc1, 0xd6, 0x97, 0x32, 0xf9, 0x98, 0x13, 0x38, 0x3d, 0x49, - 0x57, 0xbf, 0x95, 0x09, 0xc1, 0x8c, 0xba, 0xbb, 0xb6, 0x1b, 0x49, 0xd0, 0x72, 0x0a, 0xf4, 0x86, - 0x1c, 0x38, 0x21, 0xa1, 0x3e, 0x0f, 0x69, 0x80, 0x87, 0xab, 0x4c, 0xbe, 0x90, 0xf4, 0x70, 0x90, - 0xe0, 0xc4, 0x6b, 0x02, 0x32, 0xb6, 0xa0, 0xba, 0xea, 0x78, 0x5d, 0xbc, 0xc3, 0xb1, 0xb7, 0x16, - 0xa1, 0x65, 0x98, 0xe9, 0xc4, 0x4b, 0x3b, 0xe2, 0xd8, 0xb3, 0xdd, 0xc8, 0x7e, 0x87, 0xfb, 0x9a, - 0xd2, 0x50, 0x9a, 0xd3, 0xad, 0xcb, 0x9d, 0x53, 0xdc, 0x33, 0xdc, 0x47, 0x73, 0x30, 0x29, 0x41, - 0xda, 0x44, 0x43, 0x69, 0xaa, 0xad, 0x72, 0x24, 0xf6, 0x8c, 0x4f, 0x65, 0x98, 0x5e, 0x4f, 0x7e, - 0x54, 0x3b, 0x74, 0x42, 0x8c, 0x1e, 0x41, 0x39, 0x31, 0x2a, 0x98, 0xaa, 0x2b, 0x0b, 0x66, 0xd6, - 0x8f, 0x33, 0x5f, 0x08, 0xcc, 0xaa, 0x7a, 0xf8, 0xed, 0x66, 0xa1, 0x25, 0x2b, 0xd0, 0x16, 0x5c, - 0x19, 0xd1, 0x7d, 0x4e, 0x78, 0xa8, 0x95, 0x1a, 0xc5, 0x66, 0x75, 0x65, 0x29, 0x9b, 0x64, 0xc4, - 0x8c, 0x64, 0x1a, 0xaf, 0x47, 0xeb, 0x50, 0x11, 0x9f, 0xf8, 0x76, 0x5b, 0x2b, 0x8b, 0x86, 0x6e, - 0xa7, 0xb9, 0x4e, 0x7f, 0x95, 0x39, 0xea, 0x43, 0xf2, 0x0d, 0x8b, 0xd1, 0x36, 0x5c, 0x62, 0x01, - 0xdd, 0x27, 0x1e, 0x0e, 0xb6, 0x28, 0x7f, 0xda, 0xd6, 0x26, 0x05, 0x5b, 0x33, 0xcd, 0x96, 0x3a, - 0xa3, 0x2c, 0xc2, 0x34, 0x09, 0x22, 0x70, 0x2d, 0xf2, 0xc9, 0xfb, 0x08, 0xdb, 0xc9, 0xd1, 0x73, - 0xcc, 0x79, 0x5c, 0xae, 0x55, 0x84, 0x6f, 0x2b, 0xdb, 0xf7, 0x8e, 0x28, 0x79, 0x12, 0x57, 0xb4, - 0x93, 0x02, 0xa9, 0x24, 0x45, 0xae, 0x46, 0x67, 0x00, 0x1c, 0xbd, 0x06, 0x34, 0xd0, 0xb6, 0x07, - 0x39, 0xe3, 0xda, 0x94, 0xd0, 0xb9, 0x9b, 0x73, 0x48, 0x12, 0x2f, 0x88, 0xd6, 0xa2, 0xb4, 0x48, - 0x8d, 0xa5, 0x77, 0x39, 0xfa, 0x00, 0x8b, 0xe3, 0x0a, 0xb4, 0xc7, 0xf6, 0x1c, 0xe2, 0x8b, 0xe4, - 0x70, 0x0d, 0x84, 0xd8, 0xc3, 0x3f, 0x11, 0x1b, 0x14, 0x06, 0xe3, 0xb2, 0x75, 0x96, 0x89, 0xf3, - 0xe2, 0x06, 0xfa, 0x70, 0x63, 0xd8, 0x80, 0x4b, 0x7d, 0x1e, 0xf5, 0x52, 0x5e, 0xab, 0x42, 0xfe, - 0xc1, 0xf9, 0xf2, 0x6b, 0xb2, 0x2e, 0xd3, 0xb3, 0xc6, 0xb2, 0x51, 0x7c, 0x53, 0xad, 0x4c, 0xd4, - 0x8a, 0x9b, 0x6a, 0xa5, 0x58, 0x53, 0x37, 0xd5, 0x8a, 0x5a, 0x2b, 0x19, 0x9f, 0x15, 0x98, 0xcf, - 0x3d, 0x28, 0x34, 0x0b, 0x25, 0xd1, 0x98, 0x98, 0x12, 0xb5, 0x95, 0x2c, 0x50, 0x1d, 0x2a, 0x03, - 0x05, 0x31, 0x67, 0x53, 0xad, 0xe1, 0x1a, 0x69, 0x30, 0xc9, 0x02, 0xfa, 0x16, 0xbb, 0xa1, 0x56, - 0x14, 0x5b, 0x83, 0x25, 0x9a, 0x87, 0x8a, 0xbb, 0xeb, 0x10, 0xdf, 0x26, 0x9e, 0xa6, 0x26, 0x5b, - 0x62, 0xbd, 0xe1, 0xa1, 0x45, 0x00, 0x19, 0xa9, 0x78, 0xb3, 0x24, 0xb4, 0xa6, 0xe4, 0x97, 0x0d, - 0xcf, 0xf8, 0xa2, 0xc0, 0xf5, 0xec, 0x43, 0xfe, 0x8b, 0x06, 0x47, 0xdb, 0x28, 0xa6, 0xdb, 0x78, - 0x09, 0x33, 0x67, 0xb2, 0x27, 0x5a, 0x3d, 0x33, 0x8e, 0x39, 0xd1, 0x1b, 0x8c, 0xf7, 0x58, 0xe6, - 0x8c, 0x1f, 0x0a, 0x34, 0x7e, 0x17, 0x9c, 0x7f, 0x6b, 0x65, 0x1f, 0x16, 0xf2, 0x42, 0x1e, 0x9c, - 0xba, 0xb2, 0x2e, 0x98, 0x71, 0xe9, 0x6f, 0x9e, 0xe5, 0x01, 0x8c, 0x9f, 0x0a, 0xe8, 0xe7, 0x67, - 0xf4, 0x7f, 0x65, 0x8a, 0x41, 0x3d, 0x7f, 0xca, 0x44, 0xc6, 0xaa, 0x2b, 0xf7, 0x2e, 0x34, 0x64, - 0xd2, 0xfd, 0x5c, 0xce, 0x74, 0xad, 0x3e, 0x3e, 0x3c, 0xd6, 0x95, 0xa3, 0x63, 0x5d, 0xf9, 0x7e, - 0xac, 0x2b, 0x1f, 0x4f, 0xf4, 0xc2, 0xd1, 0x89, 0x5e, 0xf8, 0x7a, 0xa2, 0x17, 0x5e, 0xdd, 0xe9, - 0x92, 0x70, 0x37, 0xea, 0x98, 0x2e, 0xed, 0x59, 0xa9, 0x1b, 0xf0, 0x60, 0x78, 0xa7, 0x86, 0x7d, - 0x86, 0x79, 0xa7, 0x2c, 0x6e, 0xc0, 0xfb, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x79, 0x43, 0xa2, - 0x96, 0xeb, 0x07, 0x00, 0x00, + // 695 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0x8d, 0x1b, 0x27, 0x75, 0xbf, 0x14, 0x48, 0x8f, 0x42, 0xdd, 0xd0, 0x9a, 0xd4, 0x08, 0x29, + 0x45, 0x60, 0x4b, 0x01, 0x31, 0x30, 0xb6, 0x40, 0xd5, 0xc2, 0x40, 0x93, 0x56, 0x48, 0x2c, 0xc6, + 0xb1, 0x8f, 0xf4, 0xa0, 0xb1, 0x0f, 0x9f, 0x1d, 0x35, 0x13, 0x7f, 0x81, 0x8d, 0x99, 0x3f, 0xc2, + 0xdc, 0xb1, 0x23, 0x13, 0x42, 0xed, 0xc0, 0x6f, 0x60, 0x43, 0x3e, 0x5f, 0xd2, 0x38, 0xb5, 0x0b, + 0x45, 0x88, 0xc9, 0x3e, 0xdf, 0xfb, 0xde, 0xfb, 0x9e, 0xef, 0x7d, 0x3a, 0xd0, 0xf7, 0xed, 0xbe, + 0xed, 0xe1, 0xd0, 0x8c, 0x9f, 0x26, 0xb5, 0x49, 0x40, 0xbc, 0xae, 0xd9, 0xc5, 0x1e, 0x66, 0x84, + 0x19, 0x34, 0xf0, 0x43, 0x1f, 0xcd, 0x0b, 0x8c, 0x11, 0x3f, 0x0d, 0x81, 0xa9, 0xcd, 0x77, 0xfd, + 0xae, 0xcf, 0x01, 0x66, 0xfc, 0x96, 0x60, 0x6b, 0x2b, 0x99, 0x7c, 0xd4, 0x0e, 0xec, 0x9e, 0xa0, + 0xab, 0xdd, 0xca, 0x84, 0x60, 0xea, 0x3b, 0x7b, 0x96, 0x13, 0x09, 0xd0, 0x6a, 0x0a, 0xf4, 0x86, + 0x1c, 0xd8, 0x21, 0xf1, 0x3d, 0x16, 0xfa, 0x01, 0x1e, 0xad, 0x32, 0xf9, 0x42, 0xd2, 0xc3, 0x41, + 0x82, 0xe3, 0xaf, 0x09, 0x48, 0xdf, 0x86, 0xca, 0x9a, 0xed, 0x76, 0xf1, 0x2e, 0xc3, 0xee, 0x7a, + 0x84, 0x56, 0x61, 0xae, 0x13, 0x2f, 0xad, 0x88, 0x61, 0xd7, 0x72, 0x22, 0xeb, 0x1d, 0x1e, 0xa8, + 0x52, 0x5d, 0x6a, 0xcc, 0xb6, 0x2e, 0x77, 0x4e, 0x71, 0xcf, 0xf0, 0x00, 0x2d, 0xc0, 0xb4, 0x00, + 0xa9, 0x53, 0x75, 0xa9, 0x21, 0xb7, 0xca, 0x11, 0xdf, 0xd3, 0x3f, 0x95, 0x61, 0x76, 0x23, 0xf9, + 0x51, 0xed, 0xd0, 0x0e, 0x31, 0x7a, 0x04, 0xe5, 0xc4, 0x28, 0x67, 0xaa, 0x34, 0x97, 0x8c, 0xac, + 0x1f, 0x67, 0xbc, 0xe0, 0x98, 0x35, 0xf9, 0xf0, 0xdb, 0xcd, 0x42, 0x4b, 0x54, 0xa0, 0x6d, 0xb8, + 0x32, 0xa6, 0xfb, 0x9c, 0xb0, 0x50, 0x2d, 0xd5, 0x8b, 0x8d, 0x4a, 0x73, 0x25, 0x9b, 0x64, 0xcc, + 0x8c, 0x60, 0x9a, 0xac, 0x47, 0x1b, 0xa0, 0xf0, 0x4f, 0x6c, 0xa7, 0xad, 0x96, 0x79, 0x43, 0xb7, + 0xd3, 0x5c, 0xa7, 0xbf, 0xca, 0x18, 0xf7, 0x21, 0xf8, 0x46, 0xc5, 0x68, 0x07, 0x2e, 0xd1, 0xc0, + 0xef, 0x13, 0x17, 0x07, 0xdb, 0x3e, 0x7b, 0xda, 0x56, 0xa7, 0x39, 0x5b, 0x23, 0xcd, 0x96, 0x3a, + 0xa3, 0x2c, 0xc2, 0x34, 0x09, 0x22, 0x70, 0x2d, 0xf2, 0xc8, 0xfb, 0x08, 0x5b, 0xc9, 0xd1, 0x33, + 0xcc, 0x58, 0x5c, 0xae, 0x2a, 0xdc, 0xb7, 0x99, 0xed, 0x7b, 0x97, 0x97, 0x3c, 0x89, 0x2b, 0xda, + 0x49, 0x81, 0x50, 0x12, 0x22, 0x57, 0xa3, 0x33, 0x00, 0x86, 0x5e, 0x03, 0x1a, 0x6a, 0x5b, 0xc3, + 0x9c, 0x31, 0x75, 0x86, 0xeb, 0xdc, 0xcd, 0x39, 0x24, 0x81, 0xe7, 0x44, 0xeb, 0x51, 0x5a, 0xa4, + 0x4a, 0xd3, 0xbb, 0x0c, 0x7d, 0x80, 0xe5, 0x49, 0x05, 0xbf, 0x47, 0xf7, 0x6d, 0xe2, 0xf1, 0xe4, + 0x30, 0x15, 0xb8, 0xd8, 0xc3, 0x3f, 0x11, 0x1b, 0x16, 0x06, 0x93, 0xb2, 0x35, 0x9a, 0x89, 0x73, + 0xe3, 0x06, 0x06, 0x70, 0x63, 0xd4, 0x80, 0xe3, 0x7b, 0x2c, 0xea, 0xa5, 0xbc, 0x56, 0xb8, 0xfc, + 0x83, 0xf3, 0xe5, 0xd7, 0x45, 0x5d, 0xa6, 0x67, 0x95, 0x66, 0xa3, 0xd8, 0x96, 0xac, 0x4c, 0x55, + 0x8b, 0x5b, 0xb2, 0x52, 0xac, 0xca, 0x5b, 0xb2, 0x22, 0x57, 0x4b, 0xfa, 0x67, 0x09, 0x16, 0x73, + 0x0f, 0x0a, 0xcd, 0x43, 0x89, 0x37, 0xc6, 0xa7, 0x44, 0x6e, 0x25, 0x0b, 0x54, 0x03, 0x65, 0xa8, + 0xc0, 0xe7, 0x6c, 0xa6, 0x35, 0x5a, 0x23, 0x15, 0xa6, 0x69, 0xe0, 0xbf, 0xc5, 0x4e, 0xa8, 0x16, + 0xf9, 0xd6, 0x70, 0x89, 0x16, 0x41, 0x71, 0xf6, 0x6c, 0xe2, 0x59, 0xc4, 0x55, 0xe5, 0x64, 0x8b, + 0xaf, 0x37, 0x5d, 0xb4, 0x0c, 0x20, 0x22, 0x15, 0x6f, 0x96, 0xb8, 0xd6, 0x8c, 0xf8, 0xb2, 0xe9, + 0xea, 0x5f, 0x24, 0xb8, 0x9e, 0x7d, 0xc8, 0x7f, 0xd1, 0xe0, 0x78, 0x1b, 0xc5, 0x74, 0x1b, 0x2f, + 0x61, 0xee, 0x4c, 0xf6, 0x78, 0xab, 0x67, 0xc6, 0x31, 0x27, 0x7a, 0xc3, 0xf1, 0x9e, 0xc8, 0x9c, + 0xfe, 0x43, 0x82, 0xfa, 0xef, 0x82, 0xf3, 0x6f, 0xad, 0xf4, 0x61, 0x29, 0x2f, 0xe4, 0xc1, 0xa9, + 0x2b, 0xf3, 0x82, 0x19, 0x17, 0xfe, 0x16, 0x69, 0x1e, 0x40, 0xff, 0x29, 0x81, 0x76, 0x7e, 0x46, + 0xff, 0x57, 0xa6, 0x28, 0xd4, 0xf2, 0xa7, 0x8c, 0x67, 0xac, 0xd2, 0xbc, 0x77, 0xa1, 0x21, 0x13, + 0xee, 0x17, 0x72, 0xa6, 0x6b, 0xed, 0xf1, 0xe1, 0xb1, 0x26, 0x1d, 0x1d, 0x6b, 0xd2, 0xf7, 0x63, + 0x4d, 0xfa, 0x78, 0xa2, 0x15, 0x8e, 0x4e, 0xb4, 0xc2, 0xd7, 0x13, 0xad, 0xf0, 0xea, 0x4e, 0x97, + 0x84, 0x7b, 0x51, 0xc7, 0x70, 0xfc, 0x9e, 0x99, 0xba, 0x01, 0xfb, 0x4d, 0xf3, 0x60, 0x74, 0xad, + 0x86, 0x03, 0x8a, 0x59, 0xa7, 0xcc, 0x2f, 0xc1, 0xfb, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x86, + 0x66, 0xd3, 0x0d, 0xee, 0x07, 0x00, 0x00, } func (m *BadgeUsedCu) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/genesis_test.go b/x/pairing/types/genesis_test.go index 416d467cb9..2dd71894df 100644 --- a/x/pairing/types/genesis_test.go +++ b/x/pairing/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/pairing/types" + "github.com/lavanet/lava/v2/x/pairing/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_freeze_test.go b/x/pairing/types/message_freeze_test.go index e417621ad5..67646efa5c 100644 --- a/x/pairing/types/message_freeze_test.go +++ b/x/pairing/types/message_freeze_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_relay_payment_test.go b/x/pairing/types/message_relay_payment_test.go index 03e5fdb32f..44215c6e07 100644 --- a/x/pairing/types/message_relay_payment_test.go +++ b/x/pairing/types/message_relay_payment_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_stake_provider.go b/x/pairing/types/message_stake_provider.go index 6989909f14..5a9611464c 100644 --- a/x/pairing/types/message_stake_provider.go +++ b/x/pairing/types/message_stake_provider.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" ) const TypeMsgStakeProvider = "stake_provider" diff --git a/x/pairing/types/message_stake_provider_test.go b/x/pairing/types/message_stake_provider_test.go index 2c74cfaed6..7d640194de 100644 --- a/x/pairing/types/message_stake_provider_test.go +++ b/x/pairing/types/message_stake_provider_test.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/testutil/sample" - commontypes "github.com/lavanet/lava/utils/common/types" + "github.com/lavanet/lava/v2/testutil/sample" + commontypes "github.com/lavanet/lava/v2/utils/common/types" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_unfreeze_test.go b/x/pairing/types/message_unfreeze_test.go index 58c267180d..c098047473 100644 --- a/x/pairing/types/message_unfreeze_test.go +++ b/x/pairing/types/message_unfreeze_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/message_unstake_provider_test.go b/x/pairing/types/message_unstake_provider_test.go index 41c6b1d240..99251490b0 100644 --- a/x/pairing/types/message_unstake_provider_test.go +++ b/x/pairing/types/message_unstake_provider_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/pairing/types/pairing_cache.go b/x/pairing/types/pairing_cache.go new file mode 100644 index 0000000000..0ddfc473f8 --- /dev/null +++ b/x/pairing/types/pairing_cache.go @@ -0,0 +1,10 @@ +package types + +import "strconv" + +var PairingRelayCachePrefix = []byte("PairingRelayCache") + +func NewPairingCacheKey(project string, chainID string, epoch uint64) string { + epochStr := strconv.FormatUint(epoch, 10) + return project + " " + chainID + " " + epochStr +} diff --git a/x/pairing/types/params.pb.go b/x/pairing/types/params.pb.go index 9160d26005..fdc176030b 100644 --- a/x/pairing/types/params.pb.go +++ b/x/pairing/types/params.pb.go @@ -84,33 +84,34 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/params.proto", fileDescriptor_fc338fce33b3b67a) } var fileDescriptor_fc338fce33b3b67a = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x8f, 0xd3, 0x30, - 0x14, 0xc7, 0x93, 0xab, 0x2f, 0xe7, 0xe6, 0xee, 0x90, 0x15, 0xdd, 0x50, 0x81, 0x94, 0x1c, 0x41, - 0x82, 0x5b, 0x48, 0x86, 0xdb, 0x6e, 0x23, 0xc0, 0xe2, 0x81, 0x2b, 0x05, 0x09, 0x89, 0xc5, 0x72, - 0x1c, 0x2b, 0x8d, 0xce, 0x8e, 0x23, 0xc7, 0x2d, 0xe4, 0x03, 0xb0, 0x33, 0xc2, 0xc6, 0xc7, 0xe9, - 0xd8, 0x11, 0x31, 0x44, 0xa8, 0xfd, 0x06, 0xfd, 0x04, 0x28, 0x49, 0x05, 0x45, 0x62, 0x60, 0xfa, - 0x67, 0xf8, 0xfd, 0xde, 0xcb, 0x7b, 0x7e, 0xee, 0x43, 0x41, 0x97, 0xb4, 0xe4, 0x26, 0xee, 0x32, - 0xae, 0x68, 0xa1, 0x8b, 0x32, 0x8f, 0x2b, 0xaa, 0xa9, 0xac, 0xa3, 0x4a, 0x2b, 0xa3, 0xbc, 0x8b, - 0x3d, 0x12, 0x75, 0x19, 0xed, 0x91, 0xfb, 0x17, 0xb9, 0xca, 0x55, 0x0f, 0xc4, 0xdd, 0xd7, 0xc0, - 0x86, 0x5f, 0x47, 0xae, 0x33, 0xed, 0x65, 0xef, 0xd6, 0xf5, 0x78, 0xa5, 0xd8, 0x3c, 0x11, 0x8a, - 0xdd, 0xd5, 0xb7, 0x4b, 0xae, 0x05, 0xad, 0x26, 0xf0, 0xd2, 0xbe, 0x02, 0x49, 0xb0, 0x6b, 0x83, - 0x07, 0x0d, 0x95, 0xe2, 0x26, 0xec, 0x19, 0x92, 0xf6, 0x10, 0x51, 0x03, 0x15, 0xce, 0xfe, 0xa1, - 0x7a, 0xa5, 0x3b, 0x7e, 0xad, 0xde, 0xbc, 0xe3, 0x45, 0x3e, 0x37, 0x93, 0xf3, 0x4b, 0xfb, 0x6a, - 0x9c, 0x4c, 0x57, 0x6d, 0x60, 0xfd, 0x68, 0x83, 0xc7, 0x79, 0x61, 0xe6, 0x8b, 0x34, 0x62, 0x4a, - 0xc6, 0x4c, 0xd5, 0x52, 0xd5, 0xfb, 0x78, 0x5a, 0x67, 0x77, 0xb1, 0x69, 0x2a, 0x5e, 0x47, 0x2f, - 0x38, 0xdb, 0xb5, 0x81, 0x3f, 0x74, 0xcd, 0xa8, 0xa1, 0x44, 0x73, 0x51, 0xd0, 0xb4, 0x10, 0x85, - 0x69, 0x88, 0xe6, 0x1f, 0xa8, 0xce, 0xc2, 0xd9, 0x9f, 0x16, 0xde, 0x27, 0xdb, 0x7d, 0xa4, 0x39, - 0x53, 0x52, 0xf2, 0x32, 0xe3, 0xd9, 0xcb, 0xee, 0x8f, 0x5e, 0x2d, 0xe4, 0x5b, 0xf5, 0x5c, 0x09, - 0xc1, 0x99, 0x99, 0xd2, 0x46, 0xf2, 0xd2, 0x4c, 0xee, 0xf5, 0x23, 0x5d, 0xef, 0xda, 0x20, 0x1e, - 0x8a, 0x1f, 0x48, 0x64, 0x18, 0xaf, 0x5c, 0x48, 0x62, 0x14, 0x61, 0x83, 0x48, 0xaa, 0xc1, 0x0c, - 0x67, 0xff, 0x53, 0xff, 0x06, 0x7c, 0xf9, 0x16, 0x58, 0x18, 0x40, 0x1b, 0x1d, 0x61, 0x00, 0x8f, - 0xd0, 0x08, 0x03, 0x38, 0x42, 0x00, 0x03, 0x08, 0xd0, 0x31, 0x06, 0xf0, 0x18, 0x39, 0x18, 0x40, - 0x07, 0x9d, 0x60, 0x00, 0x4f, 0x10, 0xc4, 0x00, 0x8e, 0x91, 0x8b, 0x01, 0x74, 0xd1, 0x29, 0x06, - 0xf0, 0x14, 0x9d, 0x61, 0x00, 0xcf, 0xd0, 0x79, 0xf2, 0x6c, 0xb5, 0xf1, 0xed, 0xf5, 0xc6, 0xb7, - 0x7f, 0x6e, 0x7c, 0xfb, 0xf3, 0xd6, 0xb7, 0xd6, 0x5b, 0xdf, 0xfa, 0xbe, 0xf5, 0xad, 0xf7, 0x4f, - 0x0e, 0xd6, 0xf7, 0xd7, 0x3d, 0x7c, 0xfc, 0x7d, 0x11, 0xfd, 0x0e, 0x53, 0xa7, 0x7f, 0xe5, 0xeb, - 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xf4, 0x67, 0x9e, 0x36, 0x02, 0x00, 0x00, + // 417 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x6f, 0xd4, 0x30, + 0x14, 0xc7, 0x93, 0x9e, 0x7b, 0xf5, 0xa5, 0x2d, 0xb2, 0xa2, 0x0e, 0x27, 0x90, 0x92, 0x12, 0x24, + 0x54, 0x21, 0x11, 0x4b, 0x74, 0xeb, 0x18, 0xca, 0xe2, 0x81, 0x1e, 0x07, 0x12, 0x12, 0x8b, 0xe5, + 0x38, 0x56, 0x2e, 0xaa, 0x1d, 0x47, 0x8e, 0xef, 0x20, 0x1f, 0x80, 0x9d, 0x11, 0x36, 0x3e, 0x4e, + 0xc7, 0x8e, 0x88, 0x21, 0x42, 0x77, 0xdf, 0xe0, 0x3e, 0x01, 0x4a, 0x72, 0x82, 0x22, 0x31, 0x74, + 0xfa, 0x67, 0xf8, 0xfd, 0xde, 0xcb, 0x7b, 0x7e, 0xde, 0x63, 0xc9, 0x56, 0xac, 0x14, 0x16, 0x77, + 0x89, 0x2b, 0x56, 0x98, 0xa2, 0xcc, 0x71, 0xc5, 0x0c, 0x53, 0x75, 0x5c, 0x19, 0x6d, 0xb5, 0x7f, + 0xb2, 0x43, 0xe2, 0x2e, 0xe3, 0x1d, 0xf2, 0xf0, 0x24, 0xd7, 0xb9, 0xee, 0x01, 0xdc, 0x7d, 0x0d, + 0x6c, 0xf4, 0x6d, 0xe4, 0x8d, 0x67, 0xbd, 0xec, 0x5f, 0x79, 0xbe, 0xa8, 0x34, 0x5f, 0x24, 0x52, + 0xf3, 0xeb, 0xfa, 0x6a, 0x25, 0x8c, 0x64, 0xd5, 0x14, 0x9e, 0xba, 0x67, 0x20, 0x09, 0xb7, 0x6d, + 0xf8, 0xa8, 0x61, 0x4a, 0x5e, 0x44, 0x3d, 0x43, 0xd3, 0x1e, 0xa2, 0x7a, 0xa0, 0xa2, 0xf9, 0x7f, + 0x54, 0xbf, 0xf4, 0x26, 0x6f, 0xf4, 0xdb, 0xf7, 0xa2, 0xc8, 0x17, 0x76, 0x7a, 0x7c, 0xea, 0x9e, + 0x4d, 0x92, 0xd9, 0x4d, 0x1b, 0x3a, 0x3f, 0xdb, 0xf0, 0x69, 0x5e, 0xd8, 0xc5, 0x32, 0x8d, 0xb9, + 0x56, 0x98, 0xeb, 0x5a, 0xe9, 0x7a, 0x17, 0xcf, 0xeb, 0xec, 0x1a, 0xdb, 0xa6, 0x12, 0x75, 0x7c, + 0x29, 0xf8, 0xb6, 0x0d, 0x83, 0xa1, 0x6b, 0xc6, 0x2c, 0xa3, 0x46, 0xc8, 0x82, 0xa5, 0x85, 0x2c, + 0x6c, 0x43, 0x8d, 0xf8, 0xc8, 0x4c, 0x16, 0xcd, 0xff, 0xb6, 0xf0, 0x3f, 0xbb, 0xde, 0x13, 0x23, + 0xb8, 0x56, 0x4a, 0x94, 0x99, 0xc8, 0x5e, 0x75, 0x7f, 0xf4, 0x7a, 0xa9, 0xde, 0xe9, 0x97, 0x5a, + 0x4a, 0xc1, 0xed, 0x8c, 0x35, 0x4a, 0x94, 0x76, 0xfa, 0xa0, 0x1f, 0xe9, 0x7c, 0xdb, 0x86, 0x78, + 0x28, 0x7e, 0x47, 0xa2, 0xc3, 0x78, 0xe5, 0x52, 0x51, 0xab, 0x29, 0x1f, 0x44, 0x5a, 0x0d, 0x66, + 0x34, 0xbf, 0x4f, 0xfd, 0x0b, 0xf0, 0xf5, 0x7b, 0xe8, 0x10, 0x00, 0x5d, 0xb4, 0x47, 0x00, 0xdc, + 0x43, 0x23, 0x02, 0xe0, 0x08, 0x01, 0x02, 0x20, 0x40, 0xfb, 0x04, 0xc0, 0x7d, 0x34, 0x26, 0x00, + 0x8e, 0xd1, 0x01, 0x01, 0xf0, 0x00, 0x41, 0x02, 0xe0, 0x04, 0x79, 0x04, 0x40, 0x0f, 0x1d, 0x12, + 0x00, 0x0f, 0xd1, 0x11, 0x01, 0xf0, 0x08, 0x1d, 0x27, 0x97, 0x37, 0xeb, 0xc0, 0xbd, 0x5d, 0x07, + 0xee, 0xaf, 0x75, 0xe0, 0x7e, 0xd9, 0x04, 0xce, 0xed, 0x26, 0x70, 0x7e, 0x6c, 0x02, 0xe7, 0xc3, + 0xb3, 0x3b, 0xeb, 0xfb, 0xe7, 0x1e, 0x56, 0x2f, 0xf0, 0xa7, 0x3f, 0x47, 0xd1, 0xaf, 0x31, 0x1d, + 0xf7, 0x0f, 0x7d, 0xfe, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xda, 0x74, 0x98, 0x39, 0x02, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/pairing/types/query.pb.go b/x/pairing/types/query.pb.go index 38633bfaaf..f03473e840 100644 --- a/x/pairing/types/query.pb.go +++ b/x/pairing/types/query.pb.go @@ -11,12 +11,12 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - v1 "github.com/lavanet/lava/x/downtime/v1" - types "github.com/lavanet/lava/x/epochstorage/types" - types1 "github.com/lavanet/lava/x/plans/types" - _ "github.com/lavanet/lava/x/projects/types" - types2 "github.com/lavanet/lava/x/spec/types" - _ "github.com/lavanet/lava/x/subscription/types" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" + types "github.com/lavanet/lava/v2/x/epochstorage/types" + types1 "github.com/lavanet/lava/v2/x/plans/types" + _ "github.com/lavanet/lava/v2/x/projects/types" + types2 "github.com/lavanet/lava/v2/x/spec/types" + _ "github.com/lavanet/lava/v2/x/subscription/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -1578,120 +1578,120 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/query.proto", fileDescriptor_9e149ce9d21da0d8) } var fileDescriptor_9e149ce9d21da0d8 = []byte{ - // 1804 bytes of a gzipped FileDescriptorProto + // 1806 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0xdc, 0xc6, 0x15, 0x17, 0x57, 0xab, 0xb5, 0xf4, 0xf4, 0xc7, 0xc6, 0x44, 0xb2, 0xa5, 0xad, 0xb2, 0x5a, 0x53, - 0xf9, 0x23, 0x59, 0xce, 0x32, 0xda, 0xc4, 0x89, 0xa1, 0x28, 0x6e, 0x23, 0xc9, 0x31, 0xa4, 0xaa, + 0x49, 0xaa, 0x3f, 0xce, 0x32, 0xda, 0xc4, 0x89, 0xa1, 0x28, 0x6e, 0x2b, 0xc9, 0x31, 0xa4, 0xaa, 0x8d, 0x44, 0xd5, 0x3d, 0x04, 0x05, 0x08, 0x8a, 0x9c, 0x5d, 0x31, 0xe2, 0x72, 0x18, 0x72, 0xb8, 0x96, 0x2a, 0x6c, 0x0b, 0xb4, 0x5f, 0xa0, 0x40, 0xdb, 0x43, 0x4f, 0xbd, 0x04, 0xe8, 0x29, 0xdf, - 0xa0, 0xb7, 0x02, 0x45, 0x0e, 0x3d, 0x18, 0xe8, 0xa5, 0x28, 0x0a, 0xa3, 0xb0, 0x7b, 0x2e, 0xd0, + 0xa0, 0xb7, 0x02, 0x45, 0x0e, 0x3d, 0x18, 0xe8, 0xa5, 0x28, 0x8a, 0xa0, 0xb0, 0x7b, 0x2e, 0xd0, 0x6f, 0x50, 0x70, 0x66, 0xc8, 0x25, 0x57, 0x5c, 0xee, 0xca, 0xf6, 0x45, 0xda, 0x19, 0xbe, 0xdf, 0xcc, 0xef, 0xbd, 0x79, 0xef, 0xcd, 0x8f, 0x84, 0xaa, 0xad, 0xb7, 0x75, 0x07, 0x53, 0x25, 0xfc, - 0xaf, 0xb8, 0xba, 0xe5, 0x59, 0x4e, 0x53, 0xf9, 0x3a, 0xc0, 0xde, 0x79, 0xcd, 0xf5, 0x08, 0x25, + 0xaf, 0xb8, 0xba, 0xe5, 0x59, 0x4e, 0x53, 0xf9, 0x32, 0xc0, 0xde, 0x45, 0xcd, 0xf5, 0x08, 0x25, 0x68, 0x56, 0x58, 0xd4, 0xc2, 0xff, 0x35, 0x61, 0x51, 0x9e, 0x6d, 0x92, 0x26, 0x61, 0x06, 0x4a, 0xf8, 0x8b, 0xdb, 0x96, 0x17, 0x9b, 0x84, 0x34, 0x6d, 0xac, 0xe8, 0xae, 0xa5, 0xe8, 0x8e, 0x43, - 0xa8, 0x4e, 0x2d, 0xe2, 0xf8, 0xe2, 0xe9, 0x1d, 0x83, 0xf8, 0x2d, 0xe2, 0x2b, 0xc7, 0xba, 0x8f, - 0xf9, 0x16, 0x4a, 0x7b, 0xfd, 0x18, 0x53, 0x7d, 0x5d, 0x71, 0xf5, 0xa6, 0xe5, 0x30, 0x63, 0x61, - 0x7b, 0x3b, 0x93, 0x97, 0xab, 0x7b, 0x7a, 0x2b, 0x5a, 0x6e, 0x31, 0x65, 0xe2, 0xbb, 0xd8, 0x60, - 0x7f, 0xc4, 0xd3, 0xa5, 0xf4, 0x02, 0xb6, 0xee, 0xf8, 0x8a, 0x4b, 0x6c, 0xcb, 0x10, 0x7e, 0x95, - 0xd7, 0x52, 0x06, 0xd8, 0x25, 0xc6, 0x89, 0x4f, 0x89, 0xa7, 0x37, 0xb1, 0xe2, 0x53, 0xfd, 0x14, - 0x6b, 0xd8, 0xa1, 0x51, 0x10, 0xca, 0x77, 0xd3, 0x7b, 0x05, 0xc7, 0xbe, 0xe1, 0x59, 0x6e, 0xc8, - 0x37, 0x35, 0x10, 0xd6, 0xcb, 0xe9, 0xbd, 0x3d, 0xf2, 0x15, 0x36, 0xa8, 0x1f, 0xfd, 0x10, 0x46, - 0xef, 0xa6, 0x8c, 0x4c, 0xf2, 0xc4, 0xa1, 0x56, 0x0b, 0x2b, 0xed, 0xf5, 0xf8, 0x37, 0x37, 0x94, - 0x67, 0x01, 0x1d, 0x86, 0xc1, 0x3a, 0x60, 0xce, 0xab, 0xf8, 0xeb, 0x00, 0xfb, 0x54, 0x3e, 0x84, - 0x37, 0x52, 0xb3, 0xbe, 0x4b, 0x1c, 0x1f, 0xa3, 0x0d, 0x28, 0xf1, 0x20, 0xcd, 0x4b, 0x55, 0x69, - 0x65, 0xb2, 0xbe, 0x58, 0xcb, 0x3a, 0xbe, 0x1a, 0x47, 0x6d, 0x15, 0xbf, 0x7b, 0xb6, 0x34, 0xa2, - 0x0a, 0x84, 0x7c, 0x08, 0x73, 0x7c, 0x49, 0x8f, 0xb4, 0x2d, 0x13, 0x7b, 0xd1, 0x5e, 0x68, 0x1e, - 0xae, 0x19, 0x27, 0xba, 0xe5, 0xec, 0xee, 0xb0, 0x55, 0x27, 0xd4, 0x68, 0x88, 0x2a, 0x00, 0xfe, - 0x09, 0x79, 0xf2, 0xb9, 0x47, 0x7e, 0x8e, 0x9d, 0xf9, 0x42, 0x55, 0x5a, 0x19, 0x57, 0x13, 0x33, - 0xf2, 0x29, 0xdc, 0xec, 0x5d, 0x52, 0x10, 0xfd, 0x21, 0x00, 0x0b, 0xf3, 0xc3, 0x30, 0xca, 0xf3, - 0x52, 0x75, 0x74, 0x65, 0xb2, 0xfe, 0x76, 0x9a, 0x6c, 0xf2, 0x4c, 0x6a, 0x47, 0xb1, 0xb1, 0x60, - 0x9d, 0x80, 0xef, 0x15, 0xc7, 0x0b, 0x37, 0x46, 0xe5, 0x3d, 0x98, 0x4d, 0x6d, 0x96, 0xa0, 0xaf, - 0x9b, 0xa6, 0x87, 0x7d, 0x3f, 0xa2, 0x2f, 0x86, 0x49, 0xc7, 0x0a, 0x29, 0xc7, 0xe4, 0x93, 0x9e, - 0x58, 0xc4, 0xbc, 0xbf, 0x80, 0xa9, 0x78, 0x63, 0x0b, 0xfb, 0x2f, 0xc3, 0x3c, 0xb5, 0x80, 0xbc, - 0x27, 0x42, 0xf4, 0x08, 0xd3, 0x03, 0x7e, 0x3a, 0x83, 0xc3, 0x7e, 0x13, 0x4a, 0x86, 0x6d, 0x61, - 0x87, 0x0a, 0xda, 0x62, 0x24, 0x7f, 0x5b, 0x80, 0x5b, 0x97, 0x16, 0x13, 0xc4, 0x77, 0x61, 0xc2, - 0x8d, 0x4e, 0xe1, 0x65, 0x58, 0x77, 0xd1, 0x68, 0x19, 0xa6, 0x8d, 0xc0, 0xf3, 0xb0, 0x43, 0x35, - 0x86, 0x61, 0x2c, 0x8a, 0xea, 0x94, 0x98, 0x7c, 0x18, 0xce, 0xa1, 0xfb, 0xb0, 0x10, 0x26, 0xb1, - 0x66, 0xe3, 0x06, 0xd5, 0x28, 0xd1, 0x1c, 0x7c, 0x46, 0x35, 0x91, 0x7f, 0xf3, 0xa3, 0x0c, 0x30, - 0x17, 0x1a, 0xec, 0xe3, 0x06, 0xfd, 0x09, 0xf9, 0x31, 0x3e, 0x8b, 0x18, 0xa3, 0x7b, 0x70, 0x2b, - 0x2c, 0x64, 0xcd, 0xd6, 0x7d, 0xaa, 0x05, 0xae, 0xa9, 0x53, 0x6c, 0x6a, 0xc7, 0x36, 0x31, 0x4e, - 0xe7, 0x8b, 0x0c, 0x37, 0x1b, 0x3e, 0xde, 0xd7, 0x7d, 0xfa, 0x98, 0x3f, 0xdc, 0x0a, 0x9f, 0xa1, - 0x75, 0x98, 0x63, 0x46, 0x1a, 0x69, 0xa4, 0x37, 0x1b, 0x63, 0x20, 0xc4, 0x1e, 0x7e, 0xd1, 0x48, - 0xec, 0x24, 0xff, 0x12, 0x16, 0x58, 0xb8, 0x7e, 0x8a, 0x3d, 0xab, 0x71, 0xfe, 0xaa, 0xe1, 0x47, - 0x65, 0x18, 0x8f, 0x82, 0xc4, 0x3c, 0x9c, 0x50, 0xe3, 0x31, 0x9a, 0x85, 0xb1, 0xa4, 0x0b, 0x7c, - 0x20, 0x7f, 0x23, 0x41, 0x39, 0x8b, 0x81, 0x38, 0xb3, 0x59, 0x18, 0x6b, 0xeb, 0xb6, 0x65, 0x32, - 0x02, 0xe3, 0x2a, 0x1f, 0xa0, 0x55, 0xb8, 0x11, 0xba, 0x86, 0x4d, 0xad, 0x7b, 0xa0, 0x3c, 0xa0, - 0xd7, 0xf9, 0x7c, 0x5c, 0x6d, 0xa8, 0x0a, 0x53, 0x46, 0xa0, 0xb9, 0xd8, 0x13, 0x07, 0xc5, 0x37, - 0x07, 0x23, 0x38, 0xc0, 0x1e, 0x3f, 0xa6, 0x37, 0x01, 0x44, 0x5f, 0xd2, 0x2c, 0x93, 0x85, 0x6a, - 0x82, 0x1d, 0x75, 0x38, 0xb3, 0x6b, 0x8a, 0xca, 0xfa, 0xbd, 0x04, 0xb7, 0x53, 0xe5, 0x20, 0x88, - 0x6e, 0x9f, 0xe8, 0x8e, 0x81, 0xa3, 0x80, 0x25, 0xdd, 0x97, 0x7a, 0xdc, 0xef, 0x5b, 0x69, 0xa8, - 0x0a, 0x93, 0x4d, 0x4c, 0x6c, 0x62, 0xb0, 0xf6, 0xcf, 0x1c, 0x19, 0x53, 0x93, 0x53, 0x0c, 0x6b, - 0x07, 0x3e, 0xc5, 0x1e, 0xe3, 0x1f, 0x62, 0xf9, 0x50, 0xb6, 0x41, 0xce, 0xa3, 0x25, 0xa2, 0xf8, - 0x39, 0x94, 0x0c, 0x36, 0xc3, 0x59, 0x6d, 0xd5, 0xc2, 0x7c, 0xfe, 0xe7, 0xb3, 0xa5, 0x77, 0x9a, - 0x16, 0x3d, 0x09, 0x8e, 0x6b, 0x06, 0x69, 0x29, 0xe2, 0x6a, 0xe2, 0xff, 0xde, 0xf3, 0xcd, 0x53, - 0x85, 0x9e, 0xbb, 0xd8, 0xaf, 0xed, 0x60, 0x43, 0x15, 0x68, 0x59, 0x17, 0x3d, 0xe1, 0xb1, 0x8f, - 0x3d, 0x56, 0x19, 0xaf, 0xd0, 0x60, 0xba, 0xf9, 0x30, 0x9a, 0xcc, 0x87, 0x27, 0xa2, 0x19, 0x24, - 0xb6, 0x10, 0x4e, 0x3c, 0x82, 0x71, 0x83, 0x38, 0x7e, 0xd0, 0x12, 0xc1, 0xbd, 0x62, 0xf5, 0xc6, - 0xe0, 0x70, 0xe3, 0x96, 0x7e, 0xb6, 0xfd, 0x58, 0x14, 0x2d, 0x1f, 0xc8, 0x9f, 0xc0, 0x12, 0xdb, - 0xf8, 0x28, 0xbc, 0xb2, 0x8d, 0x38, 0x81, 0xf6, 0x2d, 0x9f, 0x0e, 0xac, 0x07, 0xb9, 0x05, 0xd5, - 0xfe, 0xe0, 0xd7, 0xde, 0x7e, 0xe4, 0x43, 0xf8, 0x1e, 0xdb, 0xee, 0x61, 0xa3, 0x81, 0x0d, 0x6a, - 0xb5, 0xf1, 0x01, 0xbb, 0xd7, 0x13, 0x69, 0x98, 0x8a, 0xd4, 0x44, 0xc2, 0xf9, 0x9b, 0x50, 0x0a, - 0x7b, 0x47, 0x7c, 0x1c, 0x62, 0x14, 0x26, 0xf8, 0x62, 0xf6, 0x9a, 0x82, 0x7e, 0x1d, 0x4a, 0x5c, - 0x3d, 0x88, 0xe0, 0x97, 0x7b, 0xee, 0xd5, 0x50, 0x5f, 0xd4, 0x04, 0x46, 0x58, 0xa2, 0xcf, 0x60, - 0xc6, 0xc5, 0x8e, 0x69, 0x39, 0x4d, 0x4d, 0x60, 0x0b, 0x03, 0xb1, 0xd3, 0x02, 0xc1, 0x87, 0xf2, - 0xff, 0x24, 0xd1, 0xd0, 0x8f, 0xcc, 0xd3, 0xde, 0xe6, 0xf0, 0x08, 0xae, 0x45, 0x1d, 0x8e, 0x73, - 0x7a, 0x2f, 0xfb, 0xae, 0xef, 0x73, 0x21, 0xa8, 0x11, 0x1a, 0xcd, 0x41, 0xa9, 0xa5, 0x9f, 0x69, - 0x46, 0x90, 0x4c, 0x89, 0x00, 0xad, 0x41, 0x31, 0x8c, 0x0e, 0x4b, 0xd0, 0xc9, 0xfa, 0xad, 0xf4, - 0xe2, 0x4c, 0x69, 0x1d, 0xb9, 0xd8, 0x50, 0x99, 0x11, 0xda, 0x85, 0xeb, 0x91, 0x6c, 0xd1, 0x84, - 0x00, 0x29, 0x32, 0x5c, 0x35, 0x8d, 0x8b, 0xb5, 0x4d, 0x7b, 0x5d, 0x88, 0x10, 0x75, 0x26, 0x9a, - 0xe3, 0x63, 0xf9, 0xfb, 0x3d, 0xbd, 0xe6, 0x47, 0xc4, 0xa1, 0x27, 0xf6, 0xf9, 0x81, 0x7e, 0x4e, - 0x02, 0x3a, 0x44, 0xaf, 0x91, 0x4f, 0x01, 0x1d, 0x25, 0x44, 0x19, 0x07, 0x22, 0x19, 0xa6, 0x92, - 0x52, 0x4d, 0xa0, 0x52, 0x73, 0x68, 0x01, 0xc6, 0x59, 0x4e, 0x87, 0xad, 0x30, 0x55, 0xaf, 0x66, - 0x98, 0x39, 0x7a, 0x8b, 0x04, 0x0e, 0x15, 0x05, 0x2b, 0x46, 0xf2, 0x2f, 0x7a, 0x5a, 0x50, 0x0f, - 0xdb, 0x6e, 0x23, 0xa7, 0x84, 0xea, 0x36, 0xdb, 0xb5, 0xa8, 0xf2, 0x01, 0xda, 0x82, 0x6b, 0x26, - 0xa6, 0xba, 0x65, 0xfb, 0xf3, 0x05, 0x56, 0x11, 0x2b, 0xd9, 0x27, 0x78, 0xd9, 0x1b, 0x35, 0x02, - 0xca, 0x3b, 0x30, 0xd3, 0xed, 0x7e, 0xcc, 0xd1, 0xbc, 0x36, 0xdc, 0xf5, 0xa2, 0x90, 0xf2, 0xe2, - 0x2b, 0x98, 0xde, 0xe6, 0xc5, 0x2c, 0x16, 0x49, 0x46, 0x42, 0x4a, 0x47, 0xe2, 0x41, 0x98, 0x77, - 0xa1, 0x51, 0xc4, 0xfa, 0xad, 0x3e, 0x1a, 0x33, 0x45, 0x4b, 0x8d, 0x40, 0xf2, 0x36, 0xbc, 0xcd, - 0x53, 0x3a, 0xe1, 0x55, 0xbf, 0x33, 0xee, 0x57, 0xc8, 0x72, 0x07, 0xde, 0x19, 0xb4, 0x48, 0x6e, - 0xe8, 0x3f, 0xed, 0x0d, 0xfd, 0x72, 0xb6, 0x13, 0xa9, 0xa8, 0x74, 0xa3, 0x5e, 0x11, 0xed, 0x22, - 0xee, 0x75, 0xec, 0x32, 0xdd, 0x0e, 0x22, 0x75, 0xae, 0xc1, 0x9b, 0x7d, 0x9e, 0x0b, 0x56, 0x0f, - 0xa0, 0x68, 0x39, 0x0d, 0x22, 0x3a, 0xe1, 0x80, 0x08, 0x6e, 0x07, 0xbb, 0x4e, 0x83, 0x88, 0x46, - 0xc8, 0x70, 0xf2, 0x66, 0xf7, 0xd8, 0xf9, 0xd3, 0xdc, 0x63, 0x9f, 0x81, 0x42, 0x5c, 0xdd, 0x05, - 0x23, 0xa8, 0x3f, 0x45, 0x30, 0xc6, 0xf8, 0xa1, 0x5f, 0x4b, 0x50, 0xe2, 0x75, 0x87, 0x56, 0x72, - 0xda, 0x47, 0xea, 0xdd, 0xa3, 0xbc, 0x3a, 0x84, 0x25, 0xf7, 0x53, 0x7e, 0xeb, 0x57, 0x7f, 0xff, - 0xcf, 0x6f, 0x0b, 0x15, 0xb4, 0xa8, 0xe4, 0xbc, 0xd0, 0xa1, 0x3f, 0x48, 0x30, 0xd1, 0x15, 0x2d, - 0x6b, 0x79, 0xcb, 0xf7, 0xbc, 0x9b, 0x94, 0xef, 0x0e, 0x67, 0x2c, 0xe8, 0xac, 0x33, 0x3a, 0x6b, - 0x68, 0xb5, 0x0f, 0x9d, 0x08, 0xa0, 0x5c, 0x88, 0xbb, 0xad, 0x83, 0xfe, 0x28, 0xc1, 0x78, 0xb4, - 0x10, 0xba, 0x33, 0xc4, 0x6e, 0x11, 0xb3, 0xb5, 0xa1, 0x6c, 0x05, 0xb1, 0x0d, 0x46, 0xec, 0x43, - 0x54, 0xcf, 0x27, 0xa6, 0x5c, 0x08, 0x65, 0xd1, 0x49, 0x30, 0xfc, 0x93, 0x04, 0xd0, 0xed, 0xef, - 0xe8, 0xee, 0x90, 0xd7, 0x00, 0x67, 0x79, 0xb5, 0x4b, 0x43, 0xde, 0x64, 0x3c, 0x3f, 0x42, 0x1f, - 0x66, 0xf3, 0x6c, 0xe2, 0x58, 0x76, 0x77, 0x09, 0x2a, 0x17, 0x5c, 0x1f, 0x77, 0xd0, 0x5f, 0x25, - 0x98, 0x4e, 0x29, 0x5d, 0xa4, 0xe4, 0x6c, 0x9f, 0xa5, 0xca, 0xcb, 0xef, 0x0f, 0x0f, 0x10, 0x94, - 0x55, 0x46, 0x79, 0x1f, 0xed, 0x65, 0x53, 0x6e, 0x33, 0x50, 0x0e, 0x6b, 0xe5, 0x22, 0x8a, 0x7e, - 0x47, 0xb9, 0x60, 0x32, 0xad, 0x83, 0xfe, 0x2b, 0xc1, 0x5c, 0xa6, 0xe8, 0x44, 0x1f, 0x0f, 0x71, - 0xea, 0x59, 0xea, 0xb9, 0x7c, 0xff, 0xea, 0x40, 0xe1, 0xe0, 0x31, 0x73, 0xf0, 0x67, 0xe8, 0xcb, - 0xfc, 0xdc, 0x89, 0x5c, 0xd4, 0xb8, 0x9c, 0x4d, 0xb9, 0xd5, 0x75, 0x3a, 0x21, 0xbc, 0x59, 0x08, - 0x98, 0xd0, 0xee, 0xa0, 0x6f, 0x24, 0x98, 0x88, 0x45, 0x69, 0x6e, 0x85, 0xf6, 0xaa, 0xe3, 0xdc, - 0x0a, 0xbd, 0xa4, 0x73, 0x07, 0x25, 0x58, 0xe0, 0x87, 0xef, 0x32, 0x21, 0x22, 0xb3, 0x14, 0xfe, - 0x22, 0xc1, 0x1b, 0x19, 0x2a, 0x14, 0xdd, 0xcb, 0xe1, 0xd0, 0x5f, 0xf2, 0x96, 0x3f, 0xba, 0x2a, - 0x4c, 0x38, 0xf1, 0x29, 0x73, 0xe2, 0x63, 0x74, 0x2f, 0xdb, 0x09, 0x9f, 0x41, 0xbb, 0x6f, 0x6f, - 0x9a, 0x6d, 0xf9, 0x34, 0xe1, 0xc5, 0x9f, 0x25, 0xb8, 0xde, 0x23, 0x44, 0xd1, 0x7a, 0x0e, 0x95, - 0x6c, 0x21, 0x5c, 0xae, 0x5f, 0x05, 0x22, 0x98, 0x6f, 0x31, 0xe6, 0x9b, 0x68, 0x23, 0x9b, 0x39, - 0x8e, 0x60, 0x42, 0xd1, 0x2a, 0x17, 0xd1, 0x8d, 0xdc, 0x51, 0x2e, 0xb8, 0x96, 0xee, 0xa0, 0xbf, - 0x25, 0x8a, 0x23, 0x75, 0x27, 0x0f, 0x55, 0x1c, 0x59, 0x52, 0x60, 0xa8, 0xe2, 0xc8, 0xbc, 0xfe, - 0xe5, 0x1f, 0x30, 0x87, 0x36, 0xd0, 0xfd, 0x01, 0xc5, 0xd1, 0xe2, 0x68, 0x8d, 0xab, 0x94, 0x44, - 0x71, 0xa0, 0x7f, 0x49, 0xb0, 0xd0, 0x57, 0x66, 0xa0, 0x4f, 0xf2, 0x52, 0x64, 0x80, 0xc2, 0x29, - 0x6f, 0xbe, 0x1c, 0x58, 0xb8, 0xb6, 0xc3, 0x5c, 0x7b, 0x80, 0x36, 0xfb, 0x64, 0x59, 0x62, 0x81, - 0x4b, 0xee, 0xc5, 0xc7, 0x86, 0x7e, 0x27, 0x01, 0x74, 0xdf, 0x2e, 0x5e, 0xe3, 0xed, 0x71, 0xf9, - 0x95, 0x45, 0x5e, 0x65, 0x8c, 0x97, 0xd1, 0xed, 0x3e, 0x8c, 0xcd, 0xd3, 0xa8, 0x49, 0xa1, 0x6f, - 0x25, 0xb8, 0xd1, 0xab, 0x9e, 0x50, 0x7d, 0x98, 0xcb, 0x3e, 0x2d, 0xc5, 0xca, 0x1f, 0x5c, 0x09, - 0x23, 0x88, 0xbe, 0xcf, 0x88, 0xde, 0x41, 0x2b, 0x03, 0x74, 0x02, 0xff, 0xac, 0xa2, 0x19, 0xc1, - 0xd6, 0x67, 0xdf, 0x3d, 0xaf, 0x48, 0x4f, 0x9f, 0x57, 0xa4, 0x7f, 0x3f, 0xaf, 0x48, 0xbf, 0x79, - 0x51, 0x19, 0x79, 0xfa, 0xa2, 0x32, 0xf2, 0x8f, 0x17, 0x95, 0x91, 0x2f, 0xdf, 0x4d, 0x7c, 0x66, - 0x48, 0xad, 0x76, 0x16, 0xaf, 0xc7, 0xbe, 0x35, 0x1c, 0x97, 0xd8, 0xf7, 0xde, 0x0f, 0xfe, 0x1f, - 0x00, 0x00, 0xff, 0xff, 0x33, 0x48, 0x68, 0x79, 0x94, 0x17, 0x00, 0x00, + 0xa8, 0x4e, 0x2d, 0xe2, 0xf8, 0xe2, 0xe9, 0x9a, 0x41, 0xfc, 0x16, 0xf1, 0x95, 0x13, 0xdd, 0xc7, + 0x7c, 0x0b, 0xa5, 0xbd, 0x71, 0x82, 0xa9, 0xbe, 0xa1, 0xb8, 0x7a, 0xd3, 0x72, 0x98, 0xb1, 0xb0, + 0xbd, 0x9b, 0xc9, 0xcb, 0xd5, 0x3d, 0xbd, 0x15, 0x2d, 0xb7, 0x98, 0x32, 0xf1, 0x5d, 0x6c, 0xb0, + 0x3f, 0xe2, 0xe9, 0x52, 0x7a, 0x01, 0x5b, 0x77, 0x7c, 0xc5, 0x25, 0xb6, 0x65, 0x08, 0xbf, 0xca, + 0xeb, 0x29, 0x03, 0xec, 0x12, 0xe3, 0xd4, 0xa7, 0xc4, 0xd3, 0x9b, 0x58, 0xf1, 0xa9, 0x7e, 0x86, + 0x35, 0xec, 0xd0, 0x28, 0x08, 0xe5, 0x7b, 0xe9, 0xbd, 0x82, 0x13, 0xdf, 0xf0, 0x2c, 0x37, 0xe4, + 0x9b, 0x1a, 0x08, 0xeb, 0xe5, 0xf4, 0xde, 0x1e, 0xf9, 0x02, 0x1b, 0xd4, 0x8f, 0x7e, 0x08, 0xa3, + 0xef, 0xa6, 0x8c, 0x4c, 0xf2, 0xd4, 0xa1, 0x56, 0x0b, 0x2b, 0xed, 0x8d, 0xf8, 0x37, 0x37, 0x94, + 0x67, 0x01, 0x1d, 0x85, 0xc1, 0x3a, 0x64, 0xce, 0xab, 0xf8, 0xcb, 0x00, 0xfb, 0x54, 0x3e, 0x82, + 0x37, 0x52, 0xb3, 0xbe, 0x4b, 0x1c, 0x1f, 0xa3, 0x4d, 0x28, 0xf1, 0x20, 0xcd, 0x4b, 0x55, 0x69, + 0x65, 0xb2, 0xbe, 0x58, 0xcb, 0x3a, 0xbe, 0x1a, 0x47, 0x6d, 0x17, 0xbf, 0xf9, 0x76, 0x69, 0x44, + 0x15, 0x08, 0xf9, 0x08, 0xe6, 0xf8, 0x92, 0x1e, 0x69, 0x5b, 0x26, 0xf6, 0xa2, 0xbd, 0xd0, 0x3c, + 0xdc, 0x30, 0x4e, 0x75, 0xcb, 0xd9, 0xdb, 0x65, 0xab, 0x4e, 0xa8, 0xd1, 0x10, 0x55, 0x00, 0xfc, + 0x53, 0xf2, 0xf4, 0x53, 0x8f, 0xfc, 0x1c, 0x3b, 0xf3, 0x85, 0xaa, 0xb4, 0x32, 0xae, 0x26, 0x66, + 0xe4, 0x33, 0xb8, 0xdd, 0xbb, 0xa4, 0x20, 0xfa, 0x43, 0x00, 0x16, 0xe6, 0x47, 0x61, 0x94, 0xe7, + 0xa5, 0xea, 0xe8, 0xca, 0x64, 0xfd, 0xed, 0x34, 0xd9, 0xe4, 0x99, 0xd4, 0x8e, 0x63, 0x63, 0xc1, + 0x3a, 0x01, 0xdf, 0x2f, 0x8e, 0x17, 0x6e, 0x8d, 0xca, 0xfb, 0x30, 0x9b, 0xda, 0x2c, 0x41, 0x5f, + 0x37, 0x4d, 0x0f, 0xfb, 0x7e, 0x44, 0x5f, 0x0c, 0x93, 0x8e, 0x15, 0x52, 0x8e, 0xc9, 0xa7, 0x3d, + 0xb1, 0x88, 0x79, 0x7f, 0x06, 0x53, 0xf1, 0xc6, 0x16, 0xf6, 0x5f, 0x86, 0x79, 0x6a, 0x01, 0x79, + 0x5f, 0x84, 0xe8, 0x31, 0xa6, 0x87, 0xfc, 0x74, 0x06, 0x87, 0xfd, 0x36, 0x94, 0x0c, 0xdb, 0xc2, + 0x0e, 0x15, 0xb4, 0xc5, 0x48, 0xfe, 0xba, 0x00, 0x77, 0xae, 0x2c, 0x26, 0x88, 0xef, 0xc1, 0x84, + 0x1b, 0x9d, 0xc2, 0xcb, 0xb0, 0xee, 0xa2, 0xd1, 0x32, 0x4c, 0x1b, 0x81, 0xe7, 0x61, 0x87, 0x6a, + 0x0c, 0xc3, 0x58, 0x14, 0xd5, 0x29, 0x31, 0xf9, 0x28, 0x9c, 0x43, 0x0f, 0x60, 0x21, 0x4c, 0x62, + 0xcd, 0xc6, 0x0d, 0xaa, 0x51, 0xa2, 0x39, 0xf8, 0x9c, 0x6a, 0x22, 0xff, 0xe6, 0x47, 0x19, 0x60, + 0x2e, 0x34, 0x38, 0xc0, 0x0d, 0xfa, 0x13, 0xf2, 0x63, 0x7c, 0x1e, 0x31, 0x46, 0xf7, 0xe1, 0x4e, + 0x58, 0xc8, 0x9a, 0xad, 0xfb, 0x54, 0x0b, 0x5c, 0x53, 0xa7, 0xd8, 0xd4, 0x4e, 0x6c, 0x62, 0x9c, + 0xcd, 0x17, 0x19, 0x6e, 0x36, 0x7c, 0x7c, 0xa0, 0xfb, 0xf4, 0x09, 0x7f, 0xb8, 0x1d, 0x3e, 0x43, + 0x1b, 0x30, 0xc7, 0x8c, 0x34, 0xd2, 0x48, 0x6f, 0x36, 0xc6, 0x40, 0x88, 0x3d, 0xfc, 0xac, 0x91, + 0xd8, 0x49, 0xfe, 0x25, 0x2c, 0xb0, 0x70, 0xfd, 0x14, 0x7b, 0x56, 0xe3, 0xe2, 0x55, 0xc3, 0x8f, + 0xca, 0x30, 0x1e, 0x05, 0x89, 0x79, 0x38, 0xa1, 0xc6, 0x63, 0x34, 0x0b, 0x63, 0x49, 0x17, 0xf8, + 0x40, 0xfe, 0x4a, 0x82, 0x72, 0x16, 0x03, 0x71, 0x66, 0xb3, 0x30, 0xd6, 0xd6, 0x6d, 0xcb, 0x64, + 0x04, 0xc6, 0x55, 0x3e, 0x40, 0xab, 0x70, 0x2b, 0x74, 0x0d, 0x9b, 0x5a, 0xf7, 0x40, 0x79, 0x40, + 0x6f, 0xf2, 0xf9, 0xb8, 0xda, 0x50, 0x15, 0xa6, 0x8c, 0x40, 0x73, 0xb1, 0x27, 0x0e, 0x8a, 0x6f, + 0x0e, 0x46, 0x70, 0x88, 0x3d, 0x7e, 0x4c, 0x6f, 0x02, 0x88, 0xbe, 0xa4, 0x59, 0x26, 0x0b, 0xd5, + 0x04, 0x3b, 0xea, 0x70, 0x66, 0xcf, 0x14, 0x95, 0xf5, 0x7b, 0x09, 0xee, 0xa6, 0xca, 0x41, 0x10, + 0xdd, 0x39, 0xd5, 0x1d, 0x03, 0x47, 0x01, 0x4b, 0xba, 0x2f, 0xf5, 0xb8, 0xdf, 0xb7, 0xd2, 0x50, + 0x15, 0x26, 0x9b, 0x98, 0xd8, 0xc4, 0x60, 0xed, 0x9f, 0x39, 0x32, 0xa6, 0x26, 0xa7, 0x18, 0xd6, + 0x0e, 0x7c, 0x8a, 0x3d, 0xc6, 0x3f, 0xc4, 0xf2, 0xa1, 0x6c, 0x83, 0x9c, 0x47, 0x4b, 0x44, 0xf1, + 0x53, 0x28, 0x19, 0x6c, 0x86, 0xb3, 0xda, 0xae, 0x85, 0xf9, 0xfc, 0xcf, 0x6f, 0x97, 0xde, 0x69, + 0x5a, 0xf4, 0x34, 0x38, 0xa9, 0x19, 0xa4, 0xa5, 0x88, 0xab, 0x89, 0xff, 0x7b, 0xd7, 0x37, 0xcf, + 0x14, 0x7a, 0xe1, 0x62, 0xbf, 0xb6, 0x8b, 0x0d, 0x55, 0xa0, 0x65, 0x5d, 0xf4, 0x84, 0x27, 0x3e, + 0xf6, 0x58, 0x65, 0xbc, 0x42, 0x83, 0xe9, 0xe6, 0xc3, 0x68, 0x32, 0x1f, 0x9e, 0x8a, 0x66, 0x90, + 0xd8, 0x42, 0x38, 0xf1, 0x18, 0xc6, 0x0d, 0xe2, 0xf8, 0x41, 0x4b, 0x04, 0xf7, 0x9a, 0xd5, 0x1b, + 0x83, 0xc3, 0x8d, 0x5b, 0xfa, 0xf9, 0xce, 0x13, 0x51, 0xb4, 0x7c, 0x20, 0x7f, 0x0c, 0x4b, 0x6c, + 0xe3, 0xe3, 0xf0, 0xca, 0x36, 0xe2, 0x04, 0x3a, 0xb0, 0x7c, 0x3a, 0xb0, 0x1e, 0xe4, 0x16, 0x54, + 0xfb, 0x83, 0x5f, 0x7b, 0xfb, 0x91, 0x8f, 0xe0, 0x3b, 0x6c, 0xbb, 0x47, 0x8d, 0x06, 0x36, 0xa8, + 0xd5, 0xc6, 0x87, 0xec, 0x5e, 0x4f, 0xa4, 0x61, 0x2a, 0x52, 0x13, 0x09, 0xe7, 0x6f, 0x43, 0x29, + 0xec, 0x1d, 0xf1, 0x71, 0x88, 0x51, 0x98, 0xe0, 0x8b, 0xd9, 0x6b, 0x0a, 0xfa, 0x75, 0x28, 0x71, + 0xf5, 0x20, 0x82, 0x5f, 0xee, 0xb9, 0x57, 0x43, 0x7d, 0x51, 0x13, 0x18, 0x61, 0x89, 0x7e, 0x00, + 0x33, 0x2e, 0x76, 0x4c, 0xcb, 0x69, 0x6a, 0x02, 0x5b, 0x18, 0x88, 0x9d, 0x16, 0x08, 0x3e, 0x94, + 0xff, 0x27, 0x89, 0x86, 0x7e, 0x6c, 0x9e, 0xf5, 0x36, 0x87, 0xc7, 0x70, 0x23, 0xea, 0x70, 0x9c, + 0xd3, 0xbb, 0xd9, 0x77, 0x7d, 0x9f, 0x0b, 0x41, 0x8d, 0xd0, 0x68, 0x0e, 0x4a, 0x2d, 0xfd, 0x5c, + 0x33, 0x82, 0x64, 0x4a, 0x04, 0x68, 0x1d, 0x8a, 0x61, 0x74, 0x58, 0x82, 0x4e, 0xd6, 0xef, 0xa4, + 0x17, 0x67, 0x4a, 0xeb, 0xd8, 0xc5, 0x86, 0xca, 0x8c, 0xd0, 0x1e, 0xdc, 0x8c, 0x64, 0x8b, 0x26, + 0x04, 0x48, 0x91, 0xe1, 0xaa, 0x69, 0x5c, 0xac, 0x6d, 0xda, 0x1b, 0x42, 0x84, 0xa8, 0x33, 0xd1, + 0x1c, 0x1f, 0xcb, 0xdf, 0xeb, 0xe9, 0x35, 0x3f, 0x22, 0x0e, 0x3d, 0xb5, 0x2f, 0x0e, 0xf5, 0x0b, + 0x12, 0xd0, 0x21, 0x7a, 0x8d, 0x7c, 0x06, 0xe8, 0x38, 0x21, 0xca, 0x38, 0x10, 0xc9, 0x30, 0x95, + 0x94, 0x6a, 0x02, 0x95, 0x9a, 0x43, 0x0b, 0x30, 0xce, 0x72, 0x3a, 0x6c, 0x85, 0xa9, 0x7a, 0x35, + 0xc3, 0xcc, 0xd1, 0x5b, 0x24, 0x70, 0xa8, 0x28, 0x58, 0x31, 0x92, 0x7f, 0xd1, 0xd3, 0x82, 0x7a, + 0xd8, 0x76, 0x1b, 0x39, 0x25, 0x54, 0xb7, 0xd9, 0xae, 0x45, 0x95, 0x0f, 0xd0, 0x36, 0xdc, 0x30, + 0x31, 0xd5, 0x2d, 0xdb, 0x9f, 0x2f, 0xb0, 0x8a, 0x58, 0xc9, 0x3e, 0xc1, 0xab, 0xde, 0xa8, 0x11, + 0x50, 0xde, 0x85, 0x99, 0x6e, 0xf7, 0x63, 0x8e, 0xe6, 0xb5, 0xe1, 0xae, 0x17, 0x85, 0x94, 0x17, + 0x5f, 0xc0, 0xf4, 0x0e, 0x2f, 0x66, 0xb1, 0x48, 0x32, 0x12, 0x52, 0x3a, 0x12, 0x0f, 0xc3, 0xbc, + 0x0b, 0x8d, 0x22, 0xd6, 0x6f, 0xf5, 0xd1, 0x98, 0x29, 0x5a, 0x6a, 0x04, 0x92, 0x77, 0xe0, 0x6d, + 0x9e, 0xd2, 0x09, 0xaf, 0xfa, 0x9d, 0x71, 0xbf, 0x42, 0x96, 0x3b, 0xf0, 0xce, 0xa0, 0x45, 0x72, + 0x43, 0xff, 0x49, 0x6f, 0xe8, 0x97, 0xb3, 0x9d, 0x48, 0x45, 0xa5, 0x1b, 0xf5, 0x8a, 0x68, 0x17, + 0x71, 0xaf, 0x63, 0x97, 0xe9, 0x4e, 0x10, 0xa9, 0x73, 0x0d, 0xde, 0xec, 0xf3, 0x5c, 0xb0, 0x7a, + 0x08, 0x45, 0xcb, 0x69, 0x10, 0xd1, 0x09, 0x07, 0x44, 0x70, 0x27, 0xd8, 0x73, 0x1a, 0x44, 0x34, + 0x42, 0x86, 0x93, 0xb7, 0xba, 0xc7, 0xce, 0x9f, 0xe6, 0x1e, 0xfb, 0x0c, 0x14, 0xe2, 0xea, 0x2e, + 0x18, 0x41, 0xfd, 0x19, 0x82, 0x31, 0xc6, 0x0f, 0xfd, 0x5a, 0x82, 0x12, 0xaf, 0x3b, 0xb4, 0x92, + 0xd3, 0x3e, 0x52, 0xef, 0x1e, 0xe5, 0xd5, 0x21, 0x2c, 0xb9, 0x9f, 0xf2, 0x5b, 0xbf, 0xfa, 0xfb, + 0x7f, 0x7e, 0x5b, 0xa8, 0xa0, 0x45, 0x25, 0xe7, 0x85, 0x0e, 0xfd, 0x41, 0x82, 0x89, 0xae, 0x68, + 0x59, 0xcf, 0x5b, 0xbe, 0xe7, 0xdd, 0xa4, 0x7c, 0x6f, 0x38, 0x63, 0x41, 0x67, 0x83, 0xd1, 0x59, + 0x47, 0xab, 0x7d, 0xe8, 0x44, 0x00, 0xe5, 0x52, 0xdc, 0x6d, 0x1d, 0xf4, 0x47, 0x09, 0xc6, 0xa3, + 0x85, 0xd0, 0xda, 0x10, 0xbb, 0x45, 0xcc, 0xd6, 0x87, 0xb2, 0x15, 0xc4, 0x36, 0x19, 0xb1, 0x0f, + 0x50, 0x3d, 0x9f, 0x98, 0x72, 0x29, 0x94, 0x45, 0x27, 0xc1, 0xf0, 0x4f, 0x12, 0x40, 0xb7, 0xbf, + 0xa3, 0x7b, 0x43, 0x5e, 0x03, 0x9c, 0xe5, 0xf5, 0x2e, 0x0d, 0x79, 0x8b, 0xf1, 0xfc, 0x10, 0x7d, + 0x90, 0xcd, 0xb3, 0x89, 0x63, 0xd9, 0xdd, 0x25, 0xa8, 0x5c, 0x72, 0x7d, 0xdc, 0x41, 0x7f, 0x95, + 0x60, 0x3a, 0xa5, 0x74, 0x91, 0x92, 0xb3, 0x7d, 0x96, 0x2a, 0x2f, 0xbf, 0x37, 0x3c, 0x40, 0x50, + 0x56, 0x19, 0xe5, 0x03, 0xb4, 0x9f, 0x4d, 0xb9, 0xcd, 0x40, 0x39, 0xac, 0x95, 0xcb, 0x28, 0xfa, + 0x1d, 0xe5, 0x92, 0xc9, 0xb4, 0x0e, 0xfa, 0xaf, 0x04, 0x73, 0x99, 0xa2, 0x13, 0x7d, 0x34, 0xc4, + 0xa9, 0x67, 0xa9, 0xe7, 0xf2, 0x83, 0xeb, 0x03, 0x85, 0x83, 0x27, 0xcc, 0xc1, 0x9f, 0xa1, 0xcf, + 0xf3, 0x73, 0x27, 0x72, 0x51, 0xe3, 0x72, 0x36, 0xe5, 0x56, 0xd7, 0xe9, 0x84, 0xf0, 0x66, 0x21, + 0x60, 0x42, 0xbb, 0x83, 0xbe, 0x92, 0x60, 0x22, 0x16, 0xa5, 0xb9, 0x15, 0xda, 0xab, 0x8e, 0x73, + 0x2b, 0xf4, 0x8a, 0xce, 0x1d, 0x94, 0x60, 0x81, 0x1f, 0xbe, 0xcb, 0x84, 0x88, 0xcc, 0x52, 0xf8, + 0x8b, 0x04, 0x6f, 0x64, 0xa8, 0x50, 0x74, 0x3f, 0x87, 0x43, 0x7f, 0xc9, 0x5b, 0xfe, 0xf0, 0xba, + 0x30, 0xe1, 0xc4, 0x27, 0xcc, 0x89, 0x8f, 0xd0, 0xfd, 0x6c, 0x27, 0x7c, 0x06, 0xed, 0xbe, 0xbd, + 0x69, 0xb6, 0xe5, 0xd3, 0x84, 0x17, 0x7f, 0x96, 0xe0, 0x66, 0x8f, 0x10, 0x45, 0x1b, 0x39, 0x54, + 0xb2, 0x85, 0x70, 0xb9, 0x7e, 0x1d, 0x88, 0x60, 0xbe, 0xcd, 0x98, 0x6f, 0xa1, 0xcd, 0x6c, 0xe6, + 0x38, 0x82, 0x09, 0x45, 0xab, 0x5c, 0x46, 0x37, 0x72, 0x47, 0xb9, 0xe4, 0x5a, 0xba, 0x83, 0xfe, + 0x96, 0x28, 0x8e, 0xd4, 0x9d, 0x3c, 0x54, 0x71, 0x64, 0x49, 0x81, 0xa1, 0x8a, 0x23, 0xf3, 0xfa, + 0x97, 0xbf, 0xcf, 0x1c, 0xda, 0x44, 0x0f, 0x06, 0x14, 0x47, 0x8b, 0xa3, 0x35, 0xae, 0x52, 0x12, + 0xc5, 0x81, 0xfe, 0x25, 0xc1, 0x42, 0x5f, 0x99, 0x81, 0x3e, 0xce, 0x4b, 0x91, 0x01, 0x0a, 0xa7, + 0xbc, 0xf5, 0x72, 0x60, 0xe1, 0xda, 0x2e, 0x73, 0xed, 0x21, 0xda, 0xea, 0x93, 0x65, 0x89, 0x05, + 0xae, 0xb8, 0x17, 0x1f, 0x1b, 0xfa, 0x9d, 0x04, 0xd0, 0x7d, 0xbb, 0x78, 0x8d, 0xb7, 0xc7, 0xd5, + 0x57, 0x16, 0x79, 0x95, 0x31, 0x5e, 0x46, 0x77, 0xfb, 0x30, 0x36, 0xcf, 0xa2, 0x26, 0x85, 0xbe, + 0x96, 0xe0, 0x56, 0xaf, 0x7a, 0x42, 0xf5, 0x61, 0x2e, 0xfb, 0xb4, 0x14, 0x2b, 0xbf, 0x7f, 0x2d, + 0x8c, 0x20, 0xfa, 0x1e, 0x23, 0xba, 0x86, 0x56, 0x06, 0xe8, 0x04, 0xfe, 0x59, 0x45, 0x33, 0x82, + 0xed, 0xdd, 0x6f, 0x9e, 0x57, 0xa4, 0x67, 0xcf, 0x2b, 0xd2, 0xbf, 0x9f, 0x57, 0xa4, 0xdf, 0xbc, + 0xa8, 0x8c, 0x3c, 0x7b, 0x51, 0x19, 0xf9, 0xc7, 0x8b, 0xca, 0xc8, 0xe7, 0x6b, 0x89, 0xcf, 0x0c, + 0xa9, 0xd5, 0xda, 0x75, 0xe5, 0x3c, 0x5e, 0x92, 0x7d, 0x6e, 0x38, 0x29, 0xb1, 0x4f, 0xbe, 0xef, + 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x9c, 0x9b, 0xe8, 0x97, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/types/relay.pb.go b/x/pairing/types/relay.pb.go index 85898eef1c..8df281a273 100644 --- a/x/pairing/types/relay.pb.go +++ b/x/pairing/types/relay.pb.go @@ -10,6 +10,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + types "github.com/lavanet/lava/v2/x/epochstorage/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -802,6 +803,58 @@ func (m *QualityOfServiceReport) XXX_DiscardUnknown() { var xxx_messageInfo_QualityOfServiceReport proto.InternalMessageInfo +type PairingRelayCache struct { + Entries []types.StakeEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` + AllowedCu uint64 `protobuf:"varint,2,opt,name=allowed_cu,json=allowedCu,proto3" json:"allowed_cu,omitempty"` +} + +func (m *PairingRelayCache) Reset() { *m = PairingRelayCache{} } +func (m *PairingRelayCache) String() string { return proto.CompactTextString(m) } +func (*PairingRelayCache) ProtoMessage() {} +func (*PairingRelayCache) Descriptor() ([]byte, []int) { + return fileDescriptor_a61d253b10eeeb9e, []int{10} +} +func (m *PairingRelayCache) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PairingRelayCache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PairingRelayCache.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 *PairingRelayCache) XXX_Merge(src proto.Message) { + xxx_messageInfo_PairingRelayCache.Merge(m, src) +} +func (m *PairingRelayCache) XXX_Size() int { + return m.Size() +} +func (m *PairingRelayCache) XXX_DiscardUnknown() { + xxx_messageInfo_PairingRelayCache.DiscardUnknown(m) +} + +var xxx_messageInfo_PairingRelayCache proto.InternalMessageInfo + +func (m *PairingRelayCache) GetEntries() []types.StakeEntry { + if m != nil { + return m.Entries + } + return nil +} + +func (m *PairingRelayCache) GetAllowedCu() uint64 { + if m != nil { + return m.AllowedCu + } + return 0 +} + func init() { proto.RegisterType((*ProbeRequest)(nil), "lavanet.lava.pairing.ProbeRequest") proto.RegisterType((*ProbeReply)(nil), "lavanet.lava.pairing.ProbeReply") @@ -813,88 +866,94 @@ func init() { proto.RegisterType((*RelayRequest)(nil), "lavanet.lava.pairing.RelayRequest") proto.RegisterType((*RelayReply)(nil), "lavanet.lava.pairing.RelayReply") proto.RegisterType((*QualityOfServiceReport)(nil), "lavanet.lava.pairing.QualityOfServiceReport") + proto.RegisterType((*PairingRelayCache)(nil), "lavanet.lava.pairing.PairingRelayCache") } func init() { proto.RegisterFile("lavanet/lava/pairing/relay.proto", fileDescriptor_a61d253b10eeeb9e) } var fileDescriptor_a61d253b10eeeb9e = []byte{ - // 1206 bytes of a gzipped FileDescriptorProto + // 1285 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0x1b, 0x45, - 0x14, 0xf6, 0xfa, 0x27, 0xb6, 0x8f, 0xb7, 0x69, 0x99, 0x36, 0xad, 0x95, 0x0a, 0xc7, 0x5d, 0xa4, - 0x34, 0x42, 0x60, 0x43, 0x40, 0x5c, 0x20, 0x21, 0xb5, 0xa6, 0x11, 0x04, 0x0a, 0x4d, 0x37, 0x70, - 0x13, 0x09, 0x6d, 0xc7, 0xbb, 0x93, 0xcd, 0xd0, 0xf5, 0xce, 0x66, 0x66, 0xd6, 0xc4, 0xbc, 0x00, - 0x57, 0x48, 0x3c, 0x04, 0x4f, 0xc0, 0x43, 0x54, 0xbd, 0xec, 0x25, 0x42, 0x22, 0x42, 0xc9, 0x1b, - 0x20, 0x1e, 0x00, 0xcd, 0x8f, 0xff, 0x12, 0x27, 0x28, 0xc0, 0xd5, 0xce, 0x7c, 0x73, 0xf6, 0x9c, - 0x33, 0xdf, 0x39, 0xe7, 0xdb, 0x85, 0x76, 0x82, 0x87, 0x38, 0x25, 0xb2, 0xab, 0x9e, 0xdd, 0x0c, - 0x53, 0x4e, 0xd3, 0xb8, 0xcb, 0x49, 0x82, 0x47, 0x9d, 0x8c, 0x33, 0xc9, 0xd0, 0x2d, 0x6b, 0xd1, - 0x51, 0xcf, 0x8e, 0xb5, 0x58, 0xbd, 0x15, 0xb3, 0x98, 0x69, 0x83, 0xae, 0x5a, 0x19, 0xdb, 0xd5, - 0x56, 0xcc, 0x58, 0x9c, 0x90, 0xae, 0xde, 0xf5, 0xf3, 0xfd, 0xee, 0x77, 0x1c, 0x67, 0x19, 0xe1, - 0xc2, 0x9e, 0xaf, 0x9d, 0x3d, 0x97, 0x74, 0x40, 0x84, 0xc4, 0x83, 0xcc, 0x18, 0x78, 0xcf, 0xc0, - 0xdd, 0xe1, 0xac, 0x4f, 0x7c, 0x72, 0x98, 0x13, 0x21, 0x11, 0x82, 0x72, 0x9c, 0xd3, 0xa8, 0xe9, - 0xb4, 0x9d, 0x8d, 0xb2, 0xaf, 0xd7, 0xe8, 0x0e, 0x54, 0x45, 0x46, 0xc2, 0x80, 0x46, 0xcd, 0x62, - 0xdb, 0xd9, 0xa8, 0xfb, 0x4b, 0x6a, 0xbb, 0x1d, 0xa1, 0x37, 0xe0, 0x1a, 0xce, 0x68, 0x40, 0x53, - 0x49, 0xf8, 0x3e, 0x0e, 0x49, 0xb3, 0xa4, 0x8f, 0x5d, 0x9c, 0xd1, 0xed, 0x31, 0xe6, 0xbd, 0x70, - 0x00, 0x6c, 0x88, 0x2c, 0x19, 0x2d, 0x0c, 0x70, 0x0f, 0xdc, 0x04, 0x4b, 0x22, 0x64, 0xd0, 0x4f, - 0x58, 0xf8, 0x5c, 0x47, 0x29, 0xf9, 0x0d, 0x83, 0xf5, 0x14, 0x84, 0x3e, 0x80, 0x3b, 0xfb, 0x34, - 0xc5, 0x09, 0xfd, 0x9e, 0x44, 0xc6, 0x4a, 0x04, 0x07, 0x58, 0x1c, 0x10, 0xa1, 0x83, 0xba, 0xfe, - 0xca, 0xe4, 0x58, 0xbf, 0x20, 0x3e, 0xd5, 0x87, 0xe8, 0x75, 0x00, 0x45, 0x63, 0x40, 0x32, 0x16, - 0x1e, 0x34, 0xcb, 0x3a, 0x68, 0x5d, 0x21, 0x5b, 0x0a, 0x40, 0x6f, 0xc2, 0x6b, 0xfa, 0x78, 0x2e, - 0x7c, 0x45, 0x5b, 0x5d, 0x57, 0x07, 0x8f, 0xa7, 0x29, 0x78, 0x2f, 0xca, 0xe0, 0xfa, 0xaa, 0x4e, - 0xbb, 0x44, 0x08, 0xca, 0xd2, 0x59, 0x5e, 0x9c, 0x39, 0x5e, 0xee, 0x81, 0x1b, 0xb2, 0x54, 0x92, - 0x54, 0xea, 0x1c, 0xf5, 0x7d, 0x5c, 0xbf, 0x61, 0x31, 0x95, 0x99, 0xca, 0x4b, 0x18, 0x37, 0xea, - 0xf5, 0x92, 0xc9, 0xcb, 0x22, 0xdb, 0x11, 0x5a, 0x81, 0xa5, 0x30, 0x0f, 0x44, 0x3e, 0xb0, 0x29, - 0x57, 0xc2, 0x7c, 0x37, 0x1f, 0xa0, 0x55, 0xa8, 0x65, 0x9c, 0x0d, 0x69, 0x44, 0xb8, 0xce, 0xb2, - 0xee, 0x4f, 0xf6, 0xe8, 0x2e, 0xd4, 0x75, 0x17, 0x05, 0x69, 0x3e, 0x68, 0x2e, 0xe9, 0xb7, 0x6a, - 0x1a, 0xf8, 0x32, 0x1f, 0xa0, 0xcf, 0x01, 0x0e, 0x99, 0x08, 0x38, 0xc9, 0x18, 0x97, 0xcd, 0x6a, - 0xdb, 0xd9, 0x68, 0x6c, 0xbe, 0xd5, 0x59, 0xd4, 0x68, 0x9d, 0xa7, 0x39, 0x4e, 0xa8, 0x1c, 0x3d, - 0xd9, 0xdf, 0x25, 0x7c, 0x48, 0x43, 0x55, 0x36, 0xc6, 0xa5, 0x5f, 0x3f, 0x64, 0xc2, 0x2c, 0xd1, - 0x2d, 0xa8, 0x18, 0x3a, 0x6b, 0xba, 0x4e, 0x66, 0x83, 0xbe, 0x81, 0xdb, 0x79, 0xca, 0x89, 0xc8, - 0x58, 0x2a, 0xe8, 0x90, 0x04, 0xe3, 0xc4, 0x44, 0xb3, 0xde, 0x2e, 0x6d, 0x34, 0x36, 0xd7, 0x17, - 0x87, 0x33, 0x3e, 0x49, 0xb4, 0x63, 0xcd, 0xfd, 0x95, 0x59, 0x2f, 0x63, 0x54, 0x20, 0x0f, 0xae, - 0xe9, 0x4a, 0x85, 0x07, 0x98, 0x6a, 0xce, 0x40, 0xdf, 0xbf, 0xa1, 0xc0, 0x8f, 0x15, 0xb6, 0x1d, - 0xa1, 0x1b, 0x50, 0x12, 0x34, 0x6e, 0x36, 0x34, 0xdd, 0x6a, 0x89, 0xde, 0x85, 0x4a, 0x1f, 0x47, - 0x31, 0x69, 0xba, 0xfa, 0xca, 0x77, 0x17, 0xe7, 0xd0, 0x53, 0x26, 0xbe, 0xb1, 0x44, 0xcf, 0x60, - 0x45, 0x51, 0x45, 0x8e, 0x42, 0x92, 0x24, 0x24, 0x0d, 0xc9, 0x98, 0xb5, 0x6b, 0xff, 0x82, 0xb5, - 0x9b, 0x87, 0x4c, 0x6c, 0x4d, 0x3c, 0x19, 0x50, 0x4d, 0x44, 0x45, 0x87, 0x54, 0x03, 0x14, 0xe6, - 0x01, 0x4e, 0x12, 0x16, 0x62, 0x49, 0x59, 0x6a, 0xa7, 0xc2, 0x0d, 0xf3, 0x87, 0x13, 0x6c, 0x4a, - 0x77, 0xd1, 0xb4, 0x82, 0xa1, 0xbb, 0x09, 0x55, 0x1c, 0x45, 0x9c, 0x08, 0x61, 0xa7, 0x6e, 0xbc, - 0x3d, 0xcf, 0x54, 0xf9, 0x3c, 0x53, 0x6b, 0xd0, 0xc8, 0x38, 0xfb, 0x96, 0x84, 0x32, 0x50, 0x8c, - 0x55, 0x34, 0x63, 0x60, 0xa1, 0x5d, 0x1a, 0xab, 0xcc, 0x86, 0x94, 0xcb, 0x1c, 0x27, 0x76, 0x74, - 0x4c, 0x47, 0xb9, 0x16, 0xd4, 0xd3, 0xe3, 0xfd, 0x5e, 0x84, 0x1b, 0x7a, 0x22, 0x76, 0x38, 0x1d, - 0x62, 0x49, 0x1e, 0x61, 0x89, 0xd1, 0x7d, 0xb8, 0x1e, 0xb2, 0x34, 0x25, 0xa1, 0x4a, 0x3e, 0x90, - 0xa3, 0x8c, 0xd8, 0xe9, 0x58, 0x9e, 0xc2, 0x5f, 0x8d, 0x32, 0xa2, 0xc6, 0x47, 0xa9, 0x47, 0xce, - 0x93, 0xb1, 0xac, 0xe0, 0x8c, 0x7e, 0xcd, 0x13, 0x25, 0x11, 0x11, 0x96, 0xd8, 0x0e, 0xb6, 0x5e, - 0xab, 0x7c, 0xb8, 0x91, 0x28, 0x3b, 0xa4, 0x65, 0xdd, 0x7b, 0xae, 0x05, 0x8d, 0x48, 0x9c, 0xd3, - 0xa3, 0xca, 0x79, 0x3d, 0x52, 0xde, 0x05, 0x4e, 0xa4, 0xbe, 0x90, 0xeb, 0xeb, 0x35, 0x7a, 0x00, - 0xb5, 0x01, 0x91, 0x58, 0x47, 0xad, 0xea, 0x6e, 0x6d, 0x2d, 0x2e, 0xf3, 0x17, 0xd6, 0xaa, 0x57, - 0x7e, 0x79, 0xbc, 0x56, 0xf0, 0x27, 0x6f, 0xa9, 0x22, 0xe1, 0x28, 0x62, 0xa9, 0x9e, 0x89, 0xba, - 0x6f, 0x36, 0xa8, 0x05, 0x40, 0x8e, 0x24, 0x49, 0xd5, 0x54, 0x9b, 0x39, 0xa8, 0xfb, 0x33, 0x88, - 0x51, 0x01, 0x92, 0xda, 0x2b, 0x81, 0xbe, 0x52, 0x5d, 0x21, 0x46, 0x71, 0x7e, 0x74, 0x14, 0xbf, - 0xf3, 0xf3, 0x31, 0x5b, 0x78, 0x67, 0xbe, 0xf0, 0xeb, 0xb0, 0x1c, 0x51, 0x31, 0x65, 0x59, 0xd8, - 0x8e, 0x39, 0x83, 0xa2, 0xdb, 0xb0, 0x44, 0x38, 0x67, 0x5c, 0x58, 0xdd, 0xb1, 0x3b, 0xd5, 0x14, - 0x93, 0xcf, 0x43, 0x20, 0x2c, 0xc3, 0x30, 0x81, 0x76, 0xbd, 0xf7, 0xa1, 0x36, 0x26, 0x40, 0xd1, - 0x98, 0xe2, 0xc1, 0xb8, 0xb6, 0x7a, 0xad, 0x48, 0x18, 0xe2, 0x24, 0x27, 0xb6, 0x9e, 0x66, 0xe3, - 0xfd, 0xec, 0x58, 0xdd, 0x1c, 0x7f, 0x63, 0x3e, 0x51, 0xb5, 0x54, 0x4a, 0x65, 0xf5, 0x4e, 0xfb, - 0x68, 0x6c, 0x7a, 0x17, 0x09, 0xc4, 0x54, 0x72, 0x55, 0xbd, 0x67, 0x04, 0x78, 0x0b, 0xc0, 0x38, - 0xd2, 0x85, 0x2b, 0x6a, 0x2f, 0xeb, 0x97, 0x78, 0x99, 0x69, 0x53, 0xdf, 0x88, 0xa5, 0x5a, 0x7e, - 0x56, 0xae, 0x95, 0x6e, 0x94, 0xbd, 0xbf, 0x1c, 0x00, 0x9b, 0xa6, 0xfd, 0x4e, 0x69, 0xaf, 0xce, - 0x4c, 0x13, 0x5a, 0x7d, 0x29, 0x4e, 0xf5, 0xe5, 0xec, 0x97, 0xab, 0x7c, 0xa5, 0x2f, 0x57, 0xe5, - 0x1f, 0xbe, 0x5c, 0x82, 0xc6, 0xf6, 0x0d, 0xdb, 0xad, 0x75, 0x41, 0x63, 0x63, 0xf4, 0xdf, 0x5b, - 0xd6, 0x5e, 0xfb, 0x97, 0x22, 0xdc, 0x5e, 0x2c, 0x5e, 0x68, 0x0f, 0xaa, 0xea, 0x22, 0x69, 0x38, - 0x32, 0x55, 0xee, 0x3d, 0x50, 0x1e, 0x7e, 0x3b, 0x5e, 0x5b, 0x8f, 0xa9, 0x3c, 0xc8, 0xfb, 0x9d, - 0x90, 0x0d, 0xba, 0x21, 0x13, 0x03, 0x26, 0xec, 0xe3, 0x6d, 0x11, 0x3d, 0xef, 0xaa, 0x91, 0x17, - 0x9d, 0x47, 0x24, 0xfc, 0xf3, 0x78, 0x6d, 0x79, 0x84, 0x07, 0xc9, 0x87, 0xde, 0x63, 0xe3, 0xc6, - 0xf3, 0xc7, 0x0e, 0x11, 0x05, 0x17, 0x0f, 0x31, 0x4d, 0x70, 0x9f, 0xaa, 0xd0, 0xa6, 0x63, 0x7a, - 0x5b, 0x57, 0x0e, 0x70, 0xd3, 0x04, 0x98, 0xf5, 0xe5, 0xf9, 0x73, 0xae, 0xd1, 0x53, 0x28, 0x8b, - 0x51, 0x1a, 0x1a, 0x99, 0xec, 0x7d, 0x74, 0xe5, 0x10, 0x0d, 0x13, 0x42, 0xf9, 0xf0, 0x7c, 0xed, - 0x6a, 0xf3, 0x87, 0x22, 0x54, 0x75, 0xaf, 0x10, 0x8e, 0x9e, 0x40, 0x45, 0x2f, 0xd1, 0x65, 0xfd, - 0x6b, 0x5b, 0x7f, 0xb5, 0x7d, 0xa9, 0x4d, 0x96, 0x8c, 0xbc, 0x02, 0xda, 0x83, 0x65, 0xd3, 0xf3, - 0x79, 0x5f, 0x84, 0x9c, 0xf6, 0xc9, 0xff, 0xe5, 0xf9, 0x1d, 0x47, 0x25, 0xab, 0xff, 0xc5, 0x2e, - 0x72, 0x39, 0xfb, 0x2f, 0x78, 0x91, 0xcb, 0xe9, 0xcf, 0x9c, 0x57, 0xe8, 0x3d, 0x7c, 0x79, 0xd2, - 0x72, 0x5e, 0x9d, 0xb4, 0x9c, 0x3f, 0x4e, 0x5a, 0xce, 0x4f, 0xa7, 0xad, 0xc2, 0xab, 0xd3, 0x56, - 0xe1, 0xd7, 0xd3, 0x56, 0x61, 0xef, 0xfe, 0x0c, 0xc1, 0x73, 0xff, 0xbc, 0x47, 0x93, 0xbf, 0x5e, - 0xcd, 0x72, 0x7f, 0x49, 0xff, 0x89, 0xbe, 0xf7, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xda, 0x6e, - 0xf9, 0x4b, 0x1a, 0x0b, 0x00, 0x00, + 0x14, 0xce, 0x3a, 0x76, 0x1c, 0x1f, 0x6f, 0xd3, 0x76, 0xda, 0xb4, 0x56, 0x2a, 0x9c, 0x74, 0x11, + 0x21, 0x2a, 0x60, 0x43, 0x40, 0x5c, 0x20, 0x21, 0x15, 0xb7, 0x11, 0x04, 0x0a, 0x4d, 0x37, 0x70, + 0x53, 0x09, 0x6d, 0xc7, 0xbb, 0x93, 0xcd, 0xd0, 0xf5, 0xce, 0x66, 0x66, 0xd6, 0xad, 0x79, 0x01, + 0xae, 0x90, 0x78, 0x08, 0x9e, 0x80, 0x87, 0xa8, 0x7a, 0xd9, 0x4b, 0x84, 0x44, 0x85, 0xda, 0x37, + 0x40, 0x3c, 0x00, 0x3a, 0x33, 0xe3, 0xbf, 0x26, 0x2d, 0x0a, 0x70, 0xb5, 0x33, 0xdf, 0x9c, 0x3d, + 0xe7, 0xcc, 0x77, 0x7e, 0xe6, 0xc0, 0x46, 0x46, 0x87, 0x34, 0x67, 0xba, 0x8b, 0xdf, 0x6e, 0x41, + 0xb9, 0xe4, 0x79, 0xda, 0x95, 0x2c, 0xa3, 0xa3, 0x4e, 0x21, 0x85, 0x16, 0xe4, 0xa2, 0x93, 0xe8, + 0xe0, 0xb7, 0xe3, 0x24, 0xd6, 0x2e, 0xa6, 0x22, 0x15, 0x46, 0xa0, 0x8b, 0x2b, 0x2b, 0xbb, 0xd6, + 0x4e, 0x85, 0x48, 0x33, 0xd6, 0x35, 0xbb, 0x7e, 0x79, 0xd0, 0x7d, 0x20, 0x69, 0x51, 0x30, 0xa9, + 0xdc, 0xf9, 0xfa, 0x8b, 0xe7, 0x9a, 0x0f, 0x98, 0xd2, 0x74, 0x50, 0x38, 0x81, 0xb7, 0xe6, 0xdc, + 0x61, 0x85, 0x88, 0x0f, 0x95, 0x16, 0x92, 0xa6, 0xac, 0xab, 0x34, 0xbd, 0xcf, 0x22, 0x96, 0x6b, + 0xe9, 0x3c, 0x0b, 0xee, 0x81, 0xbf, 0x27, 0x45, 0x9f, 0x85, 0xec, 0xa8, 0x64, 0x4a, 0x13, 0x02, + 0xd5, 0xb4, 0xe4, 0x49, 0xcb, 0xdb, 0xf0, 0xb6, 0xaa, 0xa1, 0x59, 0x93, 0xcb, 0x50, 0x57, 0x05, + 0x8b, 0x23, 0x9e, 0xb4, 0x2a, 0x1b, 0xde, 0x56, 0x23, 0x5c, 0xc2, 0xed, 0x6e, 0x42, 0x5e, 0x87, + 0x33, 0xb4, 0xe0, 0x11, 0xcf, 0x35, 0x93, 0x07, 0x34, 0x66, 0xad, 0x45, 0x73, 0xec, 0xd3, 0x82, + 0xef, 0x8e, 0xb1, 0xe0, 0x91, 0x07, 0xe0, 0x4c, 0x14, 0xd9, 0xe8, 0x44, 0x03, 0x57, 0xc1, 0xcf, + 0xa8, 0x66, 0x4a, 0x47, 0xfd, 0x4c, 0xc4, 0xf7, 0x8d, 0x95, 0xc5, 0xb0, 0x69, 0xb1, 0x1e, 0x42, + 0xe4, 0x43, 0xb8, 0x7c, 0xc0, 0x73, 0x9a, 0xf1, 0xef, 0x59, 0x62, 0xa5, 0x54, 0x74, 0x48, 0xd5, + 0x21, 0x53, 0xc6, 0xa8, 0x1f, 0xae, 0x4e, 0x8e, 0xcd, 0x0f, 0xea, 0x33, 0x73, 0x48, 0x5e, 0x03, + 0x40, 0x1a, 0x22, 0x43, 0x43, 0xab, 0x6a, 0x8c, 0x36, 0x10, 0xd9, 0x41, 0x80, 0x5c, 0x83, 0xf3, + 0xe6, 0x78, 0xce, 0x7c, 0xcd, 0x48, 0x9d, 0xc5, 0x83, 0x5b, 0x53, 0x17, 0x82, 0x47, 0x55, 0xf0, + 0x43, 0x0c, 0xea, 0x3e, 0x53, 0x8a, 0x8b, 0x7c, 0x96, 0x17, 0x6f, 0x8e, 0x97, 0xab, 0xe0, 0xc7, + 0x22, 0xd7, 0x2c, 0xd7, 0xc6, 0x47, 0x73, 0x1f, 0x3f, 0x6c, 0x3a, 0x0c, 0x3d, 0x43, 0xbf, 0x94, + 0x55, 0x83, 0xbf, 0x2f, 0x5a, 0xbf, 0x1c, 0xb2, 0x9b, 0x90, 0x55, 0x58, 0x8a, 0xcb, 0x48, 0x95, + 0x03, 0xe7, 0x72, 0x2d, 0x2e, 0xf7, 0xcb, 0x01, 0x59, 0x83, 0xe5, 0x42, 0x8a, 0x21, 0x4f, 0x98, + 0x34, 0x5e, 0x36, 0xc2, 0xc9, 0x9e, 0x5c, 0x81, 0x86, 0x49, 0xb9, 0x28, 0x2f, 0x07, 0xad, 0x25, + 0xf3, 0xd7, 0xb2, 0x01, 0xbe, 0x2a, 0x07, 0xe4, 0x0b, 0x80, 0x23, 0xa1, 0x22, 0xc9, 0x0a, 0x21, + 0x75, 0xab, 0xbe, 0xe1, 0x6d, 0x35, 0xb7, 0xdf, 0xee, 0x9c, 0x94, 0x95, 0x9d, 0x3b, 0x25, 0xcd, + 0xb8, 0x1e, 0xdd, 0x3e, 0xd8, 0x67, 0x72, 0xc8, 0x63, 0x0c, 0x9b, 0x90, 0x3a, 0x6c, 0x1c, 0x09, + 0x65, 0x97, 0xe4, 0x22, 0xd4, 0x2c, 0x9d, 0xcb, 0x26, 0x4e, 0x76, 0x43, 0xbe, 0x85, 0x4b, 0x65, + 0x2e, 0x99, 0x2a, 0x44, 0xae, 0xf8, 0x90, 0x45, 0x63, 0xc7, 0x54, 0xab, 0xb1, 0xb1, 0xb8, 0xd5, + 0xdc, 0xde, 0x3c, 0xd9, 0x9c, 0xd5, 0xc9, 0x92, 0x3d, 0x27, 0x1e, 0xae, 0xce, 0x6a, 0x19, 0xa3, + 0x8a, 0x04, 0x70, 0xc6, 0x44, 0x2a, 0x3e, 0xa4, 0xdc, 0x70, 0x06, 0xe6, 0xfe, 0x4d, 0x04, 0x6f, + 0x20, 0xb6, 0x9b, 0x90, 0x73, 0xb0, 0xa8, 0x78, 0xda, 0x6a, 0x1a, 0xba, 0x71, 0x49, 0xde, 0x83, + 0x5a, 0x9f, 0x26, 0x29, 0x6b, 0xf9, 0xe6, 0xca, 0x57, 0x4e, 0xf6, 0xa1, 0x87, 0x22, 0xa1, 0x95, + 0x24, 0xf7, 0x60, 0x15, 0xa9, 0x62, 0x0f, 0x63, 0x96, 0x65, 0x2c, 0x8f, 0xd9, 0x98, 0xb5, 0x33, + 0xff, 0x82, 0xb5, 0x0b, 0x47, 0x42, 0xed, 0x4c, 0x34, 0x59, 0x10, 0x2b, 0xa2, 0x66, 0x4c, 0x62, + 0x01, 0xc5, 0x65, 0x44, 0xb3, 0x4c, 0xc4, 0x54, 0x73, 0x91, 0xbb, 0xaa, 0xf0, 0xe3, 0xf2, 0x93, + 0x09, 0x36, 0xa5, 0xbb, 0x62, 0x53, 0xc1, 0xd2, 0xdd, 0x82, 0x3a, 0x4d, 0x12, 0xc9, 0x94, 0x72, + 0x55, 0x37, 0xde, 0x1e, 0x67, 0xaa, 0x7a, 0x9c, 0xa9, 0x75, 0x68, 0x16, 0x52, 0x7c, 0xc7, 0x62, + 0x1d, 0x21, 0x63, 0x35, 0xc3, 0x18, 0x38, 0x68, 0x9f, 0xa7, 0xe8, 0xd9, 0x90, 0x4b, 0x5d, 0xd2, + 0xcc, 0x95, 0x8e, 0xcd, 0x28, 0xdf, 0x81, 0xa6, 0x7a, 0x82, 0xdf, 0x2b, 0x70, 0xce, 0x54, 0xc4, + 0x9e, 0xe4, 0x43, 0xaa, 0xd9, 0x4d, 0xaa, 0x29, 0x79, 0x13, 0xce, 0xc6, 0x22, 0xcf, 0x59, 0x8c, + 0xce, 0x47, 0x7a, 0x54, 0x30, 0x57, 0x1d, 0x2b, 0x53, 0xf8, 0xeb, 0x51, 0xc1, 0xb0, 0x7c, 0xb0, + 0x7b, 0x94, 0x32, 0x1b, 0xb7, 0x15, 0x5a, 0xf0, 0x6f, 0x64, 0x86, 0x2d, 0x22, 0xa1, 0x9a, 0xba, + 0xc2, 0x36, 0x6b, 0xf4, 0x47, 0xda, 0x16, 0xe5, 0x8a, 0xb4, 0x6a, 0x72, 0xcf, 0x77, 0xa0, 0x6d, + 0x12, 0xc7, 0xfa, 0x51, 0xed, 0x78, 0x3f, 0x42, 0xed, 0x8a, 0x66, 0xda, 0x5c, 0xc8, 0x0f, 0xcd, + 0x9a, 0x5c, 0x87, 0xe5, 0x01, 0xd3, 0xd4, 0x58, 0xad, 0x9b, 0x6c, 0x6d, 0x9f, 0x1c, 0xe6, 0x2f, + 0x9d, 0x54, 0xaf, 0xfa, 0xf8, 0xe9, 0xfa, 0x42, 0x38, 0xf9, 0x0b, 0x83, 0x44, 0x93, 0x44, 0xe4, + 0xa6, 0x26, 0x1a, 0xa1, 0xdd, 0x90, 0x36, 0x00, 0x7b, 0xa8, 0x59, 0x8e, 0x55, 0x6d, 0xeb, 0xa0, + 0x11, 0xce, 0x20, 0xb6, 0x0b, 0xb0, 0xdc, 0x5d, 0x09, 0xcc, 0x95, 0x1a, 0x88, 0xd8, 0x8e, 0xf3, + 0xa3, 0x87, 0xfc, 0xce, 0xd7, 0xc7, 0x6c, 0xe0, 0xbd, 0xf9, 0xc0, 0x6f, 0xc2, 0x4a, 0xc2, 0xd5, + 0x94, 0x65, 0xe5, 0x32, 0xe6, 0x05, 0x94, 0x5c, 0x82, 0x25, 0x26, 0xa5, 0x90, 0xca, 0xf5, 0x1d, + 0xb7, 0xc3, 0xa4, 0x98, 0xbc, 0x25, 0x91, 0x72, 0x0c, 0xc3, 0x04, 0xda, 0x0f, 0x3e, 0x80, 0xe5, + 0x31, 0x01, 0x48, 0x63, 0x4e, 0x07, 0xe3, 0xd8, 0x9a, 0x35, 0x92, 0x30, 0xa4, 0x59, 0xc9, 0x5c, + 0x3c, 0xed, 0x26, 0xf8, 0xd9, 0x73, 0x7d, 0x73, 0xfc, 0xc6, 0x7c, 0x8a, 0xb1, 0xc4, 0x4e, 0xe5, + 0xfa, 0x9d, 0xd1, 0xd1, 0xdc, 0x0e, 0x5e, 0xd6, 0x20, 0xa6, 0x2d, 0x17, 0xe3, 0x3d, 0xd3, 0x80, + 0x77, 0x00, 0xac, 0x22, 0x13, 0xb8, 0x8a, 0xd1, 0xb2, 0xf9, 0x0a, 0x2d, 0x33, 0x69, 0x1a, 0xda, + 0x66, 0x89, 0xcb, 0xcf, 0xab, 0xcb, 0x8b, 0xe7, 0xaa, 0xc1, 0x5f, 0x1e, 0x80, 0x73, 0xd3, 0xbd, + 0x53, 0x46, 0xab, 0x37, 0x93, 0x84, 0xae, 0xbf, 0x54, 0xa6, 0xfd, 0xe5, 0xc5, 0x97, 0xab, 0x7a, + 0xaa, 0x97, 0xab, 0xf6, 0x0f, 0x2f, 0x97, 0xe2, 0xa9, 0xfb, 0xc3, 0x65, 0x6b, 0x43, 0xf1, 0xd4, + 0x0a, 0xfd, 0xf7, 0x94, 0x75, 0xd7, 0xfe, 0xa5, 0x02, 0x97, 0x4e, 0x6e, 0x5e, 0xe4, 0x2e, 0xd4, + 0xf1, 0x22, 0x79, 0x3c, 0xb2, 0x51, 0xee, 0x5d, 0x47, 0x0d, 0xbf, 0x3d, 0x5d, 0xdf, 0x4c, 0xb9, + 0x3e, 0x2c, 0xfb, 0x9d, 0x58, 0x0c, 0xba, 0xb1, 0x50, 0x03, 0xa1, 0xdc, 0xe7, 0x1d, 0x95, 0xdc, + 0xef, 0x62, 0xc9, 0xab, 0xce, 0x4d, 0x16, 0xff, 0xf9, 0x74, 0x7d, 0x65, 0x44, 0x07, 0xd9, 0x47, + 0xc1, 0x2d, 0xab, 0x26, 0x08, 0xc7, 0x0a, 0x09, 0x07, 0x9f, 0x0e, 0x29, 0xcf, 0x68, 0x9f, 0xa3, + 0x69, 0x9b, 0x31, 0xbd, 0x9d, 0x53, 0x1b, 0xb8, 0x60, 0x0d, 0xcc, 0xea, 0x0a, 0xc2, 0x39, 0xd5, + 0xe4, 0x0e, 0x54, 0xd5, 0x28, 0x8f, 0x6d, 0x9b, 0xec, 0x7d, 0x7c, 0x6a, 0x13, 0x4d, 0x6b, 0x02, + 0x75, 0x04, 0xa1, 0x51, 0x15, 0x8c, 0xe0, 0xfc, 0x9e, 0xa5, 0xd7, 0x64, 0xcc, 0x0d, 0x1a, 0x1f, + 0x32, 0xb2, 0x03, 0x75, 0x9c, 0xac, 0x38, 0xc3, 0xc2, 0xc4, 0x80, 0xbc, 0x31, 0x1f, 0x90, 0xd9, + 0x49, 0xac, 0xb3, 0x8f, 0x93, 0xd8, 0x0e, 0x0e, 0x62, 0x2e, 0x2e, 0xe3, 0x7f, 0x31, 0xee, 0xf8, + 0x20, 0x3c, 0x60, 0x49, 0x14, 0x97, 0xae, 0x82, 0x1b, 0x0e, 0xb9, 0x51, 0x6e, 0xff, 0x50, 0x81, + 0xba, 0x31, 0xca, 0x24, 0xb9, 0x0d, 0x35, 0xb3, 0x24, 0xaf, 0x2a, 0x1d, 0x57, 0x75, 0x6b, 0x1b, + 0xaf, 0x94, 0x29, 0xb2, 0x51, 0xb0, 0x40, 0xee, 0xc2, 0x8a, 0x2d, 0xb7, 0xb2, 0xaf, 0x62, 0xc9, + 0xfb, 0xec, 0xff, 0xd2, 0xfc, 0xae, 0x87, 0xce, 0x9a, 0x31, 0xf0, 0x65, 0x2a, 0x67, 0xc7, 0xd0, + 0x97, 0xa9, 0x9c, 0xce, 0x91, 0xc1, 0x42, 0xef, 0xe6, 0xe3, 0x67, 0x6d, 0xef, 0xc9, 0xb3, 0xb6, + 0xf7, 0xc7, 0xb3, 0xb6, 0xf7, 0xd3, 0xf3, 0xf6, 0xc2, 0x93, 0xe7, 0xed, 0x85, 0x5f, 0x9f, 0xb7, + 0x17, 0xee, 0x5e, 0x9b, 0x89, 0xed, 0xdc, 0x30, 0x3c, 0xdc, 0xee, 0x3e, 0x9c, 0x0c, 0xe8, 0x26, + 0xc6, 0xfd, 0x25, 0x33, 0x07, 0xbf, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0x7a, 0x06, + 0xb3, 0xc5, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1706,6 +1765,48 @@ func (m *QualityOfServiceReport) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *PairingRelayCache) 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 *PairingRelayCache) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PairingRelayCache) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowedCu != 0 { + i = encodeVarintRelay(dAtA, i, uint64(m.AllowedCu)) + i-- + dAtA[i] = 0x10 + } + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelay(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintRelay(dAtA []byte, offset int, v uint64) int { offset -= sovRelay(v) base := offset @@ -2007,6 +2108,24 @@ func (m *QualityOfServiceReport) Size() (n int) { return n } +func (m *PairingRelayCache) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovRelay(uint64(l)) + } + } + if m.AllowedCu != 0 { + n += 1 + sovRelay(uint64(m.AllowedCu)) + } + return n +} + func sovRelay(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4059,6 +4178,109 @@ func (m *QualityOfServiceReport) Unmarshal(dAtA []byte) error { } return nil } +func (m *PairingRelayCache) 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 ErrIntOverflowRelay + } + 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: PairingRelayCache: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PairingRelayCache: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelay + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entries = append(m.Entries, types.StakeEntry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedCu", wireType) + } + m.AllowedCu = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelay + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AllowedCu |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRelay(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelay + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipRelay(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/pairing/types/relayCache.pb.go b/x/pairing/types/relayCache.pb.go index 9c5ac5d51b..8eaa34bccd 100644 --- a/x/pairing/types/relayCache.pb.go +++ b/x/pairing/types/relayCache.pb.go @@ -30,9 +30,10 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type CacheRelayReply struct { - Reply *RelayReply `protobuf:"bytes,1,opt,name=reply,proto3" json:"reply,omitempty"` - OptionalMetadata []Metadata `protobuf:"bytes,2,rep,name=optional_metadata,json=optionalMetadata,proto3" json:"optional_metadata"` - SeenBlock int64 `protobuf:"varint,3,opt,name=seen_block,json=seenBlock,proto3" json:"seen_block,omitempty"` + Reply *RelayReply `protobuf:"bytes,1,opt,name=reply,proto3" json:"reply,omitempty"` + OptionalMetadata []Metadata `protobuf:"bytes,2,rep,name=optional_metadata,json=optionalMetadata,proto3" json:"optional_metadata"` + SeenBlock int64 `protobuf:"varint,3,opt,name=seen_block,json=seenBlock,proto3" json:"seen_block,omitempty"` + BlocksHashesToHeights []*BlockHashToHeight `protobuf:"bytes,4,rep,name=blocks_hashes_to_heights,json=blocksHashesToHeights,proto3" json:"blocks_hashes_to_heights,omitempty"` } func (m *CacheRelayReply) Reset() { *m = CacheRelayReply{} } @@ -89,6 +90,13 @@ func (m *CacheRelayReply) GetSeenBlock() int64 { return 0 } +func (m *CacheRelayReply) GetBlocksHashesToHeights() []*BlockHashToHeight { + if m != nil { + return m.BlocksHashesToHeights + } + return nil +} + type CacheUsage struct { CacheHits uint64 `protobuf:"varint,1,opt,name=CacheHits,proto3" json:"CacheHits,omitempty"` CacheMisses uint64 `protobuf:"varint,2,opt,name=CacheMisses,proto3" json:"CacheMisses,omitempty"` @@ -195,13 +203,14 @@ func (m *CacheHash) GetChainId() string { } type RelayCacheGet struct { - RequestHash []byte `protobuf:"bytes,1,opt,name=request_hash,json=requestHash,proto3" json:"request_hash,omitempty"` - BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` - Finalized bool `protobuf:"varint,3,opt,name=finalized,proto3" json:"finalized,omitempty"` - RequestedBlock int64 `protobuf:"varint,4,opt,name=requested_block,json=requestedBlock,proto3" json:"requested_block,omitempty"` - SharedStateId string `protobuf:"bytes,5,opt,name=shared_state_id,json=sharedStateId,proto3" json:"shared_state_id,omitempty"` - ChainId string `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - SeenBlock int64 `protobuf:"varint,7,opt,name=seen_block,json=seenBlock,proto3" json:"seen_block,omitempty"` + RequestHash []byte `protobuf:"bytes,1,opt,name=request_hash,json=requestHash,proto3" json:"request_hash,omitempty"` + BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + Finalized bool `protobuf:"varint,3,opt,name=finalized,proto3" json:"finalized,omitempty"` + RequestedBlock int64 `protobuf:"varint,4,opt,name=requested_block,json=requestedBlock,proto3" json:"requested_block,omitempty"` + SharedStateId string `protobuf:"bytes,5,opt,name=shared_state_id,json=sharedStateId,proto3" json:"shared_state_id,omitempty"` + ChainId string `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + SeenBlock int64 `protobuf:"varint,7,opt,name=seen_block,json=seenBlock,proto3" json:"seen_block,omitempty"` + BlocksHashesToHeights []*BlockHashToHeight `protobuf:"bytes,8,rep,name=blocks_hashes_to_heights,json=blocksHashesToHeights,proto3" json:"blocks_hashes_to_heights,omitempty"` } func (m *RelayCacheGet) Reset() { *m = RelayCacheGet{} } @@ -286,18 +295,26 @@ func (m *RelayCacheGet) GetSeenBlock() int64 { return 0 } +func (m *RelayCacheGet) GetBlocksHashesToHeights() []*BlockHashToHeight { + if m != nil { + return m.BlocksHashesToHeights + } + return nil +} + type RelayCacheSet struct { - RequestHash []byte `protobuf:"bytes,1,opt,name=request_hash,json=requestHash,proto3" json:"request_hash,omitempty"` - BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` - Response *RelayReply `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` - Finalized bool `protobuf:"varint,4,opt,name=finalized,proto3" json:"finalized,omitempty"` - OptionalMetadata []Metadata `protobuf:"bytes,5,rep,name=optional_metadata,json=optionalMetadata,proto3" json:"optional_metadata"` - SharedStateId string `protobuf:"bytes,6,opt,name=shared_state_id,json=sharedStateId,proto3" json:"shared_state_id,omitempty"` - RequestedBlock int64 `protobuf:"varint,7,opt,name=requested_block,json=requestedBlock,proto3" json:"requested_block,omitempty"` - ChainId string `protobuf:"bytes,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - SeenBlock int64 `protobuf:"varint,10,opt,name=seen_block,json=seenBlock,proto3" json:"seen_block,omitempty"` - AverageBlockTime int64 `protobuf:"varint,11,opt,name=average_block_time,json=averageBlockTime,proto3" json:"average_block_time,omitempty"` - IsNodeError bool `protobuf:"varint,12,opt,name=is_node_error,json=isNodeError,proto3" json:"is_node_error,omitempty"` + RequestHash []byte `protobuf:"bytes,1,opt,name=request_hash,json=requestHash,proto3" json:"request_hash,omitempty"` + BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + Response *RelayReply `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` + Finalized bool `protobuf:"varint,4,opt,name=finalized,proto3" json:"finalized,omitempty"` + OptionalMetadata []Metadata `protobuf:"bytes,5,rep,name=optional_metadata,json=optionalMetadata,proto3" json:"optional_metadata"` + SharedStateId string `protobuf:"bytes,6,opt,name=shared_state_id,json=sharedStateId,proto3" json:"shared_state_id,omitempty"` + RequestedBlock int64 `protobuf:"varint,7,opt,name=requested_block,json=requestedBlock,proto3" json:"requested_block,omitempty"` + ChainId string `protobuf:"bytes,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + SeenBlock int64 `protobuf:"varint,10,opt,name=seen_block,json=seenBlock,proto3" json:"seen_block,omitempty"` + AverageBlockTime int64 `protobuf:"varint,11,opt,name=average_block_time,json=averageBlockTime,proto3" json:"average_block_time,omitempty"` + IsNodeError bool `protobuf:"varint,12,opt,name=is_node_error,json=isNodeError,proto3" json:"is_node_error,omitempty"` + BlocksHashesToHeights []*BlockHashToHeight `protobuf:"bytes,13,rep,name=blocks_hashes_to_heights,json=blocksHashesToHeights,proto3" json:"blocks_hashes_to_heights,omitempty"` } func (m *RelayCacheSet) Reset() { *m = RelayCacheSet{} } @@ -410,12 +427,72 @@ func (m *RelayCacheSet) GetIsNodeError() bool { return false } +func (m *RelayCacheSet) GetBlocksHashesToHeights() []*BlockHashToHeight { + if m != nil { + return m.BlocksHashesToHeights + } + return nil +} + +type BlockHashToHeight struct { + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *BlockHashToHeight) Reset() { *m = BlockHashToHeight{} } +func (m *BlockHashToHeight) String() string { return proto.CompactTextString(m) } +func (*BlockHashToHeight) ProtoMessage() {} +func (*BlockHashToHeight) Descriptor() ([]byte, []int) { + return fileDescriptor_36fbab536e2bbad1, []int{5} +} +func (m *BlockHashToHeight) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockHashToHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockHashToHeight.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 *BlockHashToHeight) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockHashToHeight.Merge(m, src) +} +func (m *BlockHashToHeight) XXX_Size() int { + return m.Size() +} +func (m *BlockHashToHeight) XXX_DiscardUnknown() { + xxx_messageInfo_BlockHashToHeight.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockHashToHeight proto.InternalMessageInfo + +func (m *BlockHashToHeight) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *BlockHashToHeight) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + func init() { proto.RegisterType((*CacheRelayReply)(nil), "lavanet.lava.pairing.CacheRelayReply") proto.RegisterType((*CacheUsage)(nil), "lavanet.lava.pairing.CacheUsage") proto.RegisterType((*CacheHash)(nil), "lavanet.lava.pairing.CacheHash") proto.RegisterType((*RelayCacheGet)(nil), "lavanet.lava.pairing.RelayCacheGet") proto.RegisterType((*RelayCacheSet)(nil), "lavanet.lava.pairing.RelayCacheSet") + proto.RegisterType((*BlockHashToHeight)(nil), "lavanet.lava.pairing.BlockHashToHeight") } func init() { @@ -423,49 +500,54 @@ func init() { } var fileDescriptor_36fbab536e2bbad1 = []byte{ - // 662 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xb6, 0x9b, 0x34, 0x3f, 0x9b, 0x94, 0x96, 0x55, 0x85, 0x42, 0x68, 0x8d, 0x31, 0xea, 0xcf, - 0x01, 0xd9, 0x52, 0x91, 0x38, 0x71, 0x80, 0xd2, 0xaa, 0xad, 0x44, 0x11, 0x38, 0x20, 0x21, 0x2e, - 0xd6, 0x26, 0x9e, 0xda, 0x2b, 0x1c, 0xaf, 0xf1, 0x6e, 0x2b, 0xca, 0x53, 0xf0, 0x3e, 0xbc, 0x40, - 0x8f, 0x3d, 0x72, 0x01, 0xa1, 0xf6, 0x29, 0xe0, 0x84, 0x3c, 0x71, 0xd2, 0x24, 0x72, 0xa3, 0x4a, - 0x70, 0xf2, 0xee, 0xb7, 0xdf, 0xec, 0xcc, 0x7c, 0xdf, 0x7a, 0xc8, 0x5a, 0xc4, 0x4e, 0x58, 0x0c, - 0xca, 0xc9, 0xbe, 0x4e, 0xc2, 0x78, 0xca, 0xe3, 0xc0, 0x49, 0x21, 0x62, 0xa7, 0x2f, 0x58, 0x2f, - 0x04, 0x3b, 0x49, 0x85, 0x12, 0x74, 0x39, 0xa7, 0xd9, 0xd9, 0xd7, 0xce, 0x69, 0xed, 0xe5, 0x40, - 0x04, 0x02, 0x09, 0x4e, 0xb6, 0x1a, 0x70, 0xdb, 0xe6, 0xf5, 0x57, 0xe6, 0x8c, 0x7b, 0x81, 0x10, - 0x41, 0x04, 0x0e, 0xee, 0xba, 0xc7, 0x47, 0x0e, 0xf4, 0x13, 0x95, 0x1f, 0x5a, 0xdf, 0x74, 0xb2, - 0x88, 0xa9, 0xdd, 0x2c, 0xc2, 0x85, 0x24, 0x3a, 0xa5, 0x4f, 0xc8, 0x7c, 0x9a, 0x2d, 0x5a, 0xba, - 0xa9, 0x6f, 0x36, 0xb6, 0x4c, 0xbb, 0xa8, 0x1c, 0xfb, 0x2a, 0xc0, 0x1d, 0xd0, 0xe9, 0x1b, 0x72, - 0x5b, 0x24, 0x8a, 0x8b, 0x98, 0x45, 0x5e, 0x1f, 0x14, 0xf3, 0x99, 0x62, 0xad, 0x39, 0xb3, 0xb4, - 0xd9, 0xd8, 0x32, 0x8a, 0xef, 0x38, 0xcc, 0x59, 0xdb, 0xe5, 0xb3, 0x9f, 0xf7, 0x35, 0x77, 0x69, - 0x18, 0x3e, 0xc4, 0xe9, 0x2a, 0x21, 0x12, 0x20, 0xf6, 0xba, 0x91, 0xe8, 0x7d, 0x6c, 0x95, 0x4c, - 0x7d, 0xb3, 0xe4, 0xd6, 0x33, 0x64, 0x3b, 0x03, 0xac, 0x97, 0x84, 0x60, 0xf1, 0xef, 0x24, 0x0b, - 0x80, 0xae, 0x90, 0x3a, 0xee, 0xf6, 0xb9, 0x92, 0x58, 0x7b, 0xd9, 0xbd, 0x02, 0xa8, 0x49, 0x1a, - 0xb8, 0x39, 0xe4, 0x52, 0x82, 0x6c, 0xcd, 0xe1, 0xf9, 0x38, 0x64, 0x85, 0xc3, 0x78, 0x26, 0x43, - 0xfa, 0x8c, 0x54, 0x53, 0xf8, 0x74, 0x0c, 0x52, 0xe5, 0x32, 0xac, 0xcf, 0x90, 0xe1, 0x75, 0xca, - 0x4f, 0x98, 0x82, 0x1d, 0xa6, 0x98, 0x3b, 0x0c, 0xa3, 0x77, 0x49, 0xad, 0x17, 0x32, 0x1e, 0x7b, - 0xdc, 0xc7, 0x6c, 0x75, 0xb7, 0x8a, 0xfb, 0x03, 0xdf, 0xfa, 0xa3, 0x93, 0x05, 0x77, 0xe4, 0xfa, - 0x1e, 0x28, 0xfa, 0x80, 0x34, 0xf3, 0x38, 0x2f, 0x64, 0x32, 0xc4, 0x9c, 0x4d, 0xb7, 0x91, 0x63, - 0x58, 0xd1, 0x2a, 0x21, 0x28, 0xc3, 0x80, 0x30, 0x87, 0x84, 0x3a, 0x22, 0x78, 0xbc, 0x42, 0xea, - 0x47, 0x3c, 0x66, 0x11, 0xff, 0x02, 0x3e, 0x2a, 0x55, 0x73, 0xaf, 0x00, 0xba, 0x41, 0x16, 0xf3, - 0xbb, 0xc0, 0xcf, 0xd5, 0x2c, 0xa3, 0x9a, 0xb7, 0x46, 0x30, 0x4a, 0x4a, 0xd7, 0xc9, 0xa2, 0x0c, - 0x59, 0x0a, 0xbe, 0x27, 0x15, 0x53, 0x90, 0x15, 0x3f, 0x8f, 0xc5, 0x2f, 0x0c, 0xe0, 0x4e, 0x86, - 0x1e, 0xf8, 0x13, 0xdd, 0x55, 0x26, 0xba, 0x9b, 0x32, 0xad, 0x3a, 0x6d, 0xda, 0x8f, 0xd2, 0x78, - 0xf3, 0x9d, 0xff, 0xd2, 0xfc, 0x53, 0x52, 0x4b, 0x41, 0x26, 0x22, 0x96, 0x80, 0xbd, 0xdf, 0xe4, - 0xd5, 0x8e, 0x22, 0x26, 0xa5, 0x2b, 0x4f, 0x4b, 0x57, 0xf8, 0xac, 0xe7, 0xff, 0xe9, 0x59, 0x17, - 0x88, 0x5c, 0x29, 0x12, 0xb9, 0xc0, 0xb5, 0x6a, 0xa1, 0x6b, 0xe3, 0x6e, 0xd4, 0x67, 0xb9, 0x41, - 0xa6, 0xdc, 0xa0, 0x8f, 0x08, 0x65, 0x27, 0x90, 0xb2, 0x00, 0x06, 0x0c, 0x4f, 0xf1, 0x3e, 0xb4, - 0x1a, 0x48, 0x5b, 0xca, 0x4f, 0x90, 0xf9, 0x96, 0xf7, 0x81, 0x5a, 0x64, 0x81, 0x4b, 0x2f, 0x16, - 0x3e, 0x78, 0x90, 0xa6, 0x22, 0x6d, 0x35, 0x51, 0xad, 0x06, 0x97, 0xaf, 0x84, 0x0f, 0xbb, 0x19, - 0xb4, 0xf5, 0x5b, 0x27, 0x4d, 0x94, 0x19, 0x52, 0x74, 0x98, 0xbe, 0x27, 0xb5, 0x3d, 0x50, 0x08, - 0xd1, 0x87, 0x33, 0x6c, 0x19, 0xfe, 0x0c, 0xed, 0xb5, 0x62, 0xd2, 0xd4, 0x9c, 0xb2, 0x34, 0x7a, - 0x40, 0x6a, 0x9d, 0x1b, 0xdf, 0xdc, 0x01, 0xd5, 0xbe, 0x63, 0x0f, 0x86, 0xa1, 0x3d, 0x1c, 0x86, - 0xf6, 0x6e, 0x36, 0x0c, 0x2d, 0x8d, 0xee, 0x90, 0xca, 0x3e, 0xb0, 0x48, 0x85, 0xf4, 0x1a, 0x4e, - 0xdb, 0x9c, 0x51, 0x15, 0x0e, 0x20, 0x4b, 0xdb, 0x7e, 0x7e, 0x76, 0x61, 0xe8, 0xe7, 0x17, 0x86, - 0xfe, 0xeb, 0xc2, 0xd0, 0xbf, 0x5e, 0x1a, 0xda, 0xf9, 0xa5, 0xa1, 0x7d, 0xbf, 0x34, 0xb4, 0x0f, - 0x1b, 0x01, 0x57, 0xe1, 0x71, 0xd7, 0xee, 0x89, 0xbe, 0x33, 0x31, 0xb2, 0x3f, 0x8f, 0x86, 0xb6, - 0x3a, 0x4d, 0x40, 0x76, 0x2b, 0x98, 0xf6, 0xf1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x1c, - 0xe5, 0x7f, 0x2c, 0x06, 0x00, 0x00, + // 748 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0xd6, 0x9f, 0xf5, 0xb3, 0x92, 0x6a, 0x7b, 0xe1, 0x1a, 0xac, 0x5a, 0xab, 0x2a, 0x0b, 0xff, + 0xa0, 0x28, 0x48, 0x40, 0x05, 0x7a, 0x2a, 0xd0, 0xc2, 0xb5, 0x61, 0x19, 0x88, 0x83, 0x84, 0x72, + 0x80, 0x20, 0x17, 0x66, 0x25, 0x8e, 0xc9, 0x45, 0x28, 0xae, 0xc2, 0x5d, 0x0b, 0x71, 0x9e, 0x22, + 0x2f, 0x90, 0x67, 0xc9, 0xd5, 0x47, 0x1f, 0x73, 0x08, 0x82, 0xc0, 0x7e, 0x8a, 0xdc, 0x02, 0x0e, + 0x49, 0xd9, 0x52, 0x68, 0xc1, 0x41, 0x7c, 0x22, 0xf7, 0xdb, 0x6f, 0x66, 0x96, 0xf3, 0x7d, 0xcb, + 0x21, 0x9b, 0x3e, 0x9b, 0xb0, 0x00, 0x94, 0x19, 0x3d, 0xcd, 0x31, 0xe3, 0x21, 0x0f, 0x5c, 0x33, + 0x04, 0x9f, 0x9d, 0xfd, 0xcf, 0x86, 0x1e, 0x18, 0xe3, 0x50, 0x28, 0x41, 0xd7, 0x12, 0x9a, 0x11, + 0x3d, 0x8d, 0x84, 0xd6, 0x5a, 0x73, 0x85, 0x2b, 0x90, 0x60, 0x46, 0x6f, 0x31, 0xb7, 0xd5, 0xb9, + 0x3d, 0x65, 0xc2, 0xf8, 0xd9, 0x15, 0xc2, 0xf5, 0xc1, 0xc4, 0xd5, 0xe0, 0xf4, 0xc4, 0x84, 0xd1, + 0x58, 0x25, 0x9b, 0xfa, 0xdb, 0x02, 0x59, 0xc6, 0xd2, 0x56, 0x14, 0x61, 0xc1, 0xd8, 0x3f, 0xa3, + 0x7f, 0x93, 0xa5, 0x30, 0x7a, 0xd1, 0xf2, 0x9d, 0xfc, 0x4e, 0xbd, 0xdb, 0x31, 0xb2, 0x8e, 0x63, + 0x5c, 0x07, 0x58, 0x31, 0x9d, 0x3e, 0x26, 0xab, 0x62, 0xac, 0xb8, 0x08, 0x98, 0x6f, 0x8f, 0x40, + 0x31, 0x87, 0x29, 0xa6, 0x15, 0x3a, 0xc5, 0x9d, 0x7a, 0xb7, 0x9d, 0x9d, 0xe3, 0x28, 0x61, 0xed, + 0x96, 0xce, 0x3f, 0xfe, 0x9a, 0xb3, 0x56, 0xd2, 0xf0, 0x14, 0xa7, 0x1b, 0x84, 0x48, 0x80, 0xc0, + 0x1e, 0xf8, 0x62, 0xf8, 0x42, 0x2b, 0x76, 0xf2, 0x3b, 0x45, 0xab, 0x16, 0x21, 0xbb, 0x11, 0x40, + 0x9f, 0x13, 0x0d, 0x77, 0xa4, 0xed, 0x31, 0xe9, 0x81, 0xb4, 0x95, 0xb0, 0x3d, 0xe0, 0xae, 0xa7, + 0xa4, 0x56, 0xc2, 0xc2, 0xdb, 0xd9, 0x85, 0x31, 0xbc, 0xc7, 0xa4, 0x77, 0x2c, 0x7a, 0xc8, 0xb7, + 0x7e, 0x8c, 0x13, 0xf5, 0x30, 0x4f, 0x8a, 0x4a, 0xfd, 0x01, 0x21, 0xd8, 0x9e, 0x27, 0x92, 0xb9, + 0x40, 0x7f, 0x21, 0x35, 0x5c, 0xf5, 0xb8, 0x92, 0xd8, 0x9d, 0x92, 0x75, 0x0d, 0xd0, 0x0e, 0xa9, + 0xe3, 0xe2, 0x88, 0x4b, 0x09, 0x52, 0x2b, 0xe0, 0xfe, 0x4d, 0x48, 0xf7, 0xd2, 0x78, 0x26, 0x3d, + 0xfa, 0x1f, 0xa9, 0x84, 0xf0, 0xf2, 0x14, 0xa4, 0x4a, 0x1a, 0xbd, 0xb5, 0xa0, 0xd1, 0x8f, 0x42, + 0x3e, 0x61, 0x0a, 0xf6, 0x98, 0x62, 0x56, 0x1a, 0x46, 0x7f, 0x22, 0xd5, 0xa1, 0xc7, 0x78, 0x60, + 0x73, 0x07, 0xab, 0xd5, 0xac, 0x0a, 0xae, 0x0f, 0x1d, 0xfd, 0x43, 0x81, 0x34, 0xad, 0xa9, 0xaf, + 0x0e, 0x40, 0xd1, 0xdf, 0x48, 0x23, 0x89, 0xc3, 0x66, 0x61, 0xcd, 0x86, 0x55, 0x4f, 0x30, 0x3c, + 0xd1, 0x06, 0x21, 0xd8, 0x85, 0x98, 0x50, 0x40, 0x42, 0x6d, 0x90, 0xb6, 0x2a, 0xfa, 0xfa, 0x13, + 0x1e, 0x30, 0x9f, 0xbf, 0x06, 0x07, 0xb5, 0xa8, 0x5a, 0xd7, 0x00, 0xdd, 0x26, 0xcb, 0x49, 0x2e, + 0x70, 0x12, 0xbd, 0x4a, 0xa8, 0xd7, 0x0f, 0x53, 0x38, 0x16, 0x6d, 0x8b, 0x2c, 0x4b, 0x8f, 0x85, + 0xe0, 0xd8, 0x52, 0x31, 0x05, 0xd1, 0xe1, 0x97, 0xf0, 0xf0, 0xcd, 0x18, 0xee, 0x47, 0xe8, 0xa1, + 0x33, 0xf3, 0x75, 0xe5, 0x99, 0xaf, 0x9b, 0xb3, 0x45, 0xe5, 0x5b, 0x6c, 0x51, 0xbd, 0x17, 0x5b, + 0xbc, 0x2b, 0xdd, 0x6c, 0x6f, 0xff, 0x5e, 0xda, 0xfb, 0x0f, 0xa9, 0x86, 0x20, 0xc7, 0x22, 0x90, + 0x80, 0xdd, 0xbd, 0xcb, 0xcd, 0x9b, 0x46, 0xcc, 0x8a, 0x53, 0x9a, 0x17, 0x27, 0xf3, 0x6a, 0x2e, + 0x7d, 0xd7, 0xd5, 0xcc, 0x90, 0xb1, 0x9c, 0x25, 0x63, 0x86, 0x2f, 0x2a, 0x99, 0xbe, 0xb8, 0xa9, + 0x77, 0x6d, 0x91, 0xde, 0x64, 0x5e, 0xef, 0x3f, 0x09, 0x65, 0x13, 0x08, 0x99, 0x0b, 0x31, 0xc3, + 0x56, 0x7c, 0x04, 0x5a, 0x1d, 0x69, 0x2b, 0xc9, 0x0e, 0x32, 0x8f, 0xf9, 0x08, 0xa8, 0x4e, 0x9a, + 0x5c, 0xda, 0x81, 0x70, 0xc0, 0x86, 0x30, 0x14, 0xa1, 0xd6, 0xc0, 0x6e, 0xd5, 0xb9, 0x7c, 0x28, + 0x1c, 0xd8, 0x8f, 0xa0, 0x85, 0x0e, 0x6a, 0xde, 0x8b, 0x83, 0xfe, 0x25, 0xab, 0x5f, 0x71, 0x29, + 0x25, 0xa5, 0xa9, 0x79, 0x6a, 0x16, 0xbe, 0xd3, 0x75, 0x52, 0x8e, 0x2b, 0xa3, 0x63, 0x8a, 0x56, + 0xb2, 0xea, 0x7e, 0xce, 0x93, 0x06, 0x3a, 0x01, 0x42, 0x34, 0x21, 0x7d, 0x4a, 0xaa, 0x07, 0xa0, + 0x10, 0xa2, 0xbf, 0x2f, 0x70, 0x4e, 0xfa, 0x47, 0x68, 0x6d, 0x66, 0x93, 0xe6, 0xc6, 0x81, 0x9e, + 0xa3, 0x87, 0xa4, 0xda, 0xbf, 0x73, 0xe6, 0x3e, 0xa8, 0xd6, 0xba, 0x11, 0xcf, 0x1c, 0x23, 0x9d, + 0x39, 0xc6, 0x7e, 0x34, 0x73, 0xf4, 0x1c, 0xdd, 0x23, 0xe5, 0x1e, 0x30, 0x5f, 0x79, 0xf4, 0x16, + 0x4e, 0xab, 0xb3, 0xe0, 0x54, 0xf8, 0x17, 0xd6, 0x73, 0xbb, 0x7b, 0xe7, 0x97, 0xed, 0xfc, 0xc5, + 0x65, 0x3b, 0xff, 0xe9, 0xb2, 0x9d, 0x7f, 0x73, 0xd5, 0xce, 0x5d, 0x5c, 0xb5, 0x73, 0xef, 0xaf, + 0xda, 0xb9, 0x67, 0x7f, 0xb8, 0x5c, 0x79, 0xa7, 0x03, 0x63, 0x28, 0x46, 0xe6, 0xcc, 0x64, 0x9c, + 0x74, 0xcd, 0x57, 0xd3, 0xf1, 0xa8, 0xce, 0xc6, 0x20, 0x07, 0x65, 0xac, 0xfc, 0xd7, 0x97, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x27, 0x80, 0x2a, 0x55, 0x96, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -640,6 +722,20 @@ func (m *CacheRelayReply) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.BlocksHashesToHeights) > 0 { + for iNdEx := len(m.BlocksHashesToHeights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BlocksHashesToHeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelayCache(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } if m.SeenBlock != 0 { i = encodeVarintRelayCache(dAtA, i, uint64(m.SeenBlock)) i-- @@ -769,6 +865,20 @@ func (m *RelayCacheGet) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.BlocksHashesToHeights) > 0 { + for iNdEx := len(m.BlocksHashesToHeights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BlocksHashesToHeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelayCache(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } if m.SeenBlock != 0 { i = encodeVarintRelayCache(dAtA, i, uint64(m.SeenBlock)) i-- @@ -840,6 +950,20 @@ func (m *RelayCacheSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.BlocksHashesToHeights) > 0 { + for iNdEx := len(m.BlocksHashesToHeights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BlocksHashesToHeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRelayCache(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + } if m.IsNodeError { i-- if m.IsNodeError { @@ -932,6 +1056,41 @@ func (m *RelayCacheSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BlockHashToHeight) 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 *BlockHashToHeight) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockHashToHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintRelayCache(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintRelayCache(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintRelayCache(dAtA []byte, offset int, v uint64) int { offset -= sovRelayCache(v) base := offset @@ -962,6 +1121,12 @@ func (m *CacheRelayReply) Size() (n int) { if m.SeenBlock != 0 { n += 1 + sovRelayCache(uint64(m.SeenBlock)) } + if len(m.BlocksHashesToHeights) > 0 { + for _, e := range m.BlocksHashesToHeights { + l = e.Size() + n += 1 + l + sovRelayCache(uint64(l)) + } + } return n } @@ -1028,6 +1193,12 @@ func (m *RelayCacheGet) Size() (n int) { if m.SeenBlock != 0 { n += 1 + sovRelayCache(uint64(m.SeenBlock)) } + if len(m.BlocksHashesToHeights) > 0 { + for _, e := range m.BlocksHashesToHeights { + l = e.Size() + n += 1 + l + sovRelayCache(uint64(l)) + } + } return n } @@ -1078,6 +1249,28 @@ func (m *RelayCacheSet) Size() (n int) { if m.IsNodeError { n += 2 } + if len(m.BlocksHashesToHeights) > 0 { + for _, e := range m.BlocksHashesToHeights { + l = e.Size() + n += 1 + l + sovRelayCache(uint64(l)) + } + } + return n +} + +func (m *BlockHashToHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovRelayCache(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovRelayCache(uint64(m.Height)) + } return n } @@ -1205,6 +1398,40 @@ func (m *CacheRelayReply) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksHashesToHeights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayCache + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelayCache + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelayCache + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlocksHashesToHeights = append(m.BlocksHashesToHeights, &BlockHashToHeight{}) + if err := m.BlocksHashesToHeights[len(m.BlocksHashesToHeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRelayCache(dAtA[iNdEx:]) @@ -1651,6 +1878,40 @@ func (m *RelayCacheGet) Unmarshal(dAtA []byte) error { break } } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksHashesToHeights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayCache + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelayCache + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelayCache + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlocksHashesToHeights = append(m.BlocksHashesToHeights, &BlockHashToHeight{}) + if err := m.BlocksHashesToHeights[len(m.BlocksHashesToHeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRelayCache(dAtA[iNdEx:]) @@ -2000,6 +2261,141 @@ func (m *RelayCacheSet) Unmarshal(dAtA []byte) error { } } m.IsNodeError = bool(v != 0) + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksHashesToHeights", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayCache + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRelayCache + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRelayCache + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlocksHashesToHeights = append(m.BlocksHashesToHeights, &BlockHashToHeight{}) + if err := m.BlocksHashesToHeights[len(m.BlocksHashesToHeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRelayCache(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRelayCache + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockHashToHeight) 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 ErrIntOverflowRelayCache + } + 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: BlockHashToHeight: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockHashToHeight: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayCache + } + 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 ErrInvalidLengthRelayCache + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRelayCache + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayCache + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipRelayCache(dAtA[iNdEx:]) diff --git a/x/pairing/types/relay_exchange.go b/x/pairing/types/relay_exchange.go index f2f483bff0..f834593a57 100644 --- a/x/pairing/types/relay_exchange.go +++ b/x/pairing/types/relay_exchange.go @@ -3,8 +3,8 @@ package types import ( "strings" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" ) // RelayExchange consists a relay request and its corresponding response diff --git a/x/pairing/types/relay_finalization.go b/x/pairing/types/relay_finalization.go deleted file mode 100644 index 4bafb691ec..0000000000 --- a/x/pairing/types/relay_finalization.go +++ /dev/null @@ -1,36 +0,0 @@ -package types - -import ( - tendermintcrypto "github.com/cometbft/cometbft/crypto" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils/sigs" -) - -type RelayFinalization struct { - Exchange RelayExchange - Addr sdk.AccAddress -} - -func NewRelayFinalization(exch RelayExchange, addr sdk.AccAddress) RelayFinalization { - return RelayFinalization{Exchange: exch, Addr: addr} -} - -func (rf RelayFinalization) GetSignature() []byte { - return rf.Exchange.Reply.SigBlocks -} - -func (rf RelayFinalization) DataToSign() []byte { - relaySessionHash := tendermintcrypto.Sha256(rf.Exchange.Request.RelaySession.CalculateHashForFinalization()) - latestBlockBytes := sigs.EncodeUint64(uint64(rf.Exchange.Reply.LatestBlock)) - msgParts := [][]byte{ - latestBlockBytes, - rf.Exchange.Reply.FinalizedBlocksHashes, - rf.Addr, - relaySessionHash, - } - return sigs.Join(msgParts) -} - -func (rf RelayFinalization) HashRounds() int { - return 1 -} diff --git a/x/pairing/types/relay_mock.pb.go b/x/pairing/types/relay_mock.pb.go new file mode 100644 index 0000000000..ad76b049fa --- /dev/null +++ b/x/pairing/types/relay_mock.pb.go @@ -0,0 +1,406 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/pairing/types/relay.pb.go + +// Package types is a generated GoMock package. +package types + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + grpc "google.golang.org/grpc" + metadata "google.golang.org/grpc/metadata" +) + +// MockRelayerClient is a mock of RelayerClient interface. +type MockRelayerClient struct { + ctrl *gomock.Controller + recorder *MockRelayerClientMockRecorder +} + +// MockRelayerClientMockRecorder is the mock recorder for MockRelayerClient. +type MockRelayerClientMockRecorder struct { + mock *MockRelayerClient +} + +// NewMockRelayerClient creates a new mock instance. +func NewMockRelayerClient(ctrl *gomock.Controller) *MockRelayerClient { + mock := &MockRelayerClient{ctrl: ctrl} + mock.recorder = &MockRelayerClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayerClient) EXPECT() *MockRelayerClientMockRecorder { + return m.recorder +} + +// Probe mocks base method. +func (m *MockRelayerClient) Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeReply, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Probe", varargs...) + ret0, _ := ret[0].(*ProbeReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Probe indicates an expected call of Probe. +func (mr *MockRelayerClientMockRecorder) Probe(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Probe", reflect.TypeOf((*MockRelayerClient)(nil).Probe), varargs...) +} + +// Relay mocks base method. +func (m *MockRelayerClient) Relay(ctx context.Context, in *RelayRequest, opts ...grpc.CallOption) (*RelayReply, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Relay", varargs...) + ret0, _ := ret[0].(*RelayReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Relay indicates an expected call of Relay. +func (mr *MockRelayerClientMockRecorder) Relay(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Relay", reflect.TypeOf((*MockRelayerClient)(nil).Relay), varargs...) +} + +// RelaySubscribe mocks base method. +func (m *MockRelayerClient) RelaySubscribe(ctx context.Context, in *RelayRequest, opts ...grpc.CallOption) (Relayer_RelaySubscribeClient, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RelaySubscribe", varargs...) + ret0, _ := ret[0].(Relayer_RelaySubscribeClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RelaySubscribe indicates an expected call of RelaySubscribe. +func (mr *MockRelayerClientMockRecorder) RelaySubscribe(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RelaySubscribe", reflect.TypeOf((*MockRelayerClient)(nil).RelaySubscribe), varargs...) +} + +// MockRelayer_RelaySubscribeClient is a mock of Relayer_RelaySubscribeClient interface. +type MockRelayer_RelaySubscribeClient struct { + ctrl *gomock.Controller + recorder *MockRelayer_RelaySubscribeClientMockRecorder +} + +// MockRelayer_RelaySubscribeClientMockRecorder is the mock recorder for MockRelayer_RelaySubscribeClient. +type MockRelayer_RelaySubscribeClientMockRecorder struct { + mock *MockRelayer_RelaySubscribeClient +} + +// NewMockRelayer_RelaySubscribeClient creates a new mock instance. +func NewMockRelayer_RelaySubscribeClient(ctrl *gomock.Controller) *MockRelayer_RelaySubscribeClient { + mock := &MockRelayer_RelaySubscribeClient{ctrl: ctrl} + mock.recorder = &MockRelayer_RelaySubscribeClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayer_RelaySubscribeClient) EXPECT() *MockRelayer_RelaySubscribeClientMockRecorder { + return m.recorder +} + +// CloseSend mocks base method. +func (m *MockRelayer_RelaySubscribeClient) CloseSend() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CloseSend") + ret0, _ := ret[0].(error) + return ret0 +} + +// CloseSend indicates an expected call of CloseSend. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) CloseSend() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).CloseSend)) +} + +// Context mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Context)) +} + +// Header mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Header() (metadata.MD, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Header") + ret0, _ := ret[0].(metadata.MD) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Header indicates an expected call of Header. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Header() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Header)) +} + +// Recv mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Recv() (*RelayReply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Recv") + ret0, _ := ret[0].(*RelayReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Recv indicates an expected call of Recv. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Recv() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Recv)) +} + +// RecvMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeClient) RecvMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "RecvMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) RecvMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).RecvMsg), m) +} + +// SendMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeClient) SendMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "SendMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) SendMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).SendMsg), m) +} + +// Trailer mocks base method. +func (m *MockRelayer_RelaySubscribeClient) Trailer() metadata.MD { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Trailer") + ret0, _ := ret[0].(metadata.MD) + return ret0 +} + +// Trailer indicates an expected call of Trailer. +func (mr *MockRelayer_RelaySubscribeClientMockRecorder) Trailer() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockRelayer_RelaySubscribeClient)(nil).Trailer)) +} + +// MockRelayerServer is a mock of RelayerServer interface. +type MockRelayerServer struct { + ctrl *gomock.Controller + recorder *MockRelayerServerMockRecorder +} + +// MockRelayerServerMockRecorder is the mock recorder for MockRelayerServer. +type MockRelayerServerMockRecorder struct { + mock *MockRelayerServer +} + +// NewMockRelayerServer creates a new mock instance. +func NewMockRelayerServer(ctrl *gomock.Controller) *MockRelayerServer { + mock := &MockRelayerServer{ctrl: ctrl} + mock.recorder = &MockRelayerServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayerServer) EXPECT() *MockRelayerServerMockRecorder { + return m.recorder +} + +// Probe mocks base method. +func (m *MockRelayerServer) Probe(arg0 context.Context, arg1 *ProbeRequest) (*ProbeReply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Probe", arg0, arg1) + ret0, _ := ret[0].(*ProbeReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Probe indicates an expected call of Probe. +func (mr *MockRelayerServerMockRecorder) Probe(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Probe", reflect.TypeOf((*MockRelayerServer)(nil).Probe), arg0, arg1) +} + +// Relay mocks base method. +func (m *MockRelayerServer) Relay(arg0 context.Context, arg1 *RelayRequest) (*RelayReply, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Relay", arg0, arg1) + ret0, _ := ret[0].(*RelayReply) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Relay indicates an expected call of Relay. +func (mr *MockRelayerServerMockRecorder) Relay(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Relay", reflect.TypeOf((*MockRelayerServer)(nil).Relay), arg0, arg1) +} + +// RelaySubscribe mocks base method. +func (m *MockRelayerServer) RelaySubscribe(arg0 *RelayRequest, arg1 Relayer_RelaySubscribeServer) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RelaySubscribe", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// RelaySubscribe indicates an expected call of RelaySubscribe. +func (mr *MockRelayerServerMockRecorder) RelaySubscribe(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RelaySubscribe", reflect.TypeOf((*MockRelayerServer)(nil).RelaySubscribe), arg0, arg1) +} + +// MockRelayer_RelaySubscribeServer is a mock of Relayer_RelaySubscribeServer interface. +type MockRelayer_RelaySubscribeServer struct { + ctrl *gomock.Controller + recorder *MockRelayer_RelaySubscribeServerMockRecorder +} + +// MockRelayer_RelaySubscribeServerMockRecorder is the mock recorder for MockRelayer_RelaySubscribeServer. +type MockRelayer_RelaySubscribeServerMockRecorder struct { + mock *MockRelayer_RelaySubscribeServer +} + +// NewMockRelayer_RelaySubscribeServer creates a new mock instance. +func NewMockRelayer_RelaySubscribeServer(ctrl *gomock.Controller) *MockRelayer_RelaySubscribeServer { + mock := &MockRelayer_RelaySubscribeServer{ctrl: ctrl} + mock.recorder = &MockRelayer_RelaySubscribeServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRelayer_RelaySubscribeServer) EXPECT() *MockRelayer_RelaySubscribeServerMockRecorder { + return m.recorder +} + +// Context mocks base method. +func (m *MockRelayer_RelaySubscribeServer) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).Context)) +} + +// RecvMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeServer) RecvMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "RecvMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) RecvMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).RecvMsg), m) +} + +// Send mocks base method. +func (m *MockRelayer_RelaySubscribeServer) Send(arg0 *RelayReply) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Send", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Send indicates an expected call of Send. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) Send(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).Send), arg0) +} + +// SendHeader mocks base method. +func (m *MockRelayer_RelaySubscribeServer) SendHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendHeader indicates an expected call of SendHeader. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SendHeader), arg0) +} + +// SendMsg mocks base method. +func (m_2 *MockRelayer_RelaySubscribeServer) SendMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "SendMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SendMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SendMsg), m) +} + +// SetHeader mocks base method. +func (m *MockRelayer_RelaySubscribeServer) SetHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetHeader indicates an expected call of SetHeader. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SetHeader), arg0) +} + +// SetTrailer mocks base method. +func (m *MockRelayer_RelaySubscribeServer) SetTrailer(arg0 metadata.MD) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetTrailer", arg0) +} + +// SetTrailer indicates an expected call of SetTrailer. +func (mr *MockRelayer_RelaySubscribeServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockRelayer_RelaySubscribeServer)(nil).SetTrailer), arg0) +} diff --git a/x/pairing/types/relay_session.go b/x/pairing/types/relay_session.go index 6c22b9982f..34144ea317 100644 --- a/x/pairing/types/relay_session.go +++ b/x/pairing/types/relay_session.go @@ -1,7 +1,7 @@ package types import ( - "github.com/lavanet/lava/utils/sigs" + "github.com/lavanet/lava/v2/utils/sigs" ) func (rs RelaySession) GetSignature() []byte { diff --git a/x/pairing/types/static_providers.pb.go b/x/pairing/types/static_providers.pb.go index 0584fa4911..aec1a5c68f 100644 --- a/x/pairing/types/static_providers.pb.go +++ b/x/pairing/types/static_providers.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - types "github.com/lavanet/lava/x/epochstorage/types" + types "github.com/lavanet/lava/v2/x/epochstorage/types" io "io" math "math" math_bits "math/bits" diff --git a/x/pairing/types/tx.pb.go b/x/pairing/types/tx.pb.go index b97d9e5549..20fde9aabb 100644 --- a/x/pairing/types/tx.pb.go +++ b/x/pairing/types/tx.pb.go @@ -12,7 +12,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - types1 "github.com/lavanet/lava/x/epochstorage/types" + types1 "github.com/lavanet/lava/v2/x/epochstorage/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -645,60 +645,63 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/pairing/tx.proto", fileDescriptor_07b85a84d2198a91) } var fileDescriptor_07b85a84d2198a91 = []byte{ - // 836 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x73, 0xdb, 0x44, - 0x14, 0xb7, 0x6a, 0xc5, 0x7f, 0x9e, 0xdb, 0xc4, 0xde, 0x66, 0xa8, 0xaa, 0xb6, 0xc6, 0xa8, 0x80, - 0x0d, 0x03, 0x12, 0x09, 0x07, 0x66, 0xb8, 0xe1, 0x96, 0x32, 0x2d, 0xf5, 0x90, 0x51, 0x86, 0x03, - 0x5c, 0x3c, 0x6b, 0x69, 0xab, 0x6c, 0x23, 0x69, 0x35, 0xda, 0xad, 0xa7, 0xe1, 0x53, 0xf0, 0x15, - 0xb8, 0x71, 0xe4, 0x63, 0xe4, 0x98, 0x23, 0x27, 0x86, 0x49, 0x0e, 0x7c, 0x00, 0x66, 0x38, 0x33, - 0x5a, 0xaf, 0x64, 0x4b, 0x76, 0x32, 0x9e, 0x81, 0x4b, 0xa4, 0xf7, 0xde, 0xef, 0xbd, 0xf7, 0xdb, - 0xdf, 0x7b, 0x1b, 0x19, 0x1e, 0x85, 0x78, 0x8e, 0x63, 0x22, 0x9c, 0xec, 0xe9, 0x24, 0x98, 0xa6, - 0x34, 0x0e, 0x1c, 0xf1, 0xd6, 0x4e, 0x52, 0x26, 0x18, 0xda, 0x57, 0x61, 0x3b, 0x7b, 0xda, 0x2a, - 0x6c, 0xf6, 0x3d, 0xc6, 0x23, 0xc6, 0x9d, 0x19, 0xe6, 0xc4, 0x99, 0x1f, 0xcc, 0x88, 0xc0, 0x07, - 0x8e, 0xc7, 0x68, 0xbc, 0xc8, 0x32, 0xf7, 0x03, 0x16, 0x30, 0xf9, 0xea, 0x64, 0x6f, 0xca, 0x3b, - 0x2a, 0xb5, 0x22, 0x09, 0xf3, 0x4e, 0xb8, 0x60, 0x29, 0x0e, 0x88, 0x43, 0x62, 0x3f, 0x61, 0x34, - 0x16, 0x0a, 0x39, 0xd8, 0x48, 0x2a, 0x25, 0x21, 0x3e, 0x53, 0x88, 0xf7, 0x15, 0x03, 0x2e, 0xf0, - 0x69, 0x16, 0xcb, 0x49, 0x28, 0x5b, 0xa1, 0x7a, 0x38, 0xa2, 0x31, 0x73, 0xe4, 0xdf, 0x85, 0xcb, - 0xfa, 0xbb, 0x0e, 0xdd, 0x09, 0x0f, 0x8e, 0x05, 0x3e, 0x25, 0x47, 0x29, 0x9b, 0x53, 0x9f, 0xa4, - 0xc8, 0x80, 0xa6, 0x97, 0x12, 0x2c, 0x58, 0x6a, 0x68, 0x03, 0x6d, 0xd4, 0x76, 0x73, 0x53, 0x46, - 0x4e, 0x30, 0x8d, 0x9f, 0x3f, 0x35, 0x6e, 0xa9, 0xc8, 0xc2, 0x44, 0x5f, 0x40, 0x03, 0x47, 0xec, - 0x4d, 0x2c, 0x8c, 0xfa, 0x40, 0x1b, 0x75, 0x0e, 0xef, 0xdb, 0x0b, 0x4a, 0x76, 0x26, 0x8a, 0xad, - 0xf8, 0xd8, 0x4f, 0x18, 0x8d, 0xc7, 0xfa, 0xf9, 0x1f, 0xef, 0xd6, 0x5c, 0x05, 0x47, 0xdf, 0x40, - 0x3b, 0x3f, 0x2e, 0x37, 0xf4, 0x41, 0x7d, 0xd4, 0x39, 0x7c, 0x6c, 0x97, 0x64, 0x5e, 0x95, 0xc6, - 0xfe, 0x5a, 0x61, 0x55, 0x95, 0x65, 0x2e, 0x1a, 0x40, 0x27, 0x20, 0x2c, 0x64, 0x1e, 0x16, 0x94, - 0xc5, 0xc6, 0xce, 0x40, 0x1b, 0xed, 0xb8, 0xab, 0x2e, 0xf4, 0x0c, 0x76, 0x7d, 0x12, 0x92, 0x00, - 0x0b, 0x32, 0x0d, 0x69, 0x44, 0x85, 0xd1, 0xdc, 0x8e, 0xeb, 0x9d, 0x3c, 0xed, 0x65, 0x96, 0x85, - 0x1c, 0xb8, 0x5b, 0xd4, 0xf1, 0x58, 0x14, 0x51, 0xce, 0xb3, 0x8e, 0xad, 0x81, 0x36, 0xd2, 0x5d, - 0x94, 0x87, 0x9e, 0x14, 0x11, 0xf4, 0x10, 0xda, 0x73, 0x1c, 0x52, 0x5f, 0x4a, 0xda, 0x96, 0xc2, - 0x2d, 0x1d, 0x99, 0xa8, 0xd8, 0xf7, 0x53, 0xc2, 0xb9, 0x01, 0x0b, 0x51, 0x95, 0x89, 0x8e, 0xa0, - 0xe3, 0x13, 0xee, 0xa5, 0x34, 0x91, 0x47, 0xea, 0x48, 0xb6, 0x8f, 0x73, 0xb6, 0xf9, 0x70, 0x73, - 0xc2, 0x4f, 0x97, 0xd0, 0x71, 0x3b, 0xe3, 0xfd, 0xeb, 0x5f, 0xbf, 0x7d, 0xac, 0xb9, 0xab, 0x25, - 0x5e, 0xe8, 0xad, 0x46, 0xb7, 0x69, 0x99, 0x60, 0x54, 0x87, 0xee, 0x12, 0x9e, 0xb0, 0x98, 0x13, - 0xeb, 0x15, 0xa0, 0x09, 0x0f, 0xbe, 0x8f, 0xf9, 0x7f, 0x5e, 0x89, 0xd2, 0xa9, 0xeb, 0x95, 0x53, - 0x5b, 0x0f, 0xc1, 0x5c, 0xef, 0x53, 0xb0, 0xf8, 0x47, 0x83, 0xbd, 0x09, 0x0f, 0xdc, 0x6c, 0xc7, - 0x8f, 0xf0, 0x59, 0x44, 0x62, 0x71, 0x03, 0x87, 0x2f, 0xa1, 0x21, 0x6f, 0x03, 0x37, 0x6e, 0xc9, - 0x05, 0xb2, 0xec, 0x4d, 0xf7, 0xd4, 0x96, 0xd5, 0x8e, 0x89, 0x9c, 0x89, 0xab, 0x32, 0xd0, 0x27, - 0xd0, 0x5b, 0x11, 0xe8, 0x58, 0x64, 0x48, 0x43, 0x97, 0xf5, 0xd7, 0x03, 0xe8, 0x07, 0xd8, 0x0f, - 0xb1, 0x20, 0x5c, 0x4c, 0x67, 0x21, 0xf3, 0x4e, 0xa7, 0x29, 0x49, 0x58, 0x2a, 0xb8, 0xb1, 0x23, - 0xfb, 0x0e, 0x37, 0xf7, 0x7d, 0x29, 0x33, 0xc6, 0x59, 0x82, 0x2b, 0xf1, 0x2e, 0x0a, 0xab, 0x2e, - 0xfe, 0x42, 0x6f, 0xd5, 0xbb, 0xba, 0xf5, 0x1d, 0xf4, 0xd6, 0xe0, 0xe8, 0x1e, 0x34, 0x79, 0x42, - 0xbc, 0x29, 0xf5, 0xd5, 0xc9, 0x1b, 0x99, 0xf9, 0xdc, 0x47, 0xef, 0xc1, 0xed, 0x55, 0x3a, 0x72, - 0x02, 0xba, 0xdb, 0x59, 0xa9, 0x6e, 0x8d, 0xe1, 0x5e, 0x45, 0xc8, 0x5c, 0x64, 0x34, 0x84, 0xbd, - 0x94, 0xbc, 0x26, 0x9e, 0x20, 0xfe, 0x54, 0xe9, 0x97, 0x95, 0x6f, 0xb9, 0xbb, 0xb9, 0x5b, 0xa6, - 0x71, 0x0b, 0x43, 0x6f, 0xc2, 0x83, 0x67, 0x29, 0x21, 0x3f, 0x6d, 0xb3, 0x12, 0x26, 0xb4, 0x16, - 0x3b, 0xe0, 0x2f, 0x06, 0xd2, 0x76, 0x0b, 0x1b, 0xbd, 0x93, 0x8d, 0x0a, 0x73, 0x16, 0xab, 0x8d, - 0x50, 0x96, 0xf5, 0x00, 0xee, 0xaf, 0xb5, 0x28, 0xb6, 0xe1, 0x5b, 0xb8, 0x2b, 0x77, 0xe5, 0xd5, - 0xff, 0xc0, 0xc0, 0x7a, 0x04, 0x0f, 0x36, 0x14, 0xcb, 0x7b, 0x1d, 0xfe, 0xa2, 0x43, 0x7d, 0xc2, - 0x03, 0x14, 0xc0, 0x9d, 0xf2, 0x7f, 0xc5, 0x0f, 0x37, 0x0f, 0xb7, 0x7a, 0x91, 0x4c, 0x7b, 0x3b, - 0x5c, 0x31, 0x85, 0x08, 0xf6, 0xaa, 0xb7, 0x6d, 0x74, 0x6d, 0x89, 0x0a, 0xd2, 0xfc, 0x6c, 0x5b, - 0x64, 0xd1, 0xce, 0x87, 0xdb, 0xa5, 0x5b, 0xf5, 0xc1, 0xb5, 0x15, 0x56, 0x61, 0xe6, 0xa7, 0x5b, - 0xc1, 0x8a, 0x2e, 0xaf, 0x61, 0xb7, 0xb2, 0x2e, 0xc3, 0x6b, 0x0b, 0x94, 0x81, 0xa6, 0xb3, 0x25, - 0xb0, 0xe8, 0x95, 0x40, 0x77, 0x6d, 0x35, 0x3e, 0xba, 0x41, 0x97, 0x32, 0xd4, 0x3c, 0xd8, 0x1a, - 0x9a, 0x77, 0x1c, 0x7f, 0x75, 0x7e, 0xd9, 0xd7, 0x2e, 0x2e, 0xfb, 0xda, 0x9f, 0x97, 0x7d, 0xed, - 0xe7, 0xab, 0x7e, 0xed, 0xe2, 0xaa, 0x5f, 0xfb, 0xfd, 0xaa, 0x5f, 0xfb, 0x71, 0x18, 0x50, 0x71, - 0xf2, 0x66, 0x66, 0x7b, 0x2c, 0x72, 0x4a, 0x5f, 0xed, 0xb7, 0xcb, 0x1f, 0x13, 0x67, 0x09, 0xe1, - 0xb3, 0x86, 0xfc, 0xfe, 0x7e, 0xfe, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8e, 0xaf, 0xf3, 0xdc, - 0x71, 0x08, 0x00, 0x00, + // 887 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x73, 0xdb, 0x44, + 0x14, 0x8e, 0x12, 0xc5, 0xb1, 0x9f, 0xdb, 0xc4, 0xd9, 0xa4, 0x44, 0x51, 0x53, 0x63, 0x54, 0x20, + 0x26, 0x03, 0x12, 0x09, 0x07, 0x66, 0x7c, 0x74, 0x43, 0x99, 0x76, 0xea, 0x21, 0xa3, 0x0c, 0x07, + 0xb8, 0x78, 0xd6, 0xd2, 0xa2, 0xa8, 0xb1, 0xb4, 0x1a, 0xed, 0xd6, 0xd3, 0x70, 0xe6, 0xc4, 0x05, + 0xf8, 0x09, 0xdc, 0x38, 0xf6, 0x67, 0xf4, 0xd8, 0x23, 0x27, 0x86, 0x49, 0x0e, 0xfd, 0x1b, 0xcc, + 0xae, 0x56, 0xb2, 0x25, 0x3b, 0x1d, 0xcf, 0xd0, 0x4b, 0xac, 0xb7, 0xef, 0x7b, 0xef, 0xfb, 0xf4, + 0xbd, 0xb7, 0x19, 0xc1, 0x83, 0x31, 0x9e, 0xe0, 0x98, 0x70, 0x47, 0xfc, 0x3a, 0x09, 0x0e, 0xd3, + 0x30, 0x0e, 0x1c, 0xfe, 0xd2, 0x4e, 0x52, 0xca, 0x29, 0xda, 0x55, 0x69, 0x5b, 0xfc, 0xda, 0x2a, + 0x6d, 0xb6, 0x3d, 0xca, 0x22, 0xca, 0x9c, 0x11, 0x66, 0xc4, 0x99, 0x1c, 0x8f, 0x08, 0xc7, 0xc7, + 0x8e, 0x47, 0xc3, 0x38, 0xab, 0x32, 0x77, 0x03, 0x1a, 0x50, 0xf9, 0xe8, 0x88, 0x27, 0x75, 0xda, + 0x2d, 0x51, 0x91, 0x84, 0x7a, 0x17, 0x8c, 0xd3, 0x14, 0x07, 0xc4, 0x21, 0xb1, 0x9f, 0xd0, 0x30, + 0xe6, 0x0a, 0xd9, 0x59, 0x28, 0x2a, 0x25, 0x63, 0x7c, 0xa5, 0x10, 0x1f, 0x2b, 0x05, 0x8c, 0xe3, + 0x4b, 0x91, 0xcb, 0x45, 0xa8, 0x58, 0xa1, 0xb6, 0x71, 0x14, 0xc6, 0xd4, 0x91, 0x7f, 0xb3, 0x23, + 0xeb, 0x37, 0x1d, 0x5a, 0x03, 0x16, 0x9c, 0x73, 0x7c, 0x49, 0xce, 0x52, 0x3a, 0x09, 0x7d, 0x92, + 0x22, 0x03, 0x36, 0xbc, 0x94, 0x60, 0x4e, 0x53, 0x43, 0xeb, 0x68, 0xdd, 0x86, 0x9b, 0x87, 0x32, + 0x73, 0x81, 0xc3, 0xf8, 0xc9, 0xa9, 0xb1, 0xaa, 0x32, 0x59, 0x88, 0xbe, 0x86, 0x1a, 0x8e, 0xe8, + 0x8b, 0x98, 0x1b, 0x6b, 0x1d, 0xad, 0xdb, 0x3c, 0xd9, 0xb7, 0x33, 0x49, 0xb6, 0x30, 0xc5, 0x56, + 0x7a, 0xec, 0x47, 0x34, 0x8c, 0xfb, 0xfa, 0xeb, 0x7f, 0x3e, 0x5c, 0x71, 0x15, 0x1c, 0x7d, 0x0b, + 0x8d, 0xfc, 0x75, 0x99, 0xa1, 0x77, 0xd6, 0xba, 0xcd, 0x93, 0x87, 0x76, 0xc9, 0xe6, 0x59, 0x6b, + 0xec, 0x6f, 0x14, 0x56, 0x75, 0x99, 0xd6, 0xa2, 0x0e, 0x34, 0x03, 0x42, 0xc7, 0xd4, 0xc3, 0x3c, + 0xa4, 0xb1, 0xb1, 0xde, 0xd1, 0xba, 0xeb, 0xee, 0xec, 0x11, 0x7a, 0x0c, 0x9b, 0x3e, 0x19, 0x93, + 0x00, 0x73, 0x32, 0x1c, 0x87, 0x51, 0xc8, 0x8d, 0x8d, 0xe5, 0xb4, 0xde, 0xcd, 0xcb, 0x9e, 0x89, + 0x2a, 0xe4, 0xc0, 0x4e, 0xd1, 0xc7, 0xa3, 0x51, 0x14, 0x32, 0x26, 0x18, 0xeb, 0x1d, 0xad, 0xab, + 0xbb, 0x28, 0x4f, 0x3d, 0x2a, 0x32, 0xe8, 0x00, 0x1a, 0x13, 0x3c, 0x0e, 0x7d, 0x69, 0x69, 0x43, + 0x1a, 0x37, 0x3d, 0x10, 0xa6, 0x62, 0xdf, 0x4f, 0x09, 0x63, 0x06, 0x64, 0xa6, 0xaa, 0x10, 0x9d, + 0x41, 0xd3, 0x27, 0xcc, 0x4b, 0xc3, 0x44, 0xbe, 0x52, 0x53, 0xaa, 0x7d, 0x98, 0xab, 0xcd, 0x87, + 0x9b, 0x0b, 0x3e, 0x9d, 0x42, 0xfb, 0x0d, 0xa1, 0xfb, 0xaf, 0xb7, 0xaf, 0x8e, 0x34, 0x77, 0xb6, + 0x45, 0xcf, 0xfc, 0xf5, 0xed, 0xab, 0xa3, 0x7b, 0xf9, 0x0a, 0x95, 0xc6, 0xfe, 0x54, 0xaf, 0xd7, + 0x5a, 0x1b, 0x96, 0x09, 0x46, 0x75, 0x21, 0x5c, 0xc2, 0x12, 0x1a, 0x33, 0x62, 0xfd, 0xa2, 0x01, + 0x1a, 0xb0, 0xe0, 0xfb, 0x98, 0xfd, 0xef, 0x7d, 0x29, 0x59, 0xb2, 0x56, 0xb1, 0xa4, 0x77, 0x20, + 0x64, 0xee, 0xe5, 0x32, 0x2b, 0x7c, 0xd6, 0x01, 0x98, 0xf3, 0x2a, 0x0a, 0x91, 0x7f, 0xac, 0xc2, + 0xd6, 0x80, 0x05, 0xae, 0xb8, 0x1e, 0x67, 0xf8, 0x2a, 0x22, 0x31, 0x7f, 0x87, 0xc2, 0x1e, 0xd4, + 0xe4, 0x45, 0x62, 0xc6, 0xaa, 0xdc, 0x3d, 0xcb, 0x5e, 0x74, 0xc5, 0x6d, 0xd9, 0xed, 0x9c, 0xc8, + 0x71, 0xba, 0xaa, 0x02, 0x7d, 0x0e, 0xdb, 0x33, 0xde, 0x9e, 0x73, 0x81, 0x34, 0x74, 0xd9, 0x7f, + 0x3e, 0x81, 0x7e, 0x80, 0xdd, 0x31, 0xe6, 0x84, 0xf1, 0xe1, 0x68, 0x4c, 0xbd, 0xcb, 0x61, 0x4a, + 0x12, 0x9a, 0x72, 0x66, 0xac, 0x4b, 0xde, 0xc3, 0xc5, 0xbc, 0xcf, 0x64, 0x45, 0x5f, 0x14, 0xb8, + 0x12, 0xef, 0xa2, 0x71, 0xf5, 0x88, 0xf5, 0xf6, 0x85, 0x5d, 0xbb, 0xb9, 0x5d, 0xb3, 0x6f, 0xfe, + 0x54, 0xaf, 0xaf, 0xb5, 0x74, 0xeb, 0x3b, 0xd8, 0x9e, 0xeb, 0x84, 0xf6, 0x60, 0x83, 0x25, 0xc4, + 0x1b, 0x86, 0xbe, 0x32, 0xa5, 0x26, 0xc2, 0x27, 0x3e, 0xfa, 0x08, 0xee, 0xcc, 0x2a, 0x95, 0xa3, + 0xd3, 0xdd, 0xe6, 0x0c, 0xb1, 0xd5, 0x87, 0xbd, 0x8a, 0xc7, 0xb9, 0xff, 0xe8, 0x10, 0xb6, 0x52, + 0xf2, 0x9c, 0x78, 0x9c, 0xf8, 0x43, 0x65, 0xad, 0x68, 0x5f, 0x77, 0x37, 0xf3, 0x63, 0x59, 0xc6, + 0xac, 0x09, 0x6c, 0x0f, 0x58, 0xf0, 0x38, 0x25, 0xe4, 0xe7, 0x65, 0x76, 0xc9, 0x84, 0x7a, 0xb6, + 0x3c, 0x7e, 0x36, 0xab, 0x86, 0x5b, 0xc4, 0xe8, 0x03, 0x31, 0x45, 0xcc, 0x68, 0xac, 0x56, 0x49, + 0x45, 0xbd, 0x1d, 0x61, 0xcc, 0x66, 0x6e, 0x4c, 0x46, 0x65, 0xdd, 0x87, 0xfd, 0x39, 0xde, 0x62, + 0x7b, 0x46, 0xb0, 0x23, 0x77, 0xeb, 0xa7, 0xf7, 0x20, 0xab, 0x77, 0x4f, 0xd0, 0xb7, 0xa6, 0x6b, + 0x9c, 0x35, 0xb5, 0x1e, 0xc0, 0xfd, 0x05, 0x1c, 0xb9, 0x84, 0x93, 0x3f, 0x75, 0x58, 0x1b, 0xb0, + 0x00, 0x05, 0x70, 0xb7, 0xfc, 0x7f, 0xf9, 0xd3, 0xc5, 0x3b, 0x52, 0xbd, 0xae, 0xa6, 0xbd, 0x1c, + 0xae, 0x98, 0x58, 0x04, 0x5b, 0xd5, 0x2b, 0xdd, 0xbd, 0xb5, 0x45, 0x05, 0x69, 0x7e, 0xb9, 0x2c, + 0xb2, 0xa0, 0xf3, 0xe1, 0x4e, 0xe9, 0x72, 0x7e, 0x72, 0x6b, 0x87, 0x59, 0x98, 0xf9, 0xc5, 0x52, + 0xb0, 0x82, 0xe5, 0x39, 0x6c, 0x56, 0x56, 0xeb, 0xf0, 0xd6, 0x06, 0x65, 0xa0, 0xe9, 0x2c, 0x09, + 0x2c, 0xb8, 0x12, 0x68, 0xcd, 0x6d, 0xcc, 0x67, 0xef, 0xf0, 0xa5, 0x0c, 0x35, 0x8f, 0x97, 0x86, + 0xe6, 0x8c, 0xfd, 0xd3, 0xd7, 0xd7, 0x6d, 0xed, 0xcd, 0x75, 0x5b, 0xfb, 0xf7, 0xba, 0xad, 0xfd, + 0x7e, 0xd3, 0x5e, 0x79, 0x73, 0xd3, 0x5e, 0xf9, 0xfb, 0xa6, 0xbd, 0xf2, 0xe3, 0x51, 0x10, 0xf2, + 0x8b, 0x17, 0x23, 0xdb, 0xa3, 0x91, 0x53, 0xfa, 0x6e, 0x98, 0x9c, 0x38, 0x2f, 0xa7, 0x5f, 0x34, + 0x57, 0x09, 0x61, 0xa3, 0x9a, 0xfc, 0x08, 0xf8, 0xea, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, + 0xb8, 0xcb, 0x04, 0xf6, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pairing/types/types.go b/x/pairing/types/types.go index 38cff91711..7fca228652 100644 --- a/x/pairing/types/types.go +++ b/x/pairing/types/types.go @@ -40,13 +40,3 @@ const ( EPOCHS_NUM_TO_CHECK_CU_FOR_UNRESPONSIVE_PROVIDER uint64 = 8 // number of epochs to sum CU that the provider serviced EPOCHS_NUM_TO_CHECK_FOR_COMPLAINERS uint64 = 2 // number of epochs to sum CU of complainers against the provider ) - -type ClientUsedCU struct { - TotalUsed uint64 - Providers map[string]uint64 -} - -type ClientProviderOverusedCUPercent struct { - TotalOverusedPercent float64 - OverusedPercentProvider float64 -} diff --git a/x/pairing/types/unstake_proposal.pb.go b/x/pairing/types/unstake_proposal.pb.go index 72548c5326..cc45e04e82 100644 --- a/x/pairing/types/unstake_proposal.pb.go +++ b/x/pairing/types/unstake_proposal.pb.go @@ -180,34 +180,34 @@ func init() { } var fileDescriptor_d35cf592c1bb0d91 = []byte{ - // 422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x31, 0x6f, 0xd4, 0x30, - 0x14, 0xc7, 0x93, 0xf6, 0x80, 0xd6, 0x27, 0x5a, 0x61, 0x6e, 0xb8, 0x9e, 0x50, 0x7a, 0xba, 0xa5, - 0x45, 0x48, 0xb6, 0x5a, 0x36, 0xb6, 0x16, 0x06, 0x2a, 0x31, 0x54, 0x45, 0x30, 0x20, 0xa1, 0xc8, - 0x49, 0x7c, 0x3e, 0x8b, 0x9c, 0x9f, 0x65, 0x3b, 0x07, 0x88, 0x1d, 0x31, 0xf2, 0x11, 0xf8, 0x38, - 0x1d, 0x3b, 0x32, 0x21, 0x74, 0xf7, 0x45, 0x50, 0x1c, 0x27, 0x80, 0x9a, 0xc9, 0x79, 0xef, 0xfd, - 0xfc, 0xcf, 0xdf, 0xef, 0x3d, 0xf4, 0xa4, 0x64, 0x2b, 0xa6, 0xb8, 0xa3, 0xf5, 0x49, 0x35, 0x93, - 0x46, 0x2a, 0x41, 0x2b, 0x65, 0x1d, 0xfb, 0xc0, 0x53, 0x6d, 0x40, 0x83, 0x65, 0x25, 0xd1, 0x06, - 0x1c, 0xe0, 0x51, 0x80, 0x49, 0x7d, 0x92, 0x00, 0x4f, 0x46, 0x02, 0x04, 0x78, 0x80, 0xd6, 0x5f, - 0x0d, 0x3b, 0x49, 0x04, 0x80, 0x28, 0x39, 0xf5, 0x51, 0x56, 0xcd, 0xe9, 0x47, 0xc3, 0xb4, 0xe6, - 0xc6, 0xb6, 0xf5, 0x1c, 0xec, 0x12, 0x2c, 0xcd, 0x98, 0xe5, 0x74, 0x75, 0x92, 0x71, 0xc7, 0x4e, - 0x68, 0x0e, 0x52, 0x35, 0xf5, 0xd9, 0xd7, 0x2d, 0xb4, 0xff, 0xa6, 0xb1, 0x71, 0x19, 0x5c, 0xe0, - 0x11, 0xba, 0xe3, 0xa4, 0x2b, 0xf9, 0x38, 0x9e, 0xc6, 0xc7, 0xbb, 0x57, 0x4d, 0x80, 0xa7, 0x68, - 0x58, 0x70, 0x9b, 0x1b, 0xa9, 0x9d, 0x04, 0x35, 0xde, 0xf2, 0xb5, 0x7f, 0x53, 0xf8, 0x2d, 0xda, - 0xd3, 0x06, 0x56, 0xb2, 0xe0, 0xc6, 0xa6, 0x52, 0xcd, 0x61, 0xbc, 0x3d, 0xdd, 0x3e, 0x1e, 0x9e, - 0x3e, 0x26, 0x7d, 0x0f, 0x22, 0x97, 0x81, 0x0d, 0xbf, 0xbf, 0x50, 0x73, 0x38, 0x1f, 0x5c, 0xff, - 0x3a, 0x8c, 0xae, 0xee, 0x77, 0x32, 0x75, 0x12, 0xbf, 0x47, 0xf8, 0x05, 0x2f, 0xb9, 0x60, 0x0e, - 0x8c, 0x7d, 0x5d, 0x32, 0xbb, 0x90, 0x4a, 0x8c, 0x07, 0x5e, 0xfb, 0xa8, 0x5f, 0xbb, 0xe3, 0x5b, - 0x3c, 0x28, 0xf7, 0x08, 0x3d, 0x1b, 0x7c, 0xfb, 0x71, 0x18, 0xcd, 0x5e, 0xa1, 0x87, 0x3d, 0x86, - 0xf0, 0x04, 0xed, 0xb4, 0x66, 0x42, 0x3b, 0xba, 0x18, 0x1f, 0xa0, 0x9d, 0x7c, 0xc1, 0xa4, 0x4a, - 0x65, 0x11, 0xda, 0x71, 0xcf, 0xc7, 0x17, 0xc5, 0xec, 0x0b, 0x7a, 0x70, 0xcb, 0x02, 0x7e, 0x84, - 0x76, 0x8b, 0x36, 0x19, 0xc4, 0xfe, 0x26, 0xf0, 0x4b, 0xb4, 0x6f, 0x03, 0x99, 0xb2, 0x25, 0x54, - 0xca, 0x79, 0xd1, 0xe1, 0xe9, 0x01, 0x69, 0x66, 0x48, 0xea, 0x19, 0x92, 0x30, 0x43, 0xf2, 0x1c, - 0xa4, 0x0a, 0x8f, 0xda, 0x6b, 0xef, 0x9d, 0xf9, 0x6b, 0xe7, 0x67, 0xd7, 0xeb, 0x24, 0xbe, 0x59, - 0x27, 0xf1, 0xef, 0x75, 0x12, 0x7f, 0xdf, 0x24, 0xd1, 0xcd, 0x26, 0x89, 0x7e, 0x6e, 0x92, 0xe8, - 0xdd, 0x91, 0x90, 0x6e, 0x51, 0x65, 0x24, 0x87, 0x25, 0xfd, 0x6f, 0x23, 0x3f, 0x75, 0x3b, 0xe9, - 0x3e, 0x6b, 0x6e, 0xb3, 0xbb, 0x7e, 0x3b, 0x9e, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xde, 0x03, - 0xdd, 0x68, 0xb8, 0x02, 0x00, 0x00, + // 425 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x93, 0xad, 0xc0, 0xe6, 0x8a, 0x4d, 0x98, 0x1e, 0xba, 0x0a, 0x65, 0x55, 0x2f, 0x0c, + 0x90, 0x6c, 0xad, 0xdc, 0xb8, 0x31, 0x76, 0x60, 0x12, 0x87, 0x69, 0x08, 0x0e, 0x48, 0xa8, 0x72, + 0x12, 0xd7, 0xb5, 0x48, 0xfd, 0x2c, 0xdb, 0x0d, 0x20, 0xee, 0x88, 0x23, 0x1f, 0x81, 0x8f, 0xb3, + 0x63, 0x8f, 0x9c, 0x10, 0x6a, 0xbf, 0x08, 0x8a, 0xe3, 0x04, 0xd0, 0x72, 0x72, 0xde, 0x7b, 0x3f, + 0xff, 0xf3, 0xf7, 0x7b, 0x0f, 0x3d, 0x29, 0x58, 0xc9, 0x14, 0x77, 0xb4, 0x3a, 0xa9, 0x66, 0xd2, + 0x48, 0x25, 0xe8, 0x4a, 0x59, 0xc7, 0x3e, 0xf0, 0x99, 0x36, 0xa0, 0xc1, 0xb2, 0x82, 0x68, 0x03, + 0x0e, 0xf0, 0x20, 0xc0, 0xa4, 0x3a, 0x49, 0x80, 0x47, 0x03, 0x01, 0x02, 0x3c, 0x40, 0xab, 0xaf, + 0x9a, 0x1d, 0x25, 0x02, 0x40, 0x14, 0x9c, 0xfa, 0x28, 0x5d, 0xcd, 0xe9, 0x47, 0xc3, 0xb4, 0xe6, + 0xc6, 0x36, 0xf5, 0x0c, 0xec, 0x12, 0x2c, 0x4d, 0x99, 0xe5, 0xb4, 0x3c, 0x4d, 0xb9, 0x63, 0xa7, + 0x34, 0x03, 0xa9, 0xea, 0xfa, 0xe4, 0xeb, 0x0e, 0x3a, 0x7c, 0x53, 0xdb, 0xb8, 0x0c, 0x2e, 0xf0, + 0x00, 0xdd, 0x72, 0xd2, 0x15, 0x7c, 0x18, 0x8f, 0xe3, 0x93, 0xfd, 0xab, 0x3a, 0xc0, 0x63, 0xd4, + 0xcf, 0xb9, 0xcd, 0x8c, 0xd4, 0x4e, 0x82, 0x1a, 0xee, 0xf8, 0xda, 0xbf, 0x29, 0xfc, 0x16, 0x1d, + 0x68, 0x03, 0xa5, 0xcc, 0xb9, 0xb1, 0x33, 0xa9, 0xe6, 0x30, 0xdc, 0x1d, 0xef, 0x9e, 0xf4, 0xa7, + 0x8f, 0x48, 0xd7, 0x83, 0xc8, 0x65, 0x60, 0xc3, 0xef, 0x2f, 0xd4, 0x1c, 0xce, 0x7a, 0xd7, 0xbf, + 0x8e, 0xa3, 0xab, 0xbb, 0xad, 0x4c, 0x95, 0xc4, 0xef, 0x11, 0x3e, 0xe7, 0x05, 0x17, 0xcc, 0x81, + 0xb1, 0xaf, 0x0b, 0x66, 0x17, 0x52, 0x89, 0x61, 0xcf, 0x6b, 0x3f, 0xec, 0xd6, 0x6e, 0xf9, 0x06, + 0x0f, 0xca, 0x1d, 0x42, 0xcf, 0x7a, 0xdf, 0x7e, 0x1c, 0x47, 0x93, 0x57, 0xe8, 0x7e, 0x87, 0x21, + 0x3c, 0x42, 0x7b, 0x8d, 0x99, 0xd0, 0x8e, 0x36, 0xc6, 0x47, 0x68, 0x2f, 0x5b, 0x30, 0xa9, 0x66, + 0x32, 0x0f, 0xed, 0xb8, 0xe3, 0xe3, 0x8b, 0x7c, 0xf2, 0x05, 0xdd, 0xbb, 0x61, 0x01, 0x3f, 0x40, + 0xfb, 0x79, 0x93, 0x0c, 0x62, 0x7f, 0x13, 0xf8, 0x25, 0x3a, 0xb4, 0x81, 0x9c, 0xb1, 0x25, 0xac, + 0x94, 0xf3, 0xa2, 0xfd, 0xe9, 0x11, 0xa9, 0x67, 0x48, 0xaa, 0x19, 0x92, 0x30, 0x43, 0xf2, 0x02, + 0xa4, 0x0a, 0x8f, 0x3a, 0x68, 0xee, 0x3d, 0xf7, 0xd7, 0xce, 0xce, 0xaf, 0x37, 0x49, 0xbc, 0xde, + 0x24, 0xf1, 0xef, 0x4d, 0x12, 0x7f, 0xdf, 0x26, 0xd1, 0x7a, 0x9b, 0x44, 0x3f, 0xb7, 0x49, 0xf4, + 0xee, 0xb1, 0x90, 0x6e, 0xb1, 0x4a, 0x49, 0x06, 0x4b, 0xfa, 0xdf, 0x46, 0x96, 0x53, 0xfa, 0xa9, + 0x5d, 0x4b, 0xf7, 0x59, 0x73, 0x9b, 0xde, 0xf6, 0x0b, 0xf2, 0xf4, 0x4f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x35, 0x0e, 0x27, 0xe1, 0xbb, 0x02, 0x00, 0x00, } func (m *UnstakeProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/plans/client/cli/query.go b/x/plans/client/cli/query.go index d7f9c242c6..a41405b9e7 100644 --- a/x/plans/client/cli/query.go +++ b/x/plans/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/plans/client/cli/query_info.go b/x/plans/client/cli/query_info.go index 222b214527..bf4020bea8 100644 --- a/x/plans/client/cli/query_info.go +++ b/x/plans/client/cli/query_info.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/plans/client/cli/query_list.go b/x/plans/client/cli/query_list.go index bc7362ea31..89a48978e3 100644 --- a/x/plans/client/cli/query_list.go +++ b/x/plans/client/cli/query_list.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/plans/client/cli/query_params.go b/x/plans/client/cli/query_params.go index 2355a2488d..196e3f44d7 100644 --- a/x/plans/client/cli/query_params.go +++ b/x/plans/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/spf13/cobra" ) diff --git a/x/plans/client/cli/tx.go b/x/plans/client/cli/tx.go index 45370d731f..03216ed4c9 100644 --- a/x/plans/client/cli/tx.go +++ b/x/plans/client/cli/tx.go @@ -15,8 +15,8 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/plans/client/utils" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/client/utils" + "github.com/lavanet/lava/v2/x/plans/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/plans/client/proposal_handler.go b/x/plans/client/proposal_handler.go index 4d8c79dc69..0d3c33616d 100644 --- a/x/plans/client/proposal_handler.go +++ b/x/plans/client/proposal_handler.go @@ -2,7 +2,7 @@ package client import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/lavanet/lava/x/plans/client/cli" + "github.com/lavanet/lava/v2/x/plans/client/cli" ) var PlansAddProposalHandler = govclient.NewProposalHandler(cli.NewSubmitPlansAddProposalTxCmd) diff --git a/x/plans/client/utils/utils.go b/x/plans/client/utils/utils.go index a580a24dcd..1585c6753c 100755 --- a/x/plans/client/utils/utils.go +++ b/x/plans/client/utils/utils.go @@ -6,9 +6,9 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/utils/decoder" - "github.com/lavanet/lava/x/plans/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/utils/decoder" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/mitchellh/mapstructure" ) diff --git a/x/plans/genesis.go b/x/plans/genesis.go index 850c070c5d..64c9af39e7 100644 --- a/x/plans/genesis.go +++ b/x/plans/genesis.go @@ -2,8 +2,8 @@ package plans import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/plans/keeper" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/keeper" + "github.com/lavanet/lava/v2/x/plans/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/plans/genesis_test.go b/x/plans/genesis_test.go index 38b143e4b5..d4da3a34ea 100644 --- a/x/plans/genesis_test.go +++ b/x/plans/genesis_test.go @@ -3,10 +3,10 @@ package plans_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - plans "github.com/lavanet/lava/x/plans" - "github.com/lavanet/lava/x/plans/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + plans "github.com/lavanet/lava/v2/x/plans" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/handler.go b/x/plans/handler.go index 0f4685d372..407eb8c3c7 100644 --- a/x/plans/handler.go +++ b/x/plans/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/plans/keeper" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/keeper" + "github.com/lavanet/lava/v2/x/plans/types" ) // NewHandler ... diff --git a/x/plans/keeper/grpc_query.go b/x/plans/keeper/grpc_query.go index 3b8f9acd63..43e4fcd66d 100644 --- a/x/plans/keeper/grpc_query.go +++ b/x/plans/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/plans/keeper/grpc_query_info.go b/x/plans/keeper/grpc_query_info.go index 5455b06957..ee11aa7801 100644 --- a/x/plans/keeper/grpc_query_info.go +++ b/x/plans/keeper/grpc_query_info.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/plans/keeper/grpc_query_list.go b/x/plans/keeper/grpc_query_list.go index 249f3ab8d2..657cc9d04b 100644 --- a/x/plans/keeper/grpc_query_list.go +++ b/x/plans/keeper/grpc_query_list.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/plans/keeper/grpc_query_params.go b/x/plans/keeper/grpc_query_params.go index ea56743123..70a35140b9 100644 --- a/x/plans/keeper/grpc_query_params.go +++ b/x/plans/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/plans/keeper/grpc_query_params_test.go b/x/plans/keeper/grpc_query_params_test.go index b19cb9a26d..2901e3ffea 100644 --- a/x/plans/keeper/grpc_query_params_test.go +++ b/x/plans/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/plans/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/keeper/keeper.go b/x/plans/keeper/keeper.go index 6a83fa5150..58920f0c4d 100644 --- a/x/plans/keeper/keeper.go +++ b/x/plans/keeper/keeper.go @@ -10,8 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - "github.com/lavanet/lava/x/plans/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/plans/types" ) type ( diff --git a/x/plans/keeper/migrations.go b/x/plans/keeper/migrations.go index 760fc44101..f82ffe137b 100644 --- a/x/plans/keeper/migrations.go +++ b/x/plans/keeper/migrations.go @@ -4,11 +4,11 @@ import ( "math" sdk "github.com/cosmos/cosmos-sdk/types" - v2 "github.com/lavanet/lava/x/plans/migrations/v2" - v3 "github.com/lavanet/lava/x/plans/migrations/v3" - v7 "github.com/lavanet/lava/x/plans/migrations/v7" - v8 "github.com/lavanet/lava/x/plans/migrations/v8" - projectsv3 "github.com/lavanet/lava/x/projects/migrations/v3" + v2 "github.com/lavanet/lava/v2/x/plans/migrations/v2" + v3 "github.com/lavanet/lava/v2/x/plans/migrations/v3" + v7 "github.com/lavanet/lava/v2/x/plans/migrations/v7" + v8 "github.com/lavanet/lava/v2/x/plans/migrations/v8" + projectsv3 "github.com/lavanet/lava/v2/x/projects/migrations/v3" ) type Migrator struct { diff --git a/x/plans/keeper/msg_server.go b/x/plans/keeper/msg_server.go index 16c5427827..524a410e7e 100644 --- a/x/plans/keeper/msg_server.go +++ b/x/plans/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" ) type msgServer struct { diff --git a/x/plans/keeper/msg_server_test.go b/x/plans/keeper/msg_server_test.go index fb2ae06a1c..d3c32b4c84 100644 --- a/x/plans/keeper/msg_server_test.go +++ b/x/plans/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/plans/keeper" - "github.com/lavanet/lava/x/plans/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/plans/keeper" + "github.com/lavanet/lava/v2/x/plans/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/plans/keeper/params.go b/x/plans/keeper/params.go index a0fca2f77e..8e01d23aa3 100644 --- a/x/plans/keeper/params.go +++ b/x/plans/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" ) // GetParams get all parameters as types.Params diff --git a/x/plans/keeper/params_test.go b/x/plans/keeper/params_test.go index fb04255313..81901aba8c 100644 --- a/x/plans/keeper/params_test.go +++ b/x/plans/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/plans/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/keeper/plan.go b/x/plans/keeper/plan.go index 2b53d8352f..5b2aa20deb 100644 --- a/x/plans/keeper/plan.go +++ b/x/plans/keeper/plan.go @@ -4,9 +4,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/plans/types" ) // AddPlan adds a new plan to the KVStore diff --git a/x/plans/keeper/plan_test.go b/x/plans/keeper/plan_test.go index 4fd85a61c5..6b342b403b 100644 --- a/x/plans/keeper/plan_test.go +++ b/x/plans/keeper/plan_test.go @@ -6,10 +6,10 @@ import ( "testing" "cosmossdk.io/math" - "github.com/lavanet/lava/testutil/common" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/testutil/common" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/migrations/v3/plan.pb.go b/x/plans/migrations/v3/plan.pb.go index ce1e513ba8..01588f31a9 100755 --- a/x/plans/migrations/v3/plan.pb.go +++ b/x/plans/migrations/v3/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - v3 "github.com/lavanet/lava/x/projects/migrations/v3" + v3 "github.com/lavanet/lava/v2/x/projects/migrations/v3" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v7/plan.pb.go b/x/plans/migrations/v7/plan.pb.go index 09133e298d..97ffbc59c0 100755 --- a/x/plans/migrations/v7/plan.pb.go +++ b/x/plans/migrations/v7/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/x/spec/types" + _ "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v7/policy.pb.go b/x/plans/migrations/v7/policy.pb.go index a95eca4c29..5fa445562b 100755 --- a/x/plans/migrations/v7/policy.pb.go +++ b/x/plans/migrations/v7/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/spec/types" + types "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v8/plan.pb.go b/x/plans/migrations/v8/plan.pb.go index cb95c1a7de..190da99340 100644 --- a/x/plans/migrations/v8/plan.pb.go +++ b/x/plans/migrations/v8/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/x/spec/types" + _ "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v8/policy.pb.go b/x/plans/migrations/v8/policy.pb.go index 9339dd3468..1b58b7ece2 100644 --- a/x/plans/migrations/v8/policy.pb.go +++ b/x/plans/migrations/v8/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/spec/types" + types "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v9/plan.pb.go b/x/plans/migrations/v9/plan.pb.go index b546ca529e..f522a772e6 100644 --- a/x/plans/migrations/v9/plan.pb.go +++ b/x/plans/migrations/v9/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/x/spec/types" + _ "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/migrations/v9/policy.pb.go b/x/plans/migrations/v9/policy.pb.go index e1d0128f0d..f129503092 100644 --- a/x/plans/migrations/v9/policy.pb.go +++ b/x/plans/migrations/v9/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/spec/types" + types "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" diff --git a/x/plans/module.go b/x/plans/module.go index 11124a91e7..1d39727d19 100644 --- a/x/plans/module.go +++ b/x/plans/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/plans/client/cli" - "github.com/lavanet/lava/x/plans/keeper" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/client/cli" + "github.com/lavanet/lava/v2/x/plans/keeper" + "github.com/lavanet/lava/v2/x/plans/types" ) var ( diff --git a/x/plans/module_simulation.go b/x/plans/module_simulation.go index e6c8104455..76c96d6aca 100644 --- a/x/plans/module_simulation.go +++ b/x/plans/module_simulation.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - plansimulation "github.com/lavanet/lava/x/plans/simulation" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/testutil/sample" + plansimulation "github.com/lavanet/lava/v2/x/plans/simulation" + "github.com/lavanet/lava/v2/x/plans/types" ) // avoid unused import issue diff --git a/x/plans/proposal_handler.go b/x/plans/proposal_handler.go index 13ee49d075..d650d7ff9d 100644 --- a/x/plans/proposal_handler.go +++ b/x/plans/proposal_handler.go @@ -7,9 +7,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/plans/keeper" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/plans/keeper" + "github.com/lavanet/lava/v2/x/plans/types" ) // NewPlanProposalsHandler creates a new governance Handler for a Plan diff --git a/x/plans/types/delproposal.go b/x/plans/types/delproposal.go index 51845bef0b..0bda91837f 100644 --- a/x/plans/types/delproposal.go +++ b/x/plans/types/delproposal.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" sdkerrors "cosmossdk.io/errors" - commontypes "github.com/lavanet/lava/utils/common/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) const ( diff --git a/x/plans/types/errors.go b/x/plans/types/errors.go index 960ad4c78d..ea66544ac7 100644 --- a/x/plans/types/errors.go +++ b/x/plans/types/errors.go @@ -4,7 +4,7 @@ package types import ( sdkerrors "cosmossdk.io/errors" - commontypes "github.com/lavanet/lava/utils/common/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) // x/plan module sentinel errors diff --git a/x/plans/types/expected_keepers.go b/x/plans/types/expected_keepers.go index 27e407e7c6..76da31ab07 100644 --- a/x/plans/types/expected_keepers.go +++ b/x/plans/types/expected_keepers.go @@ -3,8 +3,8 @@ package types import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - fixationstoretypes "github.com/lavanet/lava/x/fixationstore/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + fixationstoretypes "github.com/lavanet/lava/v2/x/fixationstore/types" ) type EpochStorageKeeper interface { diff --git a/x/plans/types/genesis.go b/x/plans/types/genesis.go index eae253a95c..42ac6eeb36 100644 --- a/x/plans/types/genesis.go +++ b/x/plans/types/genesis.go @@ -1,7 +1,7 @@ package types import ( - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" ) // DefaultIndex is the default capability global index diff --git a/x/plans/types/genesis.pb.go b/x/plans/types/genesis.pb.go index 7f918c7669..fc8ce85f7d 100644 --- a/x/plans/types/genesis.pb.go +++ b/x/plans/types/genesis.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/fixationstore/types" + types "github.com/lavanet/lava/v2/x/fixationstore/types" io "io" math "math" math_bits "math/bits" @@ -84,7 +84,7 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/plans/genesis.proto", fileDescriptor_714273f6abd9b14c) } var fileDescriptor_714273f6abd9b14c = []byte{ - // 236 bytes of a gzipped FileDescriptorProto + // 239 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc8, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x39, 0x89, 0x79, 0xc5, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x42, 0x50, 0x15, 0x7a, 0x20, @@ -95,11 +95,11 @@ var fileDescriptor_714273f6abd9b14c = []byte{ 0x5c, 0x6c, 0x10, 0xb3, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xa4, 0xf4, 0x30, 0xdd, 0xa5, 0x17, 0x00, 0x56, 0xe1, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0xbd, 0x90, 0x07, 0x17, 0x3b, 0x58, 0xd6, 0x2d, 0x58, 0x82, 0x09, 0xac, 0x55, 0x03, 0x55, 0x2b, 0x8a, 0x3b, 0xf4, 0x90, - 0x2d, 0x85, 0x1a, 0x04, 0xd3, 0xee, 0x64, 0x7f, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, + 0x2d, 0x85, 0x1a, 0x04, 0xd3, 0xee, 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, 0xaa, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x28, 0x9e, - 0xac, 0x80, 0x86, 0x43, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x73, 0xc6, 0x80, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x42, 0xaa, 0x50, 0x14, 0x76, 0x01, 0x00, 0x00, + 0x0c, 0x51, 0x1a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x28, 0x9e, + 0x2c, 0x33, 0xd2, 0xaf, 0x80, 0x06, 0x45, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x7f, + 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0xef, 0x70, 0x22, 0x79, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/plans/types/genesis_test.go b/x/plans/types/genesis_test.go index f71318f553..2c15f019d1 100644 --- a/x/plans/types/genesis_test.go +++ b/x/plans/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/types/geolocation_test.go b/x/plans/types/geolocation_test.go index 5aad7095d8..6933d85e2e 100644 --- a/x/plans/types/geolocation_test.go +++ b/x/plans/types/geolocation_test.go @@ -3,8 +3,8 @@ package types_test import ( "testing" - "github.com/lavanet/lava/utils/lavaslices" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/utils/lavaslices" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/plans/types/params.pb.go b/x/plans/types/params.pb.go index b4319a839f..fcba357b6e 100644 --- a/x/plans/types/params.pb.go +++ b/x/plans/types/params.pb.go @@ -66,17 +66,17 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/plans/params.proto", fileDescriptor_bb70e7895581f8ab) } var fileDescriptor_bb70e7895581f8ab = []byte{ - // 146 bytes of a gzipped FileDescriptorProto + // 149 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcf, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x39, 0x89, 0x79, 0xc5, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x42, 0x50, 0x05, 0x7a, 0x20, 0x5a, 0x0f, 0xac, 0x40, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0x2c, 0xad, 0x0f, 0x62, 0x41, 0x54, 0x2a, - 0xf1, 0x71, 0xb1, 0x05, 0x80, 0x75, 0x5a, 0xb1, 0xcc, 0x58, 0x20, 0xcf, 0xe0, 0x64, 0x7f, 0xe2, + 0xf1, 0x71, 0xb1, 0x05, 0x80, 0x75, 0x5a, 0xb1, 0xcc, 0x58, 0x20, 0xcf, 0xe0, 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, 0xaa, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, - 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x28, 0xf6, 0x57, 0x40, 0x5d, 0x50, 0x52, 0x59, 0x90, 0x5a, 0x9c, - 0xc4, 0x06, 0x36, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xb3, 0x0f, 0x7a, 0xa4, 0x00, - 0x00, 0x00, + 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x1a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, + 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x28, 0xf6, 0x97, 0x19, 0xe9, 0x57, 0x40, 0x1d, 0x51, 0x52, 0x59, + 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x36, 0xda, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xc7, 0x26, + 0xf5, 0xa7, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/plans/types/plan.pb.go b/x/plans/types/plan.pb.go index d1661da9ea..b81229eef4 100644 --- a/x/plans/types/plan.pb.go +++ b/x/plans/types/plan.pb.go @@ -8,7 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/x/spec/types" + _ "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" @@ -206,45 +206,45 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/plans/plan.proto", fileDescriptor_64c3707a3b09a2e5) } var fileDescriptor_64c3707a3b09a2e5 = []byte{ - // 603 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xcf, 0x6e, 0xd3, 0x30, - 0x1c, 0x6e, 0xda, 0xb4, 0x4b, 0x9d, 0x75, 0x33, 0x86, 0x43, 0xa8, 0x20, 0xa9, 0x90, 0x40, 0x15, - 0x87, 0x44, 0x63, 0x12, 0x12, 0x17, 0x04, 0x1d, 0x63, 0x52, 0x35, 0x89, 0x2a, 0xd3, 0x84, 0x04, - 0x48, 0x91, 0xeb, 0x5a, 0xc5, 0xe0, 0xc5, 0x51, 0xe2, 0x8e, 0xed, 0x15, 0x38, 0xf1, 0x18, 0x3c, - 0xca, 0x8e, 0x3b, 0x72, 0x8a, 0x50, 0x77, 0xcb, 0x4b, 0x0c, 0xd9, 0xce, 0x50, 0x0b, 0x88, 0x8b, - 0x3f, 0x7f, 0xbf, 0xef, 0xfb, 0xb5, 0xbf, 0x3f, 0x31, 0xb8, 0xcf, 0xf1, 0x29, 0x4e, 0xa9, 0x8c, - 0x14, 0x46, 0x19, 0xc7, 0x69, 0xa1, 0xcf, 0x30, 0xcb, 0x85, 0x14, 0x08, 0xd5, 0x72, 0xa8, 0x30, - 0xd4, 0x72, 0xff, 0xce, 0x5c, 0xcc, 0x85, 0x96, 0x23, 0x75, 0x33, 0xce, 0xbe, 0x4f, 0x44, 0x71, - 0x22, 0x8a, 0x68, 0x8a, 0x0b, 0x1a, 0x9d, 0xee, 0x4c, 0xa9, 0xc4, 0x3b, 0x11, 0x11, 0xac, 0xfe, - 0xa5, 0xfe, 0xa3, 0xb5, 0x3f, 0x2a, 0x32, 0x4a, 0x22, 0x9c, 0xb1, 0x84, 0x08, 0xce, 0x29, 0x91, - 0x4c, 0xdc, 0xf8, 0x82, 0x7f, 0x15, 0x24, 0x38, 0x23, 0xe7, 0xc6, 0xf0, 0xe0, 0x6b, 0x1b, 0xd8, - 0x13, 0x8e, 0x53, 0x14, 0x80, 0x36, 0x4b, 0x67, 0xf4, 0xcc, 0xb3, 0x06, 0xd6, 0xb0, 0x3b, 0xea, - 0x56, 0x65, 0x60, 0x02, 0xb1, 0x01, 0x65, 0x98, 0x72, 0x41, 0x3e, 0x7b, 0xad, 0x81, 0x35, 0xb4, - 0x8d, 0x41, 0x07, 0x62, 0x03, 0xe8, 0x39, 0x68, 0x67, 0x39, 0x23, 0xd4, 0xb3, 0x07, 0xd6, 0xd0, - 0x7d, 0x72, 0x37, 0x34, 0x3d, 0x84, 0xaa, 0x87, 0xb0, 0xee, 0x21, 0xdc, 0x13, 0x2c, 0x1d, 0xf5, - 0x2e, 0xca, 0xa0, 0xa1, 0xf2, 0xb5, 0x3f, 0x36, 0x80, 0x9e, 0x82, 0x1e, 0xe6, 0x5c, 0x7c, 0x49, - 0xc4, 0x29, 0xcd, 0x17, 0x05, 0xf5, 0x9c, 0x81, 0x35, 0x74, 0x46, 0xb7, 0xaa, 0x32, 0x58, 0x17, - 0xe2, 0x4d, 0x4d, 0xdf, 0x18, 0x86, 0x76, 0xc1, 0x66, 0x2d, 0x24, 0x39, 0x96, 0xd4, 0xeb, 0xea, - 0xfa, 0x60, 0x55, 0x06, 0x6b, 0xf1, 0xd8, 0xbd, 0x49, 0xc7, 0x92, 0xa2, 0x1d, 0xe0, 0xce, 0x68, - 0x41, 0x72, 0x96, 0xa9, 0x69, 0x79, 0xae, 0x6e, 0x7a, 0xbb, 0x2a, 0x83, 0xd5, 0x70, 0xbc, 0x4a, - 0xd0, 0x3d, 0x60, 0xcb, 0xf3, 0x8c, 0x7a, 0x9b, 0xda, 0xeb, 0x54, 0x65, 0xa0, 0x79, 0xac, 0x4f, - 0xf4, 0x01, 0xf4, 0x71, 0x9a, 0x2e, 0x30, 0x4f, 0x66, 0xac, 0x20, 0x62, 0x91, 0xca, 0x24, 0xa3, - 0x39, 0xa1, 0xa9, 0xc4, 0x73, 0xea, 0xf5, 0x74, 0x4d, 0x7e, 0x55, 0x06, 0xff, 0x71, 0xc5, 0x9e, - 0xd1, 0x5e, 0xd5, 0xd2, 0xe4, 0xb7, 0x82, 0x26, 0xc0, 0x55, 0xcb, 0x4b, 0xcc, 0xee, 0xbc, 0x2d, - 0x3d, 0xe1, 0x7e, 0xf8, 0xf7, 0xf7, 0x14, 0x4e, 0xb4, 0x63, 0x74, 0xbb, 0x1e, 0xf1, 0x6a, 0x5a, - 0x0c, 0x14, 0x31, 0x06, 0xf4, 0x0c, 0x6c, 0x65, 0xb9, 0xf8, 0x44, 0x89, 0x2c, 0x12, 0xce, 0x4e, - 0x98, 0xf4, 0xb6, 0x75, 0x8d, 0xa8, 0x2a, 0x83, 0x3f, 0x94, 0xb8, 0x77, 0xc3, 0x0f, 0x15, 0x55, - 0xa9, 0x7a, 0x01, 0x74, 0x96, 0x4c, 0x17, 0xe7, 0x34, 0x2f, 0x3c, 0x38, 0x68, 0x0d, 0xbb, 0x26, - 0x75, 0x5d, 0x89, 0x7b, 0x35, 0x1f, 0x69, 0x3a, 0xb6, 0x1d, 0x00, 0xdd, 0xb1, 0xed, 0x34, 0x61, - 0x6b, 0x6c, 0x3b, 0x6d, 0xd8, 0x19, 0xdb, 0x4e, 0x07, 0x6e, 0x8c, 0x6d, 0x67, 0x03, 0x3a, 0x8f, - 0xdf, 0x03, 0xf7, 0x80, 0x0a, 0x2e, 0x08, 0xd6, 0x03, 0xdf, 0x00, 0xad, 0x83, 0xc3, 0x23, 0xd8, - 0x50, 0x97, 0xe3, 0xa3, 0x3d, 0x68, 0xa1, 0x0e, 0x68, 0xee, 0x1f, 0xc3, 0xa6, 0x09, 0xec, 0x43, - 0xdb, 0x5c, 0xde, 0x42, 0x47, 0x29, 0x2f, 0x5f, 0x43, 0xa8, 0xf1, 0x08, 0x0e, 0x34, 0x1e, 0xc3, - 0x17, 0xc8, 0x01, 0xcd, 0x83, 0x43, 0x78, 0x7d, 0xdd, 0x1a, 0xed, 0x7d, 0x5f, 0xfa, 0xd6, 0xc5, - 0xd2, 0xb7, 0x2e, 0x97, 0xbe, 0xf5, 0x73, 0xe9, 0x5b, 0xdf, 0xae, 0xfc, 0xc6, 0xe5, 0x95, 0xdf, - 0xf8, 0x71, 0xe5, 0x37, 0xde, 0x3d, 0x9c, 0x33, 0xf9, 0x71, 0x31, 0x0d, 0x89, 0x38, 0x89, 0xd6, - 0xde, 0xcc, 0x59, 0xfd, 0x6a, 0xd4, 0x92, 0x8b, 0x69, 0x47, 0xbf, 0x9a, 0xdd, 0x5f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xfc, 0x16, 0x46, 0xe9, 0xe9, 0x03, 0x00, 0x00, + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x4f, 0x6f, 0xd3, 0x3e, + 0x18, 0x6e, 0xda, 0xb4, 0x4b, 0x9d, 0x75, 0xf3, 0xcf, 0x3f, 0x0e, 0xa1, 0x82, 0xa4, 0xe2, 0x80, + 0x2a, 0x0e, 0x89, 0xb6, 0x49, 0x48, 0x5c, 0x10, 0x74, 0x6c, 0x93, 0xaa, 0x49, 0x54, 0x99, 0x26, + 0x24, 0x40, 0x8a, 0x5c, 0xd7, 0x2a, 0x06, 0x2f, 0x8e, 0x12, 0xb7, 0x6c, 0x5f, 0x81, 0x13, 0x1f, + 0x83, 0x8f, 0xb2, 0xe3, 0x8e, 0x9c, 0x22, 0xd4, 0xdd, 0xf2, 0x25, 0x86, 0x6c, 0x67, 0x68, 0x05, + 0xc4, 0xc5, 0x8f, 0x9f, 0xf7, 0x79, 0xde, 0xf6, 0xfd, 0x13, 0x83, 0x87, 0x1c, 0x2f, 0x71, 0x4a, + 0x65, 0xa4, 0x30, 0xca, 0x38, 0x4e, 0x0b, 0x7d, 0x86, 0x59, 0x2e, 0xa4, 0x40, 0xa8, 0x96, 0x43, + 0x85, 0xa1, 0x96, 0xfb, 0xf7, 0xe6, 0x62, 0x2e, 0xb4, 0x1c, 0xa9, 0x9b, 0x71, 0xf6, 0x7d, 0x22, + 0x8a, 0x33, 0x51, 0x44, 0x53, 0x5c, 0xd0, 0x68, 0xb9, 0x33, 0xa5, 0x12, 0xef, 0x44, 0x44, 0xb0, + 0xfa, 0x97, 0xfa, 0x8f, 0xd7, 0xfe, 0xa8, 0xc8, 0x28, 0x89, 0x70, 0xc6, 0x12, 0x22, 0x38, 0xa7, + 0x44, 0x32, 0x71, 0xeb, 0x0b, 0xfe, 0x56, 0x90, 0xe0, 0x8c, 0x5c, 0x18, 0xc3, 0xa3, 0x2f, 0x6d, + 0x60, 0x4f, 0x38, 0x4e, 0x51, 0x00, 0xda, 0x2c, 0x9d, 0xd1, 0x73, 0xcf, 0x1a, 0x58, 0xc3, 0xee, + 0xa8, 0x5b, 0x95, 0x81, 0x09, 0xc4, 0x06, 0x94, 0x61, 0xca, 0x05, 0xf9, 0xe4, 0xb5, 0x06, 0xd6, + 0xd0, 0x36, 0x06, 0x1d, 0x88, 0x0d, 0xa0, 0xe7, 0xa0, 0x9d, 0xe5, 0x8c, 0x50, 0xcf, 0x1e, 0x58, + 0x43, 0x77, 0xf7, 0x7e, 0x68, 0x7a, 0x08, 0x55, 0x0f, 0x61, 0xdd, 0x43, 0xb8, 0x2f, 0x58, 0x3a, + 0xea, 0x5d, 0x96, 0x41, 0x43, 0xe5, 0x6b, 0x7f, 0x6c, 0x00, 0x3d, 0x05, 0x3d, 0xcc, 0xb9, 0xf8, + 0x9c, 0x88, 0x25, 0xcd, 0x17, 0x05, 0xf5, 0x9c, 0x81, 0x35, 0x74, 0x46, 0xff, 0x55, 0x65, 0xb0, + 0x2e, 0xc4, 0x9b, 0x9a, 0xbe, 0x36, 0x0c, 0xed, 0x81, 0xcd, 0x5a, 0x48, 0x72, 0x2c, 0xa9, 0xd7, + 0xd5, 0xf5, 0xc1, 0xaa, 0x0c, 0xd6, 0xe2, 0xb1, 0x7b, 0x9b, 0x8e, 0x25, 0x45, 0x3b, 0xc0, 0x9d, + 0xd1, 0x82, 0xe4, 0x2c, 0x53, 0xd3, 0xf2, 0x5c, 0xdd, 0xf4, 0x76, 0x55, 0x06, 0x77, 0xc3, 0xf1, + 0x5d, 0x82, 0x1e, 0x00, 0x5b, 0x5e, 0x64, 0xd4, 0xdb, 0xd4, 0x5e, 0xa7, 0x2a, 0x03, 0xcd, 0x63, + 0x7d, 0xa2, 0xf7, 0xa0, 0x8f, 0xd3, 0x74, 0x81, 0x79, 0x32, 0x63, 0x05, 0x11, 0x8b, 0x54, 0x26, + 0x19, 0xcd, 0x09, 0x4d, 0x25, 0x9e, 0x53, 0xaf, 0xa7, 0x6b, 0xf2, 0xab, 0x32, 0xf8, 0x87, 0x2b, + 0xf6, 0x8c, 0xf6, 0xaa, 0x96, 0x26, 0xbf, 0x14, 0x34, 0x01, 0xae, 0x5a, 0x5e, 0x62, 0x76, 0xe7, + 0x6d, 0xe9, 0x09, 0xf7, 0xc3, 0x3f, 0xbf, 0xa7, 0x70, 0xa2, 0x1d, 0xa3, 0xff, 0xeb, 0x11, 0xdf, + 0x4d, 0x8b, 0x81, 0x22, 0xc6, 0x80, 0x9e, 0x81, 0xad, 0x2c, 0x17, 0x1f, 0x29, 0x91, 0x45, 0xc2, + 0xd9, 0x19, 0x93, 0xde, 0xb6, 0xae, 0x11, 0x55, 0x65, 0xf0, 0x9b, 0x12, 0xf7, 0x6e, 0xf9, 0xb1, + 0xa2, 0x2a, 0x55, 0x2f, 0x80, 0xce, 0x92, 0xe9, 0xe2, 0x82, 0xe6, 0x85, 0x07, 0x07, 0xad, 0x61, + 0xd7, 0xa4, 0xae, 0x2b, 0x71, 0xaf, 0xe6, 0x23, 0x4d, 0xc7, 0xb6, 0x03, 0xa0, 0x3b, 0xb6, 0x9d, + 0x26, 0x6c, 0x8d, 0x6d, 0xa7, 0x0d, 0x3b, 0x63, 0xdb, 0xe9, 0xc0, 0x8d, 0xb1, 0xed, 0x6c, 0x40, + 0xe7, 0xc9, 0x3b, 0xe0, 0x1e, 0x51, 0xc1, 0x05, 0xc1, 0x7a, 0xe0, 0x1b, 0xa0, 0x75, 0x74, 0x7c, + 0x02, 0x1b, 0xea, 0x72, 0x7a, 0xb2, 0x0f, 0x2d, 0xd4, 0x01, 0xcd, 0x83, 0x53, 0xd8, 0x34, 0x81, + 0x03, 0x68, 0x9b, 0xcb, 0x1b, 0xe8, 0x28, 0xe5, 0xe5, 0x21, 0x84, 0x1a, 0x4f, 0xe0, 0x40, 0xe3, + 0x29, 0x7c, 0x81, 0x1c, 0xd0, 0x3c, 0x3a, 0x86, 0x37, 0x37, 0xad, 0xd1, 0xe1, 0xb7, 0x95, 0x6f, + 0x5d, 0xae, 0x7c, 0xeb, 0x6a, 0xe5, 0x5b, 0x3f, 0x56, 0xbe, 0xf5, 0xf5, 0xda, 0x6f, 0x5c, 0x5d, + 0xfb, 0x8d, 0xef, 0xd7, 0x7e, 0xe3, 0xed, 0x70, 0xce, 0xe4, 0x87, 0xc5, 0x34, 0x24, 0xe2, 0x2c, + 0x5a, 0x7b, 0x33, 0xcb, 0xdd, 0xe8, 0xbc, 0x7e, 0x38, 0x6a, 0xcf, 0xc5, 0xb4, 0xa3, 0x1f, 0xce, + 0xde, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdb, 0xde, 0x75, 0xec, 0xec, 0x03, 0x00, 0x00, } func (this *Plan) Equal(that interface{}) bool { diff --git a/x/plans/types/plan_decode_test.go b/x/plans/types/plan_decode_test.go index e22f564bb9..4430fe0de5 100644 --- a/x/plans/types/plan_decode_test.go +++ b/x/plans/types/plan_decode_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/utils/decoder" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/utils/decoder" "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/require" ) diff --git a/x/plans/types/plans_proposal.pb.go b/x/plans/types/plans_proposal.pb.go index 4f788b2bfd..c32710696f 100644 --- a/x/plans/types/plans_proposal.pb.go +++ b/x/plans/types/plans_proposal.pb.go @@ -110,7 +110,7 @@ func init() { } var fileDescriptor_781f7efff31affc8 = []byte{ - // 305 bytes of a gzipped FileDescriptorProto + // 308 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcf, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x39, 0x89, 0x79, 0xc5, 0x10, 0x32, 0xbe, 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0xaf, 0xa0, 0x28, 0xbf, 0x24, 0x5f, 0x48, 0x08, 0xaa, @@ -125,12 +125,12 @@ var fileDescriptor_781f7efff31affc8 = []byte{ 0x17, 0x5b, 0x6e, 0x7e, 0x4a, 0x66, 0x5a, 0xa5, 0x04, 0x8b, 0x02, 0xa3, 0x06, 0x87, 0x13, 0xd7, 0xab, 0x7b, 0xf2, 0x50, 0x91, 0x20, 0x28, 0x6d, 0xc5, 0xd1, 0xb1, 0x40, 0x9e, 0x61, 0xc6, 0x02, 0x79, 0x06, 0xa5, 0x89, 0x30, 0x5f, 0xb9, 0xa4, 0xe6, 0xd0, 0xd4, 0x57, 0xf2, 0xc8, 0xbe, 0x82, - 0x9a, 0x89, 0xec, 0x6e, 0x84, 0x9b, 0x9c, 0x9c, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, + 0x9a, 0x89, 0xec, 0x6e, 0x84, 0x9b, 0x9c, 0xdc, 0x56, 0x3c, 0x92, 0x63, 0x3c, 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, 0xd5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0x7d, 0x94, 0x18, 0xab, 0x80, 0xc6, 0x59, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, - 0x38, 0xd6, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x72, 0xee, 0x82, 0x17, 0x29, 0x02, 0x00, - 0x00, + 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, + 0xfc, 0x5c, 0x7d, 0x94, 0x18, 0x2b, 0x33, 0xd2, 0xaf, 0x80, 0x46, 0x5b, 0x49, 0x65, 0x41, 0x6a, + 0x71, 0x12, 0x1b, 0x38, 0xe2, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x85, 0xb2, 0x47, + 0x2c, 0x02, 0x00, 0x00, } func (this *PlansAddProposal) Equal(that interface{}) bool { diff --git a/x/plans/types/policy.go b/x/plans/types/policy.go index b562b2bc21..ccbf54a203 100644 --- a/x/plans/types/policy.go +++ b/x/plans/types/policy.go @@ -11,9 +11,9 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils/decoder" - "github.com/lavanet/lava/utils/lavaslices" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" + "github.com/lavanet/lava/v2/utils/decoder" + "github.com/lavanet/lava/v2/utils/lavaslices" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" "github.com/mitchellh/mapstructure" ) diff --git a/x/plans/types/policy.pb.go b/x/plans/types/policy.pb.go index 0e3e232368..4d8238bfc3 100644 --- a/x/plans/types/policy.pb.go +++ b/x/plans/types/policy.pb.go @@ -8,7 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/spec/types" + types "github.com/lavanet/lava/v2/x/spec/types" io "io" math "math" math_bits "math/bits" @@ -280,50 +280,50 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/plans/policy.proto", fileDescriptor_c2388e0faa8deb9b) } var fileDescriptor_c2388e0faa8deb9b = []byte{ - // 678 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xcb, 0x6e, 0xda, 0x4a, - 0x18, 0x66, 0x02, 0x24, 0x30, 0x10, 0xc4, 0x99, 0x93, 0x8b, 0x4f, 0xce, 0x91, 0xcd, 0x89, 0x7a, - 0x41, 0xad, 0x64, 0x2b, 0xe9, 0xa6, 0xdb, 0x18, 0x5b, 0x2a, 0x12, 0x69, 0xd0, 0x90, 0xa4, 0x51, - 0x17, 0xb1, 0x06, 0x33, 0x25, 0x23, 0xd9, 0x8c, 0x6b, 0x9b, 0x88, 0xec, 0xfa, 0x08, 0x7d, 0x8c, + // 680 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xcd, 0x6e, 0xda, 0x4a, + 0x18, 0x65, 0x02, 0x24, 0x30, 0x10, 0xc4, 0x9d, 0x9b, 0x1f, 0xdf, 0xdc, 0x2b, 0x9b, 0x1b, 0x55, + 0x2d, 0x6a, 0x25, 0x5b, 0xa1, 0x9b, 0x6e, 0x63, 0xec, 0xaa, 0x48, 0xa4, 0x41, 0x43, 0x92, 0x46, + 0x5d, 0xc4, 0x1a, 0xcc, 0x94, 0x8c, 0x64, 0x33, 0x2e, 0x36, 0x88, 0xec, 0xfa, 0x08, 0x7d, 0x8c, 0x3e, 0x40, 0x57, 0x5d, 0x74, 0x9d, 0x65, 0x96, 0x5d, 0x59, 0x15, 0xd9, 0xf9, 0x29, 0x2a, 0x0f, - 0x57, 0x27, 0x64, 0xc3, 0xfc, 0x97, 0xef, 0xfb, 0xff, 0x0f, 0xf8, 0x66, 0xa0, 0xe2, 0x90, 0x6b, - 0x32, 0xa0, 0xa1, 0x96, 0x9c, 0x9a, 0xe7, 0x90, 0x41, 0xa0, 0x79, 0xdc, 0x61, 0xf6, 0x8d, 0xea, - 0xf9, 0x3c, 0xe4, 0x08, 0x4d, 0x01, 0x6a, 0x72, 0xaa, 0x02, 0xb0, 0xb7, 0xd5, 0xe7, 0x7d, 0x2e, - 0xda, 0x5a, 0x12, 0x4d, 0x90, 0x7b, 0xb2, 0xcd, 0x03, 0x97, 0x07, 0x5a, 0x97, 0x04, 0x54, 0xbb, - 0x3e, 0xe8, 0xd2, 0x90, 0x1c, 0x68, 0x36, 0x67, 0x83, 0x69, 0xff, 0x45, 0x6a, 0x55, 0xe0, 0x51, - 0x5b, 0x23, 0x1e, 0xb3, 0x6c, 0xee, 0x38, 0xd4, 0x0e, 0x19, 0x9f, 0xe2, 0xf6, 0x7f, 0xe6, 0xe0, - 0x7a, 0x5b, 0x48, 0x40, 0x97, 0xb0, 0x62, 0x5f, 0x11, 0x36, 0xb0, 0x84, 0x24, 0x46, 0x03, 0x09, - 0xd4, 0xb2, 0xf5, 0xd2, 0xa1, 0xa2, 0x3e, 0x56, 0xa5, 0x36, 0x12, 0xe4, 0x84, 0xa8, 0xef, 0xdc, - 0x46, 0x4a, 0x26, 0x8e, 0x94, 0x07, 0x74, 0xbc, 0x69, 0xcf, 0x41, 0x8c, 0x06, 0xe8, 0x1d, 0xfc, - 0xbb, 0x4f, 0xb9, 0xc3, 0x6d, 0x92, 0xec, 0xb7, 0x3c, 0x9f, 0x7f, 0x62, 0x0e, 0x95, 0xd6, 0x6a, - 0xa0, 0x9e, 0xd7, 0x77, 0xe3, 0x48, 0x59, 0xd5, 0xc6, 0x68, 0xa9, 0xd8, 0x9e, 0xd4, 0xd0, 0x5b, - 0x58, 0x09, 0x79, 0x48, 0x1c, 0xcb, 0x1e, 0x5a, 0x0e, 0x73, 0x59, 0x28, 0x65, 0x6b, 0xa0, 0x9e, - 0xd3, 0x51, 0x22, 0x22, 0xdd, 0xc1, 0x65, 0x91, 0x37, 0x86, 0xad, 0x24, 0x4b, 0x98, 0xd4, 0xe3, - 0xf6, 0xd5, 0x82, 0x99, 0x5b, 0x30, 0xd3, 0x1d, 0x5c, 0x16, 0xf9, 0x8c, 0xd9, 0x82, 0xdb, 0x2e, - 0x19, 0x25, 0xb2, 0xae, 0x59, 0x8f, 0xfa, 0x81, 0x15, 0x72, 0xcb, 0x23, 0xcc, 0x97, 0xf2, 0x62, - 0xc0, 0x3f, 0x71, 0xa4, 0xac, 0x06, 0x60, 0xe4, 0x92, 0x51, 0x7b, 0x56, 0x3d, 0xe5, 0x6d, 0xc2, - 0x7c, 0xf4, 0x05, 0xc0, 0xdd, 0x80, 0x26, 0x7f, 0x05, 0xed, 0x2d, 0x51, 0x5c, 0xde, 0xa3, 0xd2, - 0x7a, 0x0d, 0xd4, 0x2b, 0x87, 0xaf, 0x57, 0xfd, 0xea, 0x1d, 0xb3, 0x65, 0x36, 0x4e, 0x4d, 0xc3, - 0x6a, 0xe3, 0x93, 0xf3, 0xa6, 0x61, 0xe2, 0x8e, 0x75, 0x7c, 0x62, 0x98, 0xfa, 0xbf, 0x71, 0xa4, - 0x3c, 0x35, 0x0f, 0x6f, 0xcf, 0x1a, 0x73, 0x11, 0xc7, 0xbc, 0x47, 0x91, 0x09, 0xd1, 0x63, 0x86, - 0xb4, 0x51, 0xcb, 0xd6, 0x8b, 0xfa, 0x4e, 0x1c, 0x29, 0x2b, 0xba, 0xf8, 0xaf, 0x47, 0xa3, 0xf6, - 0xbf, 0x03, 0x58, 0x5a, 0x32, 0x03, 0x7a, 0x09, 0x0b, 0x13, 0x1b, 0xb0, 0x9e, 0x04, 0x6a, 0xa0, - 0x5e, 0xd4, 0xcb, 0x71, 0xa4, 0xcc, 0x6b, 0x78, 0x43, 0x44, 0xcd, 0x1e, 0xfa, 0x0f, 0xe6, 0x88, - 0xc7, 0x02, 0x69, 0x4d, 0x6c, 0x2c, 0xc4, 0x91, 0x22, 0x72, 0x2c, 0x3e, 0xd1, 0x25, 0x2c, 0xfb, - 0xf4, 0xf3, 0x90, 0xf9, 0xd4, 0xa5, 0x83, 0x30, 0x90, 0xb2, 0xc2, 0x8a, 0xcf, 0x9e, 0xb4, 0x22, - 0x5e, 0x80, 0xf5, 0xad, 0xa9, 0x1f, 0x53, 0x13, 0x70, 0x2a, 0xdb, 0xff, 0x01, 0x60, 0xf5, 0x21, - 0x11, 0x9d, 0x41, 0xb8, 0xb8, 0x20, 0x42, 0x7d, 0xe9, 0xf0, 0xff, 0xf4, 0xca, 0xe4, 0x26, 0xa9, - 0x8d, 0x39, 0xc8, 0x20, 0x21, 0xd1, 0xd1, 0x74, 0xdf, 0x12, 0x19, 0x2f, 0xc5, 0x48, 0x85, 0x90, - 0x8e, 0x42, 0x3a, 0x08, 0x18, 0x1f, 0xcc, 0xbe, 0x6f, 0x25, 0xc1, 0x2f, 0xaa, 0x78, 0x29, 0x46, - 0x0a, 0xcc, 0xbb, 0x6c, 0x44, 0x7b, 0xc2, 0xd5, 0x05, 0xbd, 0x18, 0x47, 0xca, 0xa4, 0x80, 0x27, - 0xc7, 0xab, 0xf7, 0x70, 0xf7, 0x09, 0x27, 0xa0, 0x12, 0xdc, 0x38, 0x6a, 0xb5, 0x4e, 0x3e, 0x98, - 0x46, 0x35, 0x83, 0x8a, 0x30, 0x7f, 0xdc, 0xbc, 0x30, 0x8d, 0x2a, 0x40, 0x9b, 0xb0, 0x68, 0x5e, - 0x34, 0x5a, 0x67, 0x9d, 0xe6, 0xb9, 0x59, 0x5d, 0x43, 0x65, 0x58, 0x30, 0x9a, 0x9d, 0x23, 0xbd, - 0x65, 0x1a, 0xd5, 0xac, 0xde, 0xf8, 0x36, 0x96, 0xc1, 0xed, 0x58, 0x06, 0x77, 0x63, 0x19, 0xfc, - 0x1e, 0xcb, 0xe0, 0xeb, 0xbd, 0x9c, 0xb9, 0xbb, 0x97, 0x33, 0xbf, 0xee, 0xe5, 0xcc, 0xc7, 0xe7, - 0x7d, 0x16, 0x5e, 0x0d, 0xbb, 0xaa, 0xcd, 0x5d, 0x2d, 0xf5, 0xaa, 0x8c, 0xa6, 0x4f, 0x58, 0x78, - 0xe3, 0xd1, 0xa0, 0xbb, 0x2e, 0x1e, 0x94, 0x37, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x08, 0x9a, - 0x8f, 0xe7, 0xe5, 0x04, 0x00, 0x00, + 0xbf, 0x4e, 0xc8, 0x86, 0xf9, 0x7e, 0xce, 0xf9, 0xbe, 0x03, 0x9c, 0x19, 0xa8, 0x38, 0x64, 0x44, + 0xfa, 0x34, 0xd0, 0xe2, 0x53, 0xf3, 0x1c, 0xd2, 0xf7, 0x35, 0x8f, 0x3b, 0xcc, 0xbe, 0x51, 0xbd, + 0x01, 0x0f, 0x38, 0x42, 0x33, 0x80, 0x1a, 0x9f, 0xaa, 0x00, 0x1c, 0xec, 0xf4, 0x78, 0x8f, 0x8b, + 0xb6, 0x16, 0x47, 0x53, 0xe4, 0x81, 0x6c, 0x73, 0xdf, 0xe5, 0xbe, 0xd6, 0x21, 0x3e, 0xd5, 0x46, + 0x47, 0x1d, 0x1a, 0x90, 0x23, 0xcd, 0xe6, 0xac, 0x3f, 0xeb, 0x3f, 0x4f, 0xac, 0xf2, 0x3d, 0x6a, + 0x6b, 0xc4, 0x63, 0x96, 0xcd, 0x1d, 0x87, 0xda, 0x01, 0xe3, 0x33, 0xdc, 0xe1, 0xcf, 0x0c, 0xdc, + 0x6c, 0x09, 0x09, 0xe8, 0x0a, 0x96, 0xec, 0x6b, 0xc2, 0xfa, 0x96, 0x90, 0xc4, 0xa8, 0x2f, 0x81, + 0x4a, 0xba, 0x5a, 0xa8, 0x29, 0xea, 0x63, 0x55, 0x6a, 0x3d, 0x46, 0x4e, 0x89, 0xfa, 0xde, 0x6d, + 0xa8, 0xa4, 0xa2, 0x50, 0x79, 0x40, 0xc7, 0xdb, 0xf6, 0x02, 0xc4, 0xa8, 0x8f, 0xde, 0xc1, 0xbf, + 0x7b, 0x94, 0x3b, 0xdc, 0x26, 0xf1, 0x7e, 0xcb, 0x1b, 0xf0, 0x4f, 0xcc, 0xa1, 0xd2, 0x46, 0x05, + 0x54, 0xb3, 0xfa, 0x7e, 0x14, 0x2a, 0xeb, 0xda, 0x18, 0xad, 0x14, 0x5b, 0xd3, 0x1a, 0x7a, 0x03, + 0x4b, 0x01, 0x0f, 0x88, 0x63, 0xd9, 0x43, 0xcb, 0x61, 0x2e, 0x0b, 0xa4, 0x74, 0x05, 0x54, 0x33, + 0x3a, 0x8a, 0x45, 0x24, 0x3b, 0xb8, 0x28, 0xf2, 0xfa, 0xb0, 0x19, 0x67, 0x31, 0x93, 0x7a, 0xdc, + 0xbe, 0x5e, 0x32, 0x33, 0x4b, 0x66, 0xb2, 0x83, 0x8b, 0x22, 0x9f, 0x33, 0x9b, 0x70, 0xd7, 0x25, + 0xe3, 0x58, 0xd6, 0x88, 0x75, 0xe9, 0xc0, 0xb7, 0x02, 0x6e, 0x79, 0x84, 0x0d, 0xa4, 0xac, 0x18, + 0xf0, 0x4f, 0x14, 0x2a, 0xeb, 0x01, 0x18, 0xb9, 0x64, 0xdc, 0x9a, 0x57, 0xcf, 0x78, 0x8b, 0xb0, + 0x01, 0xfa, 0x02, 0xe0, 0xbe, 0x4f, 0xe3, 0xbf, 0x82, 0x76, 0x57, 0x28, 0x2e, 0xef, 0x52, 0x69, + 0xb3, 0x02, 0xaa, 0xa5, 0xda, 0xab, 0x75, 0xbf, 0x7a, 0xdb, 0x6c, 0x9a, 0xf5, 0x33, 0xd3, 0xb0, + 0x5a, 0xf8, 0xf4, 0xa2, 0x61, 0x98, 0xb8, 0x6d, 0x9d, 0x9c, 0x1a, 0xa6, 0xfe, 0x6f, 0x14, 0x2a, + 0x4f, 0xcd, 0xc3, 0xbb, 0xf3, 0xc6, 0x42, 0xc4, 0x09, 0xef, 0x52, 0x64, 0x42, 0xf4, 0x98, 0x21, + 0x6d, 0x55, 0xd2, 0xd5, 0xbc, 0xbe, 0x17, 0x85, 0xca, 0x9a, 0x2e, 0xfe, 0xeb, 0xd1, 0xa8, 0xc3, + 0xef, 0x00, 0x16, 0x56, 0xcc, 0x80, 0x5e, 0xc0, 0xdc, 0xd4, 0x06, 0xac, 0x2b, 0x81, 0x0a, 0xa8, + 0xe6, 0xf5, 0x62, 0x14, 0x2a, 0x8b, 0x1a, 0xde, 0x12, 0x51, 0xa3, 0x8b, 0xfe, 0x83, 0x19, 0xe2, + 0x31, 0x5f, 0xda, 0x10, 0x1b, 0x73, 0x51, 0xa8, 0x88, 0x1c, 0x8b, 0x4f, 0x74, 0x05, 0x8b, 0x03, + 0xfa, 0x79, 0xc8, 0x06, 0xd4, 0xa5, 0xfd, 0xc0, 0x97, 0xd2, 0xc2, 0x8a, 0xcf, 0x9e, 0xb4, 0x22, + 0x5e, 0x82, 0xf5, 0x9d, 0x99, 0x1f, 0x13, 0x13, 0x70, 0x22, 0x3b, 0xfc, 0x01, 0x60, 0xf9, 0x21, + 0x11, 0x9d, 0x43, 0xb8, 0xbc, 0x20, 0x42, 0x7d, 0xa1, 0xf6, 0x7f, 0x72, 0x65, 0x7c, 0x93, 0xd4, + 0xfa, 0x02, 0x64, 0x90, 0x80, 0xe8, 0x68, 0xb6, 0x6f, 0x85, 0x8c, 0x57, 0x62, 0xa4, 0x42, 0x48, + 0xc7, 0x01, 0xed, 0xfb, 0x8c, 0xf7, 0xe7, 0xdf, 0xb7, 0x14, 0xe3, 0x97, 0x55, 0xbc, 0x12, 0x23, + 0x05, 0x66, 0x5d, 0x36, 0xa6, 0x5d, 0xe1, 0xea, 0x9c, 0x9e, 0x8f, 0x42, 0x65, 0x5a, 0xc0, 0xd3, + 0xe3, 0xe5, 0x7b, 0xb8, 0xff, 0x84, 0x13, 0x50, 0x01, 0x6e, 0x1d, 0x37, 0x9b, 0xa7, 0x1f, 0x4c, + 0xa3, 0x9c, 0x42, 0x79, 0x98, 0x3d, 0x69, 0x5c, 0x9a, 0x46, 0x19, 0xa0, 0x6d, 0x98, 0x37, 0x2f, + 0xeb, 0xcd, 0xf3, 0x76, 0xe3, 0xc2, 0x2c, 0x6f, 0xa0, 0x22, 0xcc, 0x19, 0x8d, 0xf6, 0xb1, 0xde, + 0x34, 0x8d, 0x72, 0x5a, 0x7f, 0xfb, 0x6d, 0x22, 0x83, 0xdb, 0x89, 0x0c, 0xee, 0x26, 0x32, 0xf8, + 0x3d, 0x91, 0xc1, 0xd7, 0x7b, 0x39, 0x75, 0x77, 0x2f, 0xa7, 0x7e, 0xdd, 0xcb, 0xa9, 0x8f, 0xd5, + 0x1e, 0x0b, 0xae, 0x87, 0x1d, 0xd5, 0xe6, 0xae, 0x96, 0x78, 0x55, 0x46, 0x35, 0x6d, 0x3c, 0x7b, + 0xc5, 0x82, 0x1b, 0x8f, 0xfa, 0x9d, 0x4d, 0xf1, 0xa6, 0xbc, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, + 0x8a, 0xa8, 0x36, 0x2b, 0xe8, 0x04, 0x00, 0x00, } func (this *Policy) Equal(that interface{}) bool { diff --git a/x/plans/types/query.pb.go b/x/plans/types/query.pb.go index 973cd792ab..c683c8bae6 100644 --- a/x/plans/types/query.pb.go +++ b/x/plans/types/query.pb.go @@ -355,41 +355,41 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/plans/query.proto", fileDescriptor_060142fb85a7e3eb) } var fileDescriptor_060142fb85a7e3eb = []byte{ - // 537 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x5d, 0x6b, 0x13, 0x41, - 0x14, 0xcd, 0x36, 0x1f, 0x98, 0x09, 0x88, 0x8e, 0x79, 0x58, 0x97, 0x76, 0x1b, 0x06, 0x63, 0x8b, - 0xe0, 0x0c, 0x89, 0x08, 0x82, 0x0f, 0x42, 0x7d, 0x90, 0x82, 0x60, 0x8d, 0x6f, 0x22, 0x94, 0xc9, - 0x76, 0xb2, 0x0e, 0x6c, 0x66, 0xb6, 0x3b, 0x93, 0xd2, 0x22, 0x45, 0xc8, 0x2f, 0x10, 0xfc, 0x53, - 0x7d, 0x2c, 0xf8, 0xe2, 0x93, 0x48, 0xe2, 0x0f, 0x91, 0xf9, 0x08, 0xdd, 0xd0, 0x6d, 0xfb, 0x34, - 0xc9, 0xbd, 0xe7, 0x9e, 0x73, 0xe6, 0xdc, 0x59, 0x10, 0x67, 0xf4, 0x84, 0x0a, 0xa6, 0x89, 0x39, - 0x49, 0x9e, 0x51, 0xa1, 0xc8, 0xf1, 0x8c, 0x15, 0x67, 0x38, 0x2f, 0xa4, 0x96, 0x10, 0xfa, 0x3e, - 0x36, 0x27, 0xb6, 0xfd, 0xa8, 0x9b, 0xca, 0x54, 0xda, 0x36, 0x31, 0xbf, 0x1c, 0x32, 0xda, 0x4c, - 0xa5, 0x4c, 0x33, 0x46, 0x68, 0xce, 0x09, 0x15, 0x42, 0x6a, 0xaa, 0xb9, 0x14, 0xca, 0x77, 0x9f, - 0x25, 0x52, 0x4d, 0xa5, 0x22, 0x63, 0xaa, 0x98, 0x13, 0x20, 0x27, 0x83, 0x31, 0xd3, 0x74, 0x40, - 0x72, 0x9a, 0x72, 0x61, 0xc1, 0x1e, 0xbb, 0x5d, 0xe1, 0x29, 0xa7, 0x05, 0x9d, 0xae, 0xc8, 0xe2, - 0x32, 0xd9, 0x8a, 0x26, 0x91, 0x7c, 0x45, 0xb0, 0x55, 0x45, 0x90, 0x51, 0xdf, 0x46, 0x5d, 0x00, - 0x3f, 0x1a, 0x07, 0x07, 0x96, 0x73, 0xc4, 0x8e, 0x67, 0x4c, 0x69, 0xf4, 0x01, 0x3c, 0x5a, 0xab, - 0xaa, 0x5c, 0x0a, 0xc5, 0xe0, 0x2b, 0xd0, 0x72, 0xda, 0x61, 0xd0, 0x0b, 0x76, 0x3b, 0xc3, 0x08, - 0x5f, 0x4f, 0x04, 0xbb, 0x99, 0xbd, 0xc6, 0xc5, 0x9f, 0xed, 0xda, 0xc8, 0xe3, 0x11, 0x04, 0x0f, - 0x2c, 0xe1, 0x7b, 0xae, 0xf4, 0x4a, 0xe4, 0x0b, 0x78, 0x58, 0xaa, 0x79, 0x89, 0x77, 0x00, 0x58, - 0x9a, 0x43, 0x2e, 0x26, 0x32, 0x0c, 0x7a, 0xf5, 0xdd, 0xce, 0x10, 0x55, 0xc9, 0x98, 0xa9, 0x7d, - 0x31, 0x91, 0x9f, 0x74, 0x31, 0x4b, 0xb4, 0x97, 0x6b, 0xdb, 0x9e, 0x29, 0xa3, 0xef, 0xe0, 0xfe, - 0x3a, 0x04, 0x76, 0x41, 0x93, 0x8b, 0x23, 0x76, 0x6a, 0xcd, 0xb7, 0x47, 0xee, 0x0f, 0xec, 0x81, - 0xce, 0x11, 0x53, 0x49, 0xc1, 0x73, 0x93, 0x7a, 0xb8, 0x61, 0x7b, 0xe5, 0x12, 0x7c, 0x09, 0x9a, - 0x79, 0xc1, 0x13, 0x16, 0xd6, 0xed, 0xa5, 0x1f, 0x63, 0x97, 0x38, 0x36, 0x89, 0x63, 0x9f, 0x38, - 0x7e, 0x2b, 0xb9, 0xf0, 0x26, 0x1c, 0x1a, 0x0d, 0xfc, 0x95, 0x8d, 0x03, 0x7f, 0x65, 0xb8, 0xe5, - 0x6e, 0x77, 0x58, 0xf6, 0x61, 0x3d, 0xef, 0x9b, 0x02, 0x3a, 0xf0, 0x89, 0xb8, 0x11, 0x9f, 0xc8, - 0x6b, 0xd0, 0xf6, 0x33, 0x36, 0x10, 0x63, 0x21, 0xac, 0xcc, 0x3d, 0xa3, 0x2b, 0x07, 0xf7, 0x1c, - 0xe5, 0x44, 0x0e, 0xe7, 0x75, 0xd0, 0xb4, 0x94, 0xf0, 0x1c, 0xb4, 0xdc, 0x66, 0xe0, 0xd3, 0xaa, - 0xe9, 0xeb, 0x8f, 0x20, 0xda, 0xb9, 0x13, 0xe7, 0x1c, 0x22, 0x34, 0xff, 0xf5, 0xef, 0xe7, 0xc6, - 0x26, 0x8c, 0xc8, 0x8d, 0x8f, 0x15, 0xce, 0x40, 0xc3, 0xac, 0x03, 0x3e, 0xb9, 0x91, 0xb4, 0xf4, - 0x34, 0xa2, 0xfe, 0x1d, 0x28, 0x2f, 0xdc, 0xb3, 0xc2, 0x11, 0x0c, 0xab, 0x84, 0x33, 0x23, 0x37, - 0x0f, 0x40, 0xc3, 0x04, 0x71, 0x8b, 0x6e, 0x69, 0x3f, 0xb7, 0xe8, 0x96, 0x57, 0x82, 0x9e, 0x5b, - 0xdd, 0x1d, 0xd8, 0xaf, 0xd2, 0x35, 0x7b, 0x22, 0xdf, 0xae, 0xd6, 0x7c, 0xbe, 0xf7, 0xe6, 0x62, - 0x11, 0x07, 0x97, 0x8b, 0x38, 0xf8, 0xbb, 0x88, 0x83, 0x1f, 0xcb, 0xb8, 0x76, 0xb9, 0x8c, 0x6b, - 0xbf, 0x97, 0x71, 0xed, 0x73, 0x3f, 0xe5, 0xfa, 0xeb, 0x6c, 0x8c, 0x13, 0x39, 0x5d, 0xa7, 0x3a, - 0xf5, 0x64, 0xfa, 0x2c, 0x67, 0x6a, 0xdc, 0xb2, 0xdf, 0xea, 0x8b, 0xff, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x21, 0xe4, 0xd7, 0x2c, 0xa1, 0x04, 0x00, 0x00, + // 538 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcf, 0x6b, 0x13, 0x41, + 0x18, 0xcd, 0xb6, 0x49, 0x30, 0x13, 0x10, 0x1d, 0x73, 0x58, 0x97, 0x76, 0x1b, 0x06, 0x6b, 0x83, + 0xe0, 0x0c, 0x89, 0x08, 0x82, 0xb7, 0x78, 0x90, 0x82, 0x60, 0x8d, 0x37, 0x11, 0xca, 0x64, 0x3b, + 0x59, 0x07, 0x36, 0x33, 0xdb, 0x9d, 0x49, 0x68, 0x91, 0x22, 0xe4, 0x2f, 0x10, 0xfc, 0xa7, 0x7a, + 0x2c, 0x78, 0xf1, 0x24, 0x92, 0xf8, 0x87, 0xc8, 0xfc, 0x08, 0x6e, 0xe8, 0xb6, 0x3d, 0x4d, 0xf2, + 0x7d, 0xef, 0x7b, 0xef, 0xcd, 0xfb, 0x66, 0x41, 0x9c, 0xd1, 0x39, 0x15, 0x4c, 0x13, 0x73, 0x92, + 0x3c, 0xa3, 0x42, 0x91, 0xd3, 0x19, 0x2b, 0xce, 0x71, 0x5e, 0x48, 0x2d, 0x21, 0xf4, 0x7d, 0x6c, + 0x4e, 0x6c, 0xfb, 0x51, 0x27, 0x95, 0xa9, 0xb4, 0x6d, 0x62, 0x7e, 0x39, 0x64, 0xb4, 0x93, 0x4a, + 0x99, 0x66, 0x8c, 0xd0, 0x9c, 0x13, 0x2a, 0x84, 0xd4, 0x54, 0x73, 0x29, 0x94, 0xef, 0x3e, 0x4b, + 0xa4, 0x9a, 0x4a, 0x45, 0xc6, 0x54, 0x31, 0x27, 0x40, 0xe6, 0xfd, 0x31, 0xd3, 0xb4, 0x4f, 0x72, + 0x9a, 0x72, 0x61, 0xc1, 0x1e, 0xbb, 0x57, 0xe1, 0x29, 0xa7, 0x05, 0x9d, 0xae, 0xc9, 0xe2, 0x32, + 0xd9, 0x9a, 0x26, 0x91, 0x7c, 0x4d, 0xb0, 0x5b, 0x45, 0x90, 0x51, 0xdf, 0x46, 0x1d, 0x00, 0x3f, + 0x18, 0x07, 0x47, 0x96, 0x73, 0xc4, 0x4e, 0x67, 0x4c, 0x69, 0xf4, 0x1e, 0x3c, 0xda, 0xa8, 0xaa, + 0x5c, 0x0a, 0xc5, 0xe0, 0x2b, 0xd0, 0x74, 0xda, 0x61, 0xd0, 0x0d, 0x7a, 0xed, 0x41, 0x84, 0xaf, + 0x27, 0x82, 0xdd, 0xcc, 0xb0, 0x7e, 0xf9, 0x7b, 0xaf, 0x36, 0xf2, 0x78, 0x04, 0xc1, 0x03, 0x4b, + 0xf8, 0x8e, 0x2b, 0xbd, 0x16, 0xf9, 0x0c, 0x1e, 0x96, 0x6a, 0x5e, 0xe2, 0x2d, 0x00, 0x96, 0xe6, + 0x98, 0x8b, 0x89, 0x0c, 0x83, 0xee, 0x76, 0xaf, 0x3d, 0x40, 0x55, 0x32, 0x66, 0xea, 0x50, 0x4c, + 0xe4, 0x47, 0x5d, 0xcc, 0x12, 0xed, 0xe5, 0x5a, 0xb6, 0x67, 0xca, 0xe8, 0x1b, 0xb8, 0xbf, 0x09, + 0x81, 0x1d, 0xd0, 0xe0, 0xe2, 0x84, 0x9d, 0x59, 0xf3, 0xad, 0x91, 0xfb, 0x03, 0xbb, 0xa0, 0x7d, + 0xc2, 0x54, 0x52, 0xf0, 0xdc, 0xa4, 0x1e, 0x6e, 0xd9, 0x5e, 0xb9, 0x04, 0x5f, 0x82, 0x46, 0x5e, + 0xf0, 0x84, 0x85, 0xdb, 0xf6, 0xd2, 0x8f, 0xb1, 0x4b, 0x1c, 0x9b, 0xc4, 0xb1, 0x4f, 0x1c, 0xbf, + 0x91, 0x5c, 0x78, 0x13, 0x0e, 0x8d, 0xfa, 0xfe, 0xca, 0xc6, 0x81, 0xbf, 0x32, 0xdc, 0x75, 0xb7, + 0x3b, 0x2e, 0xfb, 0xb0, 0x9e, 0x0f, 0x4d, 0x01, 0x1d, 0xf9, 0x44, 0xdc, 0x88, 0x4f, 0xe4, 0x35, + 0x68, 0xf9, 0x19, 0x1b, 0x88, 0xb1, 0x10, 0x56, 0xe6, 0x9e, 0xd1, 0xb5, 0x83, 0x7b, 0x8e, 0x72, + 0x22, 0x07, 0x8b, 0x6d, 0xd0, 0xb0, 0x94, 0xf0, 0x02, 0x34, 0xdd, 0x66, 0xe0, 0xd3, 0xaa, 0xe9, + 0xeb, 0x8f, 0x20, 0x3a, 0xb8, 0x13, 0xe7, 0x1c, 0x22, 0xb4, 0xf8, 0xf9, 0xf7, 0xc7, 0xd6, 0x0e, + 0x8c, 0xc8, 0x8d, 0x8f, 0x15, 0xce, 0x40, 0xdd, 0xac, 0x03, 0x3e, 0xb9, 0x91, 0xb4, 0xf4, 0x34, + 0xa2, 0xfd, 0x3b, 0x50, 0x5e, 0xb8, 0x6b, 0x85, 0x23, 0x18, 0x56, 0x09, 0x67, 0x46, 0x6e, 0x11, + 0x80, 0xba, 0x09, 0xe2, 0x16, 0xdd, 0xd2, 0x7e, 0x6e, 0xd1, 0x2d, 0xaf, 0x04, 0x3d, 0xb7, 0xba, + 0x07, 0x70, 0xbf, 0x4a, 0xd7, 0xec, 0x89, 0x7c, 0xfd, 0xbf, 0xe6, 0x8b, 0xe1, 0xf0, 0x72, 0x19, + 0x07, 0x57, 0xcb, 0x38, 0xf8, 0xb3, 0x8c, 0x83, 0xef, 0xab, 0xb8, 0x76, 0xb5, 0x8a, 0x6b, 0xbf, + 0x56, 0x71, 0xed, 0x53, 0x2f, 0xe5, 0xfa, 0xcb, 0x6c, 0x8c, 0x13, 0x39, 0xdd, 0xa4, 0x9a, 0x0f, + 0xc8, 0x99, 0xe7, 0xd3, 0xe7, 0x39, 0x53, 0xe3, 0xa6, 0xfd, 0x5c, 0x5f, 0xfc, 0x0b, 0x00, 0x00, + 0xff, 0xff, 0x4f, 0xee, 0xc7, 0x75, 0xa4, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/plans/types/tx.pb.go b/x/plans/types/tx.pb.go index ab0857d9e0..ab5f948eef 100644 --- a/x/plans/types/tx.pb.go +++ b/x/plans/types/tx.pb.go @@ -26,15 +26,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("lavanet/lava/plans/tx.proto", fileDescriptor_3d5c4f7f9bf14ddd) } var fileDescriptor_3d5c4f7f9bf14ddd = []byte{ - // 122 bytes of a gzipped FileDescriptorProto + // 125 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xce, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x39, 0x89, 0x79, 0xc5, 0xfa, 0x25, 0x15, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x42, 0x50, 0x49, 0x3d, 0x10, 0xad, 0x07, 0x96, 0x34, 0x62, - 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0xb2, 0x3f, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, 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, 0xd5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0xc3, - 0x2b, 0x60, 0xc6, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xad, 0x30, 0x06, 0x04, 0x00, 0x00, - 0xff, 0xff, 0x49, 0x13, 0x25, 0x94, 0x81, 0x00, 0x00, 0x00, + 0x86, 0x28, 0x8d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0xc3, + 0xcb, 0x8c, 0xf4, 0x2b, 0x60, 0x36, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x6d, 0x31, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x25, 0x90, 0x4d, 0x3b, 0x84, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/projects/client/cli/query.go b/x/projects/client/cli/query.go index bb5eb9cbd9..adf23722a5 100644 --- a/x/projects/client/cli/query.go +++ b/x/projects/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/projects/client/cli/query_developer.go b/x/projects/client/cli/query_developer.go index 1895126c28..3777e06213 100644 --- a/x/projects/client/cli/query_developer.go +++ b/x/projects/client/cli/query_developer.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/query_info.go b/x/projects/client/cli/query_info.go index eaf32cd313..02e365a013 100644 --- a/x/projects/client/cli/query_info.go +++ b/x/projects/client/cli/query_info.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/query_params.go b/x/projects/client/cli/query_params.go index 7cde526252..a32c15c761 100644 --- a/x/projects/client/cli/query_params.go +++ b/x/projects/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx.go b/x/projects/client/cli/tx.go index 895d6dbd18..bd4dcb80ab 100644 --- a/x/projects/client/cli/tx.go +++ b/x/projects/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/projects/client/cli/tx_add_keys.go b/x/projects/client/cli/tx_add_keys.go index 3916403f93..7cd794ca6e 100644 --- a/x/projects/client/cli/tx_add_keys.go +++ b/x/projects/client/cli/tx_add_keys.go @@ -4,9 +4,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/decoder" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/decoder" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx_del_keys.go b/x/projects/client/cli/tx_del_keys.go index 5583654163..a6986b112f 100644 --- a/x/projects/client/cli/tx_del_keys.go +++ b/x/projects/client/cli/tx_del_keys.go @@ -4,9 +4,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/decoder" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/decoder" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx_set_admin_policy.go b/x/projects/client/cli/tx_set_admin_policy.go index 7ef9e8ee89..938cd30fb6 100644 --- a/x/projects/client/cli/tx_set_admin_policy.go +++ b/x/projects/client/cli/tx_set_admin_policy.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - planstypes "github.com/lavanet/lava/x/plans/types" - "github.com/lavanet/lava/x/projects/types" - spectypes "github.com/lavanet/lava/x/spec/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + "github.com/lavanet/lava/v2/x/projects/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/projects/client/cli/tx_set_subscription_policy.go b/x/projects/client/cli/tx_set_subscription_policy.go index 43e97ffede..b57e2fe901 100644 --- a/x/projects/client/cli/tx_set_subscription_policy.go +++ b/x/projects/client/cli/tx_set_subscription_policy.go @@ -8,8 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - planstypes "github.com/lavanet/lava/x/plans/types" - "github.com/lavanet/lava/x/projects/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/spf13/cobra" ) diff --git a/x/projects/genesis.go b/x/projects/genesis.go index 653d7d4ca8..5d6e14ff74 100644 --- a/x/projects/genesis.go +++ b/x/projects/genesis.go @@ -2,8 +2,8 @@ package projects import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/projects/genesis_test.go b/x/projects/genesis_test.go index bdda837c03..7054e9e9c8 100644 --- a/x/projects/genesis_test.go +++ b/x/projects/genesis_test.go @@ -3,10 +3,10 @@ package projects_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/projects" - "github.com/lavanet/lava/x/projects/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/projects" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/handler.go b/x/projects/handler.go index f5aa46593d..a446a7f174 100644 --- a/x/projects/handler.go +++ b/x/projects/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) // NewHandler ... diff --git a/x/projects/keeper/creation.go b/x/projects/keeper/creation.go index 75828b99da..cf85c3254b 100644 --- a/x/projects/keeper/creation.go +++ b/x/projects/keeper/creation.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - plantypes "github.com/lavanet/lava/x/plans/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + "github.com/lavanet/lava/v2/x/projects/types" ) // Keys management logic: diff --git a/x/projects/keeper/grpc_query.go b/x/projects/keeper/grpc_query.go index b733c38f2f..b17576af1b 100644 --- a/x/projects/keeper/grpc_query.go +++ b/x/projects/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/projects/keeper/grpc_query_developer.go b/x/projects/keeper/grpc_query_developer.go index 21cdeb2e3b..63732f1614 100644 --- a/x/projects/keeper/grpc_query_developer.go +++ b/x/projects/keeper/grpc_query_developer.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/projects/keeper/grpc_query_info.go b/x/projects/keeper/grpc_query_info.go index f0b6c8d8b8..f641e15426 100644 --- a/x/projects/keeper/grpc_query_info.go +++ b/x/projects/keeper/grpc_query_info.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/projects/keeper/grpc_query_params.go b/x/projects/keeper/grpc_query_params.go index b948d3d157..b6b2642bd0 100644 --- a/x/projects/keeper/grpc_query_params.go +++ b/x/projects/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/projects/keeper/grpc_query_params_test.go b/x/projects/keeper/grpc_query_params_test.go index 313a246540..2a30654ad4 100644 --- a/x/projects/keeper/grpc_query_params_test.go +++ b/x/projects/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/projects/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/keeper/keeper.go b/x/projects/keeper/keeper.go index 655bebaf2d..4b53c80949 100644 --- a/x/projects/keeper/keeper.go +++ b/x/projects/keeper/keeper.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - "github.com/lavanet/lava/x/projects/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/projects/types" ) type ( diff --git a/x/projects/keeper/migrations.go b/x/projects/keeper/migrations.go index c1222074f4..f346b27b03 100644 --- a/x/projects/keeper/migrations.go +++ b/x/projects/keeper/migrations.go @@ -2,11 +2,11 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - v2 "github.com/lavanet/lava/x/projects/migrations/v2" - v3 "github.com/lavanet/lava/x/projects/migrations/v3" - v4 "github.com/lavanet/lava/x/projects/migrations/v4" - v5 "github.com/lavanet/lava/x/projects/migrations/v5" + "github.com/lavanet/lava/v2/utils" + v2 "github.com/lavanet/lava/v2/x/projects/migrations/v2" + v3 "github.com/lavanet/lava/v2/x/projects/migrations/v3" + v4 "github.com/lavanet/lava/v2/x/projects/migrations/v4" + v5 "github.com/lavanet/lava/v2/x/projects/migrations/v5" ) type Migrator struct { diff --git a/x/projects/keeper/msg_server.go b/x/projects/keeper/msg_server.go index 6cbebfab01..a5aafe6252 100644 --- a/x/projects/keeper/msg_server.go +++ b/x/projects/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" ) type msgServer struct { diff --git a/x/projects/keeper/msg_server_add_project_keys.go b/x/projects/keeper/msg_server_add_project_keys.go index 27f208e914..78738d35fe 100644 --- a/x/projects/keeper/msg_server_add_project_keys.go +++ b/x/projects/keeper/msg_server_add_project_keys.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/projects/types" ) func (k msgServer) AddKeys(goCtx context.Context, msg *types.MsgAddKeys) (*types.MsgAddKeysResponse, error) { diff --git a/x/projects/keeper/msg_server_del_project_keys.go b/x/projects/keeper/msg_server_del_project_keys.go index 95d3bce7dd..e353f3f8d7 100644 --- a/x/projects/keeper/msg_server_del_project_keys.go +++ b/x/projects/keeper/msg_server_del_project_keys.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/projects/types" ) func (k msgServer) DelKeys(goCtx context.Context, msg *types.MsgDelKeys) (*types.MsgDelKeysResponse, error) { diff --git a/x/projects/keeper/msg_server_set_admin_policy.go b/x/projects/keeper/msg_server_set_admin_policy.go index 6259f473d0..7b6a113ee0 100644 --- a/x/projects/keeper/msg_server_set_admin_policy.go +++ b/x/projects/keeper/msg_server_set_admin_policy.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/projects/types" ) func (k msgServer) SetPolicy(goCtx context.Context, msg *types.MsgSetPolicy) (*types.MsgSetPolicyResponse, error) { diff --git a/x/projects/keeper/msg_server_set_subscription_policy.go b/x/projects/keeper/msg_server_set_subscription_policy.go index 659d0574da..9784e97edb 100644 --- a/x/projects/keeper/msg_server_set_subscription_policy.go +++ b/x/projects/keeper/msg_server_set_subscription_policy.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/projects/types" ) func (k msgServer) SetSubscriptionPolicy(goCtx context.Context, msg *types.MsgSetSubscriptionPolicy) (*types.MsgSetSubscriptionPolicyResponse, error) { diff --git a/x/projects/keeper/msg_server_test.go b/x/projects/keeper/msg_server_test.go index f936cd0566..a0b842768d 100644 --- a/x/projects/keeper/msg_server_test.go +++ b/x/projects/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/projects/keeper/params.go b/x/projects/keeper/params.go index f22f6d921e..9af55510fc 100644 --- a/x/projects/keeper/params.go +++ b/x/projects/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" ) // GetParams get all parameters as types.Params diff --git a/x/projects/keeper/params_test.go b/x/projects/keeper/params_test.go index a0bccd96c7..b245bf9fa0 100644 --- a/x/projects/keeper/params_test.go +++ b/x/projects/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/projects/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/keeper/project.go b/x/projects/keeper/project.go index 290f6a3eb8..297528ad5a 100644 --- a/x/projects/keeper/project.go +++ b/x/projects/keeper/project.go @@ -6,9 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - planstypes "github.com/lavanet/lava/x/plans/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/utils" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + "github.com/lavanet/lava/v2/x/projects/types" ) // getProjectForBlock returns the version of a given project at a given block diff --git a/x/projects/keeper/project_test.go b/x/projects/keeper/project_test.go index a128a200fc..f738d04d35 100644 --- a/x/projects/keeper/project_test.go +++ b/x/projects/keeper/project_test.go @@ -7,11 +7,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils/sigs" - planstypes "github.com/lavanet/lava/x/plans/types" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/testutil/common" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/utils/sigs" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/module.go b/x/projects/module.go index 272f38cb1b..0380c5527f 100644 --- a/x/projects/module.go +++ b/x/projects/module.go @@ -18,9 +18,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/projects/client/cli" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/client/cli" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) var ( diff --git a/x/projects/module_simulation.go b/x/projects/module_simulation.go index 96ecd278ca..35a31c6a6c 100644 --- a/x/projects/module_simulation.go +++ b/x/projects/module_simulation.go @@ -10,9 +10,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - projectssimulation "github.com/lavanet/lava/x/projects/simulation" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/testutil/sample" + projectssimulation "github.com/lavanet/lava/v2/x/projects/simulation" + "github.com/lavanet/lava/v2/x/projects/types" ) // avoid unused import issue diff --git a/x/projects/simulation/add_project_keys.go b/x/projects/simulation/add_project_keys.go index 6b5f7fed24..c336a3ef29 100644 --- a/x/projects/simulation/add_project_keys.go +++ b/x/projects/simulation/add_project_keys.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) func SimulateMsgAddKeys( diff --git a/x/projects/simulation/del_project_keys.go b/x/projects/simulation/del_project_keys.go index d9a87c18fe..5724ceebda 100644 --- a/x/projects/simulation/del_project_keys.go +++ b/x/projects/simulation/del_project_keys.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) func SimulateMsgDelKeys( diff --git a/x/projects/simulation/set_admin_policy.go b/x/projects/simulation/set_admin_policy.go index c585b54074..77bb9e1fc1 100644 --- a/x/projects/simulation/set_admin_policy.go +++ b/x/projects/simulation/set_admin_policy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) func SimulateMsgSetPolicy( diff --git a/x/projects/simulation/set_subscription_policy.go b/x/projects/simulation/set_subscription_policy.go index e818d62fdd..d040346f6a 100644 --- a/x/projects/simulation/set_subscription_policy.go +++ b/x/projects/simulation/set_subscription_policy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/projects/keeper" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/keeper" + "github.com/lavanet/lava/v2/x/projects/types" ) func SimulateMsgSetSubscriptionPolicy( diff --git a/x/projects/types/codec.go b/x/projects/types/codec.go index c6f25bfddf..2ebe1d33c0 100644 --- a/x/projects/types/codec.go +++ b/x/projects/types/codec.go @@ -3,6 +3,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "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" @@ -36,5 +37,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + ModuleCdc = codec.NewAminoCodec(Amino) + // ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterCodec(Amino) + cryptocodec.RegisterCrypto(Amino) + Amino.Seal() +} diff --git a/x/projects/types/expected_keepers.go b/x/projects/types/expected_keepers.go index ae2970eac3..f204fdcd99 100644 --- a/x/projects/types/expected_keepers.go +++ b/x/projects/types/expected_keepers.go @@ -3,7 +3,7 @@ package types import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - fixationstoretypes "github.com/lavanet/lava/x/fixationstore/types" + fixationstoretypes "github.com/lavanet/lava/v2/x/fixationstore/types" ) type EpochStorageKeeper interface { diff --git a/x/projects/types/genesis.go b/x/projects/types/genesis.go index 6d2515a220..deb5a16474 100644 --- a/x/projects/types/genesis.go +++ b/x/projects/types/genesis.go @@ -1,7 +1,7 @@ package types import ( - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" ) // this line is used by starport scaffolding # genesis/types/import diff --git a/x/projects/types/genesis.pb.go b/x/projects/types/genesis.pb.go index 1851624518..31bfd57f3d 100644 --- a/x/projects/types/genesis.pb.go +++ b/x/projects/types/genesis.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/fixationstore/types" + types "github.com/lavanet/lava/v2/x/fixationstore/types" io "io" math "math" math_bits "math/bits" @@ -94,7 +94,7 @@ func init() { } var fileDescriptor_159556069ba44164 = []byte{ - // 262 bytes of a gzipped FileDescriptorProto + // 265 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x45, 0xf9, 0x59, 0xa9, 0xc9, 0x25, 0xc5, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xa2, 0x50, @@ -107,11 +107,11 @@ var fileDescriptor_159556069ba44164 = []byte{ 0x42, 0x7e, 0x5c, 0x5c, 0x30, 0x05, 0x6e, 0xc1, 0x12, 0x4c, 0x60, 0x03, 0x34, 0x50, 0x0d, 0x40, 0x71, 0x8d, 0x1e, 0xb2, 0xd5, 0x50, 0xb3, 0x90, 0x4c, 0x10, 0x0a, 0xe0, 0xe2, 0x4e, 0x49, 0x2d, 0x4b, 0xcd, 0xc9, 0x2f, 0x48, 0x2d, 0x72, 0x0b, 0x96, 0x60, 0x26, 0xcb, 0x40, 0x64, 0x23, 0x9c, - 0x9c, 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, 0x23, 0x3d, 0xb3, 0x24, - 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x25, 0xfc, 0x2a, 0x10, 0xa1, 0x5c, 0x52, 0x59, - 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x3a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x04, - 0xb1, 0xa7, 0xdd, 0x01, 0x00, 0x00, + 0x5c, 0x4f, 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, 0x3b, 0x3d, 0xb3, 0x24, + 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x25, 0xfc, 0xca, 0x8c, 0xf4, 0x2b, 0x10, 0x01, + 0x5d, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x3d, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x15, 0x08, 0x56, 0x7a, 0xe0, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/projects/types/genesis_test.go b/x/projects/types/genesis_test.go index 32cf7f0191..e1103400c0 100644 --- a/x/projects/types/genesis_test.go +++ b/x/projects/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_add_keys_test.go b/x/projects/types/message_add_keys_test.go index 388e22b0d3..8a37d92d25 100644 --- a/x/projects/types/message_add_keys_test.go +++ b/x/projects/types/message_add_keys_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_del_keys_test.go b/x/projects/types/message_del_keys_test.go index 80bf8bcf69..2beb23f2e5 100644 --- a/x/projects/types/message_del_keys_test.go +++ b/x/projects/types/message_del_keys_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_set_admin_policy.go b/x/projects/types/message_set_admin_policy.go index 56ce1c9659..084687704d 100644 --- a/x/projects/types/message_set_admin_policy.go +++ b/x/projects/types/message_set_admin_policy.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - planstypes "github.com/lavanet/lava/x/plans/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) const TypeMsgSetPolicy = "set_admin_policy" diff --git a/x/projects/types/message_set_admin_policy_test.go b/x/projects/types/message_set_admin_policy_test.go index f6c291efff..29798fe43c 100644 --- a/x/projects/types/message_set_admin_policy_test.go +++ b/x/projects/types/message_set_admin_policy_test.go @@ -4,8 +4,8 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/testutil/sample" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/message_set_subscription_policy.go b/x/projects/types/message_set_subscription_policy.go index 4bb4476abb..c3284d1df5 100644 --- a/x/projects/types/message_set_subscription_policy.go +++ b/x/projects/types/message_set_subscription_policy.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - planstypes "github.com/lavanet/lava/x/plans/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" ) const TypeMsgSetSubscriptionPolicy = "set_subscription_policy" diff --git a/x/projects/types/message_set_subscription_policy_test.go b/x/projects/types/message_set_subscription_policy_test.go index 29a36866ab..0dbdc73ef9 100644 --- a/x/projects/types/message_set_subscription_policy_test.go +++ b/x/projects/types/message_set_subscription_policy_test.go @@ -4,8 +4,8 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" - planstypes "github.com/lavanet/lava/x/plans/types" + "github.com/lavanet/lava/v2/testutil/sample" + planstypes "github.com/lavanet/lava/v2/x/plans/types" "github.com/stretchr/testify/require" ) diff --git a/x/projects/types/params.pb.go b/x/projects/types/params.pb.go index 6f88fe24de..9ae9659dfc 100644 --- a/x/projects/types/params.pb.go +++ b/x/projects/types/params.pb.go @@ -68,17 +68,17 @@ func init() { } var fileDescriptor_acd952a9fad2273a = []byte{ - // 150 bytes of a gzipped FileDescriptorProto + // 153 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xca, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x45, 0xf9, 0x59, 0xa9, 0xc9, 0x25, 0xc5, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xa2, 0x50, 0x35, 0x7a, 0x20, 0x5a, 0x0f, 0xa6, 0x46, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xac, 0x42, 0x1f, 0xc4, 0x82, 0x28, 0x56, 0xe2, 0xe3, 0x62, 0x0b, 0x00, 0x6b, 0xb6, 0x62, 0x99, 0xb1, 0x40, 0x9e, 0xc1, - 0xc9, 0xe9, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, - 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x34, 0xd2, 0x33, 0x4b, - 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x5c, 0x51, 0x81, 0x70, 0x47, 0x49, 0x65, - 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x68, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x5a, - 0x13, 0xcb, 0xad, 0x00, 0x00, 0x00, + 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, + 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xb4, 0xd3, 0x33, 0x4b, + 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x5c, 0x51, 0x66, 0xa4, 0x5f, 0x81, 0x70, + 0x4a, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x74, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xa3, 0x93, 0x4e, 0xc6, 0xb0, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/projects/types/project.go b/x/projects/types/project.go index a1d0b0cc5d..96d7cbf6e6 100644 --- a/x/projects/types/project.go +++ b/x/projects/types/project.go @@ -3,7 +3,7 @@ package types import ( "fmt" - commontypes "github.com/lavanet/lava/utils/common/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) const ( diff --git a/x/projects/types/project.pb.go b/x/projects/types/project.pb.go index 884d14ea01..c1bd722cf4 100644 --- a/x/projects/types/project.pb.go +++ b/x/projects/types/project.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/plans/types" + types "github.com/lavanet/lava/v2/x/plans/types" io "io" math "math" math_bits "math/bits" @@ -330,41 +330,42 @@ func init() { } var fileDescriptor_9027839604ae2915 = []byte{ - // 543 bytes of a gzipped FileDescriptorProto + // 546 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x8f, 0xd2, 0x40, - 0x14, 0x67, 0x68, 0x81, 0xf6, 0xc1, 0x26, 0xcd, 0x88, 0xd9, 0x4a, 0x4c, 0x8b, 0x78, 0x69, 0x3c, - 0x94, 0x04, 0x2f, 0x5e, 0x45, 0x30, 0x61, 0x55, 0x20, 0x8d, 0xf1, 0xb0, 0x17, 0x52, 0xe8, 0x84, - 0xad, 0x40, 0xdb, 0x30, 0x65, 0xb3, 0xbd, 0xf9, 0x11, 0xfc, 0x18, 0x26, 0x7e, 0x09, 0x8f, 0x7b, + 0x14, 0x67, 0xb6, 0x05, 0xda, 0x07, 0x9b, 0x34, 0x23, 0x66, 0x2b, 0x31, 0x2d, 0xe2, 0x85, 0x68, + 0xd2, 0x26, 0x78, 0xf1, 0x2a, 0xc2, 0x81, 0x55, 0x81, 0x34, 0xc6, 0xc3, 0x5e, 0x48, 0xa1, 0x13, + 0xb6, 0x02, 0x6d, 0xc3, 0x14, 0xb2, 0xbd, 0xf9, 0x11, 0xfc, 0x18, 0x26, 0x7e, 0x09, 0x8f, 0x7b, 0xdc, 0xa3, 0x27, 0x62, 0xe0, 0xc6, 0xa7, 0x30, 0xd3, 0x19, 0x96, 0xd6, 0x6c, 0xb2, 0x5e, 0x3a, - 0xf3, 0xde, 0xfc, 0xde, 0xbf, 0xfe, 0x7e, 0x0f, 0x5e, 0x2e, 0xdd, 0x6b, 0x37, 0x20, 0x71, 0x9b, - 0x9d, 0xed, 0x68, 0x1d, 0x7e, 0x25, 0xb3, 0x98, 0x1e, 0x2f, 0x76, 0xb4, 0x0e, 0xe3, 0x10, 0x3f, - 0x15, 0x20, 0x9b, 0x9d, 0xf6, 0x11, 0xd4, 0xa8, 0xcf, 0xc3, 0x79, 0x98, 0x22, 0xda, 0xec, 0xc6, - 0xc1, 0x0d, 0x33, 0x9f, 0x71, 0xe9, 0x06, 0xb4, 0x1d, 0x85, 0x4b, 0x7f, 0x96, 0x70, 0x40, 0xeb, - 0xa7, 0x04, 0x95, 0x31, 0xcf, 0x81, 0xeb, 0x50, 0xf2, 0x03, 0x8f, 0xdc, 0xe8, 0xa8, 0x89, 0x2c, - 0xd5, 0xe1, 0x06, 0x6e, 0x41, 0x8d, 0x6e, 0xa6, 0x74, 0xb6, 0xf6, 0xa3, 0xd8, 0x0f, 0x03, 0xbd, - 0x98, 0x3e, 0xe6, 0x7c, 0x58, 0x87, 0x0a, 0x09, 0xdc, 0xe9, 0x92, 0x78, 0xba, 0xdc, 0x44, 0x96, - 0xe2, 0x1c, 0x4d, 0x7c, 0x09, 0x35, 0xd1, 0xe2, 0x64, 0x41, 0x12, 0xaa, 0x97, 0x9a, 0x92, 0x55, - 0xed, 0xbc, 0xb0, 0x1f, 0x1c, 0xc2, 0x16, 0x9d, 0x7c, 0x20, 0x49, 0xb7, 0x7e, 0xbb, 0x35, 0x0b, - 0x87, 0xad, 0x99, 0x0b, 0x77, 0xaa, 0xd1, 0x3d, 0x82, 0xe2, 0x11, 0xd4, 0x5c, 0x6f, 0xe5, 0x07, - 0x13, 0x3e, 0x91, 0x5e, 0x6e, 0x22, 0xab, 0xda, 0x69, 0xfc, 0x93, 0x9b, 0xcd, 0x6c, 0x8f, 0x53, - 0x44, 0x57, 0x63, 0x09, 0xb3, 0x31, 0x4e, 0x35, 0xb5, 0xf8, 0x33, 0x3e, 0x87, 0xca, 0x86, 0x12, - 0x6f, 0x32, 0xdb, 0xe8, 0x95, 0x26, 0xb2, 0x64, 0xa7, 0xcc, 0xcc, 0x77, 0x1b, 0xec, 0xc1, 0x93, - 0xec, 0xbc, 0xc7, 0x82, 0xca, 0xa3, 0x05, 0xcf, 0x0f, 0x5b, 0xf3, 0xa1, 0x50, 0x07, 0x67, 0x9d, - 0xa2, 0x7c, 0x03, 0x14, 0x1a, 0xb8, 0x11, 0xbd, 0x0a, 0x63, 0x5d, 0x4d, 0xeb, 0xdf, 0xdb, 0x17, - 0xb2, 0x22, 0x69, 0x72, 0xeb, 0x1b, 0x02, 0x38, 0xfd, 0x23, 0xfc, 0x0c, 0xa4, 0x05, 0x49, 0x38, - 0x5d, 0xdd, 0xca, 0x61, 0x6b, 0x32, 0xd3, 0x61, 0x1f, 0x6c, 0x42, 0x69, 0xe1, 0x07, 0x1e, 0x4d, - 0xf9, 0x38, 0xeb, 0xaa, 0x87, 0xad, 0xc9, 0x1d, 0x0e, 0x3f, 0x5a, 0xaf, 0x40, 0xfe, 0x9c, 0x44, - 0x04, 0x2b, 0x20, 0x0f, 0x47, 0xc3, 0xbe, 0x56, 0xc0, 0x2a, 0x94, 0xde, 0xf6, 0x3e, 0x0d, 0x86, - 0x1a, 0xc2, 0x67, 0xa0, 0xf6, 0xfa, 0x5f, 0xfa, 0x1f, 0x47, 0xe3, 0xbe, 0xa3, 0x15, 0x2f, 0x64, - 0xa5, 0xa8, 0x49, 0xa2, 0x85, 0x37, 0x80, 0xc7, 0x4c, 0x39, 0x3d, 0x72, 0x4d, 0x96, 0x61, 0x44, - 0xd6, 0x3d, 0x37, 0x76, 0xf1, 0x73, 0x50, 0x05, 0x33, 0x83, 0x9e, 0x90, 0xcf, 0xc9, 0xc1, 0xe3, - 0x5b, 0xbf, 0x10, 0x54, 0x45, 0xf3, 0x69, 0x0c, 0x06, 0x39, 0x70, 0x57, 0x44, 0xc0, 0xd3, 0x7b, - 0x56, 0x48, 0x52, 0x5e, 0x48, 0x03, 0xc8, 0x72, 0xaf, 0xcb, 0xff, 0xab, 0x23, 0x99, 0xe9, 0x28, - 0xaf, 0x9b, 0x0e, 0x94, 0x05, 0x81, 0xa5, 0xc7, 0x08, 0x74, 0x04, 0x92, 0x8f, 0xd0, 0x7d, 0xff, + 0xf3, 0xde, 0xfc, 0xde, 0xbf, 0xfe, 0x7e, 0x0f, 0x5e, 0x2e, 0xdc, 0x8d, 0x1b, 0x90, 0xd8, 0x66, + 0xa7, 0x1d, 0xad, 0xc2, 0xaf, 0x64, 0x1a, 0xd3, 0xe3, 0xc5, 0x8a, 0x56, 0x61, 0x1c, 0xe2, 0xa7, + 0x02, 0x64, 0xb1, 0xd3, 0x3a, 0x82, 0xea, 0xb5, 0x59, 0x38, 0x0b, 0x53, 0x84, 0xcd, 0x6e, 0x1c, + 0x5c, 0x37, 0xf3, 0x19, 0x17, 0x6e, 0x40, 0xed, 0x28, 0x5c, 0xf8, 0xd3, 0x84, 0x03, 0x9a, 0x3f, + 0x25, 0x28, 0x8f, 0x78, 0x0e, 0x5c, 0x83, 0xa2, 0x1f, 0x78, 0xe4, 0x46, 0x47, 0x0d, 0xd4, 0x52, + 0x1d, 0x6e, 0xe0, 0x26, 0x54, 0xe9, 0x7a, 0x42, 0xa7, 0x2b, 0x3f, 0x8a, 0xfd, 0x30, 0xd0, 0xcf, + 0xd2, 0xc7, 0x9c, 0x0f, 0xeb, 0x50, 0x26, 0x81, 0x3b, 0x59, 0x10, 0x4f, 0x97, 0x1b, 0xa8, 0xa5, + 0x38, 0x47, 0x13, 0x5f, 0x41, 0x55, 0xb4, 0x38, 0x9e, 0x93, 0x84, 0xea, 0xc5, 0x86, 0xd4, 0xaa, + 0xb4, 0x5f, 0x58, 0x0f, 0x0e, 0x61, 0x89, 0x4e, 0x3e, 0x90, 0xa4, 0x53, 0xbb, 0xdd, 0x9a, 0x85, + 0xc3, 0xd6, 0xcc, 0x85, 0x3b, 0x95, 0xe8, 0x1e, 0x41, 0xf1, 0x10, 0xaa, 0xae, 0xb7, 0xf4, 0x83, + 0x31, 0x9f, 0x48, 0x2f, 0x35, 0x50, 0xab, 0xd2, 0xae, 0xff, 0x93, 0x9b, 0xcd, 0x6c, 0x8d, 0x52, + 0x44, 0x47, 0x63, 0x09, 0xb3, 0x31, 0x4e, 0x25, 0xb5, 0xf8, 0x33, 0xbe, 0x80, 0xf2, 0x9a, 0x12, + 0x6f, 0x3c, 0x5d, 0xeb, 0xe5, 0x06, 0x6a, 0xc9, 0x4e, 0x89, 0x99, 0xef, 0xd7, 0xd8, 0x83, 0x27, + 0xd9, 0x79, 0x8f, 0x05, 0x95, 0x47, 0x0b, 0x5e, 0x1c, 0xb6, 0xe6, 0x43, 0xa1, 0x0e, 0xce, 0x3a, + 0x45, 0xf9, 0x3a, 0x28, 0x34, 0x70, 0x23, 0x7a, 0x1d, 0xc6, 0xba, 0x9a, 0xd6, 0xbf, 0xb7, 0x2f, + 0x65, 0x45, 0xd2, 0xe4, 0xe6, 0x37, 0x04, 0x70, 0xfa, 0x47, 0xf8, 0x19, 0x48, 0x73, 0x92, 0x70, + 0xba, 0x3a, 0xe5, 0xc3, 0xd6, 0x64, 0xa6, 0xc3, 0x3e, 0xd8, 0x84, 0xe2, 0xdc, 0x0f, 0x3c, 0x9a, + 0xf2, 0x71, 0xde, 0x51, 0x0f, 0x5b, 0x93, 0x3b, 0x1c, 0x7e, 0x34, 0x5f, 0x81, 0xfc, 0x39, 0x89, + 0x08, 0x56, 0x40, 0x1e, 0x0c, 0x07, 0x3d, 0xad, 0x80, 0x55, 0x28, 0xbe, 0xeb, 0x7e, 0xea, 0x0f, + 0x34, 0x84, 0xcf, 0x41, 0xed, 0xf6, 0xbe, 0xf4, 0x3e, 0x0e, 0x47, 0x3d, 0x47, 0x3b, 0xbb, 0x94, + 0x95, 0x33, 0x4d, 0x12, 0x2d, 0xbc, 0x05, 0x3c, 0x62, 0xca, 0xe9, 0x92, 0x0d, 0x59, 0x84, 0x11, + 0x59, 0x75, 0xdd, 0xd8, 0xc5, 0xcf, 0x41, 0x15, 0xcc, 0xf4, 0xbb, 0x42, 0x3e, 0x27, 0x07, 0x8f, + 0x6f, 0xfe, 0x42, 0x50, 0x11, 0xcd, 0xa7, 0x31, 0x18, 0xe4, 0xc0, 0x5d, 0x12, 0x01, 0x4f, 0xef, + 0x59, 0x21, 0x49, 0x79, 0x21, 0xf5, 0x21, 0xcb, 0xbd, 0x2e, 0xff, 0xaf, 0x8e, 0x64, 0xa6, 0xa3, + 0xbc, 0x6e, 0xda, 0x50, 0x12, 0x04, 0x16, 0x1f, 0x23, 0xd0, 0x11, 0x48, 0x3e, 0x42, 0xa7, 0xff, 0x63, 0x67, 0xa0, 0xdb, 0x9d, 0x81, 0xee, 0x76, 0x06, 0xfa, 0xb3, 0x33, 0xd0, 0xf7, 0xbd, 0x51, - 0xb8, 0xdb, 0x1b, 0x85, 0xdf, 0x7b, 0xa3, 0x70, 0x69, 0xcd, 0xfd, 0xf8, 0x6a, 0x33, 0xb5, 0x67, - 0xe1, 0xaa, 0x9d, 0xdb, 0xbb, 0x9b, 0xd3, 0x2e, 0xc7, 0x49, 0x44, 0xe8, 0xb4, 0x9c, 0x2e, 0xdf, - 0xeb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xee, 0xd2, 0x34, 0xbb, 0xf1, 0x03, 0x00, 0x00, + 0xb8, 0xdb, 0x1b, 0x85, 0xdf, 0x7b, 0xa3, 0x70, 0xf5, 0x7a, 0xe6, 0xc7, 0xd7, 0xeb, 0x89, 0x35, + 0x0d, 0x97, 0x76, 0x6e, 0xef, 0x36, 0x6d, 0xfb, 0xe6, 0xb4, 0xce, 0x71, 0x12, 0x11, 0x3a, 0x29, + 0xa5, 0xfb, 0xf7, 0xe6, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x95, 0xd5, 0x16, 0xf7, 0xf4, 0x03, + 0x00, 0x00, } func (this *Project) Equal(that interface{}) bool { diff --git a/x/projects/types/query.pb.go b/x/projects/types/query.pb.go index bf8b379c4c..72766c21c3 100644 --- a/x/projects/types/query.pb.go +++ b/x/projects/types/query.pb.go @@ -316,7 +316,7 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/projects/query.proto", fileDescriptor_e0c4357eb0c2f6e6) } var fileDescriptor_e0c4357eb0c2f6e6 = []byte{ - // 461 bytes of a gzipped FileDescriptorProto + // 464 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcc, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x45, 0xf9, 0x59, 0xa9, 0xc9, 0x25, 0xc5, 0xfa, 0x85, 0xa5, 0xa9, 0x45, 0x95, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xa2, 0x50, 0x25, 0x7a, @@ -341,11 +341,11 @@ var fileDescriptor_e0c4357eb0c2f6e6 = []byte{ 0x4e, 0xd0, 0x05, 0x3b, 0x41, 0x5d, 0x48, 0x15, 0x87, 0x13, 0x32, 0xf3, 0xd2, 0xf2, 0xf5, 0xab, 0xa1, 0xdc, 0x5a, 0xa1, 0x79, 0x8c, 0x5c, 0x9c, 0xf0, 0x68, 0x13, 0xd2, 0xc1, 0x67, 0x0d, 0x7a, 0xaa, 0x90, 0xd2, 0x25, 0x52, 0x35, 0xd4, 0x65, 0x26, 0x60, 0x97, 0xe9, 0x09, 0xe9, 0xe0, 0x70, - 0x19, 0x3c, 0x41, 0xe9, 0x57, 0xc3, 0x99, 0xb5, 0x4e, 0x4e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, + 0x19, 0x3c, 0x41, 0xe9, 0x57, 0xc3, 0x99, 0xb5, 0x4e, 0xae, 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, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x8b, - 0x6a, 0x62, 0x05, 0xc2, 0xcc, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x79, 0x60, 0x0c, - 0x08, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x72, 0x77, 0x86, 0xc8, 0x04, 0x00, 0x00, + 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9d, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x8b, + 0x6a, 0x62, 0x99, 0x91, 0x7e, 0x05, 0xc2, 0xd8, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, + 0x91, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x43, 0xf8, 0x30, 0xf8, 0xcb, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/projects/types/tx.pb.go b/x/projects/types/tx.pb.go index bef09a8afc..02254eae32 100644 --- a/x/projects/types/tx.pb.go +++ b/x/projects/types/tx.pb.go @@ -6,10 +6,11 @@ package types import ( context "context" fmt "fmt" + _ "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" - types "github.com/lavanet/lava/x/plans/types" + types "github.com/lavanet/lava/v2/x/plans/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -427,35 +428,38 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/projects/tx.proto", fileDescriptor_a4f8e20515314f9d) } var fileDescriptor_a4f8e20515314f9d = []byte{ - // 434 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xbf, 0x0b, 0xd3, 0x40, - 0x14, 0xc7, 0x73, 0x8d, 0xb4, 0xf6, 0xb5, 0x53, 0x68, 0x25, 0x64, 0x48, 0x63, 0xba, 0x44, 0x84, - 0x04, 0xe2, 0xe0, 0x6c, 0x71, 0xb2, 0x14, 0x4a, 0x3a, 0x08, 0x82, 0x48, 0x9a, 0x1e, 0x31, 0x1a, - 0x73, 0x21, 0x77, 0x2d, 0xcd, 0x28, 0x38, 0x3a, 0x38, 0xfb, 0x17, 0x75, 0xec, 0xe8, 0x24, 0xd2, - 0xfe, 0x23, 0x92, 0xe6, 0x2e, 0xfd, 0x61, 0x7f, 0x68, 0x27, 0xa7, 0xbc, 0xbb, 0xf7, 0x7d, 0xef, - 0x3e, 0xb9, 0xef, 0xf1, 0x40, 0x8f, 0xfd, 0x85, 0x9f, 0x60, 0xe6, 0x14, 0x5f, 0x27, 0xcd, 0xc8, - 0x07, 0x1c, 0x30, 0xea, 0xb0, 0xa5, 0x9d, 0x66, 0x84, 0x11, 0xa5, 0xcb, 0xf3, 0x76, 0xf1, 0xb5, - 0x45, 0x5e, 0xeb, 0x9f, 0x2f, 0xe3, 0x41, 0x59, 0xab, 0xf5, 0x8e, 0x45, 0xb1, 0x9f, 0x50, 0x27, - 0x25, 0x71, 0x14, 0xe4, 0x5c, 0xd0, 0x09, 0x49, 0x48, 0x76, 0xa1, 0x53, 0x44, 0xe5, 0xae, 0xf9, - 0x15, 0x01, 0x8c, 0x68, 0xf8, 0x62, 0x36, 0x1b, 0xe2, 0x9c, 0x2a, 0x2a, 0x34, 0x82, 0x0c, 0xfb, - 0x8c, 0x64, 0x2a, 0x32, 0x90, 0xd5, 0xf4, 0xc4, 0xb2, 0xc8, 0xf0, 0x03, 0xd5, 0x5a, 0x99, 0xe1, - 0x4b, 0xe5, 0x15, 0xb4, 0x79, 0xf8, 0xee, 0x23, 0xce, 0xa9, 0x2a, 0x1b, 0xb2, 0xd5, 0x72, 0x1f, - 0xdb, 0x67, 0x7f, 0xc6, 0x1e, 0x97, 0xc1, 0x10, 0xe7, 0x83, 0x07, 0xab, 0x9f, 0x3d, 0xc9, 0x6b, - 0xa5, 0xd5, 0x0e, 0x35, 0x3b, 0xa0, 0xec, 0x69, 0x3c, 0x4c, 0x53, 0x92, 0x50, 0x2c, 0x20, 0x5f, - 0xe2, 0xf8, 0x3f, 0x82, 0xe4, 0x34, 0x15, 0xe4, 0x02, 0xda, 0x23, 0x1a, 0x4e, 0x30, 0x1b, 0xef, - 0x6e, 0xfd, 0x2e, 0x4a, 0x17, 0xea, 0xa5, 0x67, 0xaa, 0x6c, 0x20, 0xab, 0xe5, 0x6a, 0x27, 0x7c, - 0x85, 0xab, 0x76, 0xd9, 0xdf, 0xe3, 0x4a, 0xf3, 0x11, 0x74, 0x0e, 0xcf, 0xad, 0x78, 0xbe, 0x20, - 0x50, 0xcb, 0xc4, 0x64, 0x3e, 0xa5, 0x41, 0x16, 0xa5, 0x2c, 0x22, 0xc9, 0x4d, 0x38, 0x0d, 0x1e, - 0x8a, 0x6b, 0x50, 0x6b, 0x86, 0x6c, 0x35, 0xbd, 0x6a, 0x7d, 0x17, 0x9e, 0x09, 0xc6, 0x25, 0x0a, - 0x81, 0xea, 0x7e, 0x97, 0x41, 0x1e, 0xd1, 0x50, 0x79, 0x0d, 0x0d, 0xf1, 0x10, 0x2f, 0x39, 0xb3, - 0x7f, 0x1d, 0xda, 0x93, 0x9b, 0x12, 0x71, 0x40, 0xd1, 0x58, 0x3c, 0x9e, 0x2b, 0x8d, 0xb9, 0xe4, - 0x5a, 0xe3, 0x13, 0xd3, 0x95, 0xb7, 0xd0, 0xdc, 0x3b, 0xde, 0xbf, 0x5c, 0x57, 0x89, 0xb4, 0xa7, - 0x7f, 0x21, 0xaa, 0xda, 0x7f, 0x46, 0xd0, 0x3d, 0x6f, 0xa0, 0x73, 0xb5, 0xcd, 0x9f, 0x05, 0xda, - 0xf3, 0x7f, 0x2c, 0x10, 0x0c, 0x83, 0xc1, 0x6a, 0xa3, 0xa3, 0xf5, 0x46, 0x47, 0xbf, 0x36, 0x3a, - 0xfa, 0xb6, 0xd5, 0xa5, 0xf5, 0x56, 0x97, 0x7e, 0x6c, 0x75, 0xe9, 0x8d, 0x15, 0x46, 0xec, 0xfd, - 0x7c, 0x6a, 0x07, 0xe4, 0x93, 0x73, 0x34, 0x7d, 0x96, 0x07, 0xb3, 0x2d, 0x4f, 0x31, 0x9d, 0xd6, - 0x77, 0xc3, 0xe6, 0xd9, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0xd1, 0x97, 0xef, 0x01, 0x05, - 0x00, 0x00, + // 488 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x73, 0x35, 0x6a, 0xc9, 0x4b, 0x07, 0xb0, 0x12, 0xb0, 0x3c, 0x5c, 0x8d, 0xb3, 0x04, + 0x2a, 0xf9, 0x24, 0x33, 0x20, 0x75, 0xa3, 0x82, 0x85, 0x2a, 0x52, 0xe5, 0x0e, 0x48, 0x48, 0x08, + 0x39, 0xee, 0xc9, 0x18, 0x52, 0x9f, 0xe5, 0xbb, 0x56, 0xf5, 0xc8, 0xca, 0x02, 0x33, 0x2b, 0x13, + 0x1b, 0x1f, 0xa3, 0x63, 0x47, 0x26, 0x84, 0x92, 0x81, 0xaf, 0x81, 0xce, 0xbe, 0xbb, 0xa4, 0x6d, + 0x92, 0x42, 0x27, 0x16, 0xfb, 0xbd, 0x7b, 0xff, 0xfb, 0xdf, 0xef, 0xf4, 0x9e, 0x0e, 0xf0, 0x38, + 0x3e, 0x89, 0x73, 0x2a, 0x88, 0xfc, 0x93, 0xa2, 0x64, 0xef, 0x68, 0x22, 0x38, 0x11, 0xa7, 0x41, + 0x51, 0x32, 0xc1, 0xec, 0x9e, 0xaa, 0x07, 0xf2, 0x1f, 0xe8, 0xba, 0x7b, 0x37, 0x3e, 0xca, 0x72, + 0x46, 0xea, 0x6f, 0xa3, 0x74, 0xfb, 0x8b, 0x9d, 0x54, 0xa0, 0x44, 0x5b, 0x17, 0x45, 0xe3, 0x38, + 0xe7, 0xa4, 0x60, 0xe3, 0x2c, 0xa9, 0x94, 0xa0, 0x9b, 0xb2, 0x94, 0xd5, 0x21, 0x91, 0x51, 0xb3, + 0xea, 0x7f, 0x45, 0x00, 0x43, 0x9e, 0x3e, 0x3d, 0x3c, 0xdc, 0xa3, 0x15, 0xb7, 0x1d, 0xd8, 0x48, + 0x4a, 0x1a, 0x0b, 0x56, 0x3a, 0xc8, 0x43, 0x83, 0x76, 0xa4, 0x53, 0x59, 0x51, 0x07, 0x3a, 0x6b, + 0x4d, 0x45, 0xa5, 0xf6, 0x0b, 0xd8, 0x54, 0xe1, 0x9b, 0xf7, 0xb4, 0xe2, 0x8e, 0xe5, 0x59, 0x83, + 0x4e, 0xf8, 0x20, 0x58, 0x78, 0xbf, 0x60, 0xbf, 0x09, 0xf6, 0x68, 0xb5, 0x7b, 0xeb, 0xec, 0xe7, + 0x56, 0x2b, 0xea, 0x14, 0x66, 0x85, 0xef, 0xf4, 0x3e, 0xfe, 0xfe, 0xfe, 0xe8, 0x8e, 0xb9, 0xa2, + 0xc2, 0xf2, 0xbb, 0x60, 0xcf, 0x20, 0x23, 0xca, 0x0b, 0x96, 0x73, 0xaa, 0xd9, 0x9f, 0xd1, 0xf1, + 0xff, 0xc8, 0xae, 0xb0, 0x14, 0xbb, 0xca, 0x0c, 0xfb, 0x27, 0x04, 0x9b, 0x43, 0x9e, 0x1e, 0x50, + 0xb1, 0x5f, 0x37, 0xe9, 0x46, 0xf4, 0x21, 0xac, 0x37, 0x2d, 0x76, 0x2c, 0x0f, 0x0d, 0x3a, 0xa1, + 0x7b, 0x89, 0x5b, 0x0e, 0x41, 0xd0, 0xf8, 0x47, 0x4a, 0xb9, 0x73, 0x5f, 0x52, 0xda, 0x86, 0xd2, + 0x00, 0xf8, 0xf7, 0xa0, 0x3b, 0x0f, 0x64, 0x48, 0xbf, 0x21, 0x70, 0x9a, 0xc2, 0xc1, 0xf1, 0x88, + 0x27, 0x65, 0x56, 0x88, 0x8c, 0xe5, 0xd7, 0x52, 0xbb, 0x70, 0x5b, 0x1f, 0xe2, 0xac, 0x79, 0xd6, + 0xa0, 0x1d, 0x99, 0xfc, 0x46, 0xdc, 0x7d, 0xc9, 0x8d, 0xe7, 0xb9, 0xaf, 0xe2, 0xf8, 0x3e, 0x78, + 0xcb, 0x50, 0xf5, 0x7d, 0xc2, 0x2f, 0x16, 0x58, 0x43, 0x9e, 0xda, 0x2f, 0x61, 0x43, 0x4f, 0xfd, + 0xb2, 0x7e, 0xcf, 0x66, 0xce, 0x7d, 0x78, 0xad, 0x44, 0x1f, 0x20, 0x8d, 0xf5, 0x48, 0xae, 0x30, + 0x56, 0x92, 0x55, 0xc6, 0x97, 0x66, 0xc6, 0x7e, 0x0d, 0xed, 0xd9, 0xbc, 0xf4, 0x97, 0xef, 0x33, + 0x22, 0x77, 0xfb, 0x2f, 0x44, 0xc6, 0xfe, 0x03, 0x82, 0xde, 0xe2, 0x2e, 0x93, 0x95, 0x36, 0x57, + 0x37, 0xb8, 0x4f, 0xfe, 0x71, 0x83, 0x66, 0xd8, 0x7d, 0x7e, 0x36, 0xc1, 0xe8, 0x7c, 0x82, 0xd1, + 0xaf, 0x09, 0x46, 0x9f, 0xa7, 0xb8, 0x75, 0x3e, 0xc5, 0xad, 0x1f, 0x53, 0xdc, 0x7a, 0xb5, 0x9d, + 0x66, 0xe2, 0xed, 0xf1, 0x28, 0x48, 0xd8, 0x11, 0xb9, 0xf0, 0xd4, 0x9d, 0x84, 0xe4, 0x74, 0xee, + 0x79, 0xad, 0x0a, 0xca, 0x47, 0xeb, 0xf5, 0xe3, 0xf6, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xb4, 0xf6, 0xeb, 0x4a, 0x84, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/protocol/client/cli/query.go b/x/protocol/client/cli/query.go index 55b221edea..1454e719a0 100644 --- a/x/protocol/client/cli/query.go +++ b/x/protocol/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/protocol/client/cli/query_params.go b/x/protocol/client/cli/query_params.go index 1fa05c0513..1f617923ac 100644 --- a/x/protocol/client/cli/query_params.go +++ b/x/protocol/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" "github.com/spf13/cobra" ) diff --git a/x/protocol/client/cli/tx.go b/x/protocol/client/cli/tx.go index 484f52c169..ff5080c62d 100644 --- a/x/protocol/client/cli/tx.go +++ b/x/protocol/client/cli/tx.go @@ -14,7 +14,7 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/protocol/genesis.go b/x/protocol/genesis.go index d306a5f23a..fd6122e58d 100644 --- a/x/protocol/genesis.go +++ b/x/protocol/genesis.go @@ -2,8 +2,8 @@ package protocol import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/protocol/keeper" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/keeper" + "github.com/lavanet/lava/v2/x/protocol/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/protocol/genesis_test.go b/x/protocol/genesis_test.go index 28ff2b8fab..3ac403346b 100644 --- a/x/protocol/genesis_test.go +++ b/x/protocol/genesis_test.go @@ -3,10 +3,10 @@ package protocol_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/protocol" - "github.com/lavanet/lava/x/protocol/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/protocol" + "github.com/lavanet/lava/v2/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/handler.go b/x/protocol/handler.go index deaf3bc3ae..fa4df565d0 100644 --- a/x/protocol/handler.go +++ b/x/protocol/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/protocol/keeper" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/keeper" + "github.com/lavanet/lava/v2/x/protocol/types" ) // NewHandler ... diff --git a/x/protocol/keeper/grpc_query.go b/x/protocol/keeper/grpc_query.go index c30d49b05e..53c16980b3 100644 --- a/x/protocol/keeper/grpc_query.go +++ b/x/protocol/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/protocol/keeper/grpc_query_params.go b/x/protocol/keeper/grpc_query_params.go index ffc77402c0..98fb8b00db 100644 --- a/x/protocol/keeper/grpc_query_params.go +++ b/x/protocol/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/protocol/keeper/grpc_query_params_test.go b/x/protocol/keeper/grpc_query_params_test.go index a0e547ca3d..15b4c8cc00 100644 --- a/x/protocol/keeper/grpc_query_params_test.go +++ b/x/protocol/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/protocol/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/keeper/keeper.go b/x/protocol/keeper/keeper.go index 447683243e..a64186dba2 100644 --- a/x/protocol/keeper/keeper.go +++ b/x/protocol/keeper/keeper.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" ) type ( diff --git a/x/protocol/keeper/migrations.go b/x/protocol/keeper/migrations.go index e5b3134d72..b63a38248f 100644 --- a/x/protocol/keeper/migrations.go +++ b/x/protocol/keeper/migrations.go @@ -2,9 +2,9 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - protocoltypes "github.com/lavanet/lava/x/protocol/types" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + protocoltypes "github.com/lavanet/lava/v2/x/protocol/types" + "github.com/lavanet/lava/v2/x/spec/types" ) type Migrator struct { diff --git a/x/protocol/keeper/msg_server.go b/x/protocol/keeper/msg_server.go index a1c8a948aa..8890c904cf 100644 --- a/x/protocol/keeper/msg_server.go +++ b/x/protocol/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" ) type msgServer struct { diff --git a/x/protocol/keeper/msg_server_set_version.go b/x/protocol/keeper/msg_server_set_version.go index ac50610b38..8179668033 100644 --- a/x/protocol/keeper/msg_server_set_version.go +++ b/x/protocol/keeper/msg_server_set_version.go @@ -6,7 +6,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" ) func (k msgServer) SetVersion(goCtx context.Context, msg *types.MsgSetVersion) (*types.MsgSetVersionResponse, error) { diff --git a/x/protocol/keeper/msg_server_test.go b/x/protocol/keeper/msg_server_test.go index f4064e47b8..0f12ccd752 100644 --- a/x/protocol/keeper/msg_server_test.go +++ b/x/protocol/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/protocol/keeper" - "github.com/lavanet/lava/x/protocol/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/protocol/keeper" + "github.com/lavanet/lava/v2/x/protocol/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/protocol/keeper/params.go b/x/protocol/keeper/params.go index 54841a940f..0ad300a14a 100644 --- a/x/protocol/keeper/params.go +++ b/x/protocol/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" ) // GetParams get all parameters as types.Params diff --git a/x/protocol/keeper/params_test.go b/x/protocol/keeper/params_test.go index 61649b4d42..ad69efad11 100644 --- a/x/protocol/keeper/params_test.go +++ b/x/protocol/keeper/params_test.go @@ -6,8 +6,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/protocol/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/module.go b/x/protocol/module.go index 8945f395f5..6f391396f7 100644 --- a/x/protocol/module.go +++ b/x/protocol/module.go @@ -18,9 +18,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/protocol/client/cli" - "github.com/lavanet/lava/x/protocol/keeper" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/client/cli" + "github.com/lavanet/lava/v2/x/protocol/keeper" + "github.com/lavanet/lava/v2/x/protocol/types" ) var ( @@ -210,10 +210,14 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // panic:ok: at start up, migration cannot proceed anyhow panic(fmt.Errorf("%s: failed to register migration to v18: %w", types.ModuleName, err)) } + if err := cfg.RegisterMigration(types.ModuleName, 18, migrator.MigrateVersion); err != nil { + // panic:ok: at start up, migration cannot proceed anyhow + panic(fmt.Errorf("%s: failed to register migration to v19: %w", types.ModuleName, err)) + } } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 18 } +func (AppModule) ConsensusVersion() uint64 { return 19 } // RegisterInvariants registers the capability module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} diff --git a/x/protocol/module_simulation.go b/x/protocol/module_simulation.go index 832a7a4f34..fb9d7b6361 100644 --- a/x/protocol/module_simulation.go +++ b/x/protocol/module_simulation.go @@ -11,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - protocolsimulation "github.com/lavanet/lava/x/protocol/simulation" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/testutil/sample" + protocolsimulation "github.com/lavanet/lava/v2/x/protocol/simulation" + "github.com/lavanet/lava/v2/x/protocol/types" ) // avoid unused import issue diff --git a/x/protocol/types/codec.go b/x/protocol/types/codec.go index 1311d86554..cab5d2053b 100644 --- a/x/protocol/types/codec.go +++ b/x/protocol/types/codec.go @@ -3,6 +3,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" // this line is used by starport scaffolding # 1 ) @@ -19,5 +20,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + ModuleCdc = codec.NewAminoCodec(Amino) + // ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterCodec(Amino) + cryptocodec.RegisterCrypto(Amino) + Amino.Seal() +} diff --git a/x/protocol/types/genesis.pb.go b/x/protocol/types/genesis.pb.go index f075761428..2f20cecea1 100644 --- a/x/protocol/types/genesis.pb.go +++ b/x/protocol/types/genesis.pb.go @@ -77,7 +77,7 @@ func init() { } var fileDescriptor_5875ab05db1f379d = []byte{ - // 188 bytes of a gzipped FileDescriptorProto + // 191 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0xc9, 0xf9, 0x39, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x60, 0x01, 0x21, 0x51, 0xa8, 0x22, 0x3d, 0x10, @@ -85,11 +85,11 @@ var fileDescriptor_5875ab05db1f379d = []byte{ 0x29, 0x25, 0xec, 0x26, 0x16, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x0d, 0x54, 0xf2, 0xe6, 0xe2, 0x71, 0x87, 0xd8, 0x10, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcd, 0xc5, 0x06, 0x91, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd5, 0xc3, 0x6a, 0xa3, 0x5e, 0x00, 0x58, 0x91, 0x13, 0xcb, 0x89, - 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0x2d, 0x4e, 0x4e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, + 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0x2d, 0x4e, 0xae, 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, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0xe2, - 0xaa, 0x0a, 0x84, 0xbb, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x7c, 0x63, 0x40, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x6b, 0x15, 0x52, 0x8e, 0x0f, 0x01, 0x00, 0x00, + 0xc7, 0x10, 0xa5, 0x9d, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0xe2, + 0xaa, 0x32, 0x23, 0xfd, 0x0a, 0x84, 0xd3, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x7c, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x9f, 0xc2, 0xb8, 0x12, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/protocol/types/genesis_test.go b/x/protocol/types/genesis_test.go index 9034b9d1de..5db02a5d10 100644 --- a/x/protocol/types/genesis_test.go +++ b/x/protocol/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/protocol/types" + "github.com/lavanet/lava/v2/x/protocol/types" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/types/message_set_version_test.go b/x/protocol/types/message_set_version_test.go index 58e2757ad2..1b852e65dc 100644 --- a/x/protocol/types/message_set_version_test.go +++ b/x/protocol/types/message_set_version_test.go @@ -3,7 +3,7 @@ package types import ( "testing" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/protocol/types/params.go b/x/protocol/types/params.go index 3298b8172a..85d2d3cf57 100644 --- a/x/protocol/types/params.go +++ b/x/protocol/types/params.go @@ -12,8 +12,8 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) const ( - TARGET_VERSION = "2.2.1" - MIN_VERSION = "2.0.3" + TARGET_VERSION = "2.4.0" + MIN_VERSION = "2.2.2" ) var ( diff --git a/x/protocol/types/params.pb.go b/x/protocol/types/params.pb.go index 4e0ed184d3..31da3d726a 100644 --- a/x/protocol/types/params.pb.go +++ b/x/protocol/types/params.pb.go @@ -145,7 +145,7 @@ func init() { } var fileDescriptor_e1924c66c5d42a94 = []byte{ - // 305 bytes of a gzipped FileDescriptorProto + // 308 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xca, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0xc9, 0xf9, 0x39, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x60, 0xbe, 0x90, 0x28, 0x54, 0x8d, 0x1e, 0x88, 0xd6, @@ -160,12 +160,12 @@ var fileDescriptor_e1924c66c5d42a94 = []byte{ 0xab, 0x01, 0x39, 0x80, 0x05, 0xdd, 0x01, 0xc8, 0xb2, 0x4a, 0x41, 0xdc, 0x30, 0xae, 0x6f, 0x66, 0x9e, 0x92, 0x1f, 0x17, 0x5b, 0x00, 0x38, 0x28, 0x85, 0xec, 0xb8, 0xd8, 0xcb, 0x20, 0xc1, 0x02, 0x0e, 0x03, 0x6e, 0x23, 0x39, 0x3d, 0xac, 0xc1, 0xaa, 0x07, 0x0d, 0x3c, 0x27, 0x96, 0x13, 0xf7, - 0xe4, 0x19, 0x82, 0x60, 0x9a, 0xac, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x72, 0x3a, 0xf1, 0x48, + 0xe4, 0x19, 0x82, 0x60, 0x9a, 0xac, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x72, 0x3d, 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, 0x8d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, - 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x38, 0xad, 0x40, 0xc4, 0x6a, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, - 0x1b, 0x98, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x30, 0xe5, 0x73, 0xfb, 0x01, 0x00, - 0x00, + 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xed, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, + 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x38, 0x2d, 0x33, 0xd2, 0xaf, 0x40, 0x44, 0x6c, 0x49, 0x65, 0x41, + 0x6a, 0x71, 0x12, 0x1b, 0x98, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x08, 0xd9, 0x1f, + 0xfe, 0x01, 0x00, 0x00, } func (m *Version) Marshal() (dAtA []byte, err error) { diff --git a/x/protocol/types/query.pb.go b/x/protocol/types/query.pb.go index ea855d368f..63925fde73 100644 --- a/x/protocol/types/query.pb.go +++ b/x/protocol/types/query.pb.go @@ -121,26 +121,26 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/protocol/query.proto", fileDescriptor_c616be00122ebd89) } var fileDescriptor_c616be00122ebd89 = []byte{ - // 297 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x03, 0x31, - 0x14, 0x80, 0x2f, 0xa2, 0x1d, 0xe2, 0x16, 0x2b, 0x48, 0xb1, 0xa9, 0x1e, 0x08, 0xb5, 0x43, 0x42, - 0xeb, 0xe8, 0xd6, 0x5f, 0xa0, 0x1d, 0xdd, 0x72, 0x25, 0xc4, 0x83, 0x5e, 0x5e, 0x7a, 0xc9, 0x15, - 0xbb, 0x3a, 0x38, 0x17, 0xfc, 0x53, 0x1d, 0x0b, 0x2e, 0x4e, 0x22, 0x77, 0xfe, 0x10, 0xb9, 0xe4, - 0x44, 0x8a, 0x55, 0x9c, 0x5e, 0xde, 0x7b, 0xdf, 0xfb, 0xf2, 0x12, 0x7c, 0x3e, 0x13, 0x0b, 0xa1, - 0xa5, 0xe3, 0x75, 0xe4, 0x26, 0x07, 0x07, 0x53, 0x98, 0xf1, 0x79, 0x21, 0xf3, 0x25, 0xf3, 0x29, - 0x39, 0x6e, 0x10, 0x56, 0x47, 0xf6, 0x85, 0x74, 0xda, 0x0a, 0x14, 0xf8, 0x8c, 0xd7, 0xa7, 0xd0, - 0xe8, 0x9c, 0x2a, 0x00, 0x35, 0x93, 0x5c, 0x98, 0x94, 0x0b, 0xad, 0xc1, 0x09, 0x97, 0x82, 0xb6, - 0x4d, 0x77, 0x30, 0x05, 0x9b, 0x81, 0xe5, 0x89, 0xb0, 0x32, 0xdc, 0xc1, 0x17, 0xc3, 0x44, 0x3a, - 0x31, 0xe4, 0x46, 0xa8, 0x54, 0x7b, 0xb8, 0x61, 0xe3, 0xdd, 0x9b, 0x19, 0x91, 0x8b, 0xac, 0xf1, - 0xc5, 0x6d, 0x4c, 0x6e, 0x6b, 0xcb, 0x8d, 0x2f, 0x4e, 0xe4, 0xbc, 0x90, 0xd6, 0xc5, 0x13, 0x7c, - 0xb4, 0x55, 0xb5, 0x06, 0xb4, 0x95, 0xe4, 0x1a, 0xb7, 0xc2, 0xf0, 0x09, 0x3a, 0x43, 0xfd, 0xc3, - 0x51, 0x97, 0xed, 0x7c, 0x18, 0x0b, 0x63, 0xe3, 0xfd, 0xf5, 0x5b, 0x2f, 0x9a, 0x34, 0x23, 0xa3, - 0x15, 0xc2, 0x07, 0x5e, 0x4a, 0x9e, 0x10, 0x6e, 0x05, 0x84, 0x5c, 0xfe, 0x62, 0xf8, 0xb9, 0x53, - 0x67, 0xf0, 0x1f, 0x34, 0x2c, 0x1a, 0x5f, 0x3c, 0xbe, 0x7c, 0x3c, 0xef, 0xf5, 0x48, 0x97, 0xff, - 0xf5, 0x05, 0xe3, 0xf1, 0xba, 0xa4, 0x68, 0x53, 0x52, 0xf4, 0x5e, 0x52, 0xb4, 0xaa, 0x68, 0xb4, - 0xa9, 0x68, 0xf4, 0x5a, 0xd1, 0xe8, 0xae, 0xaf, 0x52, 0x77, 0x5f, 0x24, 0x6c, 0x0a, 0xd9, 0xb6, - 0xe2, 0xe1, 0x5b, 0xe2, 0x96, 0x46, 0xda, 0xa4, 0xe5, 0xf3, 0xab, 0xcf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xc6, 0x96, 0xf2, 0x1e, 0x07, 0x02, 0x00, 0x00, + // 301 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0x3b, 0x31, + 0x14, 0xc0, 0x2f, 0x7f, 0xfe, 0x76, 0x88, 0x5b, 0xac, 0x20, 0xc5, 0xa6, 0x7a, 0x20, 0x68, 0x85, + 0x84, 0xd6, 0xd1, 0xad, 0xe0, 0xae, 0x1d, 0xdd, 0x72, 0x25, 0xc4, 0x83, 0x36, 0x2f, 0xbd, 0xe4, + 0x0e, 0xbb, 0x3a, 0x38, 0x17, 0xfc, 0x52, 0x1d, 0x0b, 0x2e, 0x4e, 0x22, 0x77, 0x7e, 0x10, 0xb9, + 0xe4, 0x44, 0x8a, 0x55, 0x9c, 0x5e, 0xde, 0x7b, 0xbf, 0xf7, 0xcb, 0x4b, 0xf0, 0xf1, 0x54, 0x14, + 0x42, 0x4b, 0xc7, 0xeb, 0xc8, 0x4d, 0x06, 0x0e, 0x26, 0x30, 0xe5, 0xf3, 0x5c, 0x66, 0x0b, 0xe6, + 0x53, 0xb2, 0xdf, 0x20, 0xac, 0x8e, 0xec, 0x13, 0xe9, 0xb4, 0x15, 0x28, 0xf0, 0x19, 0xaf, 0x4f, + 0xa1, 0xd1, 0x39, 0x54, 0x00, 0x6a, 0x2a, 0xb9, 0x30, 0x29, 0x17, 0x5a, 0x83, 0x13, 0x2e, 0x05, + 0x6d, 0x9b, 0x6e, 0x7f, 0x02, 0x76, 0x06, 0x96, 0x27, 0xc2, 0xca, 0x70, 0x07, 0x2f, 0x06, 0x89, + 0x74, 0x62, 0xc0, 0x8d, 0x50, 0xa9, 0xf6, 0x70, 0xc3, 0xc6, 0xdb, 0x37, 0x33, 0x22, 0x13, 0xb3, + 0xc6, 0x17, 0xb7, 0x31, 0xb9, 0xa9, 0x2d, 0xd7, 0xbe, 0x38, 0x96, 0xf3, 0x5c, 0x5a, 0x17, 0x8f, + 0xf1, 0xde, 0x46, 0xd5, 0x1a, 0xd0, 0x56, 0x92, 0x4b, 0xdc, 0x0a, 0xc3, 0x07, 0xe8, 0x08, 0x9d, + 0xee, 0x0e, 0xbb, 0x6c, 0xeb, 0xc3, 0x58, 0x18, 0x1b, 0xfd, 0x5f, 0xbd, 0xf6, 0xa2, 0x71, 0x33, + 0x32, 0x5c, 0x22, 0xbc, 0xe3, 0xa5, 0xe4, 0x11, 0xe1, 0x56, 0x40, 0xc8, 0xd9, 0x0f, 0x86, 0xef, + 0x3b, 0x75, 0xfa, 0x7f, 0x41, 0xc3, 0xa2, 0xf1, 0xc9, 0xc3, 0xf3, 0xfb, 0xd3, 0xbf, 0x1e, 0xe9, + 0xf2, 0xdf, 0xbe, 0x60, 0x74, 0xb5, 0x2a, 0x29, 0x5a, 0x97, 0x14, 0xbd, 0x95, 0x14, 0x2d, 0x2b, + 0x1a, 0xad, 0x2b, 0x1a, 0xbd, 0x54, 0x34, 0xba, 0x3d, 0x57, 0xa9, 0xbb, 0xcb, 0x13, 0x36, 0x81, + 0xd9, 0xa6, 0xa2, 0x18, 0xf2, 0xfb, 0x2f, 0x8f, 0x5b, 0x18, 0x69, 0x93, 0x96, 0xcf, 0x2f, 0x3e, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x39, 0x1a, 0xaf, 0x0a, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/protocol/types/tx.pb.go b/x/protocol/types/tx.pb.go index 069332a58d..6fa4273b45 100644 --- a/x/protocol/types/tx.pb.go +++ b/x/protocol/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" @@ -124,22 +125,24 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/protocol/tx.proto", fileDescriptor_96fb5a36c35e2c61) } var fileDescriptor_96fb5a36c35e2c61 = []byte{ - // 230 bytes of a gzipped FileDescriptorProto + // 258 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0xc9, 0xf9, 0x39, 0xfa, - 0x25, 0x15, 0x7a, 0x60, 0xb6, 0x90, 0x28, 0x54, 0x5e, 0x0f, 0x44, 0xeb, 0xc1, 0xe4, 0xa5, 0x94, - 0xb0, 0x6b, 0x2b, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0x86, 0x28, 0x53, 0x4a, 0xe7, 0xe2, 0xf5, 0x2d, - 0x4e, 0x0f, 0x4e, 0x2d, 0x09, 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0x13, 0x92, 0xe1, 0xe2, 0x4c, - 0x2c, 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0x2c, 0xa9, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x42, - 0x08, 0x08, 0x59, 0x70, 0xb1, 0x97, 0x41, 0x14, 0x4a, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0xc9, - 0xe9, 0x61, 0xb5, 0x5b, 0x0f, 0x6a, 0x5c, 0x10, 0x4c, 0xb9, 0x92, 0x38, 0x97, 0x28, 0x8a, 0x45, - 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0xe9, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, - 0x09, 0x5c, 0x5c, 0x48, 0xae, 0x50, 0xc1, 0x61, 0x2c, 0x8a, 0x11, 0x52, 0x3a, 0xc4, 0xa8, 0x82, - 0x59, 0xe4, 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, 0xfa, 0x28, 0x61, 0x56, 0x81, 0x14, 0xd8, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xbe, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x81, 0x81, - 0x84, 0xec, 0x92, 0x01, 0x00, 0x00, + 0x25, 0x15, 0x7a, 0x60, 0xb6, 0x90, 0x28, 0x54, 0x5e, 0x0f, 0x44, 0xeb, 0xc1, 0xe4, 0xa5, 0x04, + 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x54, 0x4a, 0x09, 0xbb, 0x49, 0x05, 0x89, + 0x45, 0x89, 0xb9, 0xc5, 0x10, 0x35, 0x4a, 0x2d, 0x8c, 0x5c, 0xbc, 0xbe, 0xc5, 0xe9, 0xc1, 0xa9, + 0x25, 0x61, 0xa9, 0x45, 0xc5, 0x99, 0xf9, 0x79, 0x42, 0x32, 0x5c, 0x9c, 0x89, 0xa5, 0x25, 0x19, + 0xf9, 0x45, 0x99, 0x25, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x08, 0x01, 0x21, 0x0b, + 0x2e, 0xf6, 0x32, 0x88, 0x42, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x39, 0x3d, 0xac, 0xee, + 0xd1, 0x83, 0x1a, 0x17, 0x04, 0x53, 0x6e, 0x25, 0xdd, 0xf5, 0x7c, 0x83, 0x96, 0x18, 0xdc, 0x15, + 0x28, 0x96, 0x2a, 0x89, 0x73, 0x89, 0xa2, 0x08, 0x04, 0xa5, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, + 0x1a, 0xa5, 0x73, 0x31, 0xfb, 0x16, 0xa7, 0x0b, 0x25, 0x70, 0x71, 0x21, 0x39, 0x51, 0x05, 0x87, + 0x9d, 0x28, 0x46, 0x48, 0xe9, 0x10, 0xa3, 0x0a, 0x66, 0x91, 0x93, 0xeb, 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, 0x69, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, + 0xe7, 0xea, 0xa3, 0x84, 0x68, 0x99, 0x91, 0x7e, 0x05, 0x52, 0x04, 0x55, 0x16, 0xa4, 0x16, 0x27, + 0xb1, 0x81, 0xf9, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x14, 0x5d, 0x73, 0xc6, 0x01, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/rewards/README.md b/x/rewards/README.md index c47ef9375e..edddc83f0f 100644 --- a/x/rewards/README.md +++ b/x/rewards/README.md @@ -26,6 +26,7 @@ Please note that this module replaces Cosmos SDK's mint module, which is typical * [Queries](#queries) * [Transactions](#transactions) * [Proposals](#proposals) +* [Events](#events) ## Concepts @@ -189,7 +190,7 @@ The rewards module supports the following queries: | `iprpc-provider-reward` | provider (string) | shows the estimated IPRPC rewards for a specific provider (relative to its serviced CU) for the upcoming monthly emission | | `iprpc-spec-rewards` | spec (string, optional) | shows a specific spec's IPRPC rewards (for the entire period). If no spec is given, all IPRPC rewards are shown | -Note, use the provider's operator address for the `iprpc-provider-reward` query. For more information on the operator and vault addresses see the pairing module's [README.md](../pairing/README.md). +Note, use the provider's address for the `iprpc-provider-reward` query. For more information on the provider's two addresses (regular and vault) see the epochstorage module's [README.md](../epochstorage/README.md). ## Transactions @@ -229,4 +230,8 @@ The rewards module has the following events: | `iprpc_pool_emmission` | a successful distribution of IPRPC bonus rewards | | `set_iprpc_data` | a successful setting of IPRPC data | | `fund_iprpc` | a successful funding of the IPRPC pool | -| `transfer_iprpc_reward_to_next_month` | a successful transfer of the current month's IPRPC reward to the next month. Happens when there are no providers eligible for IPRPC rewards in the current month | \ No newline at end of file +| `transfer_iprpc_reward_to_next_month` | a successful transfer of the current month's IPRPC reward to the next month. Happens when there are no providers eligible for IPRPC rewards in the current month | +| `provider_reward` | a successful reward transfer to a provider | +| `delegator_reward` | a successful reward transfer to a delegator | + +Note, providers and their delegators get rewards for several reasons: subscription rewards (relay payments), providers bonus rewards and IPRPC rewards. Those reasons and additional information are included in the `provider_reward` and `delegator_reward` events. \ No newline at end of file diff --git a/x/rewards/abci.go b/x/rewards/abci.go index c598e9b3b5..f941f309f5 100644 --- a/x/rewards/abci.go +++ b/x/rewards/abci.go @@ -2,7 +2,7 @@ package rewards import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/keeper" + "github.com/lavanet/lava/v2/x/rewards/keeper" ) // BeginBlocker calculates the validators block rewards and transfers them to the fee collector diff --git a/x/rewards/client/cli/query.go b/x/rewards/client/cli/query.go index bb32aa4781..2922658f53 100644 --- a/x/rewards/client/cli/query.go +++ b/x/rewards/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" ) // GetQueryCmd returns the cli query commands for this module @@ -30,7 +30,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryShowIprpcData()) cmd.AddCommand(CmdQueryIprpcProviderRewardEstimation()) cmd.AddCommand(CmdQueryIprpcSpecReward()) - cmd.AddCommand(CmdQueryProviderReward()) + cmd.AddCommand(CmdSpecTrackedInfo()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/rewards/client/cli/query_block_reward.go b/x/rewards/client/cli/query_block_reward.go index 55957e4dd0..c1491d3beb 100644 --- a/x/rewards/client/cli/query_block_reward.go +++ b/x/rewards/client/cli/query_block_reward.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go b/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go index a8fd922b0c..fa8fdee08b 100644 --- a/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go +++ b/x/rewards/client/cli/query_iprpc_provider_reward_estimation.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_iprpc_spec_reward.go b/x/rewards/client/cli/query_iprpc_spec_reward.go index adfb2477bf..4d04c812a3 100644 --- a/x/rewards/client/cli/query_iprpc_spec_reward.go +++ b/x/rewards/client/cli/query_iprpc_spec_reward.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_params.go b/x/rewards/client/cli/query_params.go index 7efc38eb5a..e824fce154 100644 --- a/x/rewards/client/cli/query_params.go +++ b/x/rewards/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_pools.go b/x/rewards/client/cli/query_pools.go index 9911dc7272..899ba5e165 100644 --- a/x/rewards/client/cli/query_pools.go +++ b/x/rewards/client/cli/query_pools.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_provider_reward.go b/x/rewards/client/cli/query_provider_reward.go deleted file mode 100644 index 4e46f040da..0000000000 --- a/x/rewards/client/cli/query_provider_reward.go +++ /dev/null @@ -1,62 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdQueryProviderReward() *cobra.Command { - cmd := &cobra.Command{ - Use: "provider-reward [provider] {chain-id}", - Short: "Query the total rewards for a given provider and chain", - Long: `args: - [provider] Provider address for which we want to query the rewards - {chain-id} Chain for which we want to view the rewards of the provider - `, - Example: ` - lavad query rewards provider-reward - lavad query rewards provider-reward ETH1`, - - Args: cobra.RangeArgs(1, 2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqChainID := "" - if len(args) == 2 { - reqChainID = args[1] - } - - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - reqProvider, err := utils.ParseCLIAddress(clientCtx, args[0]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryProviderRewardRequest{ - ChainId: reqChainID, - Provider: reqProvider, - } - - res, err := queryClient.ProviderReward(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/rewards/client/cli/query_show_iprpc_data.go b/x/rewards/client/cli/query_show_iprpc_data.go index c07c4a25bf..226c293e60 100644 --- a/x/rewards/client/cli/query_show_iprpc_data.go +++ b/x/rewards/client/cli/query_show_iprpc_data.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/client/cli/query_spec_tracked_info.go b/x/rewards/client/cli/query_spec_tracked_info.go new file mode 100644 index 0000000000..3045bf1f72 --- /dev/null +++ b/x/rewards/client/cli/query_spec_tracked_info.go @@ -0,0 +1,64 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdSpecTrackedInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "spec-tracked-info [chainid] {provider}", + Short: "Query the total tracked cu serviced by providers for a specific spec", + Long: `Query the total CU serviced to a spec throughout the current month for all providers. + can specify a provider to get only his CU serviced. + args: + [chain-id] Chain for which we want to view the tracked info. + {provider} optional specific provider tracked info. + `, + Example: ` + lavad query rewards spec-tracked-info ETH1 + lavad query rewards spec-tracked-info ETH1 `, + + Args: cobra.RangeArgs(1, 2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + reqChainID := args[0] + reqProvider := "" + if len(args) == 2 { + reqProvider, err = utils.ParseCLIAddress(clientCtx, args[1]) + if err != nil { + return err + } + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QuerySpecTrackedInfoRequest{ + ChainId: reqChainID, + Provider: reqProvider, + } + + res, err := queryClient.SpecTrackedInfo(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/rewards/client/cli/tx.go b/x/rewards/client/cli/tx.go index dc1d1f6e10..0849a7be87 100644 --- a/x/rewards/client/cli/tx.go +++ b/x/rewards/client/cli/tx.go @@ -16,8 +16,8 @@ import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/x/rewards/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) @@ -27,6 +27,8 @@ const ( listSeparator = "," expeditedFlagName = "expedited" minIprpcCostFlagName = "min-cost" + titleFlagName = "title" + descriptionFlagName = "description" addIprpcSubscriptionsFlagName = "add-subscriptions" removeIprpcSubscriptionsFlagName = "remove-subscriptions" ) @@ -80,16 +82,6 @@ $ %s tx gov submit-legacy-proposal set-iprpc-data --min-cost 0ulava --add-subscr return err } - // get min cost - costStr, err := cmd.Flags().GetString(minIprpcCostFlagName) - if err != nil { - return err - } - cost, err := sdk.ParseCoinNormalized(costStr) - if err != nil { - return err - } - // get current iprpc subscriptions q := types.NewQueryClient(clientCtx) res, err := q.ShowIprpcData(context.Background(), &types.QueryShowIprpcDataRequest{}) @@ -98,6 +90,19 @@ $ %s tx gov submit-legacy-proposal set-iprpc-data --min-cost 0ulava --add-subscr } subs := res.IprpcSubscriptions + // get min cost + costStr, err := cmd.Flags().GetString(minIprpcCostFlagName) + if err != nil { + return err + } + cost := res.MinCost + if costStr != "" { + cost, err = sdk.ParseCoinNormalized(costStr) + if err != nil { + return err + } + } + // add from msg subsToAdd, err := cmd.Flags().GetStringSlice(addIprpcSubscriptionsFlagName) if err != nil { @@ -135,7 +140,16 @@ $ %s tx gov submit-legacy-proposal set-iprpc-data --min-cost 0ulava --add-subscr MinIprpcCost: cost, } - submitPropMsg, err := govv1.NewMsgSubmitProposal([]sdk.Msg{&msg}, deposit, from.String(), "", "Set IPRPC data", "Set IPRPC data", isExpedited) + title, err := cmd.Flags().GetString(titleFlagName) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(descriptionFlagName) + if err != nil { + return err + } + submitPropMsg, err := govv1.NewMsgSubmitProposal([]sdk.Msg{&msg}, deposit, from.String(), "", title, description, isExpedited) if err != nil { return err } @@ -143,10 +157,11 @@ $ %s tx gov submit-legacy-proposal set-iprpc-data --min-cost 0ulava --add-subscr return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), submitPropMsg) }, } - cmd.Flags().String(minIprpcCostFlagName, "0ulava", "set minimum iprpc cost") + cmd.Flags().String(minIprpcCostFlagName, "", "set minimum iprpc cost") + cmd.Flags().String(titleFlagName, "Set IPRPC data", "proposal title") + cmd.Flags().String(descriptionFlagName, "Set IPRPC data", "proposal description") cmd.Flags().StringSlice(addIprpcSubscriptionsFlagName, []string{}, "add iprpc eligible subscriptions") cmd.Flags().StringSlice(removeIprpcSubscriptionsFlagName, []string{}, "remove iprpc eligible subscriptions") cmd.Flags().Bool(expeditedFlagName, false, "set to true to make the spec proposal expedited") - cmd.MarkFlagRequired(minIprpcCostFlagName) return cmd } diff --git a/x/rewards/client/cli/tx_fund_iprpc.go b/x/rewards/client/cli/tx_fund_iprpc.go index c51c2abc59..a1eb7d6b66 100644 --- a/x/rewards/client/cli/tx_fund_iprpc.go +++ b/x/rewards/client/cli/tx_fund_iprpc.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/spf13/cobra" ) diff --git a/x/rewards/genesis.go b/x/rewards/genesis.go index bfe82663a5..339f67488e 100644 --- a/x/rewards/genesis.go +++ b/x/rewards/genesis.go @@ -2,8 +2,8 @@ package rewards import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/keeper" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/keeper" + "github.com/lavanet/lava/v2/x/rewards/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/rewards/genesis_test.go b/x/rewards/genesis_test.go index cd7e508195..4c293304b2 100644 --- a/x/rewards/genesis_test.go +++ b/x/rewards/genesis_test.go @@ -4,9 +4,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/rewards/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/handler.go b/x/rewards/handler.go index 0692e0efcb..e8d48b1cea 100644 --- a/x/rewards/handler.go +++ b/x/rewards/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/rewards/keeper" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/keeper" + "github.com/lavanet/lava/v2/x/rewards/types" ) // NewHandler ... diff --git a/x/rewards/keeper/base_pay.go b/x/rewards/keeper/base_pay.go index d61ab0370d..476629fec7 100644 --- a/x/rewards/keeper/base_pay.go +++ b/x/rewards/keeper/base_pay.go @@ -3,24 +3,24 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" ) // SetBasePay set a specific BasePay in the store from its index -func (k Keeper) setBasePay(ctx sdk.Context, index types.BasePayIndex, basePay types.BasePay) { +func (k Keeper) setBasePay(ctx sdk.Context, index types.BasePayWithIndex) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) - b := k.cdc.MustMarshal(&basePay) - store.Set([]byte(index.String()), b) + b := k.cdc.MustMarshal(&index.BasePay) + store.Set([]byte(index.Index()), b) } // GetBasePay returns a BasePay from its index func (k Keeper) getBasePay( ctx sdk.Context, - index types.BasePayIndex, + index types.BasePayWithIndex, ) (val types.BasePay, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) - b := store.Get([]byte(index.String())) + b := store.Get([]byte(index.Index())) if b == nil { return val, false } @@ -30,7 +30,7 @@ func (k Keeper) getBasePay( } // GetAllBasePay returns all BasePay -func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayGenesis) { +func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayWithIndex) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) @@ -39,31 +39,35 @@ func (k Keeper) GetAllBasePay(ctx sdk.Context) (list []types.BasePayGenesis) { for ; iterator.Valid(); iterator.Next() { var val types.BasePay k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, types.BasePayGenesis{Index: string(iterator.Key()), BasePay: val}) + bs := types.BasePayKeyRecover(string(iterator.Key())) + bs.BasePay = val + list = append(list, bs) } return } // SetAllBasePay sets all BasePay -func (k Keeper) SetAllBasePay(ctx sdk.Context, list []types.BasePayGenesis) { +func (k Keeper) SetAllBasePay(ctx sdk.Context, list []types.BasePayWithIndex) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) for _, basePay := range list { b := k.cdc.MustMarshal(&basePay) - store.Set([]byte(basePay.Index), b) + store.Set([]byte(basePay.Index()), b) } } func (k Keeper) getAllBasePayForChain(ctx sdk.Context, chainID string, provider string) (list []types.BasePayWithIndex) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BasePayPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte(types.BasePayIndex{ChainID: chainID, Provider: provider}.String())) + iterator := sdk.KVStorePrefixIterator(store, []byte(types.BasePayWithIndex{ChainId: chainID, Provider: provider}.Index())) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { var val types.BasePay k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, types.BasePayWithIndex{BasePayIndex: types.BasePayKeyRecover(string(iterator.Key())), BasePay: val}) + bs := types.BasePayKeyRecover(string(iterator.Key())) + bs.BasePay = val + list = append(list, bs) } return @@ -78,7 +82,9 @@ func (k Keeper) popAllBasePayForChain(ctx sdk.Context, chainID string) (list []t for ; iterator.Valid(); iterator.Next() { var val types.BasePay k.cdc.MustUnmarshal(iterator.Value(), &val) - list = append(list, types.BasePayWithIndex{BasePayIndex: types.BasePayKeyRecover(string(iterator.Key())), BasePay: val}) + bs := types.BasePayKeyRecover(string(iterator.Key())) + bs.BasePay = val + list = append(list, bs) store.Delete(iterator.Key()) } diff --git a/x/rewards/keeper/grpc_query.go b/x/rewards/keeper/grpc_query.go index d9de6e5571..fe4353914d 100644 --- a/x/rewards/keeper/grpc_query.go +++ b/x/rewards/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/rewards/keeper/grpc_query_block_reward.go b/x/rewards/keeper/grpc_query_block_reward.go index 3753686f41..d5fae3eb89 100644 --- a/x/rewards/keeper/grpc_query_block_reward.go +++ b/x/rewards/keeper/grpc_query_block_reward.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go index 6b936fd4eb..669b00640e 100644 --- a/x/rewards/keeper/grpc_query_iprpc_provider_reward.go +++ b/x/rewards/keeper/grpc_query_iprpc_provider_reward.go @@ -5,7 +5,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -32,17 +32,17 @@ func (k Keeper) IprpcProviderRewardEstimation(goCtx context.Context, req *types. providerIprpcCu := uint64(0) totalIprpcCu := uint64(0) - stakeEntry, found := k.epochstorage.GetStakeEntryByAddressCurrent(ctx, specFund.Spec, req.Provider) + stakeEntry, found := k.epochstorage.GetStakeEntryCurrent(ctx, specFund.Spec, req.Provider) if !found { continue } - providerBpIndex := types.BasePayIndex{Provider: stakeEntry.Address, ChainID: specFund.Spec} + providerBpIndex := types.BasePayWithIndex{Provider: stakeEntry.Address, ChainId: specFund.Spec} for _, bp := range bps { - if bp.BasePayIndex.String() == providerBpIndex.String() { - providerIprpcCu = bp.IprpcCu + if bp.Index() == providerBpIndex.Index() { + providerIprpcCu = bp.BasePay.IprpcCu } - totalIprpcCu += bp.IprpcCu + totalIprpcCu += bp.BasePay.IprpcCu } // get the provider's relative reward by CU diff --git a/x/rewards/keeper/grpc_query_iprpc_spec_reward.go b/x/rewards/keeper/grpc_query_iprpc_spec_reward.go index 2f0d67693b..09ed49deac 100644 --- a/x/rewards/keeper/grpc_query_iprpc_spec_reward.go +++ b/x/rewards/keeper/grpc_query_iprpc_spec_reward.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_params.go b/x/rewards/keeper/grpc_query_params.go index e719398d44..4cbfb0ff51 100644 --- a/x/rewards/keeper/grpc_query_params.go +++ b/x/rewards/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_params_test.go b/x/rewards/keeper/grpc_query_params_test.go index 1570d5139a..3710c8da00 100644 --- a/x/rewards/keeper/grpc_query_params_test.go +++ b/x/rewards/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/rewards/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/grpc_query_pools.go b/x/rewards/keeper/grpc_query_pools.go index 4e6d35d3d6..f975e36783 100644 --- a/x/rewards/keeper/grpc_query_pools.go +++ b/x/rewards/keeper/grpc_query_pools.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -29,6 +29,10 @@ func (k Keeper) Pools(goCtx context.Context, req *types.QueryPoolsRequest) (*typ Name: string(types.ProviderRewardsDistributionPool), Balance: k.TotalPoolTokens(ctx, types.ProviderRewardsDistributionPool), }, + { + Name: string(types.ValidatorsRewardsLeftOverPoolName), + Balance: k.TotalPoolTokens(ctx, types.ValidatorsRewardsLeftOverPoolName), + }, { Name: string(types.ProvidersRewardsAllocationPool), Balance: k.TotalPoolTokens(ctx, types.ProvidersRewardsAllocationPool), diff --git a/x/rewards/keeper/grpc_query_provider_reward.go b/x/rewards/keeper/grpc_query_provider_reward.go deleted file mode 100644 index b123e721b9..0000000000 --- a/x/rewards/keeper/grpc_query_provider_reward.go +++ /dev/null @@ -1,26 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) ProviderReward(goCtx context.Context, req *types.QueryProviderRewardRequest) (*types.QueryProviderRewardResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - var rewards []types.RewardInfo - - for _, basepay := range k.getAllBasePayForChain(ctx, req.ChainId, req.ChainId) { - rewards = append(rewards, types.RewardInfo{Provider: basepay.Provider, ChainId: basepay.ChainID, Amount: sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), basepay.BasePay.Total)}) - } - - return &types.QueryProviderRewardResponse{Rewards: rewards}, nil -} diff --git a/x/rewards/keeper/grpc_query_show_iprpc_data.go b/x/rewards/keeper/grpc_query_show_iprpc_data.go index 84444c1679..925dfa3640 100644 --- a/x/rewards/keeper/grpc_query_show_iprpc_data.go +++ b/x/rewards/keeper/grpc_query_show_iprpc_data.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/rewards/keeper/grpc_query_spec_tracked_info.go b/x/rewards/keeper/grpc_query_spec_tracked_info.go new file mode 100644 index 0000000000..706b719a19 --- /dev/null +++ b/x/rewards/keeper/grpc_query_spec_tracked_info.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/x/rewards/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) SpecTrackedInfo(goCtx context.Context, req *types.QuerySpecTrackedInfoRequest) (*types.QuerySpecTrackedInfoResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + res := types.QuerySpecTrackedInfoResponse{} + res.Info = k.getAllBasePayForChain(ctx, req.ChainId, req.Provider) + + return &res, nil +} diff --git a/x/rewards/keeper/helpers_test.go b/x/rewards/keeper/helpers_test.go index 50b0dbbbef..fd717ed27c 100644 --- a/x/rewards/keeper/helpers_test.go +++ b/x/rewards/keeper/helpers_test.go @@ -9,14 +9,14 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/testutil/common" - testkeeper "github.com/lavanet/lava/testutil/keeper" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/utils/sigs" - planstypes "github.com/lavanet/lava/x/plans/types" - "github.com/lavanet/lava/x/projects/types" - rewardstypes "github.com/lavanet/lava/x/rewards/types" - spectypes "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/common" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/utils/sigs" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + "github.com/lavanet/lava/v2/x/projects/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/iprpc.go b/x/rewards/keeper/iprpc.go index cccaaee334..1cd944c396 100644 --- a/x/rewards/keeper/iprpc.go +++ b/x/rewards/keeper/iprpc.go @@ -6,8 +6,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" ) func (k Keeper) FundIprpc(ctx sdk.Context, creator string, duration uint64, fund sdk.Coins, spec string) error { @@ -135,6 +135,8 @@ func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcR leftovers := sdk.NewCoins() for _, specFund := range iprpcReward.SpecFunds { + details := map[string]string{} + // verify specCuMap holds an entry for the relevant spec specCu, ok := specCuMap[specFund.Spec] if !ok { @@ -146,6 +148,18 @@ func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcR continue } + // tax the rewards to the community and validators + fundAfterTax := sdk.NewCoins() + for _, coin := range specFund.Fund { + leftover, err := k.ContributeToValidatorsAndCommunityPool(ctx, coin, string(types.IprpcPoolName)) + if err != nil { + // if ContributeToValidatorsAndCommunityPool fails we continue with the next providerrewards + continue + } + fundAfterTax = fundAfterTax.Add(leftover) + } + specFund.Fund = fundAfterTax + UsedReward := sdk.NewCoins() // distribute IPRPC reward for spec for _, providerCU := range specCu.ProvidersCu { @@ -168,7 +182,12 @@ func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcR if err != nil { utils.LavaFormatError("failed to send iprpc rewards to provider", err, utils.LogAttr("provider", providerCU)) } + details[providerCU.Provider] = fmt.Sprintf("cu: %d reward: %s", providerCU.CU, providerIprpcReward.String()) } + details["total_cu"] = strconv.FormatUint(specCu.TotalCu, 10) + details["total_reward"] = specFund.Fund.String() + details["chainid"] = specFund.GetSpec() + utils.LogLavaEvent(ctx, k.Logger(ctx), types.IprpcPoolEmissionEventName, details, "IPRPC monthly rewards distributed successfully") // count used rewards leftovers = leftovers.Add(specFund.Fund.Sub(UsedReward...)...) @@ -179,6 +198,4 @@ func (k Keeper) distributeIprpcRewards(ctx sdk.Context, iprpcReward types.IprpcR if err != nil { utils.LavaFormatError("could not send iprpc leftover to community pool", err) } - - utils.LogLavaEvent(ctx, k.Logger(ctx), types.IprpcPoolEmissionEventName, map[string]string{"iprpc_rewards_leftovers": leftovers.String()}, "IPRPC monthly rewards distributed successfully") } diff --git a/x/rewards/keeper/iprpc_data.go b/x/rewards/keeper/iprpc_data.go index 45e28c6b5d..cf3199a281 100644 --- a/x/rewards/keeper/iprpc_data.go +++ b/x/rewards/keeper/iprpc_data.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" ) func (k Keeper) SetIprpcData(ctx sdk.Context, cost sdk.Coin, subs []string) error { diff --git a/x/rewards/keeper/iprpc_data_test.go b/x/rewards/keeper/iprpc_data_test.go index 8d949565b1..f6a89326e6 100644 --- a/x/rewards/keeper/iprpc_data_test.go +++ b/x/rewards/keeper/iprpc_data_test.go @@ -5,17 +5,17 @@ import ( "testing" "cosmossdk.io/math" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/rewards/keeper" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/rewards/keeper" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/testutil/sample" ) // Prevent strconv unused error diff --git a/x/rewards/keeper/iprpc_reward.go b/x/rewards/keeper/iprpc_reward.go index 4df6b9c713..5c1dd9198e 100644 --- a/x/rewards/keeper/iprpc_reward.go +++ b/x/rewards/keeper/iprpc_reward.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" ) // GetIprpcRewardsCurrentId get the total number of IprpcReward diff --git a/x/rewards/keeper/iprpc_test.go b/x/rewards/keeper/iprpc_test.go index fd94755a6b..84d08d5e7d 100644 --- a/x/rewards/keeper/iprpc_test.go +++ b/x/rewards/keeper/iprpc_test.go @@ -6,9 +6,9 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/sigs" - rewardstypes "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/sigs" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" "github.com/stretchr/testify/require" ) @@ -156,6 +156,7 @@ func TestFundIprpcTX(t *testing.T) { func TestIprpcProviderRewardQuery(t *testing.T) { ts := newTester(t, true) ts.setupForIprpcTests(true) // setup funds IPRPC for mock2 spec + ts.Keepers.Distribution.SetParams(ts.Ctx, distributiontypes.Params{CommunityTax: sdk.OneDec().QuoInt64(2)}) // get consumers and providers (note, only c1 is IPRPC eligible) c1Acc, _ := ts.GetAccount(common.CONSUMER, 0) @@ -189,6 +190,7 @@ func TestIprpcProviderRewardQuery(t *testing.T) { provider string fund sdk.Coins } + tax := sdk.NewInt(100).SubRaw(10).SubRaw(45) // tax is 10% validators and 45% community expectedProviderRewards := []providerRewards{ {provider: p1, fund: iprpcFunds.Sub(minIprpcCost).QuoInt(sdk.NewInt(5))}, {provider: p2, fund: iprpcFunds.Sub(minIprpcCost).MulInt(sdk.NewInt(4)).QuoInt(sdk.NewInt(5))}, @@ -207,7 +209,7 @@ func TestIprpcProviderRewardQuery(t *testing.T) { for i, expectedProviderReward := range expectedProviderRewards { res2, err := ts.QueryDualstakingDelegatorRewards(providerAccs[i].GetVaultAddr(), expectedProviderReward.provider, ts.specs[1].Index) require.NoError(t, err) - require.True(t, res2.Rewards[0].Amount.IsEqual(expectedProviderReward.fund)) // taking 0 index because there are no delegators + require.True(t, res2.Rewards[0].Amount.IsEqual(expectedProviderReward.fund.MulInt(tax).QuoInt(sdk.NewInt(100)))) // taking 0 index because there are no delegators } } @@ -434,6 +436,10 @@ func TestIprpcRewardObjectsUpdate(t *testing.T) { func TestFundIprpcTwice(t *testing.T) { ts := newTester(t, true) ts.setupForIprpcTests(false) + ts.Keepers.Distribution.SetParams(ts.Ctx, distributiontypes.Params{CommunityTax: sdk.OneDec().QuoInt64(2)}) + validatorTax := sdk.NewInt(10) + tax := sdk.NewInt(100).Sub(validatorTax).SubRaw(45) // tax is 10% validators and 45% community + consumerAcc, consumer := ts.GetAccount(common.CONSUMER, 0) p1Acc, p1 := ts.GetAccount(common.PROVIDER, 0) @@ -460,7 +466,11 @@ func TestFundIprpcTwice(t *testing.T) { // check rewards - should be only from first funding (=iprpcFunds) res, err := ts.QueryDualstakingDelegatorRewards(p1Acc.GetVaultAddr(), p1, mockSpec2) require.NoError(t, err) - require.True(t, iprpcFunds.Sub(minIprpcCost).IsEqual(res.Rewards[0].Amount)) + require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(tax).QuoInt(sdk.NewInt(100)).IsEqual(res.Rewards[0].Amount)) + + taxed := iprpcFunds.Sub(minIprpcCost).MulInt(validatorTax).QuoInt(sdk.NewInt(100)) + validatorDistributionPoolTokens := ts.Keepers.Rewards.TotalPoolTokens(ts.Ctx, rewardstypes.ValidatorsRewardsDistributionPoolName) + require.Equal(t, validatorDistributionPoolTokens.AmountOf(ibcDenom), taxed.AmountOf(ibcDenom)) // make a provider service an IPRPC eligible consumer and advance month again relay = ts.SendRelay(p1, consumerAcc, []string{ts.specs[1].Index}, 100) @@ -472,7 +482,7 @@ func TestFundIprpcTwice(t *testing.T) { // check rewards - should be only from first + second funding (=iprpcFunds*3) res, err = ts.QueryDualstakingDelegatorRewards(p1Acc.GetVaultAddr(), p1, mockSpec2) require.NoError(t, err) - require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(math.NewInt(3)).IsEqual(res.Rewards[0].Amount)) + require.True(t, iprpcFunds.Sub(minIprpcCost).MulInt(math.NewInt(3)).MulInt(tax).QuoInt(sdk.NewInt(100)).IsEqual(res.Rewards[0].Amount)) } // TestIprpcMinCost tests that a fund TX fails if it doesn't have enough tokens to cover for the minimum IPRPC costs @@ -696,10 +706,10 @@ func TestMultipleIprpcSpec(t *testing.T) { } // TestIprpcRewardWithZeroSubRewards checks that even if a subscription is free (providers won't get paid for their service) -// if the providers service an IPRPC eligible subscription, they get IPRPC rewards +// if the providers service an IPRPC eligible subscription, they get IPRPC rewards (which are taxed) // Scenarios: -// 0. consumer is IPRPC eligible and community tax = 100% -> provider won't get paid for its service -// 1. two providers provide service -> they get IPRPC reward relative to their serviced CU +// consumer is IPRPC eligible and community tax = 100% -> provider won't get paid for its service and IPRPC +// rewards will be transffered to the community pool func TestIprpcRewardWithZeroSubRewards(t *testing.T) { ts := newTester(t, true) ts.setupForIprpcTests(true) // create a consumer and buys subscription + funds iprpc @@ -728,16 +738,13 @@ func TestIprpcRewardWithZeroSubRewards(t *testing.T) { ts.AdvanceEpoch() ts.AdvanceBlocks(ts.BlocksToSave() + 1) - // check provider rewards (should be only expected IPRPC rewards) - p1ExpectedReward := iprpcFunds.Sub(minIprpcCost).QuoInt(sdk.NewInt(5)) + // check there are no provider rewards res1, err := ts.QueryDualstakingDelegatorRewards(p1Acc.GetVaultAddr(), p1, mockSpec2) require.NoError(t, err) - require.True(t, p1ExpectedReward.IsEqual(res1.Rewards[0].Amount)) - - p2ExpectedReward := p1ExpectedReward.MulInt(sdk.NewInt(4)) + require.Len(t, res1.Rewards, 0) res2, err := ts.QueryDualstakingDelegatorRewards(p2Acc.GetVaultAddr(), p2, mockSpec2) require.NoError(t, err) - require.True(t, p2ExpectedReward.IsEqual(res2.Rewards[0].Amount)) + require.Len(t, res2.Rewards, 0) } // TestMinIprpcCostForSeveralMonths checks that if a user sends fund=1.1*minIprpcCost with duration=2 diff --git a/x/rewards/keeper/keeper.go b/x/rewards/keeper/keeper.go index 2b3334e001..afdba00631 100644 --- a/x/rewards/keeper/keeper.go +++ b/x/rewards/keeper/keeper.go @@ -9,8 +9,8 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) type ( diff --git a/x/rewards/keeper/msg_server.go b/x/rewards/keeper/msg_server.go index 423f4de374..de9c61325c 100644 --- a/x/rewards/keeper/msg_server.go +++ b/x/rewards/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" ) type msgServer struct { diff --git a/x/rewards/keeper/msg_server_fund_iprpc.go b/x/rewards/keeper/msg_server_fund_iprpc.go index d0e4e4a678..6687df91a5 100644 --- a/x/rewards/keeper/msg_server_fund_iprpc.go +++ b/x/rewards/keeper/msg_server_fund_iprpc.go @@ -5,8 +5,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" ) func (k msgServer) FundIprpc(goCtx context.Context, msg *types.MsgFundIprpc) (*types.MsgFundIprpcResponse, error) { diff --git a/x/rewards/keeper/msg_server_set_iprpc_data.go b/x/rewards/keeper/msg_server_set_iprpc_data.go index 05fb12e02e..8a7c397421 100644 --- a/x/rewards/keeper/msg_server_set_iprpc_data.go +++ b/x/rewards/keeper/msg_server_set_iprpc_data.go @@ -7,8 +7,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" ) func (k msgServer) SetIprpcData(goCtx context.Context, msg *types.MsgSetIprpcData) (*types.MsgSetIprpcDataResponse, error) { diff --git a/x/rewards/keeper/msg_server_test.go b/x/rewards/keeper/msg_server_test.go index 7fefcfee19..2549291562 100644 --- a/x/rewards/keeper/msg_server_test.go +++ b/x/rewards/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/rewards/keeper" - "github.com/lavanet/lava/x/rewards/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/rewards/keeper" + "github.com/lavanet/lava/v2/x/rewards/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/rewards/keeper/params.go b/x/rewards/keeper/params.go index a2c2cb1a8f..2584ad1325 100644 --- a/x/rewards/keeper/params.go +++ b/x/rewards/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" ) // GetParams get all parameters as types.Params diff --git a/x/rewards/keeper/params_test.go b/x/rewards/keeper/params_test.go index 8988ffbaba..fbb195bf11 100644 --- a/x/rewards/keeper/params_test.go +++ b/x/rewards/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/rewards/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/pool.go b/x/rewards/keeper/pool.go index 7d2cf221a8..ed37b61efb 100644 --- a/x/rewards/keeper/pool.go +++ b/x/rewards/keeper/pool.go @@ -4,7 +4,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" ) // TotalPoolTokens gets the total tokens supply from a pool diff --git a/x/rewards/keeper/pool_test.go b/x/rewards/keeper/pool_test.go index 6bdf71a995..1a0398d9f1 100644 --- a/x/rewards/keeper/pool_test.go +++ b/x/rewards/keeper/pool_test.go @@ -4,12 +4,14 @@ import ( "testing" "time" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + distribution "github.com/cosmos/cosmos-sdk/x/distribution" + "github.com/lavanet/lava/v2/testutil/common" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/stretchr/testify/require" ) @@ -382,3 +384,20 @@ func TestRefillPoolsTimerStore(t *testing.T) { month = ts.GetNextMonth(ts.BlockTime()) - ts.BlockTime().UTC().Unix() } } + +// TestBlockRewardsWith2Tokens tests that block rewatds from the distribution pool works with more than 1 kind of token +func TestBlockRewardsWith2Tokens(t *testing.T) { + ts := newTester(t, true) + startTokens := ts.Keepers.Rewards.TotalPoolTokens(ts.Ctx, types.ValidatorsRewardsDistributionPoolName) + err := ts.Keepers.BankKeeper.AddToBalance(testkeeper.GetModuleAddress(string(types.ValidatorsRewardsDistributionPoolName)), + sdk.NewCoins(sdk.NewCoin(ibcDenom, startTokens[0].Amount))) + require.NoError(t, err) + startTokens = ts.Keepers.Rewards.TotalPoolTokens(ts.Ctx, types.ValidatorsRewardsDistributionPoolName) + + ts.AdvanceBlock() + distribution.BeginBlocker(ts.Ctx, abci.RequestBeginBlock{}, ts.Keepers.Distribution) + + currentTokens := ts.Keepers.Rewards.TotalPoolTokens(ts.Ctx, types.ValidatorsRewardsDistributionPoolName) + require.Equal(t, currentTokens.AmountOf(ibcDenom), currentTokens.AmountOf(ts.BondDenom())) + require.True(t, currentTokens.IsAllLT(startTokens)) +} diff --git a/x/rewards/keeper/providers.go b/x/rewards/keeper/providers.go index 96f496b6be..d9dcacae07 100644 --- a/x/rewards/keeper/providers.go +++ b/x/rewards/keeper/providers.go @@ -2,12 +2,15 @@ package keeper import ( "fmt" + "strconv" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" + + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) const DAY_SECONDS = 60 * 60 * 24 @@ -17,43 +20,43 @@ func (k Keeper) AggregateCU(ctx sdk.Context, subscription, provider string, chai return } - index := types.BasePayIndex{Provider: provider, ChainID: chainID} - basepay, found := k.getBasePay(ctx, index) + bp := types.BasePayWithIndex{Provider: provider, ChainId: chainID} + var found bool + bp.BasePay, found = k.getBasePay(ctx, bp) if !found { - basepay = types.BasePay{IprpcCu: cu} + bp.BasePay = types.BasePay{IprpcCu: cu} } else { - basepay.IprpcCu += cu + bp.BasePay.IprpcCu += cu } - k.setBasePay(ctx, index, basepay) + k.setBasePay(ctx, bp) } func (k Keeper) AggregateRewards(ctx sdk.Context, provider, chainid string, adjustment sdk.Dec, rewards math.Int) { - index := types.BasePayIndex{Provider: provider, ChainID: chainid} - basepay, found := k.getBasePay(ctx, index) + bp := types.BasePayWithIndex{Provider: provider, ChainId: chainid} + var found bool + bp.BasePay, found = k.getBasePay(ctx, bp) adjustedPay := adjustment.MulInt(rewards) adjustedPay = sdk.MinDec(adjustedPay, sdk.NewDecFromInt(rewards)) if !found { - basepay = types.BasePay{Total: rewards, TotalAdjusted: adjustedPay} + bp.BasePay = types.BasePay{Total: rewards, TotalAdjusted: adjustedPay} } else { - basepay.Total = basepay.Total.Add(rewards) - basepay.TotalAdjusted = basepay.TotalAdjusted.Add(adjustedPay) + bp.BasePay.Total = bp.BasePay.Total.Add(rewards) + bp.BasePay.TotalAdjusted = bp.BasePay.TotalAdjusted.Add(adjustedPay) } - k.setBasePay(ctx, index, basepay) + k.setBasePay(ctx, bp) } // Distribute bonus rewards to providers across all chains based on performance func (k Keeper) distributeMonthlyBonusRewards(ctx sdk.Context) { - details := map[string]string{} coins := k.TotalPoolTokens(ctx, types.ProviderRewardsDistributionPool) total := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) totalRewarded := sdk.ZeroInt() // specs emissions from the total reward pool base on stake - specs := k.specEmissionParts(ctx) + specs := k.SpecEmissionParts(ctx) defer func() { k.removeAllBasePay(ctx) - utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProvidersBonusRewardsEventName, details, "provider bonus rewards distributed") }() // Get serviced CU for each provider + spec @@ -68,13 +71,14 @@ func (k Keeper) distributeMonthlyBonusRewards(ctx sdk.Context) { // calculate the maximum rewards for the spec specTotalPayout := math.LegacyZeroDec() if !totalbasepay.IsZero() { - specTotalPayout = k.specTotalPayout(ctx, total, sdk.NewDecFromInt(totalbasepay), spec) + specTotalPayout = k.SpecTotalPayout(ctx, total, sdk.NewDecFromInt(totalbasepay), spec) } + details := map[string]string{} // distribute the rewards to all providers for _, basepay := range basepays { if !specTotalPayout.IsZero() { // calculate the providers bonus base on adjusted base pay - reward := specTotalPayout.Mul(basepay.TotalAdjusted).QuoInt(totalbasepay).TruncateInt() + reward := specTotalPayout.Mul(basepay.BasePay.TotalAdjusted).QuoInt(totalbasepay).TruncateInt() totalRewarded = totalRewarded.Add(reward) if totalRewarded.GT(total) { utils.LavaFormatError("provider rewards are larger than the distribution pool balance", nil, @@ -84,17 +88,22 @@ func (k Keeper) distributeMonthlyBonusRewards(ctx sdk.Context) { return } // now give the reward the provider contributor and delegators - _, _, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, basepay.Provider, basepay.ChainID, sdk.NewCoins(sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), reward)), string(types.ProviderRewardsDistributionPool), false, false, false) + _, _, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, basepay.Provider, basepay.ChainId, sdk.NewCoins(sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), reward)), string(types.ProviderRewardsDistributionPool), false, false, false) if err != nil { utils.LavaFormatError("failed to send bonus rewards to provider", err, utils.LogAttr("provider", basepay.Provider)) } - - details[basepay.Provider+" "+spec.ChainID] = reward.String() + details[basepay.Provider] = fmt.Sprintf("cu: %d reward: %s", basepay.BasePay.TotalAdjusted, reward.String()) } // count iprpc cu - k.countIprpcCu(specCuMap, basepay.IprpcCu, spec.ChainID, basepay.Provider) + k.countIprpcCu(specCuMap, basepay.BasePay.IprpcCu, spec.ChainID, basepay.Provider) } + + details["block"] = strconv.FormatInt(ctx.BlockHeight(), 10) + details["chainid"] = spec.ChainID + details["total_rewards"] = sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), totalbasepay).String() + details["total_cu"] = totalbasepay.String() + utils.LogLavaEvent(ctx, k.Logger(ctx), types.ProvidersBonusRewardsEventName, details, "provider bonus rewards distributed") } // Get current month IprpcReward and use it to distribute rewards @@ -108,18 +117,18 @@ func (k Keeper) distributeMonthlyBonusRewards(ctx sdk.Context) { k.distributeIprpcRewards(ctx, iprpcReward, specCuMap) } -// specTotalPayout calculates the total bonus for a specific spec +// SpecTotalPayout calculates the total bonus for a specific spec // specPayoutAllocation: maximum rewards that the spec can have // rewardBoost: bonus based on the total rewards providers got factored by maxboost // diminishingRewards: makes sure to diminish the bonuses in case there are enough consumers on the chain -func (k Keeper) specTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards sdk.Dec, spec types.SpecEmissionPart) math.LegacyDec { +func (k Keeper) SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards sdk.Dec, spec types.SpecEmissionPart) math.LegacyDec { specPayoutAllocation := spec.Emission.MulInt(totalMonthlyPayout) rewardBoost := totalProvidersBaseRewards.MulInt64(int64(k.MaxRewardBoost(ctx))) diminishingRewards := sdk.MaxDec(sdk.ZeroDec(), (sdk.NewDecWithPrec(15, 1).Mul(specPayoutAllocation)).Sub(sdk.NewDecWithPrec(5, 1).Mul(totalProvidersBaseRewards))) return sdk.MinDec(sdk.MinDec(specPayoutAllocation, rewardBoost), diminishingRewards) } -func (k Keeper) specEmissionParts(ctx sdk.Context) (emissions []types.SpecEmissionPart) { +func (k Keeper) SpecEmissionParts(ctx sdk.Context) (emissions []types.SpecEmissionPart) { chainIDs := k.specKeeper.GetAllChainIDs(ctx) totalStake := sdk.ZeroDec() chainStake := map[string]sdk.Dec{} @@ -133,12 +142,9 @@ func (k Keeper) specEmissionParts(ctx sdk.Context) (emissions []types.SpecEmissi continue } - stakeStorage, found := k.epochstorage.GetStakeStorageCurrent(ctx, chainID) - if !found { - continue - } + stakeEntries := k.epochstorage.GetAllStakeEntriesCurrentForChainId(ctx, chainID) chainStake[chainID] = sdk.ZeroDec() - for _, entry := range stakeStorage.StakeEntries { + for _, entry := range stakeEntries { chainStake[chainID] = chainStake[chainID].Add(sdk.NewDecFromInt(entry.EffectiveStake())) } @@ -173,7 +179,7 @@ func (k Keeper) specProvidersBasePay(ctx sdk.Context, chainID string, pop bool) totalBasePay := math.ZeroInt() for _, basepay := range basepays { - totalBasePay = totalBasePay.Add(basepay.Total) + totalBasePay = totalBasePay.Add(basepay.BasePay.Total) } return basepays, totalBasePay } @@ -189,12 +195,12 @@ func (k Keeper) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward s } // send validators participation + validatorPool := types.ValidatorsRewardsDistributionPoolName if !validatorsParticipationReward.AmountOf(reward.Denom).IsZero() { - pool := types.ValidatorsRewardsDistributionPoolName if k.isEndOfMonth(ctx) { - pool = types.ValidatorsRewardsAllocationPoolName + validatorPool = types.ValidatorsRewardsLeftOverPoolName } - err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, senderModule, string(pool), validatorsParticipationReward) + err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, senderModule, string(validatorPool), validatorsParticipationReward) if err != nil { return reward, utils.LavaFormatError("sending validators participation failed", err, utils.Attribute{Key: "validators_participation_reward", Value: validatorsParticipationReward.String()}, @@ -214,6 +220,10 @@ func (k Keeper) ContributeToValidatorsAndCommunityPool(ctx sdk.Context, reward s } } + utils.LogLavaEvent(ctx, ctx.Logger(), types.ValidatorsAndCommunityFund, + map[string]string{"community": communityParticipationReward.String(), "validators": validatorsParticipationReward.String(), "validator_pool": string(validatorPool)}, + "contribution to validators pool and community pool") + // update reward amount reward = reward.SubAmount(communityParticipationReward.AmountOf(reward.Denom)).SubAmount(validatorsParticipationReward.AmountOf(reward.Denom)) @@ -250,7 +260,7 @@ func (k Keeper) CalculateValidatorsAndCommunityParticipationRewards(ctx sdk.Cont // CalculateContributionPercentages calculates the providers' rewards participation to the validators and community pool func (k Keeper) CalculateContributionPercentages(ctx sdk.Context, reward math.Int) (validatorsParticipation math.LegacyDec, communityParticipation math.LegacyDec, err error) { - communityTax := k.distributionKeeper.GetParams(ctx).CommunityTax + communityTax := k.GetCommunityTax(ctx) if communityTax.Equal(sdk.OneDec()) { return sdk.ZeroDec(), sdk.OneDec(), nil } @@ -302,5 +312,16 @@ func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, amount sdk.Coins, s // isEndOfMonth checks that we're close to next timer expiry by at least 24 hours func (k Keeper) isEndOfMonth(ctx sdk.Context) bool { - return ctx.BlockTime().UTC().Unix()+DAY_SECONDS > k.TimeToNextTimerExpiry(ctx) + _, expiries, _ := k.refillRewardsPoolTS.GetFrontTimers(ctx, timerstoretypes.BlockTime) + if len(expiries) == 0 { + // there is no next timer, this is called in between the end and start of the new timer this is the end of the month + return true + } + + NextExpiery := int64(expiries[0]) - ctx.BlockTime().UTC().Unix() + return ctx.BlockTime().UTC().Unix()+DAY_SECONDS > NextExpiery +} + +func (k Keeper) GetCommunityTax(ctx sdk.Context) math.LegacyDec { + return k.distributionKeeper.GetParams(ctx).CommunityTax } diff --git a/x/rewards/keeper/providers_test.go b/x/rewards/keeper/providers_test.go index 50a85b3bc5..f9fb6b80e6 100644 --- a/x/rewards/keeper/providers_test.go +++ b/x/rewards/keeper/providers_test.go @@ -6,10 +6,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/lavanet/lava/testutil/common" - "github.com/lavanet/lava/utils/sigs" - "github.com/lavanet/lava/x/rewards/types" - subscription "github.com/lavanet/lava/x/subscription/keeper" + "github.com/lavanet/lava/v2/testutil/common" + "github.com/lavanet/lava/v2/utils/sigs" + "github.com/lavanet/lava/v2/x/rewards/types" + subscription "github.com/lavanet/lava/v2/x/subscription/keeper" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/keeper/rewards.go b/x/rewards/keeper/rewards.go index 1d2944259e..985e6d7fd9 100644 --- a/x/rewards/keeper/rewards.go +++ b/x/rewards/keeper/rewards.go @@ -9,9 +9,9 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/rewards/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) func (k Keeper) DistributeBlockReward(ctx sdk.Context) { @@ -20,8 +20,7 @@ func (k Keeper) DistributeBlockReward(ctx sdk.Context) { blocksToNextTimerExpiry := k.BlocksToNextTimerExpiry(ctx) // get validator distribution pool balance - coins := k.TotalPoolTokens(ctx, types.ValidatorsRewardsDistributionPoolName) - distributionPoolBalance := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) + distributionPoolBalance := k.TotalPoolTokens(ctx, types.ValidatorsRewardsDistributionPoolName) if blocksToNextTimerExpiry == 0 { utils.LavaFormatWarning("blocksToNextTimerExpiry is zero", fmt.Errorf("critical: Attempt to divide by zero"), utils.LogAttr("blocksToNextTimerExpiry", blocksToNextTimerExpiry), @@ -31,15 +30,13 @@ func (k Keeper) DistributeBlockReward(ctx sdk.Context) { } // validators bonus rewards = (distributionPoolBalance * bondedTargetFactor) / blocksToNextTimerExpiry - validatorsRewards := bondedTargetFactor.MulInt(distributionPoolBalance).QuoInt64(blocksToNextTimerExpiry).TruncateInt() + validatorsRewards, _ := sdk.NewDecCoinsFromCoins(distributionPoolBalance...).MulDec(bondedTargetFactor).QuoDecTruncate(sdk.NewDec(blocksToNextTimerExpiry)).TruncateDecimal() if !validatorsRewards.IsZero() { - coins := sdk.NewCoins(sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), validatorsRewards)) - // distribute rewards to validators (same as Cosmos mint module) - err := k.addCollectedFees(ctx, coins) + err := k.addCollectedFees(ctx, validatorsRewards) if err != nil { utils.LavaFormatWarning("could not send validators rewards to fee collector", err, - utils.Attribute{Key: "rewards", Value: coins.String()}, + utils.Attribute{Key: "rewards", Value: validatorsRewards.String()}, ) } } @@ -71,6 +68,7 @@ func (k Keeper) RefillRewardsPools(ctx sdk.Context, _ []byte, data []byte) { burnRate := k.GetParams(ctx).LeftoverBurnRate k.refillDistributionPool(ctx, monthsLeft, types.ValidatorsRewardsAllocationPoolName, types.ValidatorsRewardsDistributionPoolName, burnRate) k.refillDistributionPool(ctx, monthsLeft, types.ProvidersRewardsAllocationPool, types.ProviderRewardsDistributionPool, sdk.OneDec()) + k.MovePoolToPool(ctx, types.ValidatorsRewardsLeftOverPoolName, types.ValidatorsRewardsDistributionPoolName) if monthsLeft > 1 { monthsLeft -= 1 @@ -101,6 +99,22 @@ func (k Keeper) RefillRewardsPools(ctx sdk.Context, _ []byte, data []byte) { utils.LogLavaEvent(ctx, k.Logger(ctx), types.DistributionPoolRefillEventName, details, "distribution rewards pools refilled successfully") } +func (k Keeper) MovePoolToPool(ctx sdk.Context, from types.Pool, to types.Pool) { + coins := k.TotalPoolTokens(ctx, from) + if coins.IsZero() { + return + } + err := k.bankKeeper.SendCoinsFromModuleToModule( + ctx, + string(from), + string(to), + coins, + ) + if err != nil { + panic(err) + } +} + func (k Keeper) refillDistributionPool(ctx sdk.Context, monthsLeft uint64, allocationPool types.Pool, distributionPool types.Pool, burnRate sdkmath.LegacyDec) { // burn remaining tokens in the distribution pool coins := k.TotalPoolTokens(ctx, distributionPool) diff --git a/x/rewards/module.go b/x/rewards/module.go index cba6a9c05d..4e7b329001 100644 --- a/x/rewards/module.go +++ b/x/rewards/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/rewards/client/cli" - "github.com/lavanet/lava/x/rewards/keeper" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/client/cli" + "github.com/lavanet/lava/v2/x/rewards/keeper" + "github.com/lavanet/lava/v2/x/rewards/types" ) var ( diff --git a/x/rewards/module_simulation.go b/x/rewards/module_simulation.go index 12f1c937b6..a0cc57d889 100644 --- a/x/rewards/module_simulation.go +++ b/x/rewards/module_simulation.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - rewardssimulation "github.com/lavanet/lava/x/rewards/simulation" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/testutil/sample" + rewardssimulation "github.com/lavanet/lava/v2/x/rewards/simulation" + "github.com/lavanet/lava/v2/x/rewards/types" ) // avoid unused import issue diff --git a/x/rewards/types/base_pay.go b/x/rewards/types/base_pay.go index f654bcd40c..39f0713118 100644 --- a/x/rewards/types/base_pay.go +++ b/x/rewards/types/base_pay.go @@ -9,25 +9,15 @@ const ( BasePayPrefix = "BasePay/" ) -type BasePayIndex struct { - Provider string - ChainID string -} - -type BasePayWithIndex struct { - BasePayIndex - BasePay -} - const ( serializedFormat = "%s %s" ) -func (bp BasePayIndex) String() string { - return fmt.Sprintf(serializedFormat, bp.ChainID, bp.Provider) +func (bp BasePayWithIndex) Index() string { + return fmt.Sprintf(serializedFormat, bp.ChainId, bp.Provider) } -func BasePayKeyRecover(key string) (bp BasePayIndex) { - fmt.Sscanf(key, serializedFormat, &bp.ChainID, &bp.Provider) +func BasePayKeyRecover(key string) (bp BasePayWithIndex) { + fmt.Sscanf(key, serializedFormat, &bp.ChainId, &bp.Provider) return bp } diff --git a/x/rewards/types/base_pay.pb.go b/x/rewards/types/base_pay.pb.go index e5ef1b4193..ffd5daad87 100644 --- a/x/rewards/types/base_pay.pb.go +++ b/x/rewards/types/base_pay.pb.go @@ -75,23 +75,24 @@ func (m *BasePay) GetIprpcCu() uint64 { } // aggregated rewards for the provider through out the month -type BasePayGenesis struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - BasePay BasePay `protobuf:"bytes,2,opt,name=base_pay,json=basePay,proto3" json:"base_pay"` +type BasePayWithIndex struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + BasePay BasePay `protobuf:"bytes,3,opt,name=base_pay,json=basePay,proto3" json:"base_pay"` } -func (m *BasePayGenesis) Reset() { *m = BasePayGenesis{} } -func (m *BasePayGenesis) String() string { return proto.CompactTextString(m) } -func (*BasePayGenesis) ProtoMessage() {} -func (*BasePayGenesis) Descriptor() ([]byte, []int) { +func (m *BasePayWithIndex) Reset() { *m = BasePayWithIndex{} } +func (m *BasePayWithIndex) String() string { return proto.CompactTextString(m) } +func (*BasePayWithIndex) ProtoMessage() {} +func (*BasePayWithIndex) Descriptor() ([]byte, []int) { return fileDescriptor_a2fb0eb917a4ee4e, []int{1} } -func (m *BasePayGenesis) XXX_Unmarshal(b []byte) error { +func (m *BasePayWithIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *BasePayGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *BasePayWithIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_BasePayGenesis.Marshal(b, m, deterministic) + return xxx_messageInfo_BasePayWithIndex.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -101,26 +102,33 @@ func (m *BasePayGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *BasePayGenesis) XXX_Merge(src proto.Message) { - xxx_messageInfo_BasePayGenesis.Merge(m, src) +func (m *BasePayWithIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasePayWithIndex.Merge(m, src) } -func (m *BasePayGenesis) XXX_Size() int { +func (m *BasePayWithIndex) XXX_Size() int { return m.Size() } -func (m *BasePayGenesis) XXX_DiscardUnknown() { - xxx_messageInfo_BasePayGenesis.DiscardUnknown(m) +func (m *BasePayWithIndex) XXX_DiscardUnknown() { + xxx_messageInfo_BasePayWithIndex.DiscardUnknown(m) } -var xxx_messageInfo_BasePayGenesis proto.InternalMessageInfo +var xxx_messageInfo_BasePayWithIndex proto.InternalMessageInfo -func (m *BasePayGenesis) GetIndex() string { +func (m *BasePayWithIndex) GetProvider() string { if m != nil { - return m.Index + return m.Provider } return "" } -func (m *BasePayGenesis) GetBasePay() BasePay { +func (m *BasePayWithIndex) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *BasePayWithIndex) GetBasePay() BasePay { if m != nil { return m.BasePay } @@ -129,7 +137,7 @@ func (m *BasePayGenesis) GetBasePay() BasePay { func init() { proto.RegisterType((*BasePay)(nil), "lavanet.lava.rewards.BasePay") - proto.RegisterType((*BasePayGenesis)(nil), "lavanet.lava.rewards.BasePayGenesis") + proto.RegisterType((*BasePayWithIndex)(nil), "lavanet.lava.rewards.BasePayWithIndex") } func init() { @@ -137,29 +145,31 @@ func init() { } var fileDescriptor_a2fb0eb917a4ee4e = []byte{ - // 349 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x51, 0xc1, 0x4e, 0x02, 0x31, - 0x14, 0xdc, 0x2a, 0x08, 0xd6, 0x68, 0xe2, 0x86, 0x03, 0x90, 0x58, 0x08, 0x26, 0xca, 0x85, 0x36, - 0xe8, 0xd5, 0x98, 0x80, 0x26, 0x86, 0x9b, 0xd9, 0x78, 0xf2, 0x42, 0xba, 0xbb, 0x15, 0x57, 0xa1, - 0xdd, 0x6c, 0xbb, 0x08, 0x7f, 0xe1, 0xc7, 0xf8, 0x11, 0x9c, 0x0c, 0xf1, 0x64, 0x3c, 0x10, 0x03, - 0x3f, 0x62, 0xb6, 0xad, 0x46, 0x12, 0x2f, 0x5e, 0xfa, 0xde, 0xf4, 0x4d, 0xa7, 0x6f, 0x32, 0xf0, - 0x70, 0x48, 0xc7, 0x94, 0x33, 0x45, 0xb2, 0x4a, 0x12, 0xf6, 0x44, 0x93, 0x50, 0x12, 0x9f, 0x4a, - 0xd6, 0x8f, 0xe9, 0x14, 0xc7, 0x89, 0x50, 0xc2, 0x2d, 0x59, 0x12, 0xce, 0x2a, 0xb6, 0xa4, 0x6a, - 0x69, 0x20, 0x06, 0x42, 0x13, 0x48, 0xd6, 0x19, 0x6e, 0x15, 0x05, 0x42, 0x8e, 0x84, 0x91, 0x20, - 0xe3, 0xb6, 0xcf, 0x14, 0x6d, 0x93, 0x40, 0x44, 0xdc, 0xce, 0x2b, 0x66, 0xde, 0x37, 0x0f, 0x0d, - 0xb0, 0xa3, 0x7d, 0x3a, 0x8a, 0xb8, 0x20, 0xfa, 0x34, 0x57, 0x8d, 0x57, 0x00, 0x0b, 0x5d, 0x2a, - 0xd9, 0x35, 0x9d, 0xba, 0x1e, 0xcc, 0x2b, 0xa1, 0xe8, 0xb0, 0x0c, 0xea, 0xa0, 0xb9, 0xdd, 0x3d, - 0x9b, 0x2d, 0x6a, 0xce, 0xc7, 0xa2, 0x76, 0x34, 0x88, 0xd4, 0x7d, 0xea, 0xe3, 0x40, 0x8c, 0xac, - 0x9c, 0x2d, 0x2d, 0x19, 0x3e, 0x12, 0x35, 0x8d, 0x99, 0xc4, 0x3d, 0xae, 0xde, 0x5e, 0x5a, 0xd0, - 0xfe, 0xd6, 0xe3, 0xca, 0x33, 0x52, 0xee, 0x0d, 0xdc, 0xd5, 0x4d, 0x27, 0x7c, 0x48, 0xa5, 0x62, - 0x61, 0x79, 0x43, 0x6b, 0xe3, 0x7f, 0x68, 0x5f, 0xb2, 0xc0, 0x5b, 0x17, 0x71, 0x2b, 0xb0, 0x18, - 0xc5, 0x49, 0x1c, 0xf4, 0x83, 0xb4, 0xbc, 0x59, 0x07, 0xcd, 0x9c, 0x57, 0xd0, 0xf8, 0x22, 0x6d, - 0xdc, 0xc1, 0x3d, 0xeb, 0xe7, 0x8a, 0x71, 0x26, 0x23, 0xe9, 0x96, 0x60, 0x3e, 0xe2, 0x21, 0x9b, - 0x18, 0x5b, 0x9e, 0x01, 0xee, 0x39, 0x2c, 0x7e, 0x87, 0xa0, 0x77, 0xda, 0x39, 0x39, 0xc0, 0x7f, - 0xa5, 0x80, 0xad, 0x5a, 0x37, 0x97, 0xad, 0xec, 0x15, 0x7c, 0x0b, 0x3b, 0xb3, 0x25, 0x02, 0xf3, - 0x25, 0x02, 0x9f, 0x4b, 0x04, 0x9e, 0x57, 0xc8, 0x99, 0xaf, 0x90, 0xf3, 0xbe, 0x42, 0xce, 0xed, - 0xf1, 0x2f, 0x4f, 0x6b, 0xe1, 0x4f, 0x7e, 0xe2, 0xd7, 0xc6, 0xfc, 0x2d, 0x1d, 0xc1, 0xe9, 0x57, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x24, 0x2a, 0x65, 0x23, 0x02, 0x00, 0x00, + // 375 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xc1, 0x4a, 0xeb, 0x40, + 0x14, 0xcd, 0xbc, 0xd7, 0xf7, 0x52, 0x47, 0x04, 0x0d, 0x5d, 0xb4, 0x05, 0xd3, 0x52, 0x41, 0x8a, + 0xd0, 0x19, 0x5a, 0xb7, 0x22, 0x58, 0xbb, 0xc9, 0x4e, 0x82, 0x20, 0xb8, 0x09, 0x93, 0x64, 0x68, + 0x47, 0xdb, 0x4c, 0x48, 0x26, 0xb1, 0xfd, 0x04, 0x77, 0x7e, 0x8c, 0x1f, 0xd1, 0x95, 0x14, 0x57, + 0xe2, 0xa2, 0x48, 0xfb, 0x23, 0x92, 0x99, 0xb1, 0x58, 0x70, 0xe3, 0x26, 0xf7, 0x9e, 0x7b, 0x6f, + 0xce, 0x9d, 0xc3, 0xb9, 0xf0, 0x68, 0x4c, 0x72, 0x12, 0x51, 0x81, 0x8b, 0x88, 0x13, 0xfa, 0x40, + 0x92, 0x30, 0xc5, 0x3e, 0x49, 0xa9, 0x17, 0x93, 0x19, 0x8a, 0x13, 0x2e, 0xb8, 0x55, 0xd1, 0x43, + 0xa8, 0x88, 0x48, 0x0f, 0xd5, 0x0f, 0xc8, 0x84, 0x45, 0x1c, 0xcb, 0xaf, 0x1a, 0xac, 0xdb, 0x01, + 0x4f, 0x27, 0x5c, 0xfd, 0x8f, 0xf3, 0xae, 0x4f, 0x05, 0xe9, 0xe2, 0x80, 0xb3, 0x48, 0xf7, 0x6b, + 0xaa, 0xef, 0x49, 0x84, 0x15, 0xd0, 0xad, 0xca, 0x90, 0x0f, 0xb9, 0xaa, 0x17, 0x99, 0xaa, 0xb6, + 0x5e, 0x00, 0x34, 0xfb, 0x24, 0xa5, 0x57, 0x64, 0x66, 0xb9, 0xf0, 0x9f, 0xe0, 0x82, 0x8c, 0xab, + 0xa0, 0x09, 0xda, 0x3b, 0xfd, 0xb3, 0xf9, 0xb2, 0x61, 0xbc, 0x2f, 0x1b, 0xc7, 0x43, 0x26, 0x46, + 0x99, 0x8f, 0x02, 0x3e, 0xd1, 0x8c, 0x3a, 0x74, 0xd2, 0xf0, 0x1e, 0x8b, 0x59, 0x4c, 0x53, 0xe4, + 0x44, 0xe2, 0xf5, 0xb9, 0x03, 0xf5, 0x42, 0x27, 0x12, 0xae, 0xa2, 0xb2, 0xae, 0xe1, 0x9e, 0x4c, + 0x2e, 0xc2, 0xbb, 0x2c, 0x15, 0x34, 0xac, 0xfe, 0x91, 0xdc, 0xe8, 0x17, 0xdc, 0x03, 0x1a, 0xb8, + 0xdb, 0x24, 0x56, 0x0d, 0x96, 0x59, 0x9c, 0xc4, 0x81, 0x17, 0x64, 0xd5, 0xbf, 0x4d, 0xd0, 0x2e, + 0xb9, 0xa6, 0xc4, 0x97, 0x59, 0xeb, 0x11, 0xc0, 0x7d, 0x2d, 0xe8, 0x86, 0x89, 0x91, 0x13, 0x85, + 0x74, 0x6a, 0xd5, 0x61, 0x39, 0x4e, 0x78, 0xce, 0x42, 0x9a, 0x28, 0x71, 0xee, 0x06, 0x17, 0x5c, + 0xc1, 0x88, 0xb0, 0xc8, 0x63, 0xfa, 0x71, 0xae, 0x29, 0xb1, 0x13, 0x5a, 0xe7, 0xb0, 0xfc, 0x65, + 0x94, 0x5c, 0xb3, 0xdb, 0x3b, 0x44, 0x3f, 0x39, 0x85, 0xf4, 0xc2, 0x7e, 0xa9, 0x90, 0xe5, 0x9a, + 0xbe, 0x86, 0x83, 0xf9, 0xca, 0x06, 0x8b, 0x95, 0x0d, 0x3e, 0x56, 0x36, 0x78, 0x5a, 0xdb, 0xc6, + 0x62, 0x6d, 0x1b, 0x6f, 0x6b, 0xdb, 0xb8, 0x3d, 0xf9, 0xa6, 0x7b, 0xeb, 0x40, 0xf2, 0x1e, 0x9e, + 0x6e, 0xae, 0x44, 0xea, 0xf7, 0xff, 0x4b, 0xa7, 0x4e, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x57, + 0x67, 0x61, 0x46, 0x4a, 0x02, 0x00, 0x00, } func (m *BasePay) Marshal() (dAtA []byte, err error) { @@ -210,7 +220,7 @@ func (m *BasePay) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BasePayGenesis) Marshal() (dAtA []byte, err error) { +func (m *BasePayWithIndex) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -220,12 +230,12 @@ func (m *BasePayGenesis) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BasePayGenesis) MarshalTo(dAtA []byte) (int, error) { +func (m *BasePayWithIndex) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BasePayGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *BasePayWithIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -239,11 +249,18 @@ func (m *BasePayGenesis) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintBasePay(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintBasePay(dAtA, i, uint64(len(m.Index))) + dAtA[i] = 0x1a + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintBasePay(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintBasePay(dAtA, i, uint64(len(m.Provider))) i-- dAtA[i] = 0xa } @@ -277,13 +294,17 @@ func (m *BasePay) Size() (n int) { return n } -func (m *BasePayGenesis) Size() (n int) { +func (m *BasePayWithIndex) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Index) + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovBasePay(uint64(l)) + } + l = len(m.ChainId) if l > 0 { n += 1 + l + sovBasePay(uint64(l)) } @@ -435,7 +456,7 @@ func (m *BasePay) Unmarshal(dAtA []byte) error { } return nil } -func (m *BasePayGenesis) Unmarshal(dAtA []byte) error { +func (m *BasePayWithIndex) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -458,15 +479,15 @@ func (m *BasePayGenesis) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: BasePayGenesis: wiretype end group for non-group") + return fmt.Errorf("proto: BasePayWithIndex: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: BasePayGenesis: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BasePayWithIndex: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -494,9 +515,41 @@ func (m *BasePayGenesis) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Index = string(dAtA[iNdEx:postIndex]) + m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBasePay + } + 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 ErrInvalidLengthBasePay + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBasePay + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BasePay", wireType) } diff --git a/x/rewards/types/codec.go b/x/rewards/types/codec.go index 8ec03098ef..ee962eae5d 100644 --- a/x/rewards/types/codec.go +++ b/x/rewards/types/codec.go @@ -3,6 +3,7 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" // this line is used by starport scaffolding # 1 @@ -26,5 +27,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + ModuleCdc = codec.NewAminoCodec(Amino) + // ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterCodec(Amino) + cryptocodec.RegisterCrypto(Amino) + Amino.Seal() +} diff --git a/x/rewards/types/expected_keepers.go b/x/rewards/types/expected_keepers.go index 118ea7e94d..a1cb0221f6 100644 --- a/x/rewards/types/expected_keepers.go +++ b/x/rewards/types/expected_keepers.go @@ -5,10 +5,10 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - v1 "github.com/lavanet/lava/x/downtime/v1" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - spectypes "github.com/lavanet/lava/x/spec/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + v1 "github.com/lavanet/lava/v2/x/downtime/v1" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -38,8 +38,8 @@ type TimerStoreKeeper interface { } type EpochstorageKeeper interface { - GetStakeStorageCurrent(ctx sdk.Context, chainID string) (epochstoragetypes.StakeStorage, bool) - GetStakeEntryByAddressCurrent(ctx sdk.Context, chainID string, address string) (epochstoragetypes.StakeEntry, bool) + GetStakeEntryCurrent(ctx sdk.Context, chainID string, address string) (epochstoragetypes.StakeEntry, bool) + GetAllStakeEntriesCurrentForChainId(ctx sdk.Context, chainID string) []epochstoragetypes.StakeEntry } type DowntimeKeeper interface { @@ -53,7 +53,7 @@ type StakingKeeper interface { } type DualStakingKeeper interface { - RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributer bool) (providerReward sdk.Coins, totalRewards sdk.Coins, err error) + RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributor bool) (providerReward sdk.Coins, totalRewards sdk.Coins, err error) // Methods imported from bank should be defined here } diff --git a/x/rewards/types/genesis.go b/x/rewards/types/genesis.go index 217ed9506d..ee49ca9b72 100644 --- a/x/rewards/types/genesis.go +++ b/x/rewards/types/genesis.go @@ -4,8 +4,8 @@ import ( fmt "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/x/timerstore/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/timerstore/types" ) // this line is used by starport scaffolding # genesis/types/import @@ -19,7 +19,7 @@ func DefaultGenesis() *GenesisState { // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), RefillRewardsTS: *types.DefaultGenesis(), - BasePays: []BasePayGenesis{}, + BasePays: []BasePayWithIndex{}, IprpcSubscriptions: []string{}, MinIprpcCost: sdk.NewCoin(commontypes.TokenDenom, sdk.ZeroInt()), IprpcRewards: []IprpcReward{}, diff --git a/x/rewards/types/genesis.pb.go b/x/rewards/types/genesis.pb.go index d39a2fc306..584818111e 100644 --- a/x/rewards/types/genesis.pb.go +++ b/x/rewards/types/genesis.pb.go @@ -8,7 +8,7 @@ import ( types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/timerstore/types" + types "github.com/lavanet/lava/v2/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -29,7 +29,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` RefillRewardsTS types.GenesisState `protobuf:"bytes,2,opt,name=refillRewardsTS,proto3" json:"refillRewardsTS"` - BasePays []BasePayGenesis `protobuf:"bytes,3,rep,name=base_pays,json=basePays,proto3" json:"base_pays"` + BasePays []BasePayWithIndex `protobuf:"bytes,3,rep,name=base_pays,json=basePays,proto3" json:"base_pays"` IprpcSubscriptions []string `protobuf:"bytes,4,rep,name=iprpc_subscriptions,json=iprpcSubscriptions,proto3" json:"iprpc_subscriptions,omitempty"` MinIprpcCost types1.Coin `protobuf:"bytes,5,opt,name=min_iprpc_cost,json=minIprpcCost,proto3" json:"min_iprpc_cost"` IprpcRewards []IprpcReward `protobuf:"bytes,6,rep,name=iprpc_rewards,json=iprpcRewards,proto3" json:"iprpc_rewards"` @@ -83,7 +83,7 @@ func (m *GenesisState) GetRefillRewardsTS() types.GenesisState { return types.GenesisState{} } -func (m *GenesisState) GetBasePays() []BasePayGenesis { +func (m *GenesisState) GetBasePays() []BasePayWithIndex { if m != nil { return m.BasePays } @@ -127,34 +127,35 @@ func init() { } var fileDescriptor_02c24f4df31ca14e = []byte{ - // 429 bytes of a gzipped FileDescriptorProto + // 442 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0x80, 0x13, 0x52, 0x0a, 0xf3, 0x06, 0x48, 0xde, 0x90, 0x42, 0x85, 0x42, 0x36, 0x40, 0xe4, - 0x64, 0x6b, 0xe5, 0xc6, 0x8d, 0x56, 0x68, 0x42, 0xe2, 0x30, 0xa5, 0x70, 0xe1, 0x12, 0x39, 0xc1, - 0x04, 0x4b, 0x8d, 0x1d, 0xf9, 0xb9, 0x83, 0xfe, 0x0b, 0x7e, 0xd6, 0x8e, 0x3b, 0x72, 0x42, 0xa8, - 0xe5, 0x87, 0xa0, 0xd8, 0x2e, 0x6d, 0xa7, 0x9c, 0x6c, 0xf9, 0x7d, 0xef, 0xf3, 0x7b, 0x4f, 0x0f, - 0x9d, 0xcd, 0xd9, 0x15, 0x93, 0xdc, 0xd0, 0xee, 0xa4, 0x9a, 0x7f, 0x67, 0xfa, 0x0b, 0xd0, 0x9a, - 0x4b, 0x0e, 0x02, 0x48, 0xab, 0x95, 0x51, 0xf8, 0xc4, 0x33, 0xa4, 0x3b, 0x89, 0x67, 0x46, 0x27, - 0xb5, 0xaa, 0x95, 0x05, 0x68, 0x77, 0x73, 0xec, 0xe8, 0xb4, 0xd7, 0xd7, 0x32, 0xcd, 0x1a, 0xaf, - 0x1b, 0x3d, 0xef, 0x45, 0x4a, 0x06, 0xbc, 0x68, 0xd9, 0xd2, 0x43, 0x69, 0x2f, 0x24, 0x5a, 0xdd, - 0x56, 0xbd, 0x1a, 0x23, 0x1a, 0xae, 0xc1, 0x28, 0xcd, 0xdd, 0xd5, 0x43, 0x49, 0xa5, 0xa0, 0x51, - 0xce, 0x4e, 0xaf, 0xce, 0x4b, 0x6e, 0xd8, 0x39, 0xad, 0x94, 0x90, 0x2e, 0x7e, 0xf6, 0x37, 0x42, - 0x47, 0x17, 0xae, 0xd9, 0x99, 0x61, 0x86, 0xe3, 0x37, 0x68, 0xe8, 0x8a, 0x8d, 0xc3, 0x34, 0xcc, - 0x0e, 0xc7, 0x4f, 0x49, 0x5f, 0xf3, 0xe4, 0xd2, 0x32, 0x93, 0xc1, 0xf5, 0xef, 0x67, 0x41, 0xee, - 0x33, 0xf0, 0x27, 0xf4, 0x48, 0xf3, 0xaf, 0x62, 0x3e, 0xcf, 0x1d, 0xf5, 0x71, 0x16, 0xdf, 0xb1, - 0x92, 0x97, 0xfb, 0x92, 0x6d, 0xad, 0x64, 0xf7, 0x6f, 0x6f, 0xbb, 0xed, 0xc0, 0x17, 0xe8, 0x60, - 0x33, 0x1c, 0x88, 0xa3, 0x34, 0xca, 0x0e, 0xc7, 0x2f, 0xfa, 0xab, 0x9a, 0x30, 0xe0, 0x97, 0x6c, - 0xe9, 0xa5, 0xde, 0x77, 0xbf, 0x74, 0xaf, 0x80, 0x29, 0x3a, 0xb6, 0x03, 0x2c, 0x60, 0x51, 0x42, - 0xa5, 0x45, 0x6b, 0x84, 0x92, 0x10, 0x0f, 0xd2, 0x28, 0x3b, 0xc8, 0xb1, 0x0d, 0xcd, 0x76, 0x23, - 0xf8, 0x1d, 0x7a, 0xd8, 0x08, 0x59, 0xb8, 0xa4, 0x4a, 0x81, 0x89, 0xef, 0xda, 0x7e, 0x9e, 0x10, - 0x37, 0x56, 0xd2, 0xa9, 0x89, 0x1f, 0x2b, 0x99, 0x2a, 0x21, 0xfd, 0x9f, 0x47, 0x8d, 0x90, 0xef, - 0xbb, 0xac, 0xa9, 0x02, 0x83, 0x3f, 0xa0, 0x07, 0x4e, 0xe1, 0xeb, 0x8c, 0x87, 0xb6, 0x89, 0xd3, - 0xfe, 0x26, 0x6c, 0x9e, 0xeb, 0x7e, 0x63, 0x13, 0xdb, 0x27, 0xc0, 0x63, 0xf4, 0x78, 0xcf, 0x56, - 0x54, 0x0b, 0xad, 0xb9, 0x34, 0xf1, 0xbd, 0x34, 0xcc, 0x06, 0xf9, 0xf1, 0x2e, 0x3c, 0x75, 0xa1, - 0xc9, 0xdb, 0xeb, 0x55, 0x12, 0xde, 0xac, 0x92, 0xf0, 0xcf, 0x2a, 0x09, 0x7f, 0xae, 0x93, 0xe0, - 0x66, 0x9d, 0x04, 0xbf, 0xd6, 0x49, 0xf0, 0xf9, 0x55, 0x2d, 0xcc, 0xb7, 0x45, 0x49, 0x2a, 0xd5, - 0xd0, 0xbd, 0x85, 0xfa, 0xf1, 0x7f, 0xe9, 0xcc, 0xb2, 0xe5, 0x50, 0x0e, 0xed, 0xc2, 0xbc, 0xfe, - 0x17, 0x00, 0x00, 0xff, 0xff, 0x15, 0xb1, 0xb4, 0xbe, 0x31, 0x03, 0x00, 0x00, + 0x14, 0xc7, 0x1b, 0x5a, 0x0a, 0xf3, 0x06, 0x48, 0xde, 0x90, 0xc2, 0x84, 0x42, 0x36, 0x04, 0x8a, + 0x38, 0xd8, 0x5a, 0xb8, 0x71, 0x6c, 0x41, 0xa8, 0x12, 0x87, 0x29, 0x05, 0x21, 0x71, 0x89, 0x9c, + 0xcc, 0x64, 0x96, 0x1a, 0x3b, 0xf2, 0x73, 0xcb, 0xfa, 0x2d, 0xf8, 0x58, 0x3b, 0xee, 0xc8, 0x09, + 0xa1, 0x56, 0xe2, 0x73, 0xa0, 0xd8, 0x1e, 0x6d, 0xa7, 0x9c, 0x6c, 0xbd, 0xf7, 0x7f, 0xbf, 0xf7, + 0xfe, 0xf6, 0x43, 0xa7, 0x33, 0xb6, 0x60, 0x92, 0x1b, 0xda, 0x9e, 0x54, 0xf3, 0x1f, 0x4c, 0x5f, + 0x00, 0xad, 0xb8, 0xe4, 0x20, 0x80, 0x34, 0x5a, 0x19, 0x85, 0x8f, 0xbc, 0x86, 0xb4, 0x27, 0xf1, + 0x9a, 0xe3, 0xa8, 0x54, 0x50, 0x2b, 0xa0, 0x05, 0x03, 0x4e, 0x17, 0x67, 0x05, 0x37, 0xec, 0x8c, + 0x96, 0x4a, 0x48, 0x57, 0x75, 0x7c, 0x54, 0xa9, 0x4a, 0xd9, 0x2b, 0x6d, 0x6f, 0x3e, 0xfa, 0xb2, + 0xb3, 0x5f, 0xcb, 0xc8, 0x1b, 0xb6, 0xf4, 0xa2, 0xb8, 0x53, 0x24, 0x1a, 0xdd, 0x94, 0x5e, 0x71, + 0xd2, 0xa9, 0x68, 0x98, 0x66, 0x35, 0x74, 0x76, 0x32, 0xa2, 0xe6, 0x1a, 0x8c, 0xd2, 0xdc, 0x5d, + 0x9d, 0xe8, 0xf4, 0x6f, 0x1f, 0x1d, 0x7c, 0x74, 0x66, 0xa7, 0x86, 0x19, 0x8e, 0xdf, 0xa1, 0xa1, + 0xa3, 0x84, 0x41, 0x1c, 0x24, 0xfb, 0xe9, 0x73, 0xd2, 0x65, 0x9e, 0x9c, 0x5b, 0xcd, 0x68, 0x70, + 0xfd, 0xfb, 0x45, 0x2f, 0xf3, 0x15, 0xf8, 0x0b, 0x7a, 0xa2, 0xf9, 0x77, 0x31, 0x9b, 0x65, 0x4e, + 0xf5, 0x79, 0x1a, 0xde, 0xb3, 0x90, 0x57, 0xbb, 0x90, 0xcd, 0x2c, 0x64, 0xbb, 0xb7, 0xa7, 0xdd, + 0x65, 0xe0, 0x09, 0xda, 0xbb, 0x7d, 0x1f, 0x08, 0xfb, 0x71, 0x3f, 0xd9, 0x4f, 0x5f, 0x77, 0x4f, + 0x35, 0x62, 0xc0, 0xcf, 0xd9, 0xf2, 0xab, 0x30, 0x97, 0x13, 0x79, 0xc1, 0xaf, 0x3c, 0xf1, 0x61, + 0xe1, 0xe2, 0x80, 0x29, 0x3a, 0xb4, 0xaf, 0x98, 0xc3, 0xbc, 0x80, 0x52, 0x8b, 0xc6, 0x08, 0x25, + 0x21, 0x1c, 0xc4, 0xfd, 0x64, 0x2f, 0xc3, 0x36, 0x35, 0xdd, 0xce, 0xe0, 0x0f, 0xe8, 0x71, 0x2d, + 0x64, 0xee, 0x8a, 0x4a, 0x05, 0x26, 0xbc, 0x6f, 0x1d, 0x3d, 0x23, 0xee, 0xf7, 0x49, 0x8b, 0x26, + 0xfe, 0xf7, 0xc9, 0x58, 0x09, 0xe9, 0x7b, 0x1e, 0xd4, 0x42, 0x4e, 0xda, 0xaa, 0xb1, 0x02, 0x83, + 0x3f, 0xa1, 0x47, 0x0e, 0xe1, 0x27, 0x0d, 0x87, 0xd6, 0xc6, 0x49, 0xb7, 0x0d, 0x5b, 0xe7, 0xfc, + 0xdf, 0xd2, 0xc4, 0x26, 0x04, 0x38, 0x45, 0x4f, 0x77, 0x68, 0x79, 0x39, 0xd7, 0x9a, 0x4b, 0x13, + 0x3e, 0x88, 0x83, 0x64, 0x90, 0x1d, 0x6e, 0x8b, 0xc7, 0x2e, 0x35, 0x7a, 0x7f, 0xbd, 0x8a, 0x82, + 0x9b, 0x55, 0x14, 0xfc, 0x59, 0x45, 0xc1, 0xcf, 0x75, 0xd4, 0xbb, 0x59, 0x47, 0xbd, 0x5f, 0xeb, + 0xa8, 0xf7, 0xed, 0x4d, 0x25, 0xcc, 0xe5, 0xbc, 0x20, 0xa5, 0xaa, 0xe9, 0xce, 0xca, 0x2c, 0x52, + 0x7a, 0xf5, 0x7f, 0xb5, 0xcc, 0xb2, 0xe1, 0x50, 0x0c, 0xed, 0xd6, 0xbc, 0xfd, 0x17, 0x00, 0x00, + 0xff, 0xff, 0x45, 0xc2, 0x64, 0xfb, 0x36, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -429,7 +430,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BasePays = append(m.BasePays, BasePayGenesis{}) + m.BasePays = append(m.BasePays, BasePayWithIndex{}) if err := m.BasePays[len(m.BasePays)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/rewards/types/genesis_test.go b/x/rewards/types/genesis_test.go index e7745ca5ad..53e7c22a6d 100644 --- a/x/rewards/types/genesis_test.go +++ b/x/rewards/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/rewards/types" + "github.com/lavanet/lava/v2/x/rewards/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/types/iprpc.pb.go b/x/rewards/types/iprpc.pb.go index 7349489ce8..5ca61c024a 100644 --- a/x/rewards/types/iprpc.pb.go +++ b/x/rewards/types/iprpc.pb.go @@ -138,26 +138,26 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/iprpc.proto", fileDescriptor_1293618a311573f7) } var fileDescriptor_1293618a311573f7 = []byte{ - // 301 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4e, 0xf3, 0x30, - 0x14, 0x85, 0x93, 0xfc, 0xd1, 0x2f, 0xea, 0x4a, 0x0c, 0x56, 0x87, 0xd2, 0xc1, 0x8d, 0xba, 0x90, - 0x05, 0x9b, 0xc2, 0x13, 0x90, 0x4a, 0x48, 0xac, 0x61, 0x63, 0xa9, 0x12, 0xc7, 0x04, 0x0b, 0x1a, - 0x5b, 0x71, 0x5a, 0x60, 0xe2, 0x15, 0x78, 0x0e, 0x9e, 0xa4, 0x63, 0x47, 0x26, 0x40, 0xc9, 0x8b, - 0xa0, 0xeb, 0x18, 0x04, 0x12, 0xd3, 0xb5, 0x74, 0xce, 0xfd, 0xee, 0xf1, 0x41, 0xd1, 0x5d, 0xb6, - 0xc9, 0x2a, 0xd1, 0x30, 0x98, 0xac, 0x16, 0xf7, 0x59, 0x5d, 0x18, 0x26, 0x75, 0xad, 0x39, 0xd5, - 0xb5, 0x6a, 0x14, 0x1e, 0x39, 0x07, 0x85, 0x49, 0x9d, 0x63, 0x32, 0x2a, 0x55, 0xa9, 0xac, 0x81, - 0xc1, 0xab, 0xf7, 0x4e, 0x08, 0x57, 0x66, 0xa5, 0x0c, 0xcb, 0x33, 0x23, 0xd8, 0x66, 0x9e, 0x8b, - 0x26, 0x9b, 0x33, 0xae, 0x64, 0xd5, 0xeb, 0xb3, 0x1c, 0x0d, 0x2f, 0x00, 0x9d, 0x5a, 0x0a, 0xde, - 0x47, 0x81, 0x2c, 0xc6, 0x7e, 0xe4, 0xc7, 0x61, 0x1a, 0xc8, 0x02, 0x2f, 0x10, 0x32, 0x5a, 0xf0, - 0xe5, 0xf5, 0xba, 0x2a, 0xcc, 0x38, 0x88, 0xfe, 0xc5, 0xc3, 0x13, 0x42, 0xff, 0xba, 0x4f, 0x2f, - 0xb5, 0xe0, 0x60, 0x4b, 0xc2, 0xed, 0xdb, 0xd4, 0x4b, 0x07, 0xb0, 0x77, 0x0e, 0x6b, 0xb3, 0x27, - 0xb4, 0xf7, 0x25, 0x62, 0x8c, 0x42, 0x10, 0xec, 0x89, 0x41, 0x6a, 0xdf, 0x78, 0x89, 0x42, 0xd0, - 0x1c, 0xfe, 0x80, 0xf6, 0x91, 0x29, 0x44, 0xa6, 0x2e, 0x32, 0x5d, 0x28, 0x59, 0x25, 0xc7, 0x40, - 0x7e, 0x79, 0x9f, 0xc6, 0xa5, 0x6c, 0x6e, 0xd6, 0x39, 0xe5, 0x6a, 0xc5, 0xdc, 0xff, 0xfa, 0x71, - 0x64, 0x8a, 0x5b, 0xd6, 0x3c, 0x6a, 0x61, 0xec, 0x82, 0x49, 0x2d, 0x38, 0x39, 0xdb, 0xb6, 0xc4, - 0xdf, 0xb5, 0xc4, 0xff, 0x68, 0x89, 0xff, 0xdc, 0x11, 0x6f, 0xd7, 0x11, 0xef, 0xb5, 0x23, 0xde, - 0xd5, 0xe1, 0x0f, 0xd2, 0xaf, 0xde, 0x1f, 0xbe, 0x9b, 0xb7, 0xb8, 0xfc, 0xbf, 0xad, 0xeb, 0xf4, - 0x33, 0x00, 0x00, 0xff, 0xff, 0x19, 0x8c, 0x21, 0xa2, 0x9e, 0x01, 0x00, 0x00, + // 303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0x86, 0x93, 0x10, 0x21, 0xea, 0x4a, 0x0c, 0x56, 0x87, 0xd2, 0xc1, 0x8d, 0x3a, 0x45, 0x48, + 0xd8, 0xb4, 0xdc, 0x20, 0x45, 0x48, 0xac, 0x61, 0x63, 0xa9, 0x12, 0xc7, 0x04, 0x0b, 0x1a, 0x5b, + 0x71, 0x1a, 0x60, 0xe2, 0x0a, 0x9c, 0x83, 0x93, 0x74, 0xec, 0xc8, 0x04, 0x28, 0xb9, 0x08, 0x7a, + 0x4e, 0x40, 0x20, 0x31, 0x3d, 0x4b, 0xff, 0xff, 0xbe, 0xf7, 0xfb, 0x47, 0xc1, 0x7d, 0x52, 0x27, + 0x85, 0xa8, 0x18, 0x4c, 0x56, 0x8a, 0x87, 0xa4, 0xcc, 0x0c, 0x93, 0xba, 0xd4, 0x9c, 0xea, 0x52, + 0x55, 0x0a, 0x8f, 0x7a, 0x07, 0x85, 0x49, 0x7b, 0xc7, 0x64, 0x94, 0xab, 0x5c, 0x59, 0x03, 0x83, + 0x57, 0xe7, 0x9d, 0x10, 0xae, 0xcc, 0x5a, 0x19, 0x96, 0x26, 0x46, 0xb0, 0x7a, 0x9e, 0x8a, 0x2a, + 0x99, 0x33, 0xae, 0x64, 0xd1, 0xe9, 0xb3, 0x14, 0x0d, 0x2f, 0x01, 0x1d, 0x5b, 0x0a, 0x3e, 0x44, + 0x9e, 0xcc, 0xc6, 0x6e, 0xe0, 0x86, 0x7e, 0xec, 0xc9, 0x0c, 0x2f, 0x11, 0x32, 0x5a, 0xf0, 0xd5, + 0xcd, 0xa6, 0xc8, 0xcc, 0xd8, 0x0b, 0xf6, 0xc2, 0xe1, 0x82, 0xd0, 0xff, 0xee, 0xd3, 0x2b, 0x2d, + 0x38, 0xd8, 0x22, 0x7f, 0xfb, 0x3e, 0x75, 0xe2, 0x01, 0xec, 0x5d, 0xc0, 0xda, 0xec, 0x19, 0x1d, + 0x7c, 0x8b, 0x18, 0x23, 0x1f, 0x04, 0x7b, 0x62, 0x10, 0xdb, 0x37, 0x5e, 0x21, 0x1f, 0xb4, 0x1e, + 0x7f, 0x44, 0xbb, 0xc8, 0x14, 0x22, 0xd3, 0x3e, 0x32, 0x5d, 0x2a, 0x59, 0x44, 0xa7, 0x40, 0x7e, + 0xfd, 0x98, 0x86, 0xb9, 0xac, 0x6e, 0x37, 0x29, 0xe5, 0x6a, 0xcd, 0xfa, 0xff, 0x75, 0xe3, 0xc4, + 0x64, 0x77, 0xac, 0x7a, 0xd2, 0xc2, 0xd8, 0x05, 0x13, 0x5b, 0x70, 0x74, 0xbe, 0x6d, 0x88, 0xbb, + 0x6b, 0x88, 0xfb, 0xd9, 0x10, 0xf7, 0xa5, 0x25, 0xce, 0xae, 0x25, 0xce, 0x5b, 0x4b, 0x9c, 0xeb, + 0xe3, 0x5f, 0xa4, 0x3f, 0xbd, 0xd7, 0x0b, 0xf6, 0xf8, 0x53, 0xbe, 0x25, 0xa6, 0xfb, 0xb6, 0xb1, + 0xb3, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0x54, 0xe0, 0x0d, 0xa1, 0x01, 0x00, 0x00, } func (m *IprpcReward) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/message_fund_iprpc_test.go b/x/rewards/types/message_fund_iprpc_test.go index b44c983b30..df40f49af8 100644 --- a/x/rewards/types/message_fund_iprpc_test.go +++ b/x/rewards/types/message_fund_iprpc_test.go @@ -5,7 +5,7 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/types/message_set_iprpc_data_test.go b/x/rewards/types/message_set_iprpc_data_test.go index 2526f43ca2..2e2b6e641c 100644 --- a/x/rewards/types/message_set_iprpc_data_test.go +++ b/x/rewards/types/message_set_iprpc_data_test.go @@ -5,8 +5,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/sample" - commontypes "github.com/lavanet/lava/utils/common/types" + "github.com/lavanet/lava/v2/testutil/sample" + commontypes "github.com/lavanet/lava/v2/utils/common/types" "github.com/stretchr/testify/require" ) diff --git a/x/rewards/types/params.pb.go b/x/rewards/types/params.pb.go index 248deb19ec..33e024fa52 100644 --- a/x/rewards/types/params.pb.go +++ b/x/rewards/types/params.pb.go @@ -80,34 +80,34 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/params.proto", fileDescriptor_12687c5fbcde5c39) } var fileDescriptor_12687c5fbcde5c39 = []byte{ - // 418 bytes of a gzipped FileDescriptorProto + // 422 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xbf, 0x8e, 0x94, 0x50, - 0x14, 0xc6, 0x41, 0x67, 0x27, 0xd9, 0x5b, 0xe8, 0x2e, 0xd9, 0x02, 0x2d, 0x60, 0xc5, 0xa8, 0x53, - 0x28, 0x14, 0x76, 0xdb, 0x89, 0xc6, 0x42, 0x9b, 0x0d, 0x5a, 0x59, 0x78, 0x73, 0x80, 0xbb, 0x78, - 0x23, 0x70, 0xc8, 0xbd, 0x17, 0x86, 0x79, 0x0b, 0x4b, 0x4b, 0x9f, 0xc1, 0xda, 0x07, 0xd8, 0x72, - 0x4a, 0x63, 0x31, 0x31, 0x33, 0x6f, 0xe0, 0x13, 0x18, 0x2e, 0xe8, 0xfc, 0x6b, 0x9c, 0x58, 0x9d, - 0xc3, 0x97, 0x8f, 0xef, 0xf7, 0x05, 0x72, 0xc8, 0xbd, 0x1c, 0x1a, 0x28, 0x99, 0x0a, 0xba, 0x19, - 0x08, 0x36, 0x05, 0x91, 0xca, 0xa0, 0x02, 0x01, 0x85, 0xf4, 0x2b, 0x81, 0x0a, 0xad, 0xb3, 0xc1, - 0xe2, 0x77, 0xd3, 0x1f, 0x2c, 0x77, 0xcf, 0x32, 0xcc, 0x50, 0x1b, 0x82, 0x6e, 0xeb, 0xbd, 0xde, - 0xb7, 0x23, 0x32, 0xbe, 0xd4, 0x2f, 0x5b, 0x0d, 0x39, 0x2d, 0x78, 0x49, 0x63, 0x2c, 0x53, 0x96, - 0x52, 0x05, 0x22, 0x63, 0xca, 0x36, 0xcf, 0xcd, 0xc9, 0x71, 0xf8, 0xea, 0x7a, 0xe1, 0x1a, 0x3f, - 0x16, 0xee, 0xc3, 0x8c, 0xab, 0x0f, 0x75, 0xec, 0x27, 0x58, 0x04, 0x09, 0xca, 0x02, 0xe5, 0x30, - 0x9e, 0xc8, 0xf4, 0x63, 0xa0, 0x66, 0x15, 0x93, 0xfe, 0x0b, 0x96, 0xfc, 0x5a, 0xb8, 0xf6, 0x0c, - 0x8a, 0xfc, 0xc2, 0xdb, 0x0b, 0xf4, 0xa2, 0xdb, 0x05, 0x2f, 0x43, 0x2d, 0xbd, 0xd5, 0x8a, 0xe6, - 0x42, 0xbb, 0xc3, 0xbd, 0xf1, 0x9f, 0xdc, 0xdd, 0xc0, 0x8e, 0x0b, 0xed, 0x16, 0x37, 0x26, 0x24, - 0xc7, 0x29, 0xbd, 0x82, 0x44, 0xa1, 0xb0, 0x6f, 0x6a, 0xe0, 0xf3, 0x83, 0x81, 0xa7, 0x3d, 0x70, - 0x9d, 0xe4, 0x45, 0xc7, 0x39, 0x4e, 0x5f, 0xea, 0xdd, 0x9a, 0x11, 0x2b, 0x67, 0x57, 0x0a, 0x1b, - 0x26, 0x68, 0x5c, 0x8b, 0x92, 0x0a, 0x50, 0xcc, 0x1e, 0x69, 0xd6, 0xeb, 0x83, 0x59, 0x77, 0x06, - 0xd6, 0x5e, 0xa2, 0x17, 0x9d, 0xfc, 0x11, 0xc3, 0x5a, 0x94, 0x11, 0x28, 0x66, 0x4d, 0xc8, 0x49, - 0xf7, 0x15, 0xfa, 0xdf, 0x4f, 0x63, 0x44, 0xa9, 0xec, 0xa3, 0x73, 0x73, 0x32, 0x8a, 0x6e, 0x15, - 0xd0, 0x46, 0x5a, 0x0e, 0x3b, 0xd5, 0xfa, 0x6a, 0x92, 0x07, 0x0d, 0xe4, 0x3c, 0x05, 0x85, 0x42, - 0x52, 0x59, 0xc7, 0x32, 0x11, 0xbc, 0x52, 0x1c, 0x4b, 0x5a, 0x81, 0x50, 0x3c, 0xe1, 0x15, 0x74, - 0x4f, 0xf6, 0x58, 0x17, 0x7f, 0x7f, 0x70, 0xf1, 0xc7, 0x7d, 0xf1, 0x7f, 0x82, 0x78, 0xd1, 0xfd, - 0xb5, 0xef, 0xcd, 0x86, 0xed, 0x72, 0xd3, 0x75, 0x31, 0xfa, 0xfc, 0xc5, 0x35, 0xc2, 0x67, 0xd7, - 0x4b, 0xc7, 0x9c, 0x2f, 0x1d, 0xf3, 0xe7, 0xd2, 0x31, 0x3f, 0xad, 0x1c, 0x63, 0xbe, 0x72, 0x8c, - 0xef, 0x2b, 0xc7, 0x78, 0xf7, 0x68, 0xa3, 0xdc, 0xd6, 0xc9, 0xb4, 0x7f, 0x8f, 0x46, 0x37, 0x8c, - 0xc7, 0xfa, 0x10, 0x9e, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xed, 0xaf, 0xe7, 0x4f, 0x59, 0x03, - 0x00, 0x00, + 0x14, 0xc6, 0x41, 0x67, 0x27, 0xd9, 0x5b, 0xe8, 0x2e, 0xd9, 0x02, 0x2d, 0x60, 0xc5, 0x68, 0x26, + 0x46, 0x21, 0xd1, 0x6e, 0x4b, 0xdc, 0x58, 0x68, 0xb3, 0x41, 0x2b, 0x0b, 0x6f, 0x0e, 0x70, 0x17, + 0x6f, 0x04, 0x0e, 0xb9, 0xf7, 0xc2, 0x30, 0x6f, 0x61, 0x69, 0xe9, 0x33, 0x58, 0xfb, 0x00, 0x5b, + 0x6e, 0x69, 0x2c, 0x26, 0x66, 0xe6, 0x0d, 0x7c, 0x02, 0xc3, 0x05, 0x9d, 0x7f, 0x8d, 0x93, 0xad, + 0xce, 0xe1, 0xcb, 0xc7, 0xf7, 0xfb, 0x02, 0x39, 0xe4, 0x41, 0x0e, 0x0d, 0x94, 0x4c, 0x05, 0xdd, + 0x0c, 0x04, 0x9b, 0x82, 0x48, 0x65, 0x50, 0x81, 0x80, 0x42, 0xfa, 0x95, 0x40, 0x85, 0xd6, 0xc9, + 0x60, 0xf1, 0xbb, 0xe9, 0x0f, 0x96, 0xfb, 0x27, 0x19, 0x66, 0xa8, 0x0d, 0x41, 0xb7, 0xf5, 0x5e, + 0xef, 0xfb, 0x01, 0x19, 0x5f, 0xe8, 0x97, 0xad, 0x86, 0x1c, 0x17, 0xbc, 0xa4, 0x31, 0x96, 0x29, + 0x4b, 0xa9, 0x02, 0x91, 0x31, 0x65, 0x9b, 0xa7, 0xe6, 0xe4, 0x30, 0x7c, 0x7d, 0x35, 0x77, 0x8d, + 0x9f, 0x73, 0xf7, 0x71, 0xc6, 0xd5, 0xc7, 0x3a, 0xf6, 0x13, 0x2c, 0x82, 0x04, 0x65, 0x81, 0x72, + 0x18, 0xcf, 0x64, 0xfa, 0x29, 0x50, 0xb3, 0x8a, 0x49, 0xff, 0x9c, 0x25, 0xbf, 0xe7, 0xae, 0x3d, + 0x83, 0x22, 0x3f, 0xf3, 0x76, 0x02, 0xbd, 0xe8, 0x6e, 0xc1, 0xcb, 0x50, 0x4b, 0xef, 0xb4, 0xa2, + 0xb9, 0xd0, 0x6e, 0x71, 0x6f, 0xdd, 0x90, 0xbb, 0x1d, 0xd8, 0x71, 0xa1, 0xdd, 0xe0, 0xc6, 0x84, + 0xe4, 0x38, 0xa5, 0x97, 0x90, 0x28, 0x14, 0xf6, 0x6d, 0x0d, 0x7c, 0xb9, 0x37, 0xf0, 0xb8, 0x07, + 0xae, 0x92, 0xbc, 0xe8, 0x30, 0xc7, 0xe9, 0x2b, 0xbd, 0x5b, 0x33, 0x62, 0xe5, 0xec, 0x52, 0x61, + 0xc3, 0x04, 0x8d, 0x6b, 0x51, 0x52, 0x01, 0x8a, 0xd9, 0x23, 0xcd, 0x7a, 0xb3, 0x37, 0xeb, 0xde, + 0xc0, 0xda, 0x49, 0xf4, 0xa2, 0xa3, 0xbf, 0x62, 0x58, 0x8b, 0x32, 0x02, 0xc5, 0xac, 0x09, 0x39, + 0xea, 0xbe, 0x42, 0xff, 0xfb, 0x69, 0x8c, 0x28, 0x95, 0x7d, 0x70, 0x6a, 0x4e, 0x46, 0xd1, 0x9d, + 0x02, 0xda, 0x48, 0xcb, 0x61, 0xa7, 0x5a, 0xdf, 0x4c, 0xf2, 0xa8, 0x81, 0x9c, 0xa7, 0xa0, 0x50, + 0x48, 0x2a, 0xeb, 0x58, 0x26, 0x82, 0x57, 0x8a, 0x63, 0x49, 0x2b, 0x10, 0x8a, 0x27, 0xbc, 0x82, + 0xee, 0xc9, 0x1e, 0xeb, 0xe2, 0x1f, 0xf6, 0x2e, 0xfe, 0xb4, 0x2f, 0xfe, 0x5f, 0x10, 0x2f, 0x7a, + 0xb8, 0xf2, 0xbd, 0x5d, 0xb3, 0x5d, 0xac, 0xbb, 0xce, 0x46, 0x5f, 0xbe, 0xba, 0x46, 0x78, 0x7e, + 0xb5, 0x70, 0xcc, 0xeb, 0x85, 0x63, 0xfe, 0x5a, 0x38, 0xe6, 0xe7, 0xa5, 0x63, 0x5c, 0x2f, 0x1d, + 0xe3, 0xc7, 0xd2, 0x31, 0xde, 0x3f, 0x59, 0x2b, 0xb7, 0x71, 0x32, 0xcd, 0xf3, 0xa0, 0xfd, 0x77, + 0x37, 0xba, 0x64, 0x3c, 0xd6, 0xb7, 0xf0, 0xe2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x9f, + 0x83, 0x73, 0x5c, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/query.pb.go b/x/rewards/types/query.pb.go index dfd1109e68..27c38cd287 100644 --- a/x/rewards/types/query.pb.go +++ b/x/rewards/types/query.pb.go @@ -447,23 +447,23 @@ func (m *QueryShowIprpcDataResponse) GetIprpcSubscriptions() []string { } // QueryProviderRewardRequest is request type for the Query/ProviderReward RPC method. -type QueryProviderRewardRequest struct { +type QuerySpecTrackedInfoRequest struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` } -func (m *QueryProviderRewardRequest) Reset() { *m = QueryProviderRewardRequest{} } -func (m *QueryProviderRewardRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProviderRewardRequest) ProtoMessage() {} -func (*QueryProviderRewardRequest) Descriptor() ([]byte, []int) { +func (m *QuerySpecTrackedInfoRequest) Reset() { *m = QuerySpecTrackedInfoRequest{} } +func (m *QuerySpecTrackedInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySpecTrackedInfoRequest) ProtoMessage() {} +func (*QuerySpecTrackedInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_15bce9a904340007, []int{9} } -func (m *QueryProviderRewardRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySpecTrackedInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryProviderRewardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpecTrackedInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryProviderRewardRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpecTrackedInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -473,109 +473,49 @@ func (m *QueryProviderRewardRequest) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *QueryProviderRewardRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProviderRewardRequest.Merge(m, src) +func (m *QuerySpecTrackedInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpecTrackedInfoRequest.Merge(m, src) } -func (m *QueryProviderRewardRequest) XXX_Size() int { +func (m *QuerySpecTrackedInfoRequest) XXX_Size() int { return m.Size() } -func (m *QueryProviderRewardRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProviderRewardRequest.DiscardUnknown(m) +func (m *QuerySpecTrackedInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpecTrackedInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryProviderRewardRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySpecTrackedInfoRequest proto.InternalMessageInfo -func (m *QueryProviderRewardRequest) GetChainId() string { +func (m *QuerySpecTrackedInfoRequest) GetChainId() string { if m != nil { return m.ChainId } return "" } -func (m *QueryProviderRewardRequest) GetProvider() string { +func (m *QuerySpecTrackedInfoRequest) GetProvider() string { if m != nil { return m.Provider } return "" } -type RewardInfo struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` - Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` -} - -func (m *RewardInfo) Reset() { *m = RewardInfo{} } -func (m *RewardInfo) String() string { return proto.CompactTextString(m) } -func (*RewardInfo) ProtoMessage() {} -func (*RewardInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_15bce9a904340007, []int{10} -} -func (m *RewardInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RewardInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RewardInfo.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 *RewardInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_RewardInfo.Merge(m, src) -} -func (m *RewardInfo) XXX_Size() int { - return m.Size() -} -func (m *RewardInfo) XXX_DiscardUnknown() { - xxx_messageInfo_RewardInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_RewardInfo proto.InternalMessageInfo - -func (m *RewardInfo) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *RewardInfo) GetProvider() string { - if m != nil { - return m.Provider - } - return "" -} - -func (m *RewardInfo) GetAmount() types.Coin { - if m != nil { - return m.Amount - } - return types.Coin{} -} - // QueryProviderRewardResponse is response type for the Query/ProviderReward RPC method. -type QueryProviderRewardResponse struct { - Rewards []RewardInfo `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards"` +type QuerySpecTrackedInfoResponse struct { + Info []BasePayWithIndex `protobuf:"bytes,1,rep,name=info,proto3" json:"info"` } -func (m *QueryProviderRewardResponse) Reset() { *m = QueryProviderRewardResponse{} } -func (m *QueryProviderRewardResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProviderRewardResponse) ProtoMessage() {} -func (*QueryProviderRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15bce9a904340007, []int{11} +func (m *QuerySpecTrackedInfoResponse) Reset() { *m = QuerySpecTrackedInfoResponse{} } +func (m *QuerySpecTrackedInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySpecTrackedInfoResponse) ProtoMessage() {} +func (*QuerySpecTrackedInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15bce9a904340007, []int{10} } -func (m *QueryProviderRewardResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySpecTrackedInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryProviderRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySpecTrackedInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryProviderRewardResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySpecTrackedInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -585,21 +525,21 @@ func (m *QueryProviderRewardResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *QueryProviderRewardResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProviderRewardResponse.Merge(m, src) +func (m *QuerySpecTrackedInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpecTrackedInfoResponse.Merge(m, src) } -func (m *QueryProviderRewardResponse) XXX_Size() int { +func (m *QuerySpecTrackedInfoResponse) XXX_Size() int { return m.Size() } -func (m *QueryProviderRewardResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProviderRewardResponse.DiscardUnknown(m) +func (m *QuerySpecTrackedInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpecTrackedInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryProviderRewardResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySpecTrackedInfoResponse proto.InternalMessageInfo -func (m *QueryProviderRewardResponse) GetRewards() []RewardInfo { +func (m *QuerySpecTrackedInfoResponse) GetInfo() []BasePayWithIndex { if m != nil { - return m.Rewards + return m.Info } return nil } @@ -617,7 +557,7 @@ func (m *QueryIprpcProviderRewardEstimationRequest) String() string { } func (*QueryIprpcProviderRewardEstimationRequest) ProtoMessage() {} func (*QueryIprpcProviderRewardEstimationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15bce9a904340007, []int{12} + return fileDescriptor_15bce9a904340007, []int{11} } func (m *QueryIprpcProviderRewardEstimationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -666,7 +606,7 @@ func (m *QueryIprpcProviderRewardEstimationResponse) String() string { } func (*QueryIprpcProviderRewardEstimationResponse) ProtoMessage() {} func (*QueryIprpcProviderRewardEstimationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15bce9a904340007, []int{13} + return fileDescriptor_15bce9a904340007, []int{12} } func (m *QueryIprpcProviderRewardEstimationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -711,7 +651,7 @@ func (m *QueryIprpcSpecRewardRequest) Reset() { *m = QueryIprpcSpecRewar func (m *QueryIprpcSpecRewardRequest) String() string { return proto.CompactTextString(m) } func (*QueryIprpcSpecRewardRequest) ProtoMessage() {} func (*QueryIprpcSpecRewardRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15bce9a904340007, []int{14} + return fileDescriptor_15bce9a904340007, []int{13} } func (m *QueryIprpcSpecRewardRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -757,7 +697,7 @@ func (m *QueryIprpcSpecRewardResponse) Reset() { *m = QueryIprpcSpecRewa func (m *QueryIprpcSpecRewardResponse) String() string { return proto.CompactTextString(m) } func (*QueryIprpcSpecRewardResponse) ProtoMessage() {} func (*QueryIprpcSpecRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15bce9a904340007, []int{15} + return fileDescriptor_15bce9a904340007, []int{14} } func (m *QueryIprpcSpecRewardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -810,9 +750,8 @@ func init() { proto.RegisterType((*QueryBlockRewardResponse)(nil), "lavanet.lava.rewards.QueryBlockRewardResponse") proto.RegisterType((*QueryShowIprpcDataRequest)(nil), "lavanet.lava.rewards.QueryShowIprpcDataRequest") proto.RegisterType((*QueryShowIprpcDataResponse)(nil), "lavanet.lava.rewards.QueryShowIprpcDataResponse") - proto.RegisterType((*QueryProviderRewardRequest)(nil), "lavanet.lava.rewards.QueryProviderRewardRequest") - proto.RegisterType((*RewardInfo)(nil), "lavanet.lava.rewards.RewardInfo") - proto.RegisterType((*QueryProviderRewardResponse)(nil), "lavanet.lava.rewards.QueryProviderRewardResponse") + proto.RegisterType((*QuerySpecTrackedInfoRequest)(nil), "lavanet.lava.rewards.QuerySpecTrackedInfoRequest") + proto.RegisterType((*QuerySpecTrackedInfoResponse)(nil), "lavanet.lava.rewards.QuerySpecTrackedInfoResponse") proto.RegisterType((*QueryIprpcProviderRewardEstimationRequest)(nil), "lavanet.lava.rewards.QueryIprpcProviderRewardEstimationRequest") proto.RegisterType((*QueryIprpcProviderRewardEstimationResponse)(nil), "lavanet.lava.rewards.QueryIprpcProviderRewardEstimationResponse") proto.RegisterType((*QueryIprpcSpecRewardRequest)(nil), "lavanet.lava.rewards.QueryIprpcSpecRewardRequest") @@ -822,73 +761,74 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/query.proto", fileDescriptor_15bce9a904340007) } var fileDescriptor_15bce9a904340007 = []byte{ - // 1041 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0x8e, 0xf3, 0x3b, 0x2f, 0x6d, 0x80, 0x49, 0xa4, 0x6e, 0x9c, 0x74, 0x9b, 0x9a, 0xa0, 0x6c, - 0x23, 0xc5, 0x4e, 0x82, 0x54, 0x10, 0x08, 0x28, 0x09, 0x3f, 0x14, 0xa9, 0x48, 0xad, 0x97, 0x13, - 0x17, 0x6b, 0xd6, 0x3b, 0xbb, 0x6b, 0xd5, 0xf6, 0x38, 0x9e, 0xd9, 0x84, 0x0a, 0x2a, 0x24, 0x10, - 0x07, 0x24, 0x0e, 0x48, 0x48, 0x88, 0x2b, 0x12, 0x27, 0x4e, 0xfc, 0x19, 0x3d, 0x56, 0xe2, 0xc2, - 0x09, 0x50, 0xc2, 0x5f, 0xc0, 0x5f, 0x80, 0xe6, 0xcd, 0x78, 0xb3, 0x9b, 0x38, 0x9b, 0x6d, 0x4f, - 0x6b, 0xcf, 0x7c, 0xef, 0x7d, 0xdf, 0xf7, 0xe6, 0xcd, 0x5b, 0xc3, 0x5a, 0x4c, 0x8f, 0x68, 0xca, - 0xa4, 0xa7, 0x7e, 0xbd, 0x9c, 0x1d, 0xd3, 0xbc, 0x29, 0xbc, 0xc3, 0x2e, 0xcb, 0x1f, 0xbb, 0x59, - 0xce, 0x25, 0x27, 0x4b, 0x06, 0xe1, 0xaa, 0x5f, 0xd7, 0x20, 0xec, 0xa5, 0x36, 0x6f, 0x73, 0x04, - 0x78, 0xea, 0x49, 0x63, 0xed, 0xd5, 0x36, 0xe7, 0xed, 0x98, 0x79, 0x34, 0x8b, 0x3c, 0x9a, 0xa6, - 0x5c, 0x52, 0x19, 0xf1, 0x54, 0x98, 0xdd, 0xcd, 0x90, 0x8b, 0x84, 0x0b, 0xaf, 0x41, 0x05, 0xd3, - 0x14, 0xde, 0xd1, 0x4e, 0x83, 0x49, 0xba, 0xe3, 0x65, 0xb4, 0x1d, 0xa5, 0x08, 0x36, 0xd8, 0xdb, - 0xa5, 0xba, 0x32, 0x9a, 0xd3, 0xa4, 0x48, 0x57, 0x2e, 0x3d, 0xca, 0xf2, 0x2c, 0x34, 0x88, 0x6a, - 0x3f, 0x61, 0x41, 0x15, 0xf2, 0xc8, 0x90, 0x38, 0x4b, 0x40, 0x1e, 0x2a, 0x19, 0x0f, 0x30, 0xad, - 0xcf, 0x0e, 0xbb, 0x4c, 0x48, 0xe7, 0x21, 0x2c, 0x0e, 0xac, 0x8a, 0x8c, 0xa7, 0x82, 0x91, 0xb7, - 0x60, 0x5a, 0xd3, 0x57, 0xac, 0x35, 0xab, 0x36, 0xbf, 0xbb, 0xea, 0x96, 0x15, 0xc6, 0xd5, 0x51, - 0x7b, 0x93, 0x4f, 0xff, 0xba, 0x35, 0xe6, 0x9b, 0x08, 0x67, 0x11, 0x5e, 0xd1, 0x29, 0x39, 0x8f, - 0x7b, 0x3c, 0xdf, 0x5a, 0x30, 0xab, 0x16, 0x0e, 0xd2, 0x16, 0x27, 0x04, 0x26, 0x53, 0x9a, 0x30, - 0xcc, 0x3d, 0xe7, 0xe3, 0x33, 0x61, 0x30, 0xd3, 0xa0, 0x31, 0x4d, 0x43, 0x56, 0x19, 0x5f, 0x9b, - 0xa8, 0xcd, 0xef, 0x2e, 0xbb, 0xda, 0x90, 0xab, 0x0c, 0xb9, 0xc6, 0x90, 0xbb, 0xcf, 0xa3, 0x74, - 0x6f, 0x5b, 0xf1, 0xfd, 0xf6, 0xf7, 0xad, 0x5a, 0x3b, 0x92, 0x9d, 0x6e, 0xc3, 0x0d, 0x79, 0xe2, - 0x19, 0xf7, 0xfa, 0x67, 0x4b, 0x34, 0x1f, 0x79, 0xf2, 0x71, 0xc6, 0x04, 0x06, 0x08, 0xbf, 0xc8, - 0xed, 0xfc, 0x67, 0x15, 0x65, 0xd0, 0xea, 0x7a, 0x7e, 0xa7, 0x32, 0xb5, 0x50, 0xb1, 0x90, 0xbb, - 0x7a, 0x89, 0x5d, 0x63, 0xc0, 0x18, 0xd6, 0x21, 0x64, 0x1d, 0x16, 0x64, 0x94, 0xb0, 0x40, 0xf2, - 0x20, 0x67, 0xad, 0x28, 0x8e, 0x2b, 0xe3, 0x6b, 0x56, 0x6d, 0xc2, 0xbf, 0xa6, 0x56, 0x3f, 0xe5, - 0x3e, 0xae, 0x91, 0xb7, 0xc1, 0x66, 0x42, 0x46, 0x09, 0x95, 0xac, 0x19, 0x34, 0x62, 0x1e, 0x3e, - 0x12, 0x7d, 0x11, 0x13, 0x18, 0x71, 0xa3, 0x87, 0xd8, 0x43, 0x40, 0x2f, 0xf8, 0x1d, 0x58, 0xa1, - 0x71, 0xcc, 0x43, 0x6c, 0x9a, 0x40, 0xd1, 0x06, 0x09, 0x4f, 0x65, 0x47, 0x04, 0x31, 0x6b, 0xc9, - 0xca, 0x24, 0x46, 0x57, 0xce, 0x20, 0x4a, 0xe8, 0x27, 0x08, 0xb8, 0xcf, 0x5a, 0xd2, 0x59, 0x86, - 0x1b, 0xe8, 0x19, 0xb3, 0xfa, 0x68, 0xa6, 0x38, 0x97, 0x3a, 0x54, 0x2e, 0x6e, 0x99, 0xa2, 0xbc, - 0x01, 0xd3, 0xda, 0xb9, 0x69, 0x82, 0x21, 0x27, 0x62, 0x3a, 0x40, 0xc3, 0x9d, 0x15, 0x58, 0xc6, - 0xa4, 0xf5, 0x0e, 0x3f, 0x3e, 0x50, 0x2d, 0xfa, 0x01, 0x95, 0xb4, 0x60, 0xfc, 0xce, 0x02, 0xbb, - 0x6c, 0xb7, 0x77, 0x12, 0xb3, 0x49, 0x94, 0x06, 0x21, 0x17, 0x72, 0x54, 0xda, 0x99, 0x24, 0x4a, - 0xf7, 0xb9, 0x90, 0xc4, 0x83, 0x45, 0xbc, 0x11, 0x81, 0xe8, 0x36, 0x44, 0x98, 0x47, 0x19, 0x5e, - 0x48, 0xec, 0xa7, 0x39, 0x9f, 0xe0, 0x56, 0xbd, 0x7f, 0xc7, 0xa9, 0x1b, 0x29, 0x0f, 0x72, 0x7e, - 0x14, 0x35, 0x59, 0x3e, 0x50, 0x1b, 0xb2, 0x0c, 0xb3, 0x61, 0x87, 0x46, 0x69, 0x10, 0x35, 0x4d, - 0xab, 0xce, 0xe0, 0xfb, 0x41, 0x93, 0xd8, 0x30, 0x9b, 0x99, 0x18, 0x3c, 0xed, 0x39, 0xbf, 0xf7, - 0xee, 0x7c, 0x09, 0xa0, 0xf3, 0x60, 0xaf, 0xbf, 0x58, 0x12, 0x55, 0x7b, 0x9a, 0xf0, 0x6e, 0x2a, - 0xb1, 0x35, 0x46, 0xa9, 0xbd, 0x86, 0x3b, 0x01, 0xac, 0x94, 0x5a, 0x32, 0xe5, 0xbd, 0x07, 0x33, - 0xa6, 0x9b, 0x4d, 0xab, 0xaf, 0x95, 0xb7, 0xfa, 0x99, 0x83, 0xa2, 0xc8, 0x66, 0xc7, 0xf9, 0x18, - 0xee, 0x20, 0x01, 0x1e, 0xdd, 0x20, 0xcb, 0x87, 0xba, 0x7d, 0x23, 0x9e, 0x16, 0x25, 0xec, 0xb7, - 0x68, 0x9d, 0xab, 0xd3, 0x21, 0x6c, 0x8e, 0x92, 0xc8, 0x08, 0xdf, 0x07, 0x10, 0x19, 0x0b, 0x83, - 0x56, 0x37, 0x6d, 0x5e, 0x71, 0x4d, 0xeb, 0x19, 0x0b, 0x15, 0xcc, 0x28, 0x9f, 0x53, 0x71, 0x1f, - 0xa9, 0x30, 0x67, 0xc7, 0x14, 0x07, 0x29, 0x15, 0x6c, 0xf0, 0xc0, 0x09, 0x4c, 0x2a, 0x6c, 0x31, - 0x97, 0xd4, 0xb3, 0xf3, 0x93, 0x05, 0xab, 0xe5, 0x31, 0x46, 0xd8, 0x7d, 0xb8, 0xae, 0x9b, 0x6e, - 0xb0, 0xae, 0xb7, 0xcb, 0xb5, 0x61, 0x16, 0x9d, 0xc1, 0xc8, 0xbb, 0x16, 0x9d, 0x2d, 0x09, 0x52, - 0x83, 0x97, 0xc3, 0x6e, 0x9e, 0xb3, 0x54, 0xea, 0x1b, 0xae, 0xda, 0x46, 0xf5, 0xc6, 0xa4, 0xbf, - 0x60, 0xd6, 0xf1, 0x5e, 0x1f, 0x34, 0x77, 0xbf, 0x9f, 0x83, 0x29, 0x14, 0x46, 0xbe, 0xb1, 0x60, - 0x5a, 0x4f, 0x62, 0x52, 0x2b, 0x67, 0xbd, 0x38, 0xf8, 0xed, 0x3b, 0x23, 0x20, 0xb5, 0x43, 0x67, - 0xfd, 0xeb, 0x3f, 0xfe, 0xfd, 0x71, 0xbc, 0x4a, 0x56, 0xbd, 0x21, 0xff, 0x53, 0xe4, 0x2b, 0x98, - 0xc2, 0x99, 0x4a, 0x36, 0x86, 0x65, 0xee, 0xfb, 0x4f, 0xb0, 0x6b, 0x57, 0x03, 0x8d, 0x82, 0x57, - 0x51, 0xc1, 0x4d, 0xb2, 0x72, 0x89, 0x02, 0xe4, 0xfd, 0xd9, 0x82, 0xf9, 0xbe, 0x31, 0x46, 0xb6, - 0x86, 0xa4, 0xbf, 0x38, 0x09, 0x6d, 0x77, 0x54, 0xb8, 0xd1, 0xb4, 0x89, 0x9a, 0xd6, 0x89, 0x53, - 0xae, 0x09, 0x47, 0xbc, 0xe9, 0x09, 0xf2, 0x8b, 0x05, 0xd7, 0x07, 0xc6, 0x1d, 0xf1, 0x86, 0xb0, - 0x95, 0x8d, 0x4d, 0x7b, 0x7b, 0xf4, 0x00, 0x23, 0x70, 0x0b, 0x05, 0x6e, 0x90, 0xd7, 0xca, 0x05, - 0x8a, 0x0e, 0x3f, 0x0e, 0x74, 0xe7, 0x36, 0x95, 0xa2, 0x5f, 0x2d, 0x58, 0x18, 0xbc, 0x85, 0x64, - 0x18, 0x67, 0xe9, 0xc8, 0xb4, 0x77, 0x9e, 0x23, 0x62, 0x34, 0x99, 0xc5, 0xb8, 0x28, 0x4a, 0x79, - 0x62, 0xc1, 0xcd, 0xa1, 0x13, 0x83, 0xbc, 0x37, 0x44, 0xc3, 0x28, 0x43, 0xcb, 0xbe, 0xf7, 0xe2, - 0x09, 0x8c, 0xa7, 0x77, 0xd1, 0xd3, 0x9b, 0xe4, 0xae, 0x77, 0xf9, 0x67, 0x5b, 0x70, 0xce, 0x99, - 0xf7, 0x45, 0xb1, 0xf0, 0x84, 0xfc, 0x6e, 0xc1, 0x4b, 0xe7, 0xe6, 0x0d, 0xd9, 0xb9, 0x4a, 0xd5, - 0x85, 0x79, 0x66, 0xef, 0x3e, 0x4f, 0x88, 0x91, 0x7e, 0x17, 0xa5, 0x6f, 0x13, 0x77, 0x98, 0x74, - 0x9c, 0xc4, 0x85, 0x6c, 0xf5, 0xf2, 0x64, 0xef, 0xfd, 0xa7, 0x27, 0x55, 0xeb, 0xd9, 0x49, 0xd5, - 0xfa, 0xe7, 0xa4, 0x6a, 0xfd, 0x70, 0x5a, 0x1d, 0x7b, 0x76, 0x5a, 0x1d, 0xfb, 0xf3, 0xb4, 0x3a, - 0xf6, 0xd9, 0x46, 0xdf, 0x57, 0xda, 0x40, 0xce, 0xcf, 0x7b, 0x59, 0xf1, 0x53, 0xad, 0x31, 0x8d, - 0x1f, 0xaa, 0xaf, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x0e, 0xc7, 0x33, 0xa7, 0x0b, 0x00, - 0x00, + // 1070 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x6f, 0xdc, 0xc4, + 0x1b, 0x8e, 0xf3, 0x3f, 0x93, 0xfe, 0xf9, 0xfd, 0x26, 0x91, 0xba, 0x71, 0xd2, 0x6d, 0xea, 0x06, + 0xba, 0x8d, 0x14, 0x3b, 0x09, 0x52, 0x41, 0x54, 0x85, 0x6a, 0x53, 0x40, 0x2b, 0x15, 0x29, 0x75, + 0x22, 0x21, 0x71, 0x31, 0xb3, 0xf6, 0xec, 0xee, 0x28, 0x5e, 0x8f, 0xe3, 0x99, 0x4d, 0x1a, 0x55, + 0x11, 0x12, 0x88, 0x03, 0x37, 0x24, 0x24, 0xc4, 0x95, 0x03, 0x17, 0x4e, 0x7c, 0x01, 0xee, 0x3d, + 0x56, 0xe2, 0xc2, 0x09, 0x50, 0xc2, 0x27, 0xe0, 0x13, 0xa0, 0x79, 0x67, 0xbc, 0xdd, 0x24, 0x8e, + 0xbb, 0x70, 0xb2, 0x3d, 0xf3, 0xbc, 0xef, 0xfb, 0x3c, 0xf3, 0xbe, 0xf3, 0xc8, 0x68, 0x39, 0x26, + 0x07, 0x24, 0xa1, 0xd2, 0x53, 0x4f, 0x2f, 0xa3, 0x87, 0x24, 0x8b, 0x84, 0xb7, 0xdf, 0xa3, 0xd9, + 0x91, 0x9b, 0x66, 0x5c, 0x72, 0x3c, 0x6f, 0x10, 0xae, 0x7a, 0xba, 0x06, 0x61, 0xaf, 0x86, 0x5c, + 0x74, 0xb9, 0xf0, 0x9a, 0x44, 0x50, 0x0d, 0xf7, 0x0e, 0x36, 0x9a, 0x54, 0x92, 0x0d, 0x2f, 0x25, + 0x6d, 0x96, 0x10, 0xc9, 0x78, 0xa2, 0x33, 0xd8, 0xd5, 0x41, 0x6c, 0x8e, 0x0a, 0x39, 0xcb, 0xf7, + 0xe7, 0xdb, 0xbc, 0xcd, 0xe1, 0xd5, 0x53, 0x6f, 0x66, 0x75, 0xa9, 0xcd, 0x79, 0x3b, 0xa6, 0x1e, + 0x49, 0x99, 0x47, 0x92, 0x84, 0x4b, 0x48, 0x29, 0xcc, 0xee, 0x9d, 0x42, 0xde, 0xaa, 0x42, 0x90, + 0x12, 0x43, 0xdd, 0x2e, 0x16, 0xc7, 0xd2, 0x2c, 0x0d, 0x0d, 0xe2, 0x76, 0x21, 0x22, 0x25, 0x19, + 0xe9, 0x9a, 0x4a, 0xce, 0x3c, 0xc2, 0x4f, 0x95, 0xbe, 0x6d, 0x58, 0xf4, 0xe9, 0x7e, 0x8f, 0x0a, + 0xe9, 0x3c, 0x45, 0x73, 0x67, 0x56, 0x45, 0xca, 0x13, 0x41, 0xf1, 0xbb, 0x68, 0x52, 0x07, 0x57, + 0xac, 0x65, 0xab, 0x36, 0xbb, 0xb9, 0xe4, 0x16, 0x9d, 0x9e, 0xab, 0xa3, 0xea, 0xe3, 0x2f, 0x7e, + 0xbf, 0x35, 0xe2, 0x9b, 0x08, 0x67, 0x0e, 0xfd, 0x5f, 0xa7, 0xe4, 0x3c, 0xee, 0xd7, 0xf9, 0xca, + 0x42, 0xd3, 0x6a, 0xa1, 0x91, 0xb4, 0x38, 0xc6, 0x68, 0x3c, 0x21, 0x5d, 0x0a, 0xb9, 0x67, 0x7c, + 0x78, 0xc7, 0x14, 0x4d, 0x35, 0x49, 0x4c, 0x92, 0x90, 0x56, 0x46, 0x97, 0xc7, 0x6a, 0xb3, 0x9b, + 0x0b, 0xae, 0x3e, 0x6e, 0x57, 0x1d, 0x86, 0x6b, 0x8e, 0xdb, 0xdd, 0xe2, 0x2c, 0xa9, 0xaf, 0xab, + 0x7a, 0x3f, 0xfd, 0x71, 0xab, 0xd6, 0x66, 0xb2, 0xd3, 0x6b, 0xba, 0x21, 0xef, 0x7a, 0xa6, 0x37, + 0xfa, 0xb1, 0x26, 0xa2, 0x3d, 0x4f, 0x1e, 0xa5, 0x54, 0x40, 0x80, 0xf0, 0xf3, 0xdc, 0xce, 0xdf, + 0x56, 0x7e, 0x0c, 0x9a, 0x5d, 0x5f, 0xef, 0x44, 0xaa, 0x16, 0x2a, 0x16, 0xd4, 0xae, 0x5e, 0x22, + 0xd7, 0x08, 0x30, 0x82, 0x75, 0x08, 0x5e, 0x41, 0xd7, 0x24, 0xeb, 0xd2, 0x40, 0xf2, 0x20, 0xa3, + 0x2d, 0x16, 0xc7, 0x95, 0xd1, 0x65, 0xab, 0x36, 0xe6, 0x5f, 0x51, 0xab, 0xbb, 0xdc, 0x87, 0x35, + 0xfc, 0x00, 0xd9, 0x54, 0x48, 0xd6, 0x25, 0x92, 0x46, 0x41, 0x33, 0xe6, 0xe1, 0x9e, 0x18, 0x88, + 0x18, 0x83, 0x88, 0x1b, 0x7d, 0x44, 0x1d, 0x00, 0xfd, 0xe0, 0x87, 0x68, 0x91, 0xc4, 0x31, 0x0f, + 0x61, 0x74, 0x02, 0x55, 0x36, 0xe8, 0xf2, 0x44, 0x76, 0x44, 0x10, 0xd3, 0x96, 0xac, 0x8c, 0x43, + 0x74, 0xe5, 0x15, 0x44, 0x11, 0xfd, 0x18, 0x00, 0x4f, 0x68, 0x4b, 0x3a, 0x0b, 0xe8, 0x06, 0x68, + 0x86, 0xac, 0x3e, 0x88, 0xc9, 0xfb, 0xb2, 0x83, 0x2a, 0x17, 0xb7, 0xcc, 0xa1, 0xbc, 0x8d, 0x26, + 0xb5, 0x72, 0x33, 0x04, 0x25, 0x1d, 0x31, 0x13, 0xa0, 0xe1, 0xce, 0x22, 0x5a, 0x80, 0xa4, 0x3b, + 0x1d, 0x7e, 0xd8, 0x50, 0x53, 0xfa, 0x98, 0x48, 0x92, 0x57, 0xfc, 0xda, 0x42, 0x76, 0xd1, 0x6e, + 0xbf, 0x13, 0xd3, 0x5d, 0x96, 0x04, 0x21, 0x17, 0x72, 0xd8, 0xb2, 0x53, 0x5d, 0x96, 0x6c, 0x71, + 0x21, 0xb1, 0x87, 0xe6, 0xe0, 0x52, 0x04, 0xa2, 0xd7, 0x14, 0x61, 0xc6, 0x52, 0xb8, 0x69, 0x30, + 0x4f, 0x33, 0x3e, 0x86, 0xad, 0x9d, 0xc1, 0x1d, 0x67, 0x17, 0x2d, 0x6a, 0x2a, 0x29, 0x0d, 0x77, + 0x33, 0x12, 0xee, 0xd1, 0x48, 0xf5, 0xd7, 0x50, 0xc5, 0x0b, 0x68, 0x3a, 0xec, 0x10, 0x96, 0x04, + 0x2c, 0x32, 0xb3, 0x3a, 0x05, 0xdf, 0x8d, 0x08, 0xdb, 0x68, 0x3a, 0xcd, 0xf8, 0x01, 0x8b, 0x68, + 0x06, 0xed, 0x9e, 0xf1, 0xfb, 0xdf, 0xce, 0x67, 0x68, 0xa9, 0x38, 0xab, 0x91, 0xf8, 0x08, 0x8d, + 0xb3, 0xa4, 0xc5, 0xcd, 0xac, 0xbd, 0x59, 0x3c, 0x6b, 0x75, 0x22, 0xe8, 0x36, 0x39, 0xfa, 0x84, + 0xc9, 0x4e, 0x23, 0x89, 0xe8, 0x33, 0xa3, 0x15, 0x22, 0x9d, 0x8f, 0xd0, 0x3d, 0xa8, 0x00, 0xc7, + 0xb7, 0x6d, 0xea, 0xea, 0xee, 0x7d, 0xa0, 0x47, 0x88, 0xf1, 0x24, 0x57, 0x31, 0x48, 0xd5, 0x3a, + 0x47, 0x75, 0x1f, 0xad, 0x0e, 0x93, 0xc8, 0x10, 0xdf, 0x42, 0x48, 0xa4, 0x34, 0x0c, 0x5a, 0xbd, + 0x24, 0x7a, 0xcd, 0x55, 0x51, 0xda, 0x15, 0xcc, 0xd0, 0x9e, 0x51, 0x71, 0x1f, 0xaa, 0x30, 0x67, + 0xc3, 0x9c, 0x39, 0x94, 0x54, 0xb0, 0x33, 0x03, 0xa9, 0xbc, 0x41, 0x61, 0x73, 0x6f, 0x50, 0xef, + 0xce, 0x77, 0x96, 0x39, 0xd1, 0x0b, 0x31, 0x86, 0xd8, 0x13, 0x74, 0x55, 0x37, 0xde, 0x94, 0x37, + 0xdc, 0x6e, 0x17, 0x73, 0x83, 0x2c, 0x3a, 0x83, 0xa1, 0x77, 0x85, 0xbd, 0x5a, 0x12, 0xb8, 0x86, + 0xfe, 0x17, 0xf6, 0xb2, 0x8c, 0x26, 0x52, 0xdf, 0x32, 0xd5, 0x7e, 0xd5, 0xe3, 0x71, 0xff, 0x9a, + 0x59, 0x87, 0xbb, 0xd5, 0x88, 0x36, 0x7f, 0x9c, 0x41, 0x13, 0x40, 0x0c, 0x7f, 0x69, 0xa1, 0x49, + 0xed, 0x86, 0xb8, 0x56, 0x5c, 0xf5, 0xa2, 0xf9, 0xda, 0xf7, 0x86, 0x40, 0x6a, 0x85, 0xce, 0xca, + 0x17, 0xbf, 0xfe, 0xf5, 0xed, 0x68, 0x15, 0x2f, 0x79, 0x25, 0x4e, 0x8f, 0x3f, 0x47, 0x13, 0xe0, + 0x6b, 0xf8, 0x6e, 0x59, 0xe6, 0x01, 0x5f, 0xb6, 0x6b, 0xaf, 0x07, 0x1a, 0x06, 0x77, 0x80, 0xc1, + 0x4d, 0xbc, 0x78, 0x09, 0x03, 0xa8, 0xfb, 0xbd, 0x85, 0x66, 0x07, 0xac, 0x04, 0xaf, 0x95, 0xa4, + 0xbf, 0xe8, 0x46, 0xb6, 0x3b, 0x2c, 0xdc, 0x70, 0x5a, 0x05, 0x4e, 0x2b, 0xd8, 0x29, 0xe6, 0x04, + 0x36, 0x6b, 0x66, 0x02, 0xff, 0x60, 0xa1, 0xab, 0x67, 0x2c, 0x07, 0x7b, 0x25, 0xd5, 0x8a, 0xac, + 0xcb, 0x5e, 0x1f, 0x3e, 0xc0, 0x10, 0x5c, 0x03, 0x82, 0x77, 0xf1, 0x1b, 0xc5, 0x04, 0x45, 0x87, + 0x1f, 0x06, 0x7a, 0x72, 0x23, 0xc5, 0xe8, 0x17, 0x0b, 0x5d, 0x3f, 0xe7, 0x1a, 0x78, 0xa3, 0xac, + 0x68, 0xa1, 0x6f, 0xd9, 0x9b, 0xff, 0x26, 0xc4, 0x30, 0xdd, 0x02, 0xa6, 0x0f, 0xf1, 0x83, 0x62, + 0xa6, 0xe7, 0xc2, 0xbc, 0xe7, 0xb9, 0x31, 0x1e, 0x7b, 0xcf, 0x73, 0x37, 0x39, 0xc6, 0x27, 0x16, + 0xba, 0x59, 0x6a, 0x25, 0xf8, 0xfd, 0x12, 0x6a, 0xc3, 0xb8, 0x99, 0xfd, 0xe8, 0xbf, 0x27, 0x30, + 0x4a, 0xdf, 0x03, 0xa5, 0xef, 0xe0, 0xfb, 0xde, 0xe5, 0xbf, 0x55, 0x41, 0xae, 0xc9, 0x4c, 0xcf, + 0xa0, 0xc8, 0x9f, 0x2d, 0x74, 0xfd, 0x9c, 0x11, 0x95, 0x36, 0xa9, 0xd8, 0xe8, 0x4a, 0x9b, 0x74, + 0x89, 0xcf, 0x39, 0xf7, 0x81, 0xfa, 0x3a, 0x76, 0xcb, 0xa8, 0x83, 0x45, 0xe7, 0xb4, 0xd5, 0xc7, + 0x71, 0xfd, 0xf1, 0x8b, 0x93, 0xaa, 0xf5, 0xf2, 0xa4, 0x6a, 0xfd, 0x79, 0x52, 0xb5, 0xbe, 0x39, + 0xad, 0x8e, 0xbc, 0x3c, 0xad, 0x8e, 0xfc, 0x76, 0x5a, 0x1d, 0xf9, 0x74, 0x75, 0xe0, 0x17, 0xea, + 0x4c, 0xce, 0x83, 0x4d, 0xef, 0x59, 0x3f, 0x31, 0xfc, 0x4a, 0x35, 0x27, 0xe1, 0x47, 0xf2, 0xad, + 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x7e, 0xe4, 0xc8, 0x6c, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -912,7 +852,7 @@ type QueryClient interface { // ShowIprpcData queries for the iprpc data ShowIprpcData(ctx context.Context, in *QueryShowIprpcDataRequest, opts ...grpc.CallOption) (*QueryShowIprpcDataResponse, error) // ProviderReward queries for the providers reward for their services - ProviderReward(ctx context.Context, in *QueryProviderRewardRequest, opts ...grpc.CallOption) (*QueryProviderRewardResponse, error) + SpecTrackedInfo(ctx context.Context, in *QuerySpecTrackedInfoRequest, opts ...grpc.CallOption) (*QuerySpecTrackedInfoResponse, error) // IprpcProviderRewardEstimation queries for a provider's current IPRPC reward (relative to its serviced CU) IprpcProviderRewardEstimation(ctx context.Context, in *QueryIprpcProviderRewardEstimationRequest, opts ...grpc.CallOption) (*QueryIprpcProviderRewardEstimationResponse, error) // IprpcSpecReward queries for a spec's IPRPC reward @@ -963,9 +903,9 @@ func (c *queryClient) ShowIprpcData(ctx context.Context, in *QueryShowIprpcDataR return out, nil } -func (c *queryClient) ProviderReward(ctx context.Context, in *QueryProviderRewardRequest, opts ...grpc.CallOption) (*QueryProviderRewardResponse, error) { - out := new(QueryProviderRewardResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.rewards.Query/ProviderReward", in, out, opts...) +func (c *queryClient) SpecTrackedInfo(ctx context.Context, in *QuerySpecTrackedInfoRequest, opts ...grpc.CallOption) (*QuerySpecTrackedInfoResponse, error) { + out := new(QuerySpecTrackedInfoResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.rewards.Query/SpecTrackedInfo", in, out, opts...) if err != nil { return nil, err } @@ -1001,7 +941,7 @@ type QueryServer interface { // ShowIprpcData queries for the iprpc data ShowIprpcData(context.Context, *QueryShowIprpcDataRequest) (*QueryShowIprpcDataResponse, error) // ProviderReward queries for the providers reward for their services - ProviderReward(context.Context, *QueryProviderRewardRequest) (*QueryProviderRewardResponse, error) + SpecTrackedInfo(context.Context, *QuerySpecTrackedInfoRequest) (*QuerySpecTrackedInfoResponse, error) // IprpcProviderRewardEstimation queries for a provider's current IPRPC reward (relative to its serviced CU) IprpcProviderRewardEstimation(context.Context, *QueryIprpcProviderRewardEstimationRequest) (*QueryIprpcProviderRewardEstimationResponse, error) // IprpcSpecReward queries for a spec's IPRPC reward @@ -1024,8 +964,8 @@ func (*UnimplementedQueryServer) BlockReward(ctx context.Context, req *QueryBloc func (*UnimplementedQueryServer) ShowIprpcData(ctx context.Context, req *QueryShowIprpcDataRequest) (*QueryShowIprpcDataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ShowIprpcData not implemented") } -func (*UnimplementedQueryServer) ProviderReward(ctx context.Context, req *QueryProviderRewardRequest) (*QueryProviderRewardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProviderReward not implemented") +func (*UnimplementedQueryServer) SpecTrackedInfo(ctx context.Context, req *QuerySpecTrackedInfoRequest) (*QuerySpecTrackedInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpecTrackedInfo not implemented") } func (*UnimplementedQueryServer) IprpcProviderRewardEstimation(ctx context.Context, req *QueryIprpcProviderRewardEstimationRequest) (*QueryIprpcProviderRewardEstimationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method IprpcProviderRewardEstimation not implemented") @@ -1110,20 +1050,20 @@ func _Query_ShowIprpcData_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Query_ProviderReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProviderRewardRequest) +func _Query_SpecTrackedInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpecTrackedInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ProviderReward(ctx, in) + return srv.(QueryServer).SpecTrackedInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/lavanet.lava.rewards.Query/ProviderReward", + FullMethod: "/lavanet.lava.rewards.Query/SpecTrackedInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ProviderReward(ctx, req.(*QueryProviderRewardRequest)) + return srv.(QueryServer).SpecTrackedInfo(ctx, req.(*QuerySpecTrackedInfoRequest)) } return interceptor(ctx, in, info, handler) } @@ -1185,8 +1125,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_ShowIprpcData_Handler, }, { - MethodName: "ProviderReward", - Handler: _Query_ProviderReward_Handler, + MethodName: "SpecTrackedInfo", + Handler: _Query_SpecTrackedInfo_Handler, }, { MethodName: "IprpcProviderRewardEstimation", @@ -1497,7 +1437,7 @@ func (m *QueryShowIprpcDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryProviderRewardRequest) Marshal() (dAtA []byte, err error) { +func (m *QuerySpecTrackedInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1507,12 +1447,12 @@ func (m *QueryProviderRewardRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryProviderRewardRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySpecTrackedInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryProviderRewardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySpecTrackedInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1534,7 +1474,7 @@ func (m *QueryProviderRewardRequest) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *RewardInfo) Marshal() (dAtA []byte, err error) { +func (m *QuerySpecTrackedInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1544,67 +1484,20 @@ func (m *RewardInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RewardInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySpecTrackedInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RewardInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySpecTrackedInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Provider) > 0 { - i -= len(m.Provider) - copy(dAtA[i:], m.Provider) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) - i-- - dAtA[i] = 0x12 - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryProviderRewardResponse) 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 *QueryProviderRewardResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProviderRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1886,24 +1779,7 @@ func (m *QueryShowIprpcDataResponse) Size() (n int) { return n } -func (m *QueryProviderRewardRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Provider) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *RewardInfo) Size() (n int) { +func (m *QuerySpecTrackedInfoRequest) Size() (n int) { if m == nil { return 0 } @@ -1917,19 +1793,17 @@ func (m *RewardInfo) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = m.Amount.Size() - n += 1 + l + sovQuery(uint64(l)) return n } -func (m *QueryProviderRewardResponse) Size() (n int) { +func (m *QuerySpecTrackedInfoResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { + if len(m.Info) > 0 { + for _, e := range m.Info { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } @@ -2740,7 +2614,7 @@ func (m *QueryShowIprpcDataResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryProviderRewardRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySpecTrackedInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2763,10 +2637,10 @@ func (m *QueryProviderRewardRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProviderRewardRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpecTrackedInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProviderRewardRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySpecTrackedInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2854,154 +2728,7 @@ func (m *QueryProviderRewardRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RewardInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RewardInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RewardInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Provider = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProviderRewardResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySpecTrackedInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3024,15 +2751,15 @@ func (m *QueryProviderRewardResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryProviderRewardResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySpecTrackedInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProviderRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySpecTrackedInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3059,8 +2786,8 @@ func (m *QueryProviderRewardResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Rewards = append(m.Rewards, RewardInfo{}) - if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Info = append(m.Info, BasePayWithIndex{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/rewards/types/query.pb.gw.go b/x/rewards/types/query.pb.gw.go index 94fe230994..7b6dfac1c5 100644 --- a/x/rewards/types/query.pb.gw.go +++ b/x/rewards/types/query.pb.gw.go @@ -105,38 +105,78 @@ func local_request_Query_ShowIprpcData_0(ctx context.Context, marshaler runtime. } -var ( - filter_Query_ProviderReward_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_ProviderReward_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProviderRewardRequest +func request_Query_SpecTrackedInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpecTrackedInfoRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ProviderReward_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") } - msg, err := client.ProviderReward(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + msg, err := client.SpecTrackedInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_ProviderReward_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProviderRewardRequest +func local_request_Query_SpecTrackedInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpecTrackedInfoRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ProviderReward_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) } - msg, err := server.ProviderReward(ctx, &protoReq) + msg, err := server.SpecTrackedInfo(ctx, &protoReq) return msg, metadata, err } @@ -347,7 +387,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_ProviderReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_SpecTrackedInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -358,7 +398,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ProviderReward_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_SpecTrackedInfo_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -366,7 +406,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_ProviderReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_SpecTrackedInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -537,7 +577,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_ProviderReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_SpecTrackedInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -546,14 +586,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_ProviderReward_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_SpecTrackedInfo_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_ProviderReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_SpecTrackedInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -609,7 +649,7 @@ var ( pattern_Query_ShowIprpcData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "rewards", "show_iprpc_data"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ProviderReward_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "rewards", "provider_reward"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_SpecTrackedInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"lavanet", "lava", "rewards", "SpecTrackedInfo", "chain_id", "provider"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_IprpcProviderRewardEstimation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lavanet", "lava", "rewards", "iprpc_provider_reward", "provider"}, "", runtime.AssumeColonVerbOpt(false))) @@ -625,7 +665,7 @@ var ( forward_Query_ShowIprpcData_0 = runtime.ForwardResponseMessage - forward_Query_ProviderReward_0 = runtime.ForwardResponseMessage + forward_Query_SpecTrackedInfo_0 = runtime.ForwardResponseMessage forward_Query_IprpcProviderRewardEstimation_0 = runtime.ForwardResponseMessage diff --git a/x/rewards/types/tx.pb.go b/x/rewards/types/tx.pb.go index 36a497f99f..8fbe12d8f2 100644 --- a/x/rewards/types/tx.pb.go +++ b/x/rewards/types/tx.pb.go @@ -8,6 +8,7 @@ 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" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -240,35 +241,37 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/rewards/tx.proto", fileDescriptor_6a4c66e189226d78) } var fileDescriptor_6a4c66e189226d78 = []byte{ - // 443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcd, 0x6e, 0xd4, 0x30, - 0x10, 0xc7, 0xd7, 0xec, 0x8a, 0xb2, 0x66, 0x05, 0x92, 0x59, 0x41, 0x1a, 0x41, 0xba, 0x8a, 0x84, - 0x88, 0x90, 0x6a, 0xd3, 0xf2, 0x04, 0xb4, 0x80, 0xc4, 0x61, 0x2f, 0xe9, 0x0d, 0x0e, 0x95, 0x93, - 0x58, 0xa9, 0x05, 0xb1, 0x23, 0x8f, 0x53, 0xda, 0xb7, 0xe0, 0x2d, 0x90, 0x78, 0x09, 0xae, 0x7b, - 0xec, 0x91, 0x13, 0xa0, 0xdd, 0x17, 0x41, 0x76, 0x92, 0xee, 0xb6, 0xe2, 0xeb, 0x34, 0x63, 0xff, - 0x67, 0xc6, 0xbf, 0x19, 0x0f, 0x7e, 0xf4, 0x81, 0x9f, 0x72, 0x25, 0x2c, 0x73, 0x96, 0x19, 0xf1, - 0x91, 0x9b, 0x02, 0x98, 0x3d, 0xa3, 0xb5, 0xd1, 0x56, 0x93, 0x69, 0x27, 0x53, 0x67, 0x69, 0x27, - 0x87, 0x51, 0xae, 0xa1, 0xd2, 0xc0, 0x32, 0x0e, 0x82, 0x9d, 0xee, 0x65, 0xc2, 0xf2, 0x3d, 0x96, - 0x6b, 0xa9, 0xda, 0xac, 0x70, 0x5a, 0xea, 0x52, 0x7b, 0x97, 0x39, 0xaf, 0xbd, 0x8d, 0x3f, 0x23, - 0x7c, 0x77, 0x0e, 0xe5, 0x91, 0xb0, 0x6f, 0x6a, 0x53, 0xe7, 0x2f, 0xb9, 0xe5, 0xe4, 0x21, 0x1e, - 0xf3, 0xc6, 0x9e, 0x68, 0x23, 0xed, 0x79, 0x80, 0x66, 0x28, 0x19, 0xa7, 0xeb, 0x0b, 0xf2, 0x0a, - 0xdf, 0xa9, 0xa4, 0x3a, 0x96, 0x2e, 0xfc, 0x38, 0xd7, 0x60, 0x83, 0x1b, 0x33, 0x94, 0xdc, 0xde, - 0xdf, 0xa6, 0x2d, 0x00, 0x75, 0x00, 0xb4, 0x03, 0xa0, 0x87, 0x5a, 0xaa, 0x83, 0xd1, 0xe2, 0xfb, - 0xce, 0x20, 0x9d, 0x54, 0x52, 0xf9, 0x47, 0x0e, 0x35, 0x58, 0xc2, 0xf0, 0xbd, 0xb6, 0x04, 0x34, - 0x19, 0xe4, 0x46, 0xd6, 0x56, 0x6a, 0x05, 0xc1, 0x70, 0x36, 0x4c, 0xc6, 0x29, 0xf1, 0xd2, 0xd1, - 0xa6, 0x12, 0x6f, 0xe3, 0x07, 0xd7, 0x40, 0x53, 0x01, 0xb5, 0x56, 0x20, 0xe2, 0xaf, 0x08, 0x4f, - 0xe6, 0x50, 0xbe, 0x6e, 0x54, 0xe1, 0x45, 0x12, 0xe0, 0xad, 0xdc, 0x08, 0x6e, 0xb5, 0xe9, 0xf8, - 0xfb, 0x23, 0x09, 0xf1, 0xad, 0xa2, 0x31, 0xdc, 0x95, 0xf4, 0xdc, 0xa3, 0xf4, 0xf2, 0x4c, 0x04, - 0xde, 0xe2, 0x95, 0x6e, 0x94, 0x6d, 0x31, 0xfe, 0xda, 0xd2, 0x33, 0xd7, 0xd2, 0x97, 0x1f, 0x3b, - 0x49, 0x29, 0xed, 0x49, 0x93, 0xd1, 0x5c, 0x57, 0xac, 0xfb, 0x80, 0xd6, 0xec, 0x42, 0xf1, 0x9e, - 0xd9, 0xf3, 0x5a, 0x80, 0x4f, 0x80, 0xb4, 0xaf, 0x4d, 0x08, 0x1e, 0x41, 0x2d, 0xf2, 0x60, 0xe4, - 0xc9, 0xbc, 0x1f, 0xdf, 0xc7, 0xd3, 0xcd, 0x06, 0xfa, 0xce, 0xf6, 0x17, 0x08, 0x0f, 0xe7, 0x50, - 0x92, 0x02, 0x4f, 0xae, 0x7c, 0xd1, 0x63, 0xfa, 0xbb, 0x1d, 0xa0, 0xd7, 0x06, 0x14, 0xee, 0xfe, - 0x57, 0x58, 0xff, 0x1a, 0x79, 0x87, 0xc7, 0xeb, 0x19, 0xc6, 0x7f, 0xcc, 0xbd, 0x8c, 0x09, 0x9f, - 0xfe, 0x3b, 0xa6, 0x2f, 0x7e, 0xf0, 0x62, 0xb1, 0x8c, 0xd0, 0xc5, 0x32, 0x42, 0x3f, 0x97, 0x11, - 0xfa, 0xb4, 0x8a, 0x06, 0x17, 0xab, 0x68, 0xf0, 0x6d, 0x15, 0x0d, 0xde, 0x3e, 0xd9, 0x98, 0xe1, - 0x95, 0xcd, 0x3f, 0x5b, 0xef, 0xbe, 0x1b, 0x64, 0x76, 0xd3, 0xef, 0xec, 0xf3, 0x5f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x87, 0x10, 0x57, 0xff, 0x20, 0x03, 0x00, 0x00, + // 478 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0x6f, 0x68, 0xc5, 0xa8, 0xa9, 0x40, 0x98, 0x8a, 0xa5, 0xd1, 0xc8, 0xaa, 0x48, 0x48, 0x55, + 0xa5, 0xd9, 0xac, 0xdc, 0x76, 0xdc, 0x06, 0x12, 0x87, 0x5e, 0xb2, 0x1b, 0x1c, 0x26, 0x27, 0xb1, + 0x32, 0x0b, 0x62, 0x47, 0x79, 0x4e, 0xd9, 0xbe, 0x02, 0x27, 0x3e, 0x07, 0x27, 0xbe, 0x04, 0x52, + 0x8f, 0x3b, 0x22, 0x0e, 0x80, 0xda, 0x03, 0x5f, 0x03, 0xd9, 0x49, 0xda, 0xae, 0xe2, 0xdf, 0x25, + 0xef, 0xcf, 0xef, 0xe5, 0xbd, 0xdf, 0xef, 0xd9, 0x46, 0x8f, 0xdf, 0xb2, 0x19, 0x93, 0x5c, 0x53, + 0x63, 0x69, 0xc1, 0xdf, 0xb1, 0x22, 0x01, 0xaa, 0x2f, 0x49, 0x5e, 0x28, 0xad, 0x70, 0xbf, 0x86, + 0x89, 0xb1, 0xa4, 0x86, 0xbd, 0x07, 0x2c, 0x13, 0x52, 0x51, 0xfb, 0xad, 0x0a, 0x3d, 0x3f, 0x56, + 0x90, 0x29, 0xa0, 0x11, 0x03, 0x4e, 0x67, 0x87, 0x11, 0xd7, 0xec, 0x90, 0xc6, 0x4a, 0xc8, 0x1a, + 0xef, 0xa7, 0x2a, 0x55, 0xd6, 0xa5, 0xc6, 0xab, 0xb2, 0xc1, 0x67, 0x07, 0xdd, 0x9f, 0x42, 0x7a, + 0xc6, 0xf5, 0xcb, 0xbc, 0xc8, 0xe3, 0x53, 0xa6, 0x19, 0xde, 0x43, 0x5d, 0x56, 0xea, 0x0b, 0x55, + 0x08, 0x7d, 0xe5, 0x3a, 0x43, 0x67, 0xd4, 0x0d, 0xd7, 0x09, 0xfc, 0x1c, 0xdd, 0xcb, 0x84, 0x3c, + 0x17, 0xa6, 0xfc, 0x3c, 0x56, 0xa0, 0xdd, 0x5b, 0x43, 0x67, 0x74, 0x77, 0x32, 0x20, 0x15, 0x01, + 0x62, 0x08, 0x90, 0x9a, 0x00, 0x39, 0x51, 0x42, 0x1e, 0x77, 0xe6, 0xdf, 0xf6, 0x5b, 0x61, 0x2f, + 0x13, 0xd2, 0x0e, 0x39, 0x51, 0xa0, 0x31, 0x45, 0x0f, 0xab, 0x16, 0x50, 0x46, 0x10, 0x17, 0x22, + 0xd7, 0x42, 0x49, 0x70, 0xdb, 0xc3, 0xf6, 0xa8, 0x1b, 0x62, 0x0b, 0x9d, 0x6d, 0x22, 0x47, 0x7b, + 0xef, 0x7f, 0x7e, 0x1a, 0xef, 0x36, 0xfb, 0xd9, 0xe2, 0x1c, 0x0c, 0xd0, 0xee, 0x56, 0x2a, 0xe4, + 0x90, 0x2b, 0x09, 0x3c, 0xf8, 0xea, 0xa0, 0xde, 0x14, 0xd2, 0x17, 0xa5, 0x4c, 0x2c, 0x88, 0x5d, + 0xb4, 0x13, 0x17, 0x9c, 0x69, 0x55, 0xd4, 0xea, 0x9a, 0x10, 0x7b, 0xe8, 0x4e, 0x52, 0x16, 0xcc, + 0x0c, 0xb4, 0xaa, 0x3a, 0xe1, 0x2a, 0xc6, 0x1c, 0xed, 0xb0, 0x4c, 0x95, 0x52, 0x57, 0x24, 0xff, + 0x2a, 0xf8, 0xa9, 0x11, 0xfc, 0xf1, 0xfb, 0xfe, 0x28, 0x15, 0xfa, 0xa2, 0x8c, 0x48, 0xac, 0x32, + 0x5a, 0x1f, 0x4f, 0x65, 0x0e, 0x20, 0x79, 0x43, 0xf5, 0x55, 0xce, 0xc1, 0xfe, 0x00, 0x61, 0xd3, + 0x1b, 0x63, 0xd4, 0x81, 0x9c, 0xc7, 0x6e, 0xc7, 0x32, 0xb3, 0xfe, 0xd1, 0xc0, 0x48, 0xef, 0x6f, + 0x48, 0x5f, 0x69, 0x09, 0x1e, 0xa1, 0xfe, 0x66, 0xdc, 0x88, 0x9e, 0xcc, 0x1d, 0xd4, 0x9e, 0x42, + 0x8a, 0x13, 0xd4, 0xbb, 0x71, 0xb6, 0x4f, 0xc8, 0xef, 0xee, 0x13, 0xd9, 0xda, 0x9d, 0x77, 0xf0, + 0x5f, 0x65, 0xcd, 0x34, 0xfc, 0x1a, 0x75, 0xd7, 0xeb, 0x0d, 0xfe, 0xf8, 0xef, 0xaa, 0xc6, 0x1b, + 0xff, 0xbb, 0xa6, 0x69, 0x7e, 0x7c, 0x3a, 0x5f, 0xf8, 0xce, 0xf5, 0xc2, 0x77, 0x7e, 0x2c, 0x7c, + 0xe7, 0xc3, 0xd2, 0x6f, 0x5d, 0x2f, 0xfd, 0xd6, 0x97, 0xa5, 0xdf, 0x7a, 0x35, 0xde, 0x58, 0xef, + 0x8d, 0x57, 0x34, 0x9b, 0xd0, 0xcb, 0xf5, 0x53, 0x32, 0x6b, 0x8e, 0x6e, 0xdb, 0xfb, 0xfe, 0xec, + 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0xb5, 0x24, 0x32, 0x6f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/rewards/types/types.go b/x/rewards/types/types.go index be518a4ae7..8485f37371 100644 --- a/x/rewards/types/types.go +++ b/x/rewards/types/types.go @@ -29,6 +29,11 @@ const ( ProvidersBonusRewardsEventName = "provider_bonus_rewards" ) +// Validators leftover pool for coins that were moved near the end of the month +const ( + ValidatorsRewardsLeftOverPoolName Pool = "validators_rewards_leftover_pool" +) + // BlocksToTimerExpirySlackFactor is used to calculate the number of blocks until the // next timer expiry which determine the validators block rewards. // since the time/blocks conversion can be errornous, we multiply our calculated number @@ -55,6 +60,11 @@ const ( TransferIprpcRewardToNextMonthEventName = "transfer_iprpc_reward_to_next_month" ) +// Events +const ( + ValidatorsAndCommunityFund = "validators_and_community_fund" +) + // helper struct to track the serviced IPRPC CU for each spec+provider type SpecCuType struct { ProvidersCu []ProviderCuType diff --git a/x/spec/ante/ante.go b/x/spec/ante/ante.go index f994207300..03e398e162 100644 --- a/x/spec/ante/ante.go +++ b/x/spec/ante/ante.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/gogoproto/proto" - "github.com/lavanet/lava/x/spec/keeper" + "github.com/lavanet/lava/v2/x/spec/keeper" "google.golang.org/protobuf/reflect/protoreflect" ) diff --git a/x/spec/ante/ante_test.go b/x/spec/ante/ante_test.go index 5eb105a29b..82571e5413 100644 --- a/x/spec/ante/ante_test.go +++ b/x/spec/ante/ante_test.go @@ -12,12 +12,12 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/gogoproto/proto" - "github.com/lavanet/lava/app" - testkeeper "github.com/lavanet/lava/testutil/keeper" - plantypes "github.com/lavanet/lava/x/plans/types" - "github.com/lavanet/lava/x/spec/ante" - spectypes "github.com/lavanet/lava/x/spec/types" - subsciptiontypes "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/app" + specutils "github.com/lavanet/lava/v2/utils/keeper" + plantypes "github.com/lavanet/lava/v2/x/plans/types" + "github.com/lavanet/lava/v2/x/spec/ante" + spectypes "github.com/lavanet/lava/v2/x/spec/types" + subsciptiontypes "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) @@ -181,7 +181,7 @@ func TestNewExpeditedProposalFilterAnteDecorator(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { - k, ctx := testkeeper.SpecKeeper(t) + k, ctx := specutils.SpecKeeper(t) params := spectypes.DefaultParams() params.AllowlistedExpeditedMsgs = []string{ proto.MessageName(&banktypes.MsgSend{}), diff --git a/x/spec/client/cli/query.go b/x/spec/client/cli/query.go index 4282bde293..35775385fa 100644 --- a/x/spec/client/cli/query.go +++ b/x/spec/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" ) // GetQueryCmd returns the cli query commands for this module diff --git a/x/spec/client/cli/query_params.go b/x/spec/client/cli/query_params.go index 7eee2cd29b..2f85e51834 100644 --- a/x/spec/client/cli/query_params.go +++ b/x/spec/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_show_all_chains.go b/x/spec/client/cli/query_show_all_chains.go index 87c7e526bf..a5624c3304 100644 --- a/x/spec/client/cli/query_show_all_chains.go +++ b/x/spec/client/cli/query_show_all_chains.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_show_chain_info.go b/x/spec/client/cli/query_show_chain_info.go index 7b848c7ae4..4a9fdcca62 100644 --- a/x/spec/client/cli/query_show_chain_info.go +++ b/x/spec/client/cli/query_show_chain_info.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_spec.go b/x/spec/client/cli/query_spec.go index 1bddcdcda0..6659cfd7f2 100644 --- a/x/spec/client/cli/query_spec.go +++ b/x/spec/client/cli/query_spec.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/spf13/cobra" ) diff --git a/x/spec/client/cli/query_spec_test.go b/x/spec/client/cli/query_spec_test.go index f4f5884f55..ba8612f332 100644 --- a/x/spec/client/cli/query_spec_test.go +++ b/x/spec/client/cli/query_spec_test.go @@ -12,10 +12,10 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/lavanet/lava/testutil/network" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/spec/client/cli" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/network" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/spec/client/cli" + "github.com/lavanet/lava/v2/x/spec/types" ) // Prevent strconv unused error diff --git a/x/spec/client/cli/tx.go b/x/spec/client/cli/tx.go index 344cdb44c1..feb862e039 100644 --- a/x/spec/client/cli/tx.go +++ b/x/spec/client/cli/tx.go @@ -14,9 +14,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - utilslib "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/spec/client/utils" - "github.com/lavanet/lava/x/spec/types" + utilslib "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/spec/client/utils" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/spec/client/proposal_handler.go b/x/spec/client/proposal_handler.go index 5b4bee5d8e..fbaa2d0714 100644 --- a/x/spec/client/proposal_handler.go +++ b/x/spec/client/proposal_handler.go @@ -2,7 +2,7 @@ package client import ( govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - "github.com/lavanet/lava/x/spec/client/cli" + "github.com/lavanet/lava/v2/x/spec/client/cli" ) // SpecAddProposalHandler is the param change proposal handler. diff --git a/x/spec/client/utils/utils.go b/x/spec/client/utils/utils.go index d00d19c99a..593e09ca98 100755 --- a/x/spec/client/utils/utils.go +++ b/x/spec/client/utils/utils.go @@ -10,9 +10,9 @@ import ( sdkerrors "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/spec/types" ) type ( diff --git a/x/spec/genesis.go b/x/spec/genesis.go index ef909270c3..ce7d9c737a 100644 --- a/x/spec/genesis.go +++ b/x/spec/genesis.go @@ -2,8 +2,8 @@ package spec import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/spec/keeper" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/keeper" + "github.com/lavanet/lava/v2/x/spec/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/spec/genesis_test.go b/x/spec/genesis_test.go index 0e116fbeb2..9faaa7e9ae 100644 --- a/x/spec/genesis_test.go +++ b/x/spec/genesis_test.go @@ -6,10 +6,10 @@ import ( types2 "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/gogoproto/proto" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/spec" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/nullify" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/x/spec" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -32,7 +32,7 @@ func TestGenesis(t *testing.T) { // this line is used by starport scaffolding # genesis/test/state } - k, ctx := keepertest.SpecKeeper(t) + k, ctx := specutils.SpecKeeper(t) spec.InitGenesis(ctx, *k, genesisState) got := spec.ExportGenesis(ctx, *k) require.NotNil(t, got) diff --git a/x/spec/handler.go b/x/spec/handler.go index bb5c45dbd6..5a26855c41 100644 --- a/x/spec/handler.go +++ b/x/spec/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/spec/keeper" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/keeper" + "github.com/lavanet/lava/v2/x/spec/types" ) // NewHandler ... diff --git a/x/spec/keeper/grpc_query.go b/x/spec/keeper/grpc_query.go index 2f18908d5f..b41d893c7a 100644 --- a/x/spec/keeper/grpc_query.go +++ b/x/spec/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/spec/keeper/grpc_query_params.go b/x/spec/keeper/grpc_query_params.go index 555e0cab7d..1f63cfd831 100644 --- a/x/spec/keeper/grpc_query_params.go +++ b/x/spec/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_params_test.go b/x/spec/keeper/grpc_query_params_test.go index af5963e4db..5d94e82188 100644 --- a/x/spec/keeper/grpc_query_params_test.go +++ b/x/spec/keeper/grpc_query_params_test.go @@ -4,13 +4,13 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/spec/types" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.SpecKeeper(t) + keeper, ctx := specutils.SpecKeeper(t) wctx := sdk.WrapSDKContext(ctx) params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/spec/keeper/grpc_query_show_all_chains.go b/x/spec/keeper/grpc_query_show_all_chains.go index 65779f13cf..decd07798e 100644 --- a/x/spec/keeper/grpc_query_show_all_chains.go +++ b/x/spec/keeper/grpc_query_show_all_chains.go @@ -5,8 +5,8 @@ import ( "sort" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_show_chain_info.go b/x/spec/keeper/grpc_query_show_chain_info.go index 0055a3e138..79471bc475 100644 --- a/x/spec/keeper/grpc_query_show_chain_info.go +++ b/x/spec/keeper/grpc_query_show_chain_info.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/spec/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_spec.go b/x/spec/keeper/grpc_query_spec.go index 342f0e98bc..fb3e0d2695 100644 --- a/x/spec/keeper/grpc_query_spec.go +++ b/x/spec/keeper/grpc_query_spec.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/spec/keeper/grpc_query_spec_test.go b/x/spec/keeper/grpc_query_spec_test.go index 737e63dc1a..ad97b52fbf 100644 --- a/x/spec/keeper/grpc_query_spec_test.go +++ b/x/spec/keeper/grpc_query_spec_test.go @@ -10,16 +10,16 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/nullify" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/x/spec/types" ) // Prevent strconv unused error var _ = strconv.IntSize func TestSpecQuerySingle(t *testing.T) { - keeper, ctx := keepertest.SpecKeeper(t) + keeper, ctx := specutils.SpecKeeper(t) wctx := sdk.WrapSDKContext(ctx) msgs := createNSpec(keeper, ctx, 2) for _, tc := range []struct { @@ -70,7 +70,7 @@ func TestSpecQuerySingle(t *testing.T) { } func TestSpecQuerySingleRaw(t *testing.T) { - keeper, ctx := keepertest.SpecKeeper(t) + keeper, ctx := specutils.SpecKeeper(t) wctx := sdk.WrapSDKContext(ctx) msgs := createNSpec(keeper, ctx, 2) @@ -98,7 +98,7 @@ func TestSpecQuerySingleRaw(t *testing.T) { } func TestSpecQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.SpecKeeper(t) + keeper, ctx := specutils.SpecKeeper(t) wctx := sdk.WrapSDKContext(ctx) msgs := createNSpec(keeper, ctx, 5) diff --git a/x/spec/keeper/keeper.go b/x/spec/keeper/keeper.go index 45ac8abe7f..b4a91e1cf8 100644 --- a/x/spec/keeper/keeper.go +++ b/x/spec/keeper/keeper.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" ) type ( diff --git a/x/spec/keeper/migrations.go b/x/spec/keeper/migrations.go index 2f76988f05..b376a4bbd8 100644 --- a/x/spec/keeper/migrations.go +++ b/x/spec/keeper/migrations.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/spec/types" - typesv1 "github.com/lavanet/lava/x/spec/types/migrations/v1" + "github.com/lavanet/lava/v2/x/spec/types" + typesv1 "github.com/lavanet/lava/v2/x/spec/types/migrations/v1" ) type Migrator struct { diff --git a/x/spec/keeper/msg_server.go b/x/spec/keeper/msg_server.go index 2ce40c34fe..1928d8071f 100644 --- a/x/spec/keeper/msg_server.go +++ b/x/spec/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" ) type msgServer struct { diff --git a/x/spec/keeper/msg_server_test.go b/x/spec/keeper/msg_server_test.go index a3550bf834..b15805f52b 100644 --- a/x/spec/keeper/msg_server_test.go +++ b/x/spec/keeper/msg_server_test.go @@ -5,12 +5,12 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/spec/keeper" - "github.com/lavanet/lava/x/spec/types" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/x/spec/keeper" + "github.com/lavanet/lava/v2/x/spec/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.SpecKeeper(t) + k, ctx := specutils.SpecKeeper(t) return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) } diff --git a/x/spec/keeper/params.go b/x/spec/keeper/params.go index 1f473db316..5c3aee2688 100644 --- a/x/spec/keeper/params.go +++ b/x/spec/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" ) // GetParams get all parameters as types.Params diff --git a/x/spec/keeper/params_test.go b/x/spec/keeper/params_test.go index 21c86e8964..429f0d7410 100644 --- a/x/spec/keeper/params_test.go +++ b/x/spec/keeper/params_test.go @@ -3,13 +3,13 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/spec/types" + specutils "github.com/lavanet/lava/v2/utils/keeper" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) func TestGetParams(t *testing.T) { - k, ctx := testkeeper.SpecKeeper(t) + k, ctx := specutils.SpecKeeper(t) params := types.DefaultParams() k.SetParams(ctx, params) diff --git a/x/spec/keeper/spec.go b/x/spec/keeper/spec.go index 905d9d6ff2..0a98074cdc 100644 --- a/x/spec/keeper/spec.go +++ b/x/spec/keeper/spec.go @@ -9,10 +9,10 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/sigs" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/sigs" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/spec/types" ) // SetSpec set a specific Spec in the store from its index @@ -324,7 +324,7 @@ func (k Keeper) IsFinalizedBlock(ctx sdk.Context, chainID string, requestedBlock if !found { return false } - return types.IsFinalizedBlock(requestedBlock, latestBlock, spec.BlockDistanceForFinalizedData) + return types.IsFinalizedBlock(requestedBlock, latestBlock, int64(spec.BlockDistanceForFinalizedData)) } // returns the reward per contributor diff --git a/x/spec/keeper/spec_test.go b/x/spec/keeper/spec_test.go index fb98cd866c..f8fdd05a33 100644 --- a/x/spec/keeper/spec_test.go +++ b/x/spec/keeper/spec_test.go @@ -9,12 +9,13 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/spec/client/utils" - "github.com/lavanet/lava/x/spec/keeper" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/cmd/lavad/cmd" + "github.com/lavanet/lava/v2/testutil/common" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/spec/client/utils" + "github.com/lavanet/lava/v2/x/spec/keeper" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) @@ -225,6 +226,14 @@ func TestSpecRemove(t *testing.T) { } } +func TestMain(m *testing.M) { + // This code will run once before any test cases are executed. + cmd.InitSDKConfig() + // Run the actual tests + exitCode := m.Run() + os.Exit(exitCode) +} + func TestSpecGetAll(t *testing.T) { ts := newTester(t) items := ts.createNSpec(10) diff --git a/x/spec/module.go b/x/spec/module.go index 5244792d52..f18efc00ea 100644 --- a/x/spec/module.go +++ b/x/spec/module.go @@ -16,9 +16,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/spec/client/cli" - "github.com/lavanet/lava/x/spec/keeper" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/client/cli" + "github.com/lavanet/lava/v2/x/spec/keeper" + "github.com/lavanet/lava/v2/x/spec/types" ) var ( diff --git a/x/spec/module_simulation.go b/x/spec/module_simulation.go index fc3a50c2a4..47b54a3504 100644 --- a/x/spec/module_simulation.go +++ b/x/spec/module_simulation.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - specsimulation "github.com/lavanet/lava/x/spec/simulation" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/testutil/sample" + specsimulation "github.com/lavanet/lava/v2/x/spec/simulation" + "github.com/lavanet/lava/v2/x/spec/types" ) // avoid unused import issue diff --git a/x/spec/proposal_handler.go b/x/spec/proposal_handler.go index 4f63b3fd0d..735aa4d206 100644 --- a/x/spec/proposal_handler.go +++ b/x/spec/proposal_handler.go @@ -12,10 +12,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramkeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/lavanet/lava/utils" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - "github.com/lavanet/lava/x/spec/keeper" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + "github.com/lavanet/lava/v2/x/spec/keeper" + "github.com/lavanet/lava/v2/x/spec/types" ) // overwriting the params handler so we can add events and callbacks on specific params @@ -45,7 +45,7 @@ func HandleParameterChangeProposal(ctx sdk.Context, k paramkeeper.Keeper, p *par {Key: "value", Value: c.Value}, } if c.Key == string(epochstoragetypes.KeyLatestParamChange) { - return utils.LavaFormatWarning("Gov Proposal Param Change Error", fmt.Errorf("tried to modify "+string(epochstoragetypes.KeyLatestParamChange)), + return utils.LavaFormatWarning("Gov Proposal Param Change Error", fmt.Errorf("tried to modify %s", string(epochstoragetypes.KeyLatestParamChange)), details..., ) } diff --git a/x/spec/types/api_collection.pb.go b/x/spec/types/api_collection.pb.go index 699c53c289..ef4b5ba4fe 100644 --- a/x/spec/types/api_collection.pb.go +++ b/x/spec/types/api_collection.pb.go @@ -58,6 +58,9 @@ const ( FUNCTION_TAG_SET_LATEST_IN_BODY FUNCTION_TAG = 4 FUNCTION_TAG_VERIFICATION FUNCTION_TAG = 5 FUNCTION_TAG_GET_EARLIEST_BLOCK FUNCTION_TAG = 6 + FUNCTION_TAG_SUBSCRIBE FUNCTION_TAG = 7 + FUNCTION_TAG_UNSUBSCRIBE FUNCTION_TAG = 8 + FUNCTION_TAG_UNSUBSCRIBE_ALL FUNCTION_TAG = 9 ) var FUNCTION_TAG_name = map[int32]string{ @@ -68,6 +71,9 @@ var FUNCTION_TAG_name = map[int32]string{ 4: "SET_LATEST_IN_BODY", 5: "VERIFICATION", 6: "GET_EARLIEST_BLOCK", + 7: "SUBSCRIBE", + 8: "UNSUBSCRIBE", + 9: "UNSUBSCRIBE_ALL", } var FUNCTION_TAG_value = map[string]int32{ @@ -78,6 +84,9 @@ var FUNCTION_TAG_value = map[string]int32{ "SET_LATEST_IN_BODY": 4, "VERIFICATION": 5, "GET_EARLIEST_BLOCK": 6, + "SUBSCRIBE": 7, + "UNSUBSCRIBE": 8, + "UNSUBSCRIBE_ALL": 9, } func (x FUNCTION_TAG) String() string { @@ -98,6 +107,7 @@ const ( PARSER_TYPE_EXTENSION_ARG PARSER_TYPE = 4 PARSER_TYPE_IDENTIFIER PARSER_TYPE = 5 PARSER_TYPE_DEFAULT_VALUE PARSER_TYPE = 6 + PARSER_TYPE_BLOCK_HASH PARSER_TYPE = 7 ) var PARSER_TYPE_name = map[int32]string{ @@ -108,6 +118,7 @@ var PARSER_TYPE_name = map[int32]string{ 4: "EXTENSION_ARG", 5: "IDENTIFIER", 6: "DEFAULT_VALUE", + 7: "BLOCK_HASH", } var PARSER_TYPE_value = map[string]int32{ @@ -118,6 +129,7 @@ var PARSER_TYPE_value = map[string]int32{ "EXTENSION_ARG": 4, "IDENTIFIER": 5, "DEFAULT_VALUE": 6, + "BLOCK_HASH": 7, } func (x PARSER_TYPE) String() string { @@ -922,6 +934,7 @@ type GenericParser struct { ParsePath string `protobuf:"bytes,1,opt,name=parse_path,json=parsePath,proto3" json:"parse_path,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` ParseType PARSER_TYPE `protobuf:"varint,3,opt,name=parse_type,json=parseType,proto3,enum=lavanet.lava.spec.PARSER_TYPE" json:"parse_type,omitempty"` + Rule string `protobuf:"bytes,4,opt,name=rule,proto3" json:"rule,omitempty"` } func (m *GenericParser) Reset() { *m = GenericParser{} } @@ -978,6 +991,13 @@ func (m *GenericParser) GetParseType() PARSER_TYPE { return PARSER_TYPE_NO_PARSER } +func (m *GenericParser) GetRule() string { + if m != nil { + return m.Rule + } + return "" +} + type SpecCategory struct { Deterministic bool `protobuf:"varint,1,opt,name=deterministic,proto3" json:"deterministic,omitempty"` Local bool `protobuf:"varint,2,opt,name=local,proto3" json:"local,omitempty"` @@ -1080,105 +1100,108 @@ func init() { } var fileDescriptor_c9f7567a181f534f = []byte{ - // 1559 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0x4f, 0x6f, 0xdb, 0xc8, - 0x15, 0x37, 0x25, 0x4a, 0x96, 0x9e, 0xfe, 0x98, 0x9e, 0xb8, 0xa9, 0x36, 0xf5, 0x4a, 0x2e, 0x37, - 0x6d, 0x0d, 0x2f, 0x6a, 0xa3, 0x0e, 0x0a, 0x14, 0x8b, 0x16, 0x2d, 0x25, 0xd1, 0x5e, 0x25, 0xb2, - 0x64, 0x8c, 0x68, 0xb7, 0xee, 0x85, 0x18, 0x53, 0x63, 0x79, 0xb0, 0x14, 0x49, 0x90, 0x43, 0xd7, - 0x3e, 0x6f, 0x3f, 0x40, 0x3f, 0x43, 0x4f, 0x05, 0x0a, 0x14, 0xe8, 0xb7, 0xc8, 0x31, 0xc7, 0x9e, - 0x8c, 0xc2, 0x39, 0x14, 0xcd, 0x31, 0x97, 0xa2, 0x87, 0x02, 0xc5, 0x0c, 0x29, 0x59, 0x74, 0x14, - 0x2f, 0x72, 0x92, 0xe7, 0xf7, 0x7e, 0xef, 0x37, 0x6f, 0xde, 0x7b, 0xf3, 0xc6, 0x84, 0x1f, 0xbb, - 0xe4, 0x8a, 0x78, 0x94, 0xef, 0x89, 0xdf, 0xbd, 0x28, 0xa0, 0xce, 0x1e, 0x09, 0x98, 0xed, 0xf8, - 0xae, 0x4b, 0x1d, 0xce, 0x7c, 0x6f, 0x37, 0x08, 0x7d, 0xee, 0xa3, 0xf5, 0x94, 0xb7, 0x2b, 0x7e, - 0x77, 0x05, 0xef, 0xd9, 0xc6, 0xc4, 0x9f, 0xf8, 0xd2, 0xba, 0x27, 0xfe, 0x4a, 0x88, 0xfa, 0xff, - 0xf2, 0x50, 0x33, 0x02, 0xd6, 0x99, 0x0b, 0xa0, 0x06, 0xac, 0x52, 0x8f, 0x9c, 0xbb, 0x74, 0xdc, - 0x50, 0xb6, 0x94, 0xed, 0x12, 0x9e, 0x2d, 0xd1, 0x31, 0xac, 0xdd, 0x6f, 0x64, 0x8f, 0x09, 0x27, - 0x8d, 0xdc, 0x96, 0xb2, 0x5d, 0xd9, 0xff, 0xe1, 0xee, 0x07, 0xdb, 0xed, 0xde, 0x2b, 0x76, 0x09, - 0x27, 0x6d, 0xf5, 0xf5, 0x6d, 0x6b, 0x05, 0xd7, 0x9d, 0x0c, 0x8a, 0x76, 0x40, 0x25, 0x01, 0x8b, - 0x1a, 0xf9, 0xad, 0xfc, 0x76, 0x65, 0xff, 0xe9, 0x12, 0x19, 0x23, 0x60, 0x58, 0x72, 0xd0, 0x0b, - 0x58, 0xbd, 0xa4, 0x64, 0x4c, 0xc3, 0xa8, 0xa1, 0x4a, 0xfa, 0x67, 0x4b, 0xe8, 0x5f, 0x4b, 0x06, - 0x9e, 0x31, 0x51, 0x1f, 0x34, 0xe6, 0x5d, 0xd2, 0x90, 0x71, 0xe2, 0x39, 0xd4, 0x96, 0x9b, 0x15, - 0xa4, 0xf7, 0x77, 0xc7, 0x8c, 0xd7, 0x16, 0x5c, 0x0d, 0x11, 0x42, 0x1f, 0xb4, 0x80, 0x84, 0x11, - 0xb5, 0xc7, 0x2c, 0x14, 0xbc, 0x2b, 0x1a, 0x35, 0x8a, 0x1f, 0x55, 0x3b, 0x16, 0xd4, 0xee, 0x8c, - 0x89, 0xd7, 0x82, 0xcc, 0x3a, 0x42, 0xbf, 0x04, 0xa0, 0xd7, 0x9c, 0x7a, 0x11, 0xf3, 0xbd, 0xa8, - 0xb1, 0x2a, 0x75, 0x36, 0x97, 0xe8, 0x98, 0x33, 0x12, 0x5e, 0xe0, 0x23, 0x13, 0x6a, 0x57, 0x34, - 0x64, 0x17, 0xcc, 0x21, 0x5c, 0x0a, 0x94, 0xa4, 0x40, 0x6b, 0x89, 0xc0, 0xe9, 0x02, 0x0f, 0x67, - 0xbd, 0xf4, 0x3f, 0x40, 0x79, 0xae, 0x8f, 0x10, 0xa8, 0x1e, 0x99, 0x52, 0x59, 0xf7, 0x32, 0x96, - 0x7f, 0xa3, 0x2f, 0x41, 0x0d, 0x63, 0x97, 0x36, 0xf2, 0xb2, 0xd2, 0xdf, 0x5f, 0x22, 0x8f, 0x63, - 0x97, 0x62, 0x49, 0x42, 0x5f, 0x40, 0xcd, 0x89, 0xed, 0x69, 0xec, 0x72, 0x16, 0xb8, 0x8c, 0x86, - 0x0d, 0x75, 0x4b, 0xd9, 0x56, 0x71, 0xd5, 0x89, 0x8f, 0xe6, 0xd8, 0x4b, 0xb5, 0x94, 0xd3, 0xf2, - 0xfa, 0x26, 0xa8, 0xc2, 0x11, 0x6d, 0x40, 0xe1, 0xdc, 0xf5, 0x9d, 0x6f, 0xe4, 0xa6, 0x2a, 0x4e, - 0x16, 0xfa, 0x5f, 0x15, 0xa8, 0x2e, 0x86, 0xbd, 0x34, 0xb4, 0x97, 0xb0, 0xf6, 0xa0, 0x1c, 0x8f, - 0xf4, 0xe3, 0x83, 0x6a, 0xd4, 0xb3, 0xd5, 0x40, 0x3f, 0x87, 0xe2, 0x15, 0x71, 0x63, 0x3a, 0xeb, - 0xc5, 0xcf, 0x3f, 0x26, 0x71, 0x2a, 0x58, 0x38, 0x25, 0xbf, 0x54, 0x4b, 0xaa, 0x56, 0xd0, 0xff, - 0xab, 0x00, 0xdc, 0x1b, 0xd1, 0x26, 0x94, 0xe7, 0x85, 0x4a, 0x03, 0xbe, 0x07, 0xd0, 0x8f, 0xa0, - 0x4e, 0xaf, 0x03, 0xea, 0x70, 0x3a, 0xb6, 0xa5, 0x8a, 0x0c, 0xba, 0x8c, 0x6b, 0x33, 0x34, 0x11, - 0xf9, 0x09, 0xac, 0xb9, 0x84, 0xd3, 0x88, 0xdb, 0x63, 0x16, 0xc9, 0x16, 0x94, 0x25, 0x50, 0x71, - 0x3d, 0x81, 0xbb, 0x29, 0x8a, 0x06, 0x50, 0x8a, 0xa8, 0x28, 0x2a, 0xbf, 0x91, 0xe9, 0xae, 0xef, - 0xef, 0x3f, 0x1a, 0x7b, 0xa6, 0x1d, 0x46, 0xa9, 0x27, 0x9e, 0x6b, 0xe8, 0x3f, 0x85, 0x8d, 0x65, - 0x0c, 0x54, 0x02, 0xf5, 0x80, 0x30, 0x57, 0x5b, 0x41, 0x15, 0x58, 0xfd, 0x2d, 0x09, 0x3d, 0xe6, - 0x4d, 0x34, 0x45, 0xff, 0x7b, 0x0e, 0xea, 0xd9, 0x7b, 0x83, 0x4e, 0xa1, 0x26, 0x86, 0x12, 0xf3, - 0x38, 0x0d, 0x2f, 0x88, 0x93, 0x16, 0xad, 0xfd, 0xb3, 0x77, 0xb7, 0xad, 0xac, 0xe1, 0xfd, 0x6d, - 0x6b, 0x73, 0x4a, 0x82, 0x88, 0x87, 0xb1, 0xc3, 0xe3, 0x90, 0x7e, 0xa5, 0x67, 0xcc, 0x3a, 0xae, - 0x92, 0x80, 0xf5, 0x66, 0x4b, 0xa1, 0x2b, 0x6d, 0x1e, 0x71, 0xed, 0x80, 0xf0, 0xcb, 0x24, 0x71, - 0x89, 0x6e, 0xc6, 0xf0, 0xa1, 0x6e, 0xc6, 0xac, 0xe3, 0xea, 0x6c, 0x7d, 0x4c, 0xf8, 0x25, 0x7a, - 0x01, 0x2a, 0xbf, 0x09, 0x92, 0xfc, 0x96, 0xdb, 0xad, 0x77, 0xb7, 0x2d, 0xb9, 0x7e, 0x7f, 0xdb, - 0x7a, 0x92, 0x55, 0x11, 0xa8, 0x8e, 0xa5, 0x11, 0x7d, 0x05, 0x45, 0x32, 0x1e, 0xdb, 0xbe, 0x27, - 0x93, 0x5e, 0x6e, 0x7f, 0xf1, 0xee, 0xb6, 0x95, 0x22, 0xef, 0x6f, 0x5b, 0xdf, 0x7b, 0x70, 0x2c, - 0x89, 0xeb, 0xb8, 0x40, 0xc6, 0xe3, 0xa1, 0xa7, 0xff, 0x4b, 0x81, 0x62, 0x32, 0xa9, 0x96, 0xf6, - 0xf5, 0x2f, 0x40, 0xfd, 0x86, 0x79, 0x63, 0x79, 0xbc, 0xfa, 0xfe, 0xf3, 0x8f, 0x8e, 0xb9, 0xf4, - 0xc7, 0xba, 0x09, 0x28, 0x96, 0x1e, 0xa8, 0x0d, 0xd5, 0x8b, 0xd8, 0x4b, 0xe6, 0x33, 0x27, 0x13, - 0x79, 0xa2, 0xfa, 0xd2, 0x99, 0x70, 0x70, 0x32, 0xe8, 0x58, 0xbd, 0xe1, 0xc0, 0xb6, 0x8c, 0x43, - 0x5c, 0x99, 0x39, 0x59, 0x64, 0xa2, 0xbf, 0x02, 0xb8, 0xd7, 0x45, 0x35, 0x28, 0x07, 0x24, 0x8a, - 0xec, 0x88, 0x7a, 0x63, 0x6d, 0x05, 0xd5, 0x01, 0xe4, 0x32, 0xa4, 0x81, 0x7b, 0xa3, 0x29, 0x73, - 0xf3, 0xb9, 0xcf, 0x2f, 0xb5, 0x1c, 0x5a, 0x83, 0x8a, 0x5c, 0xb2, 0x89, 0xe7, 0x87, 0x54, 0xcb, - 0xeb, 0xff, 0xc9, 0x41, 0xde, 0x08, 0xd8, 0x23, 0x8f, 0xca, 0x2c, 0x01, 0xb9, 0x85, 0x04, 0x88, - 0x31, 0xe2, 0x4f, 0x83, 0x98, 0x53, 0x3b, 0xf6, 0x18, 0x8f, 0xd2, 0xce, 0xaf, 0xa6, 0xe0, 0x89, - 0xc0, 0xd0, 0x2e, 0x3c, 0xa1, 0xd7, 0x3c, 0x24, 0x76, 0x96, 0x9a, 0x4c, 0x9c, 0x75, 0x69, 0xea, - 0x2c, 0xf2, 0x0d, 0x28, 0x39, 0x84, 0xd3, 0x89, 0x1f, 0xde, 0x34, 0x8a, 0x72, 0x4c, 0x2c, 0xcb, - 0xcb, 0x28, 0xa0, 0x4e, 0x27, 0xa5, 0xa5, 0x8f, 0xd6, 0xdc, 0x0d, 0xf5, 0xa0, 0x26, 0xc7, 0x93, - 0x2d, 0x86, 0x07, 0xf3, 0x26, 0x8d, 0x55, 0xa9, 0xd3, 0x5c, 0xa2, 0xd3, 0x16, 0x3c, 0x79, 0xe9, - 0xc2, 0x54, 0xa6, 0x7a, 0x3e, 0x83, 0x98, 0x37, 0x41, 0x9f, 0x03, 0x70, 0x36, 0xa5, 0x7e, 0xcc, - 0xed, 0xa9, 0x98, 0xdd, 0x22, 0xe8, 0x72, 0x8a, 0x1c, 0x45, 0xe8, 0x37, 0xb0, 0x2a, 0x07, 0x54, - 0x18, 0x35, 0xca, 0x72, 0x1e, 0x6d, 0x2d, 0xd9, 0xe3, 0x90, 0x7a, 0x34, 0x64, 0x4e, 0x66, 0x97, - 0x99, 0x9b, 0xfe, 0x6f, 0x05, 0xea, 0xd9, 0x99, 0xf7, 0x41, 0x77, 0x28, 0x9f, 0xde, 0x1d, 0xe8, - 0x4b, 0x58, 0xbf, 0xd7, 0xa0, 0xd3, 0x40, 0x0c, 0xa3, 0xb4, 0x76, 0xda, 0x9c, 0x97, 0xe2, 0xe8, - 0x15, 0xd4, 0x43, 0x1a, 0xc5, 0x2e, 0x9f, 0x27, 0x2c, 0xff, 0x09, 0x09, 0xab, 0x25, 0xbe, 0xb3, - 0x8c, 0x7d, 0x06, 0x25, 0x31, 0x1d, 0x64, 0xb3, 0xc8, 0x2b, 0x87, 0x57, 0x49, 0xc0, 0x06, 0x64, - 0x4a, 0xf5, 0xbf, 0x29, 0x50, 0x59, 0xf0, 0x17, 0xc9, 0x4d, 0xd2, 0x60, 0x93, 0x50, 0x1c, 0x33, - 0x2f, 0x26, 0x70, 0x82, 0x18, 0xe1, 0x04, 0xfd, 0x5a, 0x74, 0xa9, 0x34, 0x8b, 0x88, 0xd3, 0x6b, - 0xb6, 0x2c, 0xa6, 0x63, 0x03, 0x8f, 0x4c, 0x6c, 0x8b, 0x6c, 0xe0, 0x54, 0xf1, 0x20, 0xf6, 0x1c, - 0xd1, 0x9f, 0x63, 0x7a, 0x41, 0xc4, 0xc1, 0x92, 0x09, 0x2e, 0x27, 0x07, 0xae, 0xa6, 0x60, 0x32, - 0xc0, 0x9f, 0x41, 0x89, 0x7a, 0x8e, 0x3f, 0x16, 0xc7, 0x4e, 0xe2, 0x9d, 0xaf, 0xf5, 0x6f, 0x15, - 0xa8, 0x65, 0xaa, 0x37, 0x0f, 0x39, 0x19, 0x6c, 0xe9, 0xa3, 0x21, 0x11, 0x39, 0xa2, 0x36, 0xa0, - 0xb0, 0xf8, 0x56, 0x24, 0x0b, 0xf4, 0xab, 0x99, 0xd3, 0x7c, 0x7c, 0x3d, 0x7a, 0x0e, 0xeb, 0xec, - 0xd8, 0x4c, 0x45, 0xc5, 0xdd, 0x96, 0x8f, 0xec, 0x62, 0xbf, 0xa3, 0xe7, 0xe2, 0x5c, 0x9c, 0x86, - 0x53, 0xe6, 0xb1, 0x88, 0x33, 0x27, 0xbd, 0xab, 0x59, 0x50, 0xc4, 0xe2, 0xfa, 0x0e, 0x71, 0x65, - 0x2c, 0x25, 0x9c, 0x2c, 0x90, 0x0e, 0xd5, 0x28, 0x3e, 0x8f, 0x9c, 0x90, 0x05, 0xa2, 0x07, 0x64, - 0x34, 0x25, 0x9c, 0xc1, 0x44, 0x4a, 0x22, 0x4e, 0x38, 0xbd, 0x88, 0x5d, 0x99, 0x92, 0x1a, 0x9e, - 0xaf, 0x51, 0x0b, 0x2a, 0x97, 0xc4, 0x9b, 0x30, 0x6f, 0x22, 0xfe, 0x4b, 0x6b, 0x14, 0xa4, 0x3b, - 0xa4, 0x90, 0x11, 0xb0, 0x1d, 0x1d, 0xca, 0xe6, 0xef, 0x2c, 0x73, 0x30, 0xea, 0x0d, 0x07, 0xe2, - 0x31, 0x1a, 0x0c, 0x07, 0x66, 0xf2, 0x18, 0x19, 0xb8, 0xf3, 0x75, 0xef, 0xd4, 0xd4, 0x94, 0x9d, - 0x3f, 0x2b, 0x50, 0x5d, 0xec, 0x5d, 0x54, 0x85, 0x52, 0xb7, 0x37, 0x32, 0xda, 0x7d, 0xb3, 0xab, - 0xad, 0x20, 0x0d, 0xaa, 0x87, 0xa6, 0x65, 0xb7, 0xfb, 0xc3, 0xce, 0xab, 0xc1, 0xc9, 0x91, 0xa6, - 0xa0, 0x0d, 0xd0, 0xe6, 0x88, 0xdd, 0x3e, 0xb3, 0x05, 0x9a, 0x43, 0xcf, 0xe0, 0xe9, 0xc8, 0xb4, - 0xec, 0xbe, 0x61, 0x99, 0x23, 0xcb, 0xee, 0x0d, 0xec, 0x23, 0xd3, 0x32, 0xba, 0x86, 0x65, 0x68, - 0x79, 0xf4, 0x14, 0x50, 0xd6, 0xd6, 0x1e, 0x76, 0xcf, 0x34, 0x55, 0x68, 0x9f, 0x9a, 0xb8, 0x77, - 0xd0, 0xeb, 0x18, 0x62, 0x77, 0xad, 0x20, 0x98, 0x42, 0xdb, 0x34, 0x70, 0xbf, 0x27, 0xb8, 0x72, - 0x13, 0xad, 0xb8, 0xf3, 0x47, 0x05, 0x2a, 0x0b, 0x15, 0x11, 0x33, 0x74, 0x30, 0xb4, 0x13, 0x24, - 0x09, 0x32, 0x09, 0x27, 0xd9, 0x42, 0x53, 0x10, 0x82, 0x7a, 0x82, 0xcc, 0xa4, 0xb4, 0x1c, 0x02, - 0x28, 0x62, 0x73, 0x74, 0xd2, 0xb7, 0xb4, 0x3c, 0x5a, 0x87, 0xda, 0x3c, 0x33, 0xb6, 0x81, 0x0f, - 0x35, 0x55, 0xcc, 0xe9, 0x5e, 0xd7, 0x1c, 0x58, 0xbd, 0x83, 0x9e, 0x89, 0xb5, 0x82, 0xa0, 0x74, - 0xcd, 0x03, 0xe3, 0xa4, 0x6f, 0xd9, 0xa7, 0x46, 0xff, 0xc4, 0xd4, 0x8a, 0x3b, 0xdf, 0xde, 0x87, - 0x21, 0x52, 0x86, 0xca, 0x50, 0x30, 0x8f, 0x8e, 0xad, 0xb3, 0x24, 0x04, 0x69, 0x11, 0x19, 0x11, - 0x7a, 0x0a, 0x7a, 0x02, 0x6b, 0x09, 0xd2, 0x31, 0x06, 0xc3, 0x41, 0xaf, 0x63, 0xf4, 0xb5, 0x9c, - 0x48, 0x5e, 0x02, 0x76, 0x7b, 0x32, 0xe3, 0x06, 0x3e, 0xd3, 0xf2, 0xa8, 0x05, 0x3f, 0x78, 0x88, - 0xda, 0x43, 0x6c, 0x0f, 0x71, 0xd7, 0xc4, 0x66, 0x57, 0x53, 0x45, 0xc5, 0xd2, 0x58, 0xb4, 0x62, - 0xbb, 0xfd, 0x97, 0xbb, 0xa6, 0xf2, 0xfa, 0xae, 0xa9, 0xbc, 0xb9, 0x6b, 0x2a, 0xff, 0xbc, 0x6b, - 0x2a, 0x7f, 0x7a, 0xdb, 0x5c, 0x79, 0xf3, 0xb6, 0xb9, 0xf2, 0x8f, 0xb7, 0xcd, 0x95, 0xdf, 0x3f, - 0x9f, 0x30, 0x7e, 0x19, 0x9f, 0xef, 0x3a, 0xfe, 0x74, 0x2f, 0xf3, 0xe5, 0x73, 0x9d, 0x7c, 0xfb, - 0x88, 0xbe, 0x8f, 0xce, 0x8b, 0xf2, 0x53, 0xe6, 0xc5, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x17, - 0x19, 0xc0, 0x60, 0x1d, 0x0d, 0x00, 0x00, + // 1606 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x57, 0xcf, 0x6f, 0xdb, 0xc8, + 0x15, 0x36, 0x25, 0xea, 0xd7, 0xb3, 0x24, 0x4f, 0x26, 0x6e, 0xaa, 0x4d, 0xb3, 0x96, 0xcb, 0xdd, + 0x76, 0x03, 0x2f, 0x6a, 0xa3, 0x0e, 0x0a, 0x14, 0x8b, 0x16, 0x2d, 0x25, 0xd1, 0x89, 0x12, 0x59, + 0x32, 0x46, 0xb4, 0x5b, 0xf7, 0x42, 0x8c, 0xa9, 0xb1, 0x3c, 0x58, 0x8a, 0x24, 0xc8, 0xa1, 0x1b, + 0x9f, 0xfb, 0x0f, 0xf4, 0x50, 0xa0, 0xff, 0x42, 0x81, 0x02, 0x05, 0xfa, 0x5f, 0xec, 0x71, 0x6f, + 0xed, 0xc9, 0x28, 0x92, 0x43, 0xd1, 0x1c, 0x73, 0x29, 0x7a, 0x28, 0x50, 0xcc, 0x90, 0xfa, 0xc1, + 0x44, 0x71, 0x91, 0x93, 0x34, 0xdf, 0x7c, 0xf3, 0xcd, 0x9b, 0xf7, 0xde, 0x7c, 0x23, 0xc1, 0x0f, + 0x3d, 0x7a, 0x4d, 0x7d, 0x26, 0x0e, 0xe4, 0xe7, 0x41, 0x1c, 0x32, 0xf7, 0x80, 0x86, 0xdc, 0x71, + 0x03, 0xcf, 0x63, 0xae, 0xe0, 0x81, 0xbf, 0x1f, 0x46, 0x81, 0x08, 0xf0, 0xbd, 0x8c, 0xb7, 0x2f, + 0x3f, 0xf7, 0x25, 0xef, 0xe1, 0xf6, 0x34, 0x98, 0x06, 0x6a, 0xf6, 0x40, 0x7e, 0x4b, 0x89, 0xc6, + 0x7f, 0x8b, 0xd0, 0x30, 0x43, 0xde, 0x5d, 0x08, 0xe0, 0x16, 0x54, 0x98, 0x4f, 0x2f, 0x3c, 0x36, + 0x69, 0x69, 0xbb, 0xda, 0xe3, 0x2a, 0x99, 0x0f, 0xf1, 0x09, 0x6c, 0x2d, 0x37, 0x72, 0x26, 0x54, + 0xd0, 0x56, 0x61, 0x57, 0x7b, 0xbc, 0x79, 0xf8, 0xfd, 0xfd, 0xf7, 0xb6, 0xdb, 0x5f, 0x2a, 0xf6, + 0xa8, 0xa0, 0x1d, 0xfd, 0x9b, 0xdb, 0xf6, 0x06, 0x69, 0xba, 0x39, 0x14, 0xef, 0x81, 0x4e, 0x43, + 0x1e, 0xb7, 0x8a, 0xbb, 0xc5, 0xc7, 0x9b, 0x87, 0x0f, 0xd6, 0xc8, 0x98, 0x21, 0x27, 0x8a, 0x83, + 0x9f, 0x40, 0xe5, 0x8a, 0xd1, 0x09, 0x8b, 0xe2, 0x96, 0xae, 0xe8, 0x9f, 0xac, 0xa1, 0x3f, 0x53, + 0x0c, 0x32, 0x67, 0xe2, 0x01, 0x20, 0xee, 0x5f, 0xb1, 0x88, 0x0b, 0xea, 0xbb, 0xcc, 0x51, 0x9b, + 0x95, 0xd4, 0xea, 0xff, 0x1f, 0x33, 0xd9, 0x5a, 0x59, 0x6a, 0xca, 0x10, 0x06, 0x80, 0x42, 0x1a, + 0xc5, 0xcc, 0x99, 0xf0, 0x48, 0xf2, 0xae, 0x59, 0xdc, 0x2a, 0x7f, 0x50, 0xed, 0x44, 0x52, 0x7b, + 0x73, 0x26, 0xd9, 0x0a, 0x73, 0xe3, 0x18, 0xff, 0x0c, 0x80, 0xbd, 0x14, 0xcc, 0x8f, 0x79, 0xe0, + 0xc7, 0xad, 0x8a, 0xd2, 0x79, 0xb4, 0x46, 0xc7, 0x9a, 0x93, 0xc8, 0x0a, 0x1f, 0x5b, 0xd0, 0xb8, + 0x66, 0x11, 0xbf, 0xe4, 0x2e, 0x15, 0x4a, 0xa0, 0xaa, 0x04, 0xda, 0x6b, 0x04, 0xce, 0x56, 0x78, + 0x24, 0xbf, 0xca, 0xf8, 0x2d, 0xd4, 0x16, 0xfa, 0x18, 0x83, 0xee, 0xd3, 0x19, 0x53, 0x75, 0xaf, + 0x11, 0xf5, 0x1d, 0x7f, 0x09, 0x7a, 0x94, 0x78, 0xac, 0x55, 0x54, 0x95, 0xfe, 0xee, 0x1a, 0x79, + 0x92, 0x78, 0x8c, 0x28, 0x12, 0xfe, 0x0c, 0x1a, 0x6e, 0xe2, 0xcc, 0x12, 0x4f, 0xf0, 0xd0, 0xe3, + 0x2c, 0x6a, 0xe9, 0xbb, 0xda, 0x63, 0x9d, 0xd4, 0xdd, 0xe4, 0x78, 0x81, 0x3d, 0xd7, 0xab, 0x05, + 0x54, 0x34, 0x1e, 0x81, 0x2e, 0x17, 0xe2, 0x6d, 0x28, 0x5d, 0x78, 0x81, 0xfb, 0xb5, 0xda, 0x54, + 0x27, 0xe9, 0xc0, 0xf8, 0xb3, 0x06, 0xf5, 0xd5, 0xb0, 0xd7, 0x86, 0xf6, 0x1c, 0xb6, 0xde, 0x29, + 0xc7, 0x1d, 0xfd, 0xf8, 0x4e, 0x35, 0x9a, 0xf9, 0x6a, 0xe0, 0x9f, 0x40, 0xf9, 0x9a, 0x7a, 0x09, + 0x9b, 0xf7, 0xe2, 0xa7, 0x1f, 0x92, 0x38, 0x93, 0x2c, 0x92, 0x91, 0x9f, 0xeb, 0x55, 0x1d, 0x95, + 0x8c, 0xff, 0x68, 0x00, 0xcb, 0x49, 0xfc, 0x08, 0x6a, 0x8b, 0x42, 0x65, 0x01, 0x2f, 0x01, 0xfc, + 0x03, 0x68, 0xb2, 0x97, 0x21, 0x73, 0x05, 0x9b, 0x38, 0x4a, 0x45, 0x05, 0x5d, 0x23, 0x8d, 0x39, + 0x9a, 0x8a, 0x7c, 0x01, 0x5b, 0x1e, 0x15, 0x2c, 0x16, 0xce, 0x84, 0xc7, 0xaa, 0x05, 0x55, 0x09, + 0x74, 0xd2, 0x4c, 0xe1, 0x5e, 0x86, 0xe2, 0x21, 0x54, 0x63, 0x26, 0x8b, 0x2a, 0x6e, 0x54, 0xba, + 0x9b, 0x87, 0x87, 0x77, 0xc6, 0x9e, 0x6b, 0x87, 0x71, 0xb6, 0x92, 0x2c, 0x34, 0x8c, 0x1f, 0xc1, + 0xf6, 0x3a, 0x06, 0xae, 0x82, 0x7e, 0x44, 0xb9, 0x87, 0x36, 0xf0, 0x26, 0x54, 0x7e, 0x45, 0x23, + 0x9f, 0xfb, 0x53, 0xa4, 0x19, 0x7f, 0x2d, 0x40, 0x33, 0x7f, 0x6f, 0xf0, 0x19, 0x34, 0xa4, 0x29, + 0x71, 0x5f, 0xb0, 0xe8, 0x92, 0xba, 0x59, 0xd1, 0x3a, 0x3f, 0x7e, 0x73, 0xdb, 0xce, 0x4f, 0xbc, + 0xbd, 0x6d, 0x3f, 0x9a, 0xd1, 0x30, 0x16, 0x51, 0xe2, 0x8a, 0x24, 0x62, 0x5f, 0x19, 0xb9, 0x69, + 0x83, 0xd4, 0x69, 0xc8, 0xfb, 0xf3, 0xa1, 0xd4, 0x55, 0x73, 0x3e, 0xf5, 0x9c, 0x90, 0x8a, 0xab, + 0x34, 0x71, 0xa9, 0x6e, 0x6e, 0xe2, 0x7d, 0xdd, 0xdc, 0xb4, 0x41, 0xea, 0xf3, 0xf1, 0x09, 0x15, + 0x57, 0xf8, 0x09, 0xe8, 0xe2, 0x26, 0x4c, 0xf3, 0x5b, 0xeb, 0xb4, 0xdf, 0xdc, 0xb6, 0xd5, 0xf8, + 0xed, 0x6d, 0xfb, 0x7e, 0x5e, 0x45, 0xa2, 0x06, 0x51, 0x93, 0xf8, 0x2b, 0x28, 0xd3, 0xc9, 0xc4, + 0x09, 0x7c, 0x95, 0xf4, 0x5a, 0xe7, 0xb3, 0x37, 0xb7, 0xed, 0x0c, 0x79, 0x7b, 0xdb, 0xfe, 0xce, + 0x3b, 0xc7, 0x52, 0xb8, 0x41, 0x4a, 0x74, 0x32, 0x19, 0xf9, 0xc6, 0x3f, 0x35, 0x28, 0xa7, 0x4e, + 0xb5, 0xb6, 0xaf, 0x7f, 0x0a, 0xfa, 0xd7, 0xdc, 0x9f, 0xa8, 0xe3, 0x35, 0x0f, 0x3f, 0xff, 0xa0, + 0xcd, 0x65, 0x1f, 0xf6, 0x4d, 0xc8, 0x88, 0x5a, 0x81, 0x3b, 0x50, 0xbf, 0x4c, 0xfc, 0xd4, 0x9f, + 0x05, 0x9d, 0xaa, 0x13, 0x35, 0xd7, 0x7a, 0xc2, 0xd1, 0xe9, 0xb0, 0x6b, 0xf7, 0x47, 0x43, 0xc7, + 0x36, 0x9f, 0x92, 0xcd, 0xf9, 0x22, 0x9b, 0x4e, 0x8d, 0x17, 0x00, 0x4b, 0x5d, 0xdc, 0x80, 0x5a, + 0x48, 0xe3, 0xd8, 0x89, 0x99, 0x3f, 0x41, 0x1b, 0xb8, 0x09, 0xa0, 0x86, 0x11, 0x0b, 0xbd, 0x1b, + 0xa4, 0x2d, 0xa6, 0x2f, 0x02, 0x71, 0x85, 0x0a, 0x78, 0x0b, 0x36, 0xd5, 0x90, 0x4f, 0xfd, 0x20, + 0x62, 0xa8, 0x68, 0xfc, 0xbb, 0x00, 0x45, 0x33, 0xe4, 0x77, 0x3c, 0x2a, 0xf3, 0x04, 0x14, 0x56, + 0x12, 0x20, 0x6d, 0x24, 0x98, 0x85, 0x89, 0x60, 0x4e, 0xe2, 0x73, 0x11, 0x67, 0x9d, 0x5f, 0xcf, + 0xc0, 0x53, 0x89, 0xe1, 0x7d, 0xb8, 0xcf, 0x5e, 0x8a, 0x88, 0x3a, 0x79, 0x6a, 0xea, 0x38, 0xf7, + 0xd4, 0x54, 0x77, 0x95, 0x6f, 0x42, 0xd5, 0xa5, 0x82, 0x4d, 0x83, 0xe8, 0xa6, 0x55, 0x56, 0x36, + 0xb1, 0x2e, 0x2f, 0xe3, 0x90, 0xb9, 0xdd, 0x8c, 0x96, 0x3d, 0x5a, 0x8b, 0x65, 0xb8, 0x0f, 0x0d, + 0x65, 0x4f, 0x8e, 0x34, 0x0f, 0xee, 0x4f, 0x5b, 0x15, 0xa5, 0xb3, 0xb3, 0x46, 0xa7, 0x23, 0x79, + 0xea, 0xd2, 0x45, 0x99, 0x4c, 0xfd, 0x62, 0x0e, 0x71, 0x7f, 0x8a, 0x3f, 0x05, 0x10, 0x7c, 0xc6, + 0x82, 0x44, 0x38, 0x33, 0xe9, 0xdd, 0x32, 0xe8, 0x5a, 0x86, 0x1c, 0xc7, 0xf8, 0x97, 0x50, 0x51, + 0x06, 0x15, 0xc5, 0xad, 0x9a, 0xf2, 0xa3, 0xdd, 0x35, 0x7b, 0x3c, 0x65, 0x3e, 0x8b, 0xb8, 0x9b, + 0xdb, 0x65, 0xbe, 0xcc, 0xf8, 0x97, 0x06, 0xcd, 0xbc, 0xe7, 0xbd, 0xd7, 0x1d, 0xda, 0xc7, 0x77, + 0x07, 0xfe, 0x12, 0xee, 0x2d, 0x35, 0xd8, 0x2c, 0x94, 0x66, 0x94, 0xd5, 0x0e, 0x2d, 0x78, 0x19, + 0x8e, 0x5f, 0x40, 0x33, 0x62, 0x71, 0xe2, 0x89, 0x45, 0xc2, 0x8a, 0x1f, 0x91, 0xb0, 0x46, 0xba, + 0x76, 0x9e, 0xb1, 0x4f, 0xa0, 0x2a, 0xdd, 0x41, 0x35, 0x8b, 0xba, 0x72, 0xa4, 0x42, 0x43, 0x3e, + 0xa4, 0x33, 0x66, 0xfc, 0x45, 0x83, 0xcd, 0x95, 0xf5, 0x32, 0xb9, 0x69, 0x1a, 0x1c, 0x1a, 0xc9, + 0x63, 0x16, 0xa5, 0x03, 0xa7, 0x88, 0x19, 0x4d, 0xf1, 0x2f, 0x64, 0x97, 0xaa, 0x69, 0x19, 0x71, + 0x76, 0xcd, 0xd6, 0xc5, 0x74, 0x62, 0x92, 0xb1, 0x45, 0x1c, 0x99, 0x0d, 0x92, 0x29, 0x1e, 0x25, + 0xbe, 0x2b, 0xfb, 0x73, 0xc2, 0x2e, 0xa9, 0x3c, 0x58, 0xea, 0xe0, 0xca, 0x39, 0x48, 0x3d, 0x03, + 0x53, 0x03, 0x7f, 0x08, 0x55, 0xe6, 0xbb, 0xc1, 0x44, 0x1e, 0x3b, 0x8d, 0x77, 0x31, 0x36, 0xfe, + 0xa8, 0x41, 0x23, 0x57, 0xbd, 0x45, 0xc8, 0xa9, 0xb1, 0x65, 0x8f, 0x86, 0x42, 0x94, 0x45, 0x6d, + 0x43, 0x69, 0xf5, 0xad, 0x48, 0x07, 0xf8, 0xe7, 0xf3, 0x45, 0x0b, 0xfb, 0xba, 0xf3, 0x1c, 0xf6, + 0xf9, 0x89, 0x95, 0x89, 0xaa, 0xbb, 0x8d, 0xb3, 0xa7, 0x3d, 0x8d, 0x4e, 0x7d, 0x57, 0x0f, 0xef, + 0xea, 0x1d, 0xc0, 0x9f, 0xcb, 0xb3, 0x0a, 0x16, 0xcd, 0xb8, 0xcf, 0x63, 0xc1, 0xdd, 0xec, 0xfe, + 0xe6, 0x41, 0x19, 0x9f, 0x17, 0xb8, 0xd4, 0x53, 0xf1, 0x55, 0x49, 0x3a, 0xc0, 0x06, 0xd4, 0xe3, + 0xe4, 0x22, 0x76, 0x23, 0x1e, 0xca, 0xbe, 0x50, 0x11, 0x56, 0x49, 0x0e, 0x93, 0x69, 0x8a, 0x05, + 0x15, 0xec, 0x32, 0xf1, 0x54, 0x20, 0x0d, 0xb2, 0x18, 0xe3, 0x36, 0x6c, 0x5e, 0x51, 0x7f, 0xca, + 0xfd, 0xa9, 0xfc, 0xe5, 0xd6, 0x2a, 0xa9, 0xe5, 0x90, 0x41, 0x66, 0xc8, 0xf7, 0x0c, 0xa8, 0x59, + 0xbf, 0xb6, 0xad, 0xe1, 0xb8, 0x3f, 0x1a, 0xca, 0x07, 0x6a, 0x38, 0x1a, 0x5a, 0xe9, 0x03, 0x65, + 0x92, 0xee, 0xb3, 0xfe, 0x99, 0x85, 0xb4, 0xbd, 0xbf, 0x69, 0x50, 0x5f, 0xed, 0x67, 0x5c, 0x87, + 0x6a, 0xaf, 0x3f, 0x36, 0x3b, 0x03, 0xab, 0x87, 0x36, 0x30, 0x82, 0xfa, 0x53, 0xcb, 0x76, 0x3a, + 0x83, 0x51, 0xf7, 0xc5, 0xf0, 0xf4, 0x18, 0x69, 0x78, 0x1b, 0xd0, 0x02, 0x71, 0x3a, 0xe7, 0x8e, + 0x44, 0x0b, 0xf8, 0x21, 0x3c, 0x18, 0x5b, 0xb6, 0x33, 0x30, 0x6d, 0x6b, 0x6c, 0x3b, 0xfd, 0xa1, + 0x73, 0x6c, 0xd9, 0x66, 0xcf, 0xb4, 0x4d, 0x54, 0xc4, 0x0f, 0x00, 0xe7, 0xe7, 0x3a, 0xa3, 0xde, + 0x39, 0xd2, 0xa5, 0xf6, 0x99, 0x45, 0xfa, 0x47, 0xfd, 0xae, 0x29, 0x77, 0x47, 0x25, 0xc9, 0x94, + 0xda, 0x96, 0x49, 0x06, 0x7d, 0xc9, 0x55, 0x9b, 0xa0, 0xb2, 0xf4, 0xd1, 0xf1, 0x69, 0x67, 0xdc, + 0x25, 0xfd, 0x8e, 0x85, 0x2a, 0xd2, 0x47, 0x4f, 0x87, 0x4b, 0xa0, 0x8a, 0xef, 0xc3, 0xd6, 0x0a, + 0xe0, 0x98, 0x83, 0x01, 0xaa, 0xed, 0xfd, 0x41, 0x83, 0xcd, 0x95, 0xd2, 0x4a, 0x91, 0xe1, 0xc8, + 0x49, 0x91, 0xf4, 0x64, 0xe9, 0x19, 0xd2, 0xb8, 0x90, 0x86, 0x31, 0x34, 0x53, 0x64, 0xbe, 0x3f, + 0x2a, 0x60, 0x80, 0x32, 0xb1, 0xc6, 0xa7, 0x03, 0x1b, 0x15, 0xf1, 0x3d, 0x68, 0x2c, 0xd2, 0xe9, + 0x98, 0xe4, 0x29, 0xd2, 0xa5, 0xe1, 0xf7, 0x7b, 0xd6, 0xd0, 0xee, 0x1f, 0xf5, 0x2d, 0x82, 0x4a, + 0x92, 0xd2, 0xb3, 0x8e, 0xcc, 0xd3, 0x81, 0xed, 0x9c, 0x99, 0x83, 0x53, 0x0b, 0x95, 0x25, 0x25, + 0x55, 0x7d, 0x66, 0x8e, 0x9f, 0xa1, 0xca, 0xde, 0xef, 0x96, 0x61, 0xc9, 0xbc, 0xe3, 0x1a, 0x94, + 0xac, 0xe3, 0x13, 0xfb, 0x3c, 0x0d, 0x49, 0xcd, 0xc8, 0xb4, 0x4a, 0x7d, 0x4d, 0x1e, 0x2c, 0x45, + 0xba, 0xe6, 0x70, 0x34, 0xec, 0x77, 0xcd, 0x01, 0x2a, 0xc8, 0x0a, 0xa4, 0x60, 0xaf, 0xaf, 0xca, + 0x66, 0x92, 0x73, 0x54, 0xc4, 0x6d, 0xf8, 0xde, 0xbb, 0xa8, 0x33, 0x22, 0xce, 0x88, 0xf4, 0x2c, + 0x62, 0xf5, 0x90, 0x2e, 0xcb, 0x9e, 0xc5, 0x86, 0xca, 0x1d, 0xeb, 0x4f, 0xaf, 0x76, 0xb4, 0x6f, + 0x5e, 0xed, 0x68, 0xdf, 0xbe, 0xda, 0xd1, 0xfe, 0xf1, 0x6a, 0x47, 0xfb, 0xfd, 0xeb, 0x9d, 0x8d, + 0x6f, 0x5f, 0xef, 0x6c, 0xfc, 0xfd, 0xf5, 0xce, 0xc6, 0x6f, 0xbe, 0x98, 0x72, 0x71, 0x95, 0x5c, + 0xec, 0xbb, 0xc1, 0xec, 0x20, 0xf7, 0x97, 0xea, 0xfa, 0xf0, 0xe0, 0x65, 0xfa, 0xbf, 0x4a, 0xde, + 0xa9, 0xf8, 0xa2, 0xac, 0xfe, 0x26, 0x3d, 0xf9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x46, + 0x63, 0xdf, 0x79, 0x0d, 0x00, 0x00, } func (this *ApiCollection) Equal(that interface{}) bool { @@ -1590,6 +1613,9 @@ func (this *GenericParser) Equal(that interface{}) bool { if this.ParseType != that1.ParseType { return false } + if this.Rule != that1.Rule { + return false + } return true } func (this *SpecCategory) Equal(that interface{}) bool { @@ -2236,6 +2262,13 @@ func (m *GenericParser) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Rule) > 0 { + i -= len(m.Rule) + copy(dAtA[i:], m.Rule) + i = encodeVarintApiCollection(dAtA, i, uint64(len(m.Rule))) + i-- + dAtA[i] = 0x22 + } if m.ParseType != 0 { i = encodeVarintApiCollection(dAtA, i, uint64(m.ParseType)) i-- @@ -2609,6 +2642,10 @@ func (m *GenericParser) Size() (n int) { if m.ParseType != 0 { n += 1 + sovApiCollection(uint64(m.ParseType)) } + l = len(m.Rule) + if l > 0 { + n += 1 + l + sovApiCollection(uint64(l)) + } return n } @@ -4459,6 +4496,38 @@ func (m *GenericParser) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApiCollection + } + 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 ErrInvalidLengthApiCollection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApiCollection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApiCollection(dAtA[iNdEx:]) diff --git a/x/spec/types/errors.go b/x/spec/types/errors.go index 62042b8c5d..24db61f04c 100644 --- a/x/spec/types/errors.go +++ b/x/spec/types/errors.go @@ -4,7 +4,7 @@ package types import ( sdkerrors "cosmossdk.io/errors" - commontypes "github.com/lavanet/lava/utils/common/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) // x/spec module sentinel errors diff --git a/x/spec/types/genesis.pb.go b/x/spec/types/genesis.pb.go index 3d456687c0..4ece76e47a 100644 --- a/x/spec/types/genesis.pb.go +++ b/x/spec/types/genesis.pb.go @@ -91,7 +91,7 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/spec/genesis.proto", fileDescriptor_012a82932c0e5e6a) } var fileDescriptor_012a82932c0e5e6a = []byte{ - // 244 bytes of a gzipped FileDescriptorProto + // 247 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcf, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc5, 0x05, 0xa9, 0xc9, 0xfa, 0xe9, 0xa9, 0x79, 0xa9, 0xc5, 0x99, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x82, 0x50, 0x05, 0x7a, 0x20, 0x5a, @@ -102,12 +102,12 @@ var fileDescriptor_012a82932c0e5e6a = []byte{ 0x88, 0x5e, 0x00, 0x58, 0x81, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0x50, 0xe5, 0x42, 0x96, 0x5c, 0x1c, 0x20, 0x49, 0x9f, 0xcc, 0xe2, 0x12, 0x09, 0x26, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x71, 0x2c, 0x5a, 0x83, 0x0b, 0x52, 0x93, 0xa1, 0x1a, 0xe1, 0xca, 0x85, 0x64, 0xb8, 0x38, 0x41, 0x6c, - 0xe7, 0xfc, 0xd2, 0xbc, 0x12, 0x09, 0x66, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x84, 0x80, 0x93, 0xdd, + 0xe7, 0xfc, 0xd2, 0xbc, 0x12, 0x09, 0x66, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x84, 0x80, 0x93, 0xe3, 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, 0xa9, 0xa4, 0x67, 0x96, 0x64, 0x94, - 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0xf8, 0xb2, 0x02, 0xe2, 0xcf, 0x92, 0xca, 0x82, 0xd4, - 0xe2, 0x24, 0x36, 0xb0, 0x4f, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3b, 0xb9, 0xed, 0xea, - 0x73, 0x01, 0x00, 0x00, + 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa7, 0x67, 0x96, 0x64, 0x94, + 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0xf8, 0xb2, 0xcc, 0x48, 0xbf, 0x02, 0xe2, 0xd5, 0x92, + 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x67, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x25, + 0x76, 0xf8, 0xbd, 0x76, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/spec/types/genesis_test.go b/x/spec/types/genesis_test.go index bda15996ed..9c97da8dee 100644 --- a/x/spec/types/genesis_test.go +++ b/x/spec/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/spec/types" + "github.com/lavanet/lava/v2/x/spec/types" "github.com/stretchr/testify/require" ) diff --git a/x/spec/types/params.pb.go b/x/spec/types/params.pb.go index 7f9f4e25a7..245ca13658 100644 --- a/x/spec/types/params.pb.go +++ b/x/spec/types/params.pb.go @@ -82,7 +82,7 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/spec/params.proto", fileDescriptor_ad2f67d2fb6b4afa) } var fileDescriptor_ad2f67d2fb6b4afa = []byte{ - // 257 bytes of a gzipped FileDescriptorProto + // 260 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc5, 0x05, 0xa9, 0xc9, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x82, 0x50, 0x79, 0x3d, 0x10, 0xad, 0x07, @@ -94,12 +94,12 @@ var fileDescriptor_ad2f67d2fb6b4afa = []byte{ 0xc9, 0x2c, 0x2e, 0x49, 0x4d, 0x89, 0x4f, 0xad, 0x28, 0x48, 0x4d, 0xc9, 0x04, 0xb1, 0x72, 0x8b, 0xd3, 0x8b, 0x25, 0x98, 0x15, 0x98, 0x35, 0x38, 0x9d, 0x54, 0x3f, 0xdd, 0x93, 0x57, 0x84, 0x18, 0x84, 0x5b, 0xad, 0x52, 0x90, 0x04, 0x92, 0xa4, 0x2b, 0x4c, 0xce, 0xb7, 0x38, 0xbd, 0xd8, 0x8a, - 0x65, 0xc6, 0x02, 0x79, 0x06, 0x2f, 0x16, 0x0e, 0x46, 0x01, 0x26, 0x27, 0xbb, 0x13, 0x8f, 0xe4, + 0x65, 0xc6, 0x02, 0x79, 0x06, 0x2f, 0x16, 0x0e, 0x46, 0x01, 0x26, 0x27, 0xc7, 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, 0x52, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, - 0xce, 0xcf, 0xd5, 0x47, 0x09, 0x9d, 0x0a, 0x48, 0xf8, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, - 0x81, 0xbd, 0x6d, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x51, 0xf7, 0x70, 0x6e, 0x41, 0x01, 0x00, - 0x00, + 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, + 0xce, 0xcf, 0xd5, 0x47, 0x09, 0x9d, 0x32, 0x23, 0xfd, 0x0a, 0x48, 0x10, 0x95, 0x54, 0x16, 0xa4, + 0x16, 0x27, 0xb1, 0x81, 0x7d, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x25, 0xb5, 0xfc, 0x18, + 0x44, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/spec/types/query.pb.go b/x/spec/types/query.pb.go index 87ebb0950b..d1e73958ce 100644 --- a/x/spec/types/query.pb.go +++ b/x/spec/types/query.pb.go @@ -636,60 +636,60 @@ func init() { proto.RegisterFile("lavanet/lava/spec/query.proto", fileDescriptor var fileDescriptor_fac9d1cad3c30379 = []byte{ // 857 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4d, 0x4f, 0xdb, 0x48, - 0x18, 0xc7, 0xe3, 0x24, 0x24, 0x64, 0x56, 0x48, 0xbb, 0x43, 0x24, 0x12, 0x07, 0x0c, 0x98, 0xd7, - 0x45, 0x8b, 0xbd, 0xb0, 0xd2, 0xae, 0xf6, 0xb2, 0x52, 0x60, 0xb5, 0x88, 0x55, 0x85, 0xa8, 0xb9, - 0x21, 0x55, 0xd1, 0xc4, 0x0c, 0x89, 0x25, 0xc7, 0x63, 0xe2, 0x09, 0x29, 0x45, 0x5c, 0xb8, 0xf5, - 0x56, 0xb5, 0x97, 0x9e, 0xab, 0x7e, 0x18, 0x8e, 0x48, 0xbd, 0x70, 0xaa, 0x2a, 0xd2, 0x0f, 0x52, - 0xcd, 0x4b, 0x12, 0x9b, 0xd8, 0x01, 0x55, 0xbd, 0x60, 0x66, 0x9e, 0x97, 0xff, 0x6f, 0xfe, 0x33, - 0x3c, 0x02, 0xcc, 0xb9, 0xe8, 0x1c, 0x79, 0x98, 0x9a, 0xec, 0x6b, 0x06, 0x3e, 0xb6, 0xcd, 0xb3, - 0x0e, 0x6e, 0x5f, 0x18, 0x7e, 0x9b, 0x50, 0x02, 0x7f, 0x91, 0x61, 0x83, 0x7d, 0x0d, 0x16, 0x56, - 0x8b, 0x0d, 0xd2, 0x20, 0x3c, 0x6a, 0xb2, 0xdf, 0x44, 0xa2, 0x3a, 0xdb, 0x20, 0xa4, 0xe1, 0x62, - 0x13, 0xf9, 0x8e, 0x89, 0x3c, 0x8f, 0x50, 0x44, 0x1d, 0xe2, 0x05, 0x32, 0xba, 0x61, 0x93, 0xa0, - 0x45, 0x02, 0xb3, 0x8e, 0x02, 0x2c, 0xfa, 0x9b, 0xe7, 0x5b, 0x75, 0x4c, 0xd1, 0x96, 0xe9, 0xa3, - 0x86, 0xe3, 0xf1, 0x64, 0x99, 0xab, 0x8d, 0x12, 0xf9, 0xa8, 0x8d, 0x5a, 0xfd, 0x5e, 0xb3, 0xa3, - 0x71, 0xf6, 0x43, 0x44, 0xf5, 0x22, 0x80, 0xcf, 0x59, 0xff, 0x43, 0x5e, 0x62, 0xe1, 0xb3, 0x0e, - 0x0e, 0xa8, 0x7e, 0x00, 0xa6, 0x23, 0xbb, 0x81, 0x4f, 0xbc, 0x00, 0xc3, 0xbf, 0x40, 0x4e, 0xb4, - 0x2e, 0x29, 0x0b, 0xca, 0xfa, 0x4f, 0xdb, 0x65, 0x63, 0xe4, 0xb8, 0x86, 0x28, 0xd9, 0xc9, 0xde, - 0x7c, 0x9e, 0x4f, 0x59, 0x32, 0x5d, 0x37, 0x65, 0xbf, 0x3d, 0x4c, 0x8f, 0x7c, 0x6c, 0x4b, 0x19, - 0x58, 0x02, 0xf9, 0xdd, 0x26, 0x72, 0xbc, 0xfd, 0x7f, 0x79, 0xc3, 0x82, 0xd5, 0x5f, 0xea, 0xfb, - 0xa0, 0x18, 0x2d, 0x90, 0x04, 0x5b, 0x20, 0xcb, 0xd6, 0x52, 0x7f, 0x26, 0x46, 0x9f, 0x85, 0xa5, - 0x3a, 0x4f, 0xd5, 0x5f, 0x48, 0xed, 0xaa, 0xeb, 0x86, 0xb5, 0xff, 0x03, 0x60, 0x68, 0xa5, 0xec, - 0xb7, 0x6a, 0x08, 0xdf, 0x0d, 0xe6, 0xbb, 0x21, 0xee, 0x55, 0xfa, 0x6e, 0x1c, 0xa2, 0x06, 0x96, - 0xb5, 0x56, 0xa8, 0x52, 0x7f, 0xab, 0x48, 0xd4, 0x41, 0xff, 0x11, 0xd4, 0xcc, 0x13, 0x51, 0xe1, - 0x5e, 0x84, 0x29, 0xcd, 0x99, 0xd6, 0x1e, 0x65, 0x12, 0x7a, 0x11, 0xa8, 0x0a, 0x28, 0x73, 0xa6, - 0xa3, 0x26, 0xe9, 0x56, 0x5d, 0x97, 0xbb, 0x3a, 0xb8, 0x5c, 0x0a, 0xd4, 0xb8, 0xa0, 0xc4, 0x3e, - 0x04, 0x53, 0x36, 0xbf, 0x04, 0xef, 0x94, 0x3c, 0x73, 0x02, 0x5a, 0x4a, 0x73, 0xfe, 0x8d, 0x38, - 0xfe, 0x70, 0x03, 0x96, 0x7f, 0x44, 0xdb, 0x1d, 0x9b, 0x5a, 0xd1, 0x06, 0xff, 0x67, 0x27, 0x95, - 0x9f, 0xd3, 0xfa, 0x07, 0x05, 0xcc, 0x24, 0x14, 0xc0, 0x59, 0x50, 0xe0, 0x25, 0x07, 0xa8, 0x85, - 0xe5, 0x4b, 0x18, 0x6e, 0xb0, 0x57, 0x62, 0xcb, 0x57, 0x92, 0x16, 0xaf, 0x44, 0x2e, 0xe1, 0x36, - 0x28, 0x62, 0x0f, 0xd5, 0x5d, 0x7c, 0x52, 0xf5, 0x9d, 0x7d, 0x8f, 0xe2, 0xf6, 0x29, 0xb2, 0x71, - 0x50, 0xca, 0x2c, 0x64, 0xd6, 0x0b, 0x56, 0x6c, 0x0c, 0x56, 0x40, 0x01, 0xf9, 0x4e, 0xcd, 0x26, - 0x1d, 0x8f, 0x96, 0xb2, 0x0b, 0xca, 0x7a, 0xd6, 0x9a, 0x44, 0xbe, 0xb3, 0xcb, 0xd6, 0xfa, 0xdf, - 0x21, 0xdf, 0x76, 0xfb, 0x87, 0xe8, 0xbf, 0x98, 0xb1, 0x94, 0xba, 0x0d, 0xf2, 0x55, 0xdf, 0x61, - 0x07, 0x66, 0x89, 0x4e, 0x5f, 0x90, 0x4b, 0x14, 0xac, 0xe1, 0x06, 0x5c, 0x06, 0x53, 0x41, 0xc7, - 0xf7, 0x49, 0x9b, 0x72, 0xb4, 0xa0, 0x34, 0xc1, 0x69, 0xa3, 0x9b, 0xb0, 0x08, 0x26, 0xd0, 0xc9, - 0x09, 0xf1, 0x4a, 0x39, 0x5e, 0x2f, 0x16, 0x7a, 0x4f, 0x09, 0xdd, 0x5d, 0x08, 0x50, 0xde, 0x5d, - 0xc8, 0x29, 0x25, 0xea, 0x94, 0x06, 0x80, 0x33, 0xf4, 0x27, 0xcd, 0x15, 0x43, 0x3b, 0xf0, 0x18, - 0xa8, 0x11, 0xfd, 0x81, 0x61, 0xfc, 0x09, 0x64, 0xf8, 0x13, 0x50, 0x63, 0x9e, 0x80, 0x3c, 0xb2, - 0x35, 0xa6, 0x1a, 0x9a, 0x60, 0x9a, 0xf8, 0xec, 0x59, 0x22, 0xb7, 0x16, 0x82, 0xc8, 0x72, 0x08, - 0xd8, 0x0f, 0x0d, 0xaf, 0x68, 0xfb, 0x2e, 0x0f, 0x26, 0xf8, 0x29, 0xe1, 0x2b, 0x90, 0x13, 0xf3, - 0x04, 0xae, 0xc4, 0x88, 0x8f, 0x0e, 0x2e, 0x75, 0xf5, 0xb1, 0x34, 0xe1, 0x94, 0xbe, 0x78, 0xfd, - 0xe9, 0xeb, 0xbb, 0x74, 0x05, 0x96, 0xcd, 0xa4, 0xe9, 0x09, 0xaf, 0x15, 0xf1, 0x07, 0x0c, 0x13, - 0x7b, 0x46, 0xa7, 0x99, 0xba, 0xf6, 0x68, 0x9e, 0x14, 0xff, 0x95, 0x8b, 0x2f, 0xc1, 0x45, 0x33, - 0x7e, 0x34, 0x9b, 0x97, 0x72, 0x0c, 0x5e, 0xc1, 0x4b, 0x90, 0x67, 0xa5, 0x55, 0xd7, 0x4d, 0xc6, - 0x88, 0x0e, 0xb6, 0x64, 0x8c, 0x07, 0x03, 0x4a, 0x9f, 0xe7, 0x18, 0x65, 0x38, 0x93, 0x80, 0x01, - 0x5f, 0x2b, 0x42, 0xdd, 0x42, 0xdd, 0x1f, 0x6f, 0xc2, 0x26, 0x57, 0x5f, 0x83, 0x2b, 0x09, 0xea, - 0xb5, 0x36, 0xea, 0x86, 0x8c, 0xb8, 0x56, 0x00, 0x90, 0x4e, 0x8c, 0xc5, 0xf9, 0x5e, 0x33, 0x96, - 0x38, 0xce, 0x1c, 0xac, 0x8c, 0xc1, 0x81, 0xef, 0x15, 0x30, 0x15, 0x99, 0x61, 0xf0, 0xb7, 0xa4, - 0xfe, 0x71, 0x93, 0x57, 0xdd, 0x7c, 0x62, 0xb6, 0x64, 0xda, 0xe0, 0x4c, 0xcb, 0x50, 0x8f, 0x63, - 0x6a, 0x92, 0x6e, 0x0d, 0xb9, 0x6e, 0xcd, 0x16, 0x20, 0x1f, 0x25, 0xda, 0x60, 0x28, 0x8c, 0x47, - 0x7b, 0x38, 0xdc, 0xc6, 0xa3, 0x8d, 0x4c, 0x1a, 0xfd, 0x4f, 0x8e, 0xf6, 0x3b, 0x34, 0x92, 0xd0, - 0x38, 0x56, 0xcd, 0xf1, 0x4e, 0x89, 0x79, 0x39, 0x18, 0x92, 0x57, 0x3b, 0xff, 0xdc, 0xdc, 0x6b, - 0xca, 0xed, 0xbd, 0xa6, 0x7c, 0xb9, 0xd7, 0x94, 0x37, 0x3d, 0x2d, 0x75, 0xdb, 0xd3, 0x52, 0x77, - 0x3d, 0x2d, 0x75, 0xbc, 0xdc, 0x70, 0x68, 0xb3, 0x53, 0x37, 0x6c, 0xd2, 0x8a, 0xf6, 0x7c, 0x29, - 0xba, 0xd2, 0x0b, 0x1f, 0x07, 0xf5, 0x1c, 0xff, 0xaf, 0xe5, 0x8f, 0x6f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x5d, 0x85, 0xca, 0x90, 0x87, 0x09, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4d, 0x4f, 0x3b, 0x45, + 0x1c, 0xc7, 0xbb, 0x6d, 0x69, 0xff, 0x1d, 0x43, 0xa2, 0xf3, 0x6f, 0x42, 0xbb, 0x85, 0x05, 0x96, + 0x87, 0x22, 0x91, 0x1d, 0xa9, 0x89, 0xc6, 0x63, 0xc1, 0x48, 0x30, 0x86, 0xe0, 0x72, 0x23, 0x31, + 0xcd, 0x74, 0x19, 0xda, 0x4d, 0xb6, 0x3b, 0x4b, 0x77, 0x4a, 0x45, 0xc2, 0x85, 0x9b, 0x37, 0xa3, + 0x17, 0xcf, 0xc6, 0x17, 0xc3, 0x91, 0xc4, 0x0b, 0x27, 0x63, 0xa8, 0x2f, 0xc4, 0xcc, 0x43, 0xdb, + 0x5d, 0xba, 0x5b, 0x88, 0xf1, 0xc2, 0x32, 0xf3, 0x7b, 0xf8, 0x7e, 0xe6, 0x3b, 0xc3, 0x2f, 0x80, + 0x15, 0x0f, 0x5f, 0x63, 0x9f, 0x30, 0xc4, 0xbf, 0x28, 0x0c, 0x88, 0x83, 0xae, 0x06, 0xa4, 0x7f, + 0x63, 0x05, 0x7d, 0xca, 0x28, 0xfc, 0x48, 0x85, 0x2d, 0xfe, 0xb5, 0x78, 0x58, 0x2f, 0x77, 0x68, + 0x87, 0x8a, 0x28, 0xe2, 0xbf, 0xc9, 0x44, 0x7d, 0xb9, 0x43, 0x69, 0xc7, 0x23, 0x08, 0x07, 0x2e, + 0xc2, 0xbe, 0x4f, 0x19, 0x66, 0x2e, 0xf5, 0x43, 0x15, 0xdd, 0x75, 0x68, 0xd8, 0xa3, 0x21, 0x6a, + 0xe3, 0x90, 0xc8, 0xfe, 0xe8, 0x7a, 0xbf, 0x4d, 0x18, 0xde, 0x47, 0x01, 0xee, 0xb8, 0xbe, 0x48, + 0x56, 0xb9, 0xc6, 0x2c, 0x51, 0x80, 0xfb, 0xb8, 0x37, 0xee, 0xb5, 0x3c, 0x1b, 0xe7, 0x3f, 0x64, + 0xd4, 0x2c, 0x03, 0xf8, 0x1d, 0xef, 0x7f, 0x2a, 0x4a, 0x6c, 0x72, 0x35, 0x20, 0x21, 0x33, 0x4f, + 0xc0, 0xfb, 0xd8, 0x6e, 0x18, 0x50, 0x3f, 0x24, 0xf0, 0x0b, 0x50, 0x90, 0xad, 0x2b, 0xda, 0x9a, + 0xb6, 0xf3, 0x41, 0xa3, 0x6a, 0xcd, 0x1c, 0xd7, 0x92, 0x25, 0x07, 0xf9, 0x87, 0xbf, 0x56, 0x33, + 0xb6, 0x4a, 0x37, 0x91, 0xea, 0x77, 0x44, 0xd8, 0x59, 0x40, 0x1c, 0x25, 0x03, 0x2b, 0xa0, 0x78, + 0xd8, 0xc5, 0xae, 0x7f, 0xfc, 0x95, 0x68, 0x58, 0xb2, 0xc7, 0x4b, 0xf3, 0x18, 0x94, 0xe3, 0x05, + 0x8a, 0x60, 0x1f, 0xe4, 0xf9, 0x5a, 0xe9, 0x2f, 0x25, 0xe8, 0xf3, 0xb0, 0x52, 0x17, 0xa9, 0xe6, + 0xf7, 0x4a, 0xbb, 0xe9, 0x79, 0x51, 0xed, 0xaf, 0x01, 0x98, 0x5a, 0xa9, 0xfa, 0x6d, 0x5b, 0xd2, + 0x77, 0x8b, 0xfb, 0x6e, 0xc9, 0x7b, 0x55, 0xbe, 0x5b, 0xa7, 0xb8, 0x43, 0x54, 0xad, 0x1d, 0xa9, + 0x34, 0x7f, 0xd1, 0x14, 0xea, 0xa4, 0xff, 0x0c, 0x6a, 0xee, 0x8d, 0xa8, 0xf0, 0x28, 0xc6, 0x94, + 0x15, 0x4c, 0xf5, 0x57, 0x99, 0xa4, 0x5e, 0x0c, 0xaa, 0x06, 0xaa, 0x82, 0xe9, 0xac, 0x4b, 0x87, + 0x4d, 0xcf, 0x13, 0xae, 0x4e, 0x2e, 0x97, 0x01, 0x3d, 0x29, 0xa8, 0xb0, 0x4f, 0xc1, 0xa2, 0x23, + 0x2e, 0xc1, 0xbf, 0xa4, 0xdf, 0xba, 0x21, 0xab, 0x64, 0x05, 0xff, 0x6e, 0x12, 0x7f, 0xb4, 0x01, + 0xcf, 0x3f, 0x63, 0xfd, 0x81, 0xc3, 0xec, 0x78, 0x83, 0x6f, 0xf2, 0xef, 0xb4, 0x0f, 0xb3, 0xe6, + 0xef, 0x1a, 0x58, 0x4a, 0x29, 0x80, 0xcb, 0xa0, 0x24, 0x4a, 0x4e, 0x70, 0x8f, 0xa8, 0x97, 0x30, + 0xdd, 0xe0, 0xaf, 0xc4, 0x51, 0xaf, 0x24, 0x2b, 0x5f, 0x89, 0x5a, 0xc2, 0x06, 0x28, 0x13, 0x1f, + 0xb7, 0x3d, 0x72, 0xd1, 0x0c, 0xdc, 0x63, 0x9f, 0x91, 0xfe, 0x25, 0x76, 0x48, 0x58, 0xc9, 0xad, + 0xe5, 0x76, 0x4a, 0x76, 0x62, 0x0c, 0xd6, 0x40, 0x09, 0x07, 0x6e, 0xcb, 0xa1, 0x03, 0x9f, 0x55, + 0xf2, 0x6b, 0xda, 0x4e, 0xde, 0x7e, 0x87, 0x03, 0xf7, 0x90, 0xaf, 0xcd, 0x2f, 0x23, 0xbe, 0x1d, + 0x8e, 0x0f, 0x31, 0x7e, 0x31, 0x73, 0x29, 0x4d, 0x07, 0x14, 0x9b, 0x81, 0xcb, 0x0f, 0xcc, 0x13, + 0xdd, 0xb1, 0xa0, 0x90, 0x28, 0xd9, 0xd3, 0x0d, 0xb8, 0x09, 0x16, 0xc3, 0x41, 0x10, 0xd0, 0x3e, + 0x13, 0x68, 0x61, 0x65, 0x41, 0xd0, 0xc6, 0x37, 0x61, 0x19, 0x2c, 0xe0, 0x8b, 0x0b, 0xea, 0x57, + 0x0a, 0xa2, 0x5e, 0x2e, 0xcc, 0x91, 0x16, 0xb9, 0xbb, 0x08, 0xa0, 0xba, 0xbb, 0x88, 0x53, 0x5a, + 0xdc, 0x29, 0x03, 0x00, 0x77, 0xea, 0x4f, 0x56, 0x28, 0x46, 0x76, 0xe0, 0x39, 0xd0, 0x63, 0xfa, + 0x13, 0xc3, 0xc4, 0x13, 0xc8, 0x89, 0x27, 0xa0, 0x27, 0x3c, 0x01, 0x75, 0x64, 0x7b, 0x4e, 0x35, + 0x44, 0xe0, 0x3d, 0x0d, 0xf8, 0xb3, 0xc4, 0x5e, 0x2b, 0x02, 0x91, 0x17, 0x10, 0x70, 0x1c, 0x9a, + 0x5e, 0x51, 0xe3, 0xa9, 0x08, 0x16, 0xc4, 0x29, 0xe1, 0x8f, 0xa0, 0x20, 0xe7, 0x09, 0xdc, 0x4a, + 0x10, 0x9f, 0x1d, 0x5c, 0xfa, 0xf6, 0x6b, 0x69, 0xd2, 0x29, 0x73, 0xfd, 0xfe, 0xcf, 0x7f, 0x7e, + 0xcd, 0xd6, 0x60, 0x15, 0xa5, 0x4d, 0x4f, 0x78, 0xaf, 0xc9, 0x3f, 0x60, 0x98, 0xda, 0x33, 0x3e, + 0xcd, 0xf4, 0xfa, 0xab, 0x79, 0x4a, 0xfc, 0x63, 0x21, 0xbe, 0x01, 0xd7, 0x51, 0xf2, 0x68, 0x46, + 0xb7, 0x6a, 0x0c, 0xde, 0xc1, 0x5b, 0x50, 0xe4, 0xa5, 0x4d, 0xcf, 0x4b, 0xc7, 0x88, 0x0f, 0xb6, + 0x74, 0x8c, 0x17, 0x03, 0xca, 0x5c, 0x15, 0x18, 0x55, 0xb8, 0x94, 0x82, 0x01, 0x7f, 0xd2, 0xa4, + 0xba, 0x8d, 0x87, 0xff, 0xbf, 0x09, 0x7b, 0x42, 0xbd, 0x0e, 0xb7, 0x52, 0xd4, 0x5b, 0x7d, 0x3c, + 0x8c, 0x18, 0x71, 0xaf, 0x01, 0xa0, 0x9c, 0x98, 0x8b, 0xf3, 0x5f, 0xcd, 0xd8, 0x10, 0x38, 0x2b, + 0xb0, 0x36, 0x07, 0x07, 0xfe, 0xa6, 0x81, 0xc5, 0xd8, 0x0c, 0x83, 0x9f, 0xa4, 0xf5, 0x4f, 0x9a, + 0xbc, 0xfa, 0xde, 0x1b, 0xb3, 0x15, 0xd3, 0xae, 0x60, 0xda, 0x84, 0x66, 0x12, 0x53, 0x97, 0x0e, + 0x5b, 0xd8, 0xf3, 0x5a, 0x8e, 0x04, 0xf9, 0x43, 0xa1, 0x4d, 0x86, 0xc2, 0x7c, 0xb4, 0x97, 0xc3, + 0x6d, 0x3e, 0xda, 0xcc, 0xa4, 0x31, 0x3f, 0x17, 0x68, 0x9f, 0x42, 0x2b, 0x0d, 0x4d, 0x60, 0xb5, + 0x5c, 0xff, 0x92, 0xa2, 0xdb, 0xc9, 0x90, 0xbc, 0x3b, 0x68, 0x3e, 0x3c, 0x1b, 0xda, 0xe3, 0xb3, + 0xa1, 0xfd, 0xfd, 0x6c, 0x68, 0x3f, 0x8f, 0x8c, 0xcc, 0xe3, 0xc8, 0xc8, 0x3c, 0x8d, 0x8c, 0xcc, + 0x79, 0xbd, 0xe3, 0xb2, 0xee, 0xa0, 0x6d, 0x39, 0xb4, 0x17, 0xef, 0x79, 0xdd, 0x40, 0x3f, 0xc8, + 0xc6, 0xec, 0x26, 0x20, 0x61, 0xbb, 0x20, 0xfe, 0x71, 0xf9, 0xec, 0xdf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x59, 0x0d, 0x5b, 0x27, 0x8a, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/spec/types/spec.go b/x/spec/types/spec.go index 65b88684e7..e0e181aaf3 100644 --- a/x/spec/types/spec.go +++ b/x/spec/types/spec.go @@ -10,8 +10,8 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) const ( diff --git a/x/spec/types/spec.pb.go b/x/spec/types/spec.pb.go index ab47f378b6..42f4d1fa8f 100644 --- a/x/spec/types/spec.pb.go +++ b/x/spec/types/spec.pb.go @@ -231,52 +231,52 @@ func init() { func init() { proto.RegisterFile("lavanet/lava/spec/spec.proto", fileDescriptor_789140b95c48dfce) } var fileDescriptor_789140b95c48dfce = []byte{ - // 715 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xdf, 0x6e, 0xeb, 0x34, - 0x18, 0x6f, 0x68, 0x4e, 0xdb, 0xb9, 0x9c, 0x2e, 0xc7, 0xf4, 0x4c, 0xde, 0x74, 0xc8, 0xc2, 0x84, - 0xa6, 0x80, 0x20, 0xd1, 0xb6, 0x1b, 0xee, 0xd0, 0xba, 0x51, 0xb1, 0x09, 0xc4, 0xc8, 0xc6, 0x0d, - 0x37, 0x91, 0xe3, 0x78, 0xad, 0xb5, 0xc4, 0x0e, 0xb1, 0x57, 0x56, 0x9e, 0x82, 0xc7, 0xe0, 0x51, - 0x76, 0xb9, 0xcb, 0x89, 0x8b, 0x09, 0x75, 0x2f, 0x82, 0xec, 0x24, 0x23, 0xd5, 0xb8, 0xa9, 0xf3, - 0xf9, 0xf7, 0xe7, 0xb3, 0xdd, 0x9f, 0x0d, 0x3e, 0x64, 0x78, 0x81, 0x39, 0x55, 0xa1, 0x1e, 0x43, - 0x59, 0x50, 0x62, 0x7e, 0x82, 0xa2, 0x14, 0x4a, 0xc0, 0x77, 0x35, 0x1a, 0xe8, 0x31, 0xd0, 0xc0, - 0xce, 0x78, 0x26, 0x66, 0xc2, 0xa0, 0xa1, 0xfe, 0xaa, 0x88, 0x3b, 0xfb, 0xaf, 0x6d, 0x70, 0xc1, - 0x62, 0x22, 0xb2, 0x8c, 0x12, 0xc5, 0x04, 0xaf, 0x79, 0x2e, 0x11, 0x32, 0x17, 0x32, 0x4c, 0xb0, - 0xa4, 0xe1, 0xe2, 0x20, 0xa1, 0x0a, 0x1f, 0x84, 0x44, 0xb0, 0x1a, 0xdf, 0x7b, 0xec, 0x03, 0xfb, - 0xb2, 0xa0, 0x04, 0x8e, 0xc1, 0x1b, 0xc6, 0x53, 0x7a, 0x87, 0x2c, 0xcf, 0xf2, 0x37, 0xa2, 0xaa, - 0x80, 0x10, 0xd8, 0x1c, 0xe7, 0x14, 0x7d, 0x64, 0x26, 0xcd, 0x37, 0x44, 0xa0, 0x4f, 0x39, 0x4e, - 0x32, 0x9a, 0x22, 0xdb, 0xb3, 0xfc, 0x41, 0xd4, 0x94, 0xf0, 0x08, 0xbc, 0x2f, 0x69, 0xc6, 0x70, - 0xc2, 0x32, 0xa6, 0x96, 0xb1, 0x9a, 0x97, 0x54, 0xce, 0x45, 0x96, 0xa2, 0x37, 0x9e, 0xe5, 0xbf, - 0x8d, 0xc6, 0x2d, 0xf0, 0xaa, 0xc1, 0xe0, 0x37, 0x00, 0xa5, 0x58, 0xe1, 0xb8, 0xad, 0x6c, 0xfc, - 0x7b, 0xc6, 0x7f, 0x4b, 0xe3, 0xd1, 0x7f, 0xf0, 0x77, 0x75, 0xbb, 0xef, 0xc1, 0x67, 0x49, 0x26, - 0xc8, 0x4d, 0x9c, 0x32, 0xa9, 0x30, 0x27, 0x34, 0xbe, 0x16, 0x65, 0x7c, 0xcd, 0x38, 0xce, 0xd8, - 0x1f, 0x34, 0x8d, 0xb5, 0x0c, 0xf5, 0x4d, 0xeb, 0x4f, 0x0d, 0xf1, 0xb4, 0xe6, 0x4d, 0x45, 0x39, - 0x6d, 0x58, 0xa7, 0x58, 0x61, 0xf8, 0x2d, 0xf8, 0x60, 0x08, 0x32, 0x66, 0xbc, 0x31, 0xc0, 0xfa, - 0x14, 0xe3, 0xa2, 0x14, 0xe2, 0x1a, 0x0d, 0x8c, 0xc9, 0x76, 0xc5, 0x39, 0xe3, 0xd3, 0x16, 0xe3, - 0x42, 0x13, 0xe0, 0x57, 0x00, 0xe2, 0x05, 0x2d, 0xf1, 0x8c, 0xc6, 0xd5, 0x92, 0x14, 0xcb, 0x29, - 0xda, 0xf0, 0x2c, 0xbf, 0x1b, 0x39, 0x35, 0x32, 0xd1, 0xc0, 0x15, 0xcb, 0x29, 0x3c, 0x06, 0x2e, - 0xce, 0x32, 0xf1, 0x3b, 0x4d, 0x6b, 0x76, 0x86, 0x67, 0x66, 0xed, 0xbf, 0x09, 0x19, 0xcb, 0x25, - 0x27, 0x08, 0x18, 0xe5, 0x76, 0xcd, 0x32, 0xca, 0x1f, 0xf0, 0x6c, 0x2a, 0xca, 0x9f, 0x85, 0xbc, - 0x5c, 0x72, 0xa2, 0x1b, 0x36, 0x52, 0xa9, 0xe2, 0xdb, 0x22, 0xc5, 0x8a, 0xa6, 0x68, 0xe8, 0x59, - 0xbe, 0x1d, 0x39, 0x49, 0xc5, 0x97, 0xea, 0x97, 0x6a, 0x1e, 0xfe, 0x08, 0x60, 0xce, 0x78, 0x2c, - 0x15, 0xbe, 0xa1, 0x7a, 0x4b, 0x0b, 0x96, 0xd2, 0x12, 0x7d, 0xec, 0x59, 0xfe, 0xf0, 0x70, 0x3b, - 0xa8, 0x22, 0x12, 0xe8, 0x88, 0x04, 0x75, 0x44, 0x82, 0x13, 0xc1, 0xf8, 0xc4, 0xbe, 0x7f, 0xda, - 0xed, 0x44, 0x4e, 0xce, 0xf8, 0xa5, 0x56, 0x5e, 0xd4, 0x42, 0xf8, 0x13, 0xd8, 0x6c, 0x4c, 0x64, - 0xac, 0x96, 0x05, 0x95, 0x68, 0xe4, 0x59, 0xfe, 0xe8, 0x70, 0x3f, 0x78, 0x95, 0xdf, 0x40, 0xa7, - 0x2b, 0x68, 0xa4, 0xf2, 0x4a, 0xb3, 0xa3, 0x51, 0xb1, 0x56, 0xeb, 0x48, 0xb1, 0xbc, 0x10, 0xa5, - 0x92, 0x68, 0xd3, 0xeb, 0xfa, 0x1b, 0x51, 0x53, 0xc2, 0x33, 0xb0, 0xb9, 0x9e, 0x6b, 0x89, 0x1c, - 0xaf, 0xeb, 0x0f, 0x0f, 0xbd, 0xff, 0x69, 0x75, 0x5c, 0xb0, 0x93, 0x17, 0x62, 0x34, 0xc2, 0xed, - 0x52, 0x42, 0x0f, 0x0c, 0x89, 0xe0, 0xaa, 0x64, 0xc9, 0xad, 0x12, 0x25, 0x7a, 0x67, 0x1a, 0xb5, - 0xa7, 0x20, 0x06, 0x5b, 0xad, 0x32, 0x2e, 0x68, 0x49, 0x28, 0x57, 0x78, 0x46, 0x11, 0xd4, 0xf9, - 0x9f, 0x7c, 0xf9, 0xf7, 0xd3, 0xee, 0xfe, 0x8c, 0xa9, 0xf9, 0x6d, 0x12, 0x10, 0x91, 0x87, 0xf5, - 0xdd, 0xaa, 0x86, 0xaf, 0x65, 0x7a, 0x13, 0x9a, 0xc3, 0x08, 0x4e, 0x29, 0x89, 0xde, 0xb7, 0x9c, - 0x2e, 0x5e, 0x8c, 0xe0, 0x16, 0xe8, 0xc9, 0x39, 0x2e, 0xa9, 0x44, 0x9f, 0x98, 0xff, 0xaa, 0xae, - 0xe0, 0x0e, 0x18, 0xb0, 0x94, 0x72, 0xc5, 0xd4, 0x12, 0x8d, 0xcd, 0x65, 0x7b, 0xa9, 0xf7, 0xbe, - 0x00, 0xa3, 0xf5, 0xf3, 0x83, 0x43, 0xd0, 0x4f, 0x97, 0x1c, 0xe7, 0x8c, 0x38, 0x1d, 0x08, 0x40, - 0x4f, 0x2a, 0xac, 0x18, 0x71, 0xac, 0x73, 0x7b, 0xd0, 0x75, 0xec, 0x73, 0x7b, 0xf0, 0xd6, 0x19, - 0x4d, 0x26, 0x7f, 0xad, 0x5c, 0xeb, 0x7e, 0xe5, 0x5a, 0x0f, 0x2b, 0xd7, 0xfa, 0x67, 0xe5, 0x5a, - 0x7f, 0x3e, 0xbb, 0x9d, 0x87, 0x67, 0xb7, 0xf3, 0xf8, 0xec, 0x76, 0x7e, 0xfd, 0xbc, 0xb5, 0x8f, - 0xb5, 0xb7, 0xe4, 0xae, 0x7a, 0x4d, 0xcc, 0x4e, 0x92, 0x9e, 0x79, 0x25, 0x8e, 0xfe, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x7b, 0x69, 0x42, 0xa7, 0xb6, 0x04, 0x00, 0x00, + // 719 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xcf, 0x72, 0xe3, 0x34, + 0x18, 0x8f, 0x89, 0x37, 0x49, 0x15, 0x36, 0xf5, 0x8a, 0x6c, 0x47, 0xed, 0x2c, 0x5e, 0xb3, 0x87, + 0x62, 0x18, 0xb0, 0x67, 0xb3, 0x17, 0x6e, 0x4c, 0xd3, 0x36, 0x43, 0x3b, 0x30, 0x14, 0xb7, 0x5c, + 0xb8, 0x78, 0x64, 0x59, 0x4d, 0x34, 0xb5, 0x25, 0x63, 0xa9, 0xa1, 0xe1, 0x29, 0x78, 0x0c, 0x1e, + 0xa5, 0xc7, 0x1e, 0x3b, 0x1c, 0x3a, 0x4c, 0xfa, 0x22, 0x8c, 0x64, 0xbb, 0x38, 0xd3, 0xbd, 0x44, + 0xfe, 0xf4, 0xfb, 0xf3, 0x49, 0xca, 0x4f, 0x02, 0x6f, 0x32, 0xbc, 0xc4, 0x9c, 0xaa, 0x50, 0x8f, + 0xa1, 0x2c, 0x28, 0x31, 0x3f, 0x41, 0x51, 0x0a, 0x25, 0xe0, 0xab, 0x1a, 0x0d, 0xf4, 0x18, 0x68, + 0x60, 0x6f, 0x3c, 0x17, 0x73, 0x61, 0xd0, 0x50, 0x7f, 0x55, 0xc4, 0xbd, 0xfd, 0xe7, 0x36, 0xb8, + 0x60, 0x31, 0x11, 0x59, 0x46, 0x89, 0x62, 0x82, 0xd7, 0x3c, 0x97, 0x08, 0x99, 0x0b, 0x19, 0x26, + 0x58, 0xd2, 0x70, 0xf9, 0x3e, 0xa1, 0x0a, 0xbf, 0x0f, 0x89, 0x60, 0x35, 0xfe, 0xee, 0xbe, 0x0f, + 0xec, 0xf3, 0x82, 0x12, 0x38, 0x06, 0x2f, 0x18, 0x4f, 0xe9, 0x0d, 0xb2, 0x3c, 0xcb, 0xdf, 0x8a, + 0xaa, 0x02, 0x42, 0x60, 0x73, 0x9c, 0x53, 0xf4, 0x89, 0x99, 0x34, 0xdf, 0x10, 0x81, 0x3e, 0xe5, + 0x38, 0xc9, 0x68, 0x8a, 0x6c, 0xcf, 0xf2, 0x07, 0x51, 0x53, 0xc2, 0x0f, 0xe0, 0x75, 0x49, 0x33, + 0x86, 0x13, 0x96, 0x31, 0xb5, 0x8a, 0xd5, 0xa2, 0xa4, 0x72, 0x21, 0xb2, 0x14, 0xbd, 0xf0, 0x2c, + 0xff, 0x65, 0x34, 0x6e, 0x81, 0x17, 0x0d, 0x06, 0xbf, 0x03, 0x28, 0xc5, 0x0a, 0xc7, 0x6d, 0x65, + 0xe3, 0xdf, 0x33, 0xfe, 0x3b, 0x1a, 0x8f, 0xfe, 0x87, 0x8f, 0xeb, 0x76, 0x3f, 0x80, 0x2f, 0x92, + 0x4c, 0x90, 0xab, 0x38, 0x65, 0x52, 0x61, 0x4e, 0x68, 0x7c, 0x29, 0xca, 0xf8, 0x92, 0x71, 0x9c, + 0xb1, 0x3f, 0x69, 0x1a, 0x6b, 0x19, 0xea, 0x9b, 0xd6, 0x9f, 0x1b, 0xe2, 0x51, 0xcd, 0x9b, 0x89, + 0x72, 0xd6, 0xb0, 0x8e, 0xb0, 0xc2, 0xf0, 0x7b, 0xf0, 0xc6, 0x10, 0x64, 0xcc, 0x78, 0x63, 0x80, + 0xf5, 0x29, 0xc6, 0x45, 0x29, 0xc4, 0x25, 0x1a, 0x18, 0x93, 0xdd, 0x8a, 0x73, 0xc2, 0x67, 0x2d, + 0xc6, 0x99, 0x26, 0xc0, 0x6f, 0x00, 0xc4, 0x4b, 0x5a, 0xe2, 0x39, 0x8d, 0xab, 0x25, 0x29, 0x96, + 0x53, 0xb4, 0xe5, 0x59, 0x7e, 0x37, 0x72, 0x6a, 0x64, 0xaa, 0x81, 0x0b, 0x96, 0x53, 0x78, 0x00, + 0x5c, 0x9c, 0x65, 0xe2, 0x0f, 0x9a, 0xd6, 0xec, 0x0c, 0xcf, 0xcd, 0xda, 0x7f, 0x17, 0x32, 0x96, + 0x2b, 0x4e, 0x10, 0x30, 0xca, 0xdd, 0x9a, 0x65, 0x94, 0x3f, 0xe2, 0xf9, 0x4c, 0x94, 0xbf, 0x08, + 0x79, 0xbe, 0xe2, 0x44, 0x37, 0x6c, 0xa4, 0x52, 0xc5, 0xd7, 0x45, 0x8a, 0x15, 0x4d, 0xd1, 0xd0, + 0xb3, 0x7c, 0x3b, 0x72, 0x92, 0x8a, 0x2f, 0xd5, 0xaf, 0xd5, 0x3c, 0xfc, 0x09, 0xc0, 0x9c, 0xf1, + 0x58, 0x2a, 0x7c, 0x45, 0xf5, 0x96, 0x96, 0x2c, 0xa5, 0x25, 0xfa, 0xd4, 0xb3, 0xfc, 0xe1, 0x64, + 0x37, 0xa8, 0x22, 0x12, 0xe8, 0x88, 0x04, 0x75, 0x44, 0x82, 0x43, 0xc1, 0xf8, 0xd4, 0xbe, 0x7d, + 0x78, 0xdb, 0x89, 0x9c, 0x9c, 0xf1, 0x73, 0xad, 0x3c, 0xab, 0x85, 0xf0, 0x67, 0xb0, 0xdd, 0x98, + 0xc8, 0x58, 0xad, 0x0a, 0x2a, 0xd1, 0xc8, 0xb3, 0xfc, 0xd1, 0x64, 0x3f, 0x78, 0x96, 0xdf, 0x40, + 0xa7, 0x2b, 0x68, 0xa4, 0xf2, 0x42, 0xb3, 0xa3, 0x51, 0xb1, 0x51, 0xeb, 0x48, 0xb1, 0xbc, 0x10, + 0xa5, 0x92, 0x68, 0xdb, 0xeb, 0xfa, 0x5b, 0x51, 0x53, 0xc2, 0x13, 0xb0, 0xbd, 0x99, 0x6b, 0x89, + 0x1c, 0xaf, 0xeb, 0x0f, 0x27, 0xde, 0x47, 0x5a, 0x1d, 0x14, 0xec, 0xf0, 0x89, 0x18, 0x8d, 0x70, + 0xbb, 0x94, 0xd0, 0x03, 0x43, 0x22, 0xb8, 0x2a, 0x59, 0x72, 0xad, 0x44, 0x89, 0x5e, 0x99, 0x46, + 0xed, 0x29, 0x88, 0xc1, 0x4e, 0xab, 0x8c, 0x0b, 0x5a, 0x12, 0xca, 0x15, 0x9e, 0x53, 0x04, 0x75, + 0xfe, 0xa7, 0x5f, 0xff, 0xf3, 0xf0, 0x76, 0x7f, 0xce, 0xd4, 0xe2, 0x3a, 0x09, 0x88, 0xc8, 0xc3, + 0xfa, 0x6e, 0x55, 0xc3, 0xb7, 0x32, 0xbd, 0x0a, 0xcd, 0x61, 0x04, 0x47, 0x94, 0x44, 0xaf, 0x5b, + 0x4e, 0x67, 0x4f, 0x46, 0x70, 0x07, 0xf4, 0xe4, 0x02, 0x97, 0x54, 0xa2, 0xcf, 0xcc, 0x7f, 0x55, + 0x57, 0x70, 0x0f, 0x0c, 0x58, 0x4a, 0xb9, 0x62, 0x6a, 0x85, 0xc6, 0xe6, 0xb2, 0x3d, 0xd5, 0xef, + 0xbe, 0x02, 0xa3, 0xcd, 0xf3, 0x83, 0x43, 0xd0, 0x4f, 0x57, 0x1c, 0xe7, 0x8c, 0x38, 0x1d, 0x08, + 0x40, 0x4f, 0x2a, 0xac, 0x18, 0x71, 0xac, 0x53, 0x7b, 0xd0, 0x75, 0xec, 0x53, 0x7b, 0xf0, 0xd2, + 0x19, 0x4d, 0x8f, 0xff, 0x5e, 0xbb, 0xd6, 0xed, 0xda, 0xb5, 0xee, 0xd6, 0xae, 0xf5, 0xef, 0xda, + 0xb5, 0xfe, 0x7a, 0x74, 0x3b, 0x77, 0x8f, 0x6e, 0xe7, 0xfe, 0xd1, 0xed, 0xfc, 0xf6, 0x65, 0x6b, + 0x1f, 0x1b, 0x6f, 0xc9, 0x72, 0x12, 0xde, 0x54, 0x0f, 0x8a, 0xd9, 0x4c, 0xd2, 0x33, 0x0f, 0xc5, + 0x87, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xad, 0xae, 0xe3, 0xb9, 0x04, 0x00, 0x00, } func (this *Spec) Equal(that interface{}) bool { diff --git a/x/spec/types/spec_add_proposal.pb.go b/x/spec/types/spec_add_proposal.pb.go index 58ef6a2188..7d974d5ac4 100644 --- a/x/spec/types/spec_add_proposal.pb.go +++ b/x/spec/types/spec_add_proposal.pb.go @@ -70,7 +70,7 @@ func init() { } var fileDescriptor_90ccba27a5c90c8a = []byte{ - // 245 bytes of a gzipped FileDescriptorProto + // 248 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcc, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc5, 0x05, 0xa9, 0xc9, 0x60, 0x22, 0x3e, 0x31, 0x25, 0x25, 0xbe, 0xa0, 0x28, 0xbf, 0x20, 0xbf, 0x38, 0x31, 0x47, 0xaf, 0xa0, 0x28, 0xbf, 0x24, 0x5f, @@ -81,12 +81,12 @@ var fileDescriptor_90ccba27a5c90c8a = []byte{ 0xdc, 0x29, 0xa9, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0x99, 0xf9, 0x79, 0x12, 0x4c, 0x60, 0x39, 0x64, 0x21, 0x21, 0x63, 0x2e, 0x56, 0x90, 0xc9, 0xc5, 0x12, 0xcc, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0xe2, 0x7a, 0x18, 0x4e, 0xd4, 0x03, 0x59, 0xe5, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x44, - 0xad, 0x15, 0x47, 0xc7, 0x02, 0x79, 0x86, 0x19, 0x0b, 0xe4, 0x19, 0x9c, 0x9c, 0x56, 0x3c, 0x92, + 0xad, 0x15, 0x47, 0xc7, 0x02, 0x79, 0x86, 0x19, 0x0b, 0xe4, 0x19, 0x9c, 0x5c, 0x57, 0x3c, 0x92, 0x63, 0x3c, 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, 0x95, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0x1f, 0x55, 0x40, 0xfc, 0x54, 0x52, 0x59, - 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0x95, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xab, 0xcf, 0x87, - 0x10, 0x49, 0x01, 0x00, 0x00, + 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf5, 0xf4, 0xcc, 0x92, + 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0x1f, 0x95, 0x19, 0xe9, 0x57, 0x40, 0xbc, + 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0x98, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, + 0x15, 0xb5, 0x74, 0x7d, 0x4c, 0x01, 0x00, 0x00, } func (this *SpecAddProposal) Equal(that interface{}) bool { diff --git a/x/spec/types/tx.pb.go b/x/spec/types/tx.pb.go index c3c53b4dce..e3b43907f4 100644 --- a/x/spec/types/tx.pb.go +++ b/x/spec/types/tx.pb.go @@ -26,15 +26,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("lavanet/lava/spec/tx.proto", fileDescriptor_c6aee532b425dbb5) } var fileDescriptor_c6aee532b425dbb5 = []byte{ - // 121 bytes of a gzipped FileDescriptorProto + // 124 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc5, 0x05, 0xa9, 0xc9, 0xfa, 0x25, 0x15, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x82, 0x50, 0x39, 0x3d, 0x10, 0xad, 0x07, 0x92, 0x33, 0x62, 0xe5, - 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0xb2, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, + 0x62, 0xf6, 0x2d, 0x4e, 0x77, 0x72, 0x3c, 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, 0x95, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0xa3, 0x2b, - 0xa0, 0x86, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x2d, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, - 0xff, 0x5c, 0x25, 0x52, 0x32, 0x7e, 0x00, 0x00, 0x00, + 0x28, 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x14, 0xa3, 0xcb, + 0x8c, 0xf4, 0x2b, 0xa0, 0xe6, 0x57, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xed, 0x30, 0x06, 0x04, + 0x00, 0x00, 0xff, 0xff, 0x53, 0xc0, 0x4a, 0x76, 0x81, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/spec/types/types.go b/x/spec/types/types.go index cff4b416c1..0430f3f472 100644 --- a/x/spec/types/types.go +++ b/x/spec/types/types.go @@ -137,7 +137,7 @@ func (s *ParseValue_VerificationSeverity) UnmarshalJSON(b []byte) error { return nil } -func IsFinalizedBlock(requestedBlock, latestBlock int64, finalizationCriteria uint32) bool { +func IsFinalizedBlock(requestedBlock, latestBlock, finalizationCriteria int64) bool { switch requestedBlock { case NOT_APPLICABLE: return false @@ -146,7 +146,7 @@ func IsFinalizedBlock(requestedBlock, latestBlock int64, finalizationCriteria ui if requestedBlock < 0 { return false } - if requestedBlock <= latestBlock-int64(finalizationCriteria) { + if requestedBlock <= latestBlock-finalizationCriteria { return true } } diff --git a/x/subscription/client/cli/query.go b/x/subscription/client/cli/query.go index fa4901a9b1..36d5f678bd 100644 --- a/x/subscription/client/cli/query.go +++ b/x/subscription/client/cli/query.go @@ -10,7 +10,7 @@ import ( // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) // GetQueryCmd returns the cli query commands for this module @@ -26,6 +26,9 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdCurrent()) + cmd.AddCommand(CmdEstimatedRewards()) + cmd.AddCommand(CmdEstimatedValidatorsRewards()) + cmd.AddCommand(CmdTrackedCuUsage()) cmd.AddCommand(CmdListProjects()) diff --git a/x/subscription/client/cli/query_current.go b/x/subscription/client/cli/query_current.go index 3bf3c9a124..6a7b4f16ad 100644 --- a/x/subscription/client/cli/query_current.go +++ b/x/subscription/client/cli/query_current.go @@ -3,8 +3,8 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_estimated_rewards.go b/x/subscription/client/cli/query_estimated_rewards.go new file mode 100644 index 0000000000..1b8b471e1f --- /dev/null +++ b/x/subscription/client/cli/query_estimated_rewards.go @@ -0,0 +1,58 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" + "github.com/spf13/cobra" +) + +func CmdEstimatedRewards() *cobra.Command { + cmd := &cobra.Command{ + Use: "estimated-rewards [provider] [chainid] {optional: amount/delegator}", + Short: "calculates the rewards estimation for a provider delegation", + Long: `Query to estimate the rewards a delegator will get for 1 month from the provider, if used without optional args the calculations will be for the provider. + optional args can be amount for new delegation or address for an existing one. + The estimation takes into account subscription rewards, bonus rewards and iprpc rewards, as well as the provider delegation limit, spec contribution and tax. + The query does not take into account the likes of addons, geolocation and the quality of the provider services. + args: + [provider] provider address. + [chain-id] provider chain id. + [amount/delegator] optional: delegation amount for the estimation Or delegator address for existing delegation. if not used the rewards will be calculated for the provider. + `, + Args: cobra.RangeArgs(2, 3), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := types.QueryEstimatedRewardsRequest{} + req.Provider = args[0] + req.ChainId = args[1] + + if len(args) == 3 { + address, err := utils.ParseCLIAddress(clientCtx, args[2]) + if err != nil { + req.AmountDelegator = args[2] + } else { + req.AmountDelegator = address + } + } + + res, err := queryClient.EstimatedRewards(cmd.Context(), &req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/subscription/client/cli/query_estimated_validators_rewards.go b/x/subscription/client/cli/query_estimated_validators_rewards.go new file mode 100644 index 0000000000..1b805f8742 --- /dev/null +++ b/x/subscription/client/cli/query_estimated_validators_rewards.go @@ -0,0 +1,55 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" + "github.com/spf13/cobra" +) + +func CmdEstimatedValidatorsRewards() *cobra.Command { + cmd := &cobra.Command{ + Use: "estimated-validator-rewards [validator] {optional: amount/delegator}", + Short: "calculates the rewards estimation for a validator delegation", + Long: `Query to estimate the rewards a delegator will get for 1 month from the validator, if used without optional args the calculations will be for the validator itself. + optional args can be amount for new delegation or address for an existing one. + The estimation takes into account subscription rewards, block rewards and iprpc rewards, as well as commisions. + args: + [validator] validator address. + [amount/delegator] optional: delegation amount for the estimation Or delegator address for existing delegation. if not used the rewards will be calculated for the validator. + `, + Args: cobra.RangeArgs(1, 2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := types.QueryEstimatedValidatorRewardsRequest{} + req.Validator = args[0] + + if len(args) == 2 { + address, err := utils.ParseCLIAddress(clientCtx, args[1]) + if err != nil { + req.AmountDelegator = args[1] + } else { + req.AmountDelegator = address + } + } + + res, err := queryClient.EstimatedValidatorRewards(cmd.Context(), &req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/subscription/client/cli/query_list.go b/x/subscription/client/cli/query_list.go index 6311b55f74..96e045e663 100644 --- a/x/subscription/client/cli/query_list.go +++ b/x/subscription/client/cli/query_list.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_list_projects.go b/x/subscription/client/cli/query_list_projects.go index 9f8b33101d..d878f7de24 100644 --- a/x/subscription/client/cli/query_list_projects.go +++ b/x/subscription/client/cli/query_list_projects.go @@ -5,8 +5,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_next_to_month_expiry.go b/x/subscription/client/cli/query_next_to_month_expiry.go index 50a0143b30..2601370450 100644 --- a/x/subscription/client/cli/query_next_to_month_expiry.go +++ b/x/subscription/client/cli/query_next_to_month_expiry.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_params.go b/x/subscription/client/cli/query_params.go index e7b32a244d..6925e2d992 100644 --- a/x/subscription/client/cli/query_params.go +++ b/x/subscription/client/cli/query_params.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/query_tracked_cu_usage.go b/x/subscription/client/cli/query_tracked_cu_usage.go new file mode 100644 index 0000000000..2c7cfc89c3 --- /dev/null +++ b/x/subscription/client/cli/query_tracked_cu_usage.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/v2/x/subscription/types" + "github.com/spf13/cobra" +) + +func CmdTrackedCuUsage() *cobra.Command { + cmd := &cobra.Command{ + Use: "tracked-cu-usage [subscription]", + Short: "shows the tracked cu for a given subscription", + Long: "Query to fetch all the CU usage of a specific subscription, the output of this query is a list of providers and the amount of CU they served for the subscription in the current month.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := types.QuerySubscriptionTrackedUsageRequest{Subscription: args[0]} + + res, err := queryClient.TrackedUsage(cmd.Context(), &req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/subscription/client/cli/tx.go b/x/subscription/client/cli/tx.go index 1d132804fd..d233b07f47 100644 --- a/x/subscription/client/cli/tx.go +++ b/x/subscription/client/cli/tx.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/subscription/client/cli/tx_add_project.go b/x/subscription/client/cli/tx_add_project.go index 10e14f6aae..893ff6fed3 100644 --- a/x/subscription/client/cli/tx_add_project.go +++ b/x/subscription/client/cli/tx_add_project.go @@ -6,11 +6,11 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/decoder" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/decoder" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/tx_auto_renewal.go b/x/subscription/client/cli/tx_auto_renewal.go index 30552cf812..b505cf9018 100644 --- a/x/subscription/client/cli/tx_auto_renewal.go +++ b/x/subscription/client/cli/tx_auto_renewal.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/tx_buy.go b/x/subscription/client/cli/tx_buy.go index 07f3f32a76..d21405e14e 100644 --- a/x/subscription/client/cli/tx_buy.go +++ b/x/subscription/client/cli/tx_buy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/x/subscription/client/cli/tx_del_project.go b/x/subscription/client/cli/tx_del_project.go index 7d9b53f571..e72dcf34b0 100644 --- a/x/subscription/client/cli/tx_del_project.go +++ b/x/subscription/client/cli/tx_del_project.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/spf13/cobra" ) diff --git a/x/subscription/genesis.go b/x/subscription/genesis.go index 346e08a4ad..47a88e5b56 100644 --- a/x/subscription/genesis.go +++ b/x/subscription/genesis.go @@ -2,8 +2,8 @@ package subscription import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) // InitGenesis initializes the capability module's state from a provided genesis diff --git a/x/subscription/genesis_test.go b/x/subscription/genesis_test.go index 18e09d96be..27f5dca7da 100644 --- a/x/subscription/genesis_test.go +++ b/x/subscription/genesis_test.go @@ -3,10 +3,10 @@ package subscription_test import ( "testing" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/testutil/nullify" - "github.com/lavanet/lava/x/subscription" - "github.com/lavanet/lava/x/subscription/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/testutil/nullify" + "github.com/lavanet/lava/v2/x/subscription" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/handler.go b/x/subscription/handler.go index fe247897f4..83d00d9449 100644 --- a/x/subscription/handler.go +++ b/x/subscription/handler.go @@ -6,8 +6,8 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) // NewHandler ... diff --git a/x/subscription/keeper/adjustment.go b/x/subscription/keeper/adjustment.go index ff0480a07d..ab0759ebba 100644 --- a/x/subscription/keeper/adjustment.go +++ b/x/subscription/keeper/adjustment.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" ) // SetAdjustment set a specific Adjustment in the store from its index diff --git a/x/subscription/keeper/adjustment_test.go b/x/subscription/keeper/adjustment_test.go index 2f41889c34..0e55270067 100644 --- a/x/subscription/keeper/adjustment_test.go +++ b/x/subscription/keeper/adjustment_test.go @@ -4,7 +4,7 @@ import ( "testing" "cosmossdk.io/math" - "github.com/lavanet/lava/testutil/common" + "github.com/lavanet/lava/v2/testutil/common" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/cluster.go b/x/subscription/keeper/cluster.go index dab55483a1..5f3de715fc 100644 --- a/x/subscription/keeper/cluster.go +++ b/x/subscription/keeper/cluster.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) func (k Keeper) GetAllClusters(ctx sdk.Context) []string { diff --git a/x/subscription/keeper/cluster_test.go b/x/subscription/keeper/cluster_test.go index 7f76319813..ae2efff1b3 100644 --- a/x/subscription/keeper/cluster_test.go +++ b/x/subscription/keeper/cluster_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "testing" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/cu_tracker.go b/x/subscription/keeper/cu_tracker.go index 83d5b6db60..739df9eb8b 100644 --- a/x/subscription/keeper/cu_tracker.go +++ b/x/subscription/keeper/cu_tracker.go @@ -8,10 +8,10 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - rewardstypes "github.com/lavanet/lava/x/rewards/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) const LIMIT_TOKEN_PER_CU = 100 @@ -70,8 +70,8 @@ func (k Keeper) GetAllSubTrackedCuIndices(ctx sdk.Context, sub string) []string } // removeCuTracker removes a trackedCu entry -func (k Keeper) resetCuTracker(ctx sdk.Context, sub string, info trackedCuInfo, subBlock uint64) error { - key := types.CuTrackerKey(sub, info.provider, info.chainID) +func (k Keeper) resetCuTracker(ctx sdk.Context, sub string, info *types.TrackedCuInfo, subBlock uint64) error { + key := types.CuTrackerKey(sub, info.Provider, info.ChainID) var trackedCu types.TrackedCu _, _, isLatest, _ := k.cuTrackerFS.FindEntryDetailed(ctx, key, subBlock, &trackedCu) if isLatest { @@ -80,14 +80,7 @@ func (k Keeper) resetCuTracker(ctx sdk.Context, sub string, info trackedCuInfo, return nil } -type trackedCuInfo struct { - provider string - chainID string - trackedCu uint64 - block uint64 -} - -func (k Keeper) GetSubTrackedCuInfo(ctx sdk.Context, sub string, block uint64) (trackedCuList []trackedCuInfo, totalCuTracked uint64) { +func (k Keeper) GetSubTrackedCuInfo(ctx sdk.Context, sub string, block uint64) (trackedCuList []*types.TrackedCuInfo, totalCuTracked uint64) { keys := k.GetAllSubTrackedCuIndices(ctx, sub) for _, key := range keys { @@ -102,11 +95,11 @@ func (k Keeper) GetSubTrackedCuInfo(ctx sdk.Context, sub string, block uint64) ( ) continue } - trackedCuList = append(trackedCuList, trackedCuInfo{ - provider: provider, - trackedCu: cu, - chainID: chainID, - block: block, + trackedCuList = append(trackedCuList, &types.TrackedCuInfo{ + Provider: provider, + TrackedCu: cu, + ChainID: chainID, + Block: block, }) totalCuTracked += cu } @@ -139,7 +132,7 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes // Note: We take the subscription from the FixationStore, based on the given block. // So, even if the plan changed during the month, we still take the original plan, based on the given block. - block := trackedCuList[0].block + block := trackedCuList[0].Block totalTokenAmount := timerData.Credit.Amount if totalTokenAmount.Quo(sdk.NewIntFromUint64(totalCuTracked)).GT(sdk.NewIntFromUint64(LIMIT_TOKEN_PER_CU)) { @@ -151,11 +144,13 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes adjustmentFactorForProvider := k.GetAdjustmentFactorProvider(ctx, adjustments) k.RemoveConsumerAdjustments(ctx, sub) + details := map[string]string{} + totalTokenRewarded := sdk.ZeroInt() for _, trackedCuInfo := range trackedCuList { - trackedCu := trackedCuInfo.trackedCu - provider := trackedCuInfo.provider - chainID := trackedCuInfo.chainID + trackedCu := trackedCuInfo.TrackedCu + provider := trackedCuInfo.Provider + chainID := trackedCuInfo.ChainID err = k.resetCuTracker(ctx, sub, trackedCuInfo, block) if err != nil { @@ -199,7 +194,8 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes // Note: if the reward function doesn't reward the provider // because he was unstaked, we only print an error and not returning - providerReward, _, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, provider, chainID, sdk.NewCoins(creditToSub), types.ModuleName, false, false, false) + + _, _, err := k.dualstakingKeeper.RewardProvidersAndDelegators(ctx, provider, chainID, sdk.NewCoins(creditToSub), types.ModuleName, false, false, false) if errors.Is(err, epochstoragetypes.ErrProviderNotStaked) || errors.Is(err, epochstoragetypes.ErrStakeStorageNotFound) { utils.LavaFormatWarning("sending provider reward with delegations failed", err, utils.Attribute{Key: "provider", Value: provider}, @@ -216,28 +212,16 @@ func (k Keeper) RewardAndResetCuTracker(ctx sdk.Context, cuTrackerTimerKeyBytes utils.Attribute{Key: "block", Value: ctx.BlockHeight()}, ) } else { - utils.LogLavaEvent(ctx, k.Logger(ctx), types.MonthlyCuTrackerProviderRewardEventName, map[string]string{ - "provider": provider, - "sub": sub, - "tracked_cu": strconv.FormatUint(trackedCu, 10), - "credit_used": creditToSub.String(), - "reward": providerReward.String(), - "block": strconv.FormatInt(ctx.BlockHeight(), 10), - "adjustment_raw": providerAdjustment.String(), - }, "Provider got monthly reward successfully") + details[provider+" "+chainID] = fmt.Sprintf("cu: %d reward: %s", trackedCu, creditToSub.String()) } } - updatedCredit := sdk.NewCoin(k.stakingKeeper.BondDenom(ctx), math.ZeroInt()) - if timerData.Credit.Amount.GT(totalTokenRewarded) { - updatedCredit = k.returnCreditToSub(ctx, sub, timerData.Credit.Amount.Sub(totalTokenRewarded)) - } + details["subscription"] = sub + details["total_cu"] = strconv.FormatUint(totalCuTracked, 10) + details["total_rewards"] = totalTokenRewarded.String() + details["block"] = strconv.FormatInt(ctx.BlockHeight(), 10) - utils.LogLavaEvent(ctx, k.Logger(ctx), types.RemainingCreditEventName, map[string]string{ - "sub": sub, - "credit_remaining": updatedCredit.String(), - "block": strconv.FormatInt(ctx.BlockHeight(), 10), - }, "CU tracker reward and reset executed") + utils.LogLavaEvent(ctx, k.Logger(ctx), types.SubscriptionPayoutEventName, details, "subscription monthly payout and reset") } func (k Keeper) CalcTotalMonthlyReward(ctx sdk.Context, totalAmount math.Int, trackedCu uint64, totalCuUsedBySub uint64) math.Int { diff --git a/x/subscription/keeper/grpc_query.go b/x/subscription/keeper/grpc_query.go index 5686188e62..f4875b1214 100644 --- a/x/subscription/keeper/grpc_query.go +++ b/x/subscription/keeper/grpc_query.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/subscription/keeper/grpc_query_current.go b/x/subscription/keeper/grpc_query_current.go index be8d908a28..664de98dbe 100644 --- a/x/subscription/keeper/grpc_query_current.go +++ b/x/subscription/keeper/grpc_query_current.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_estimated_rewards.go b/x/subscription/keeper/grpc_query_estimated_rewards.go new file mode 100644 index 0000000000..f6ce90aec5 --- /dev/null +++ b/x/subscription/keeper/grpc_query_estimated_rewards.go @@ -0,0 +1,136 @@ +package keeper + +import ( + "context" + "fmt" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + "github.com/lavanet/lava/v2/x/subscription/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) EstimatedRewards(goCtx context.Context, req *types.QueryEstimatedRewardsRequest) (*types.QueryEstimatedRewardsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + res := types.QueryEstimatedRewardsResponse{} + + _, specContribut := k.specKeeper.GetContributorReward(ctx, req.ChainId) + + storage := k.epochstorageKeeper.GetAllStakeEntriesCurrentForChainId(ctx, req.ChainId) + + totalStake := math.ZeroInt() + var entry epochstoragetypes.StakeEntry + found := false + for _, e := range storage { + totalStake = totalStake.Add(e.EffectiveStake()) + if e.Address == req.Provider { + found = true + entry = e + } + } + if !found { + return nil, fmt.Errorf("provider not found in stake entries for chain ID: %s", req.ChainId) + } + + // delegation of the provider + delegationAmount := entry.Stake + delegatorPart := sdk.NewDecFromInt(delegationAmount.Amount).QuoInt(totalStake) + if req.AmountDelegator != "" { + _, err := sdk.AccAddressFromBech32(req.AmountDelegator) + if err == nil { + d, found := k.dualstakingKeeper.GetDelegation(ctx, req.AmountDelegator, req.Provider, req.ChainId, uint64(ctx.BlockHeight())) + if !found { + return nil, fmt.Errorf("could not find delegator") + } + delegationAmount = d.Amount + } else { + var err error + delegationAmount, err = sdk.ParseCoinNormalized(req.AmountDelegator) + if err != nil { + return nil, err + } + entry.DelegateTotal = entry.DelegateTotal.Add(delegationAmount) + } + + delegatorPart = sdk.NewDecFromInt(delegationAmount.Amount).QuoInt(totalStake).MulInt64(int64(100 - entry.DelegateCommission)).QuoInt64(100) + // calculate existing delegator rewards + if entry.DelegateLimit.Amount.LT(entry.DelegateTotal.Amount) { + delegatorPart = delegatorPart.MulInt(entry.DelegateLimit.Amount).QuoInt(entry.DelegateTotal.Amount) + } + } else { + totalDelegations := entry.DelegateTotal.Amount + if entry.DelegateLimit.Amount.LT(entry.DelegateTotal.Amount) { + totalDelegations = entry.DelegateLimit.Amount + } + commission := sdk.NewDecFromInt(totalDelegations).QuoInt(totalStake).MulInt64(int64(entry.DelegateCommission)).QuoInt64(100) + delegatorPart = delegatorPart.Add(commission) + } + delegatorPart = delegatorPart.Mul(sdk.OneDec().Sub(specContribut)) + + totalSubsRewards := sdk.Coins{} + subsIndices := k.GetAllSubscriptionsIndices(ctx) + for _, subIndex := range subsIndices { + sub, found := k.GetSubscription(ctx, subIndex) + if found { + sub.Credit.Amount = sub.Credit.Amount.Quo(sdk.NewIntFromUint64(sub.DurationLeft)) + totalSubsRewards = totalSubsRewards.Add(sub.Credit) + } + } + + emissions := k.rewardsKeeper.SpecEmissionParts(ctx) + var specEmission rewardstypes.SpecEmissionPart + found = false + for _, k := range emissions { + if k.ChainID == req.ChainId { + specEmission = k + found = true + break + } + } + + if !found { + return nil, fmt.Errorf("spec emission part not found for chain ID: %s", req.ChainId) + } + + subscriptionRewards, _ := sdk.NewDecCoinsFromCoins(totalSubsRewards...).MulDec(specEmission.Emission).TruncateDecimal() + valRewards, comRewards, err := k.rewardsKeeper.CalculateValidatorsAndCommunityParticipationRewards(ctx, subscriptionRewards[0]) + if err != nil { + return nil, fmt.Errorf("failed to calculate Validators And Community Participation Rewards") + } + + coins := k.rewardsKeeper.TotalPoolTokens(ctx, rewardstypes.ProviderRewardsDistributionPool) + TotalPoolTokens := coins.AmountOf(k.stakingKeeper.BondDenom(ctx)) + + bonusRewards := k.rewardsKeeper.SpecTotalPayout(ctx, + TotalPoolTokens, + sdk.NewDecFromInt(subscriptionRewards.AmountOf(k.stakingKeeper.BondDenom(ctx))), + specEmission) + + subscriptionRewards = subscriptionRewards.Sub(valRewards...).Sub(comRewards...) + + iprpcReward, found := k.rewardsKeeper.GetIprpcReward(ctx, k.rewardsKeeper.GetIprpcRewardsCurrentId(ctx)) + if found { + for _, fund := range iprpcReward.SpecFunds { + if fund.Spec == req.ChainId { + res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "iprpc", Amount: sdk.NewDecCoinsFromCoins(fund.Fund...).MulDec(delegatorPart)}) + } + } + } + + res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "subscriptions", Amount: sdk.NewDecCoinsFromCoins(subscriptionRewards...).MulDec(delegatorPart)}) + res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "boost", Amount: sdk.NewDecCoins(sdk.NewDecCoinFromDec(k.stakingKeeper.BondDenom(ctx), bonusRewards.Mul(delegatorPart)))}) + + res.Total = sdk.NewDecCoins() + for _, k := range res.Info { + res.Total = res.Total.Add(k.Amount...) + } + + return &res, nil +} diff --git a/x/subscription/keeper/grpc_query_estimated_validator_rewards.go b/x/subscription/keeper/grpc_query_estimated_validator_rewards.go new file mode 100644 index 0000000000..dd6a129e2b --- /dev/null +++ b/x/subscription/keeper/grpc_query_estimated_validator_rewards.go @@ -0,0 +1,117 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + "github.com/lavanet/lava/v2/x/subscription/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) EstimatedValidatorRewards(goCtx context.Context, req *types.QueryEstimatedValidatorRewardsRequest) (*types.QueryEstimatedValidatorRewardsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + res := types.QueryEstimatedValidatorRewardsResponse{} + + valAddress, err := sdk.ValAddressFromBech32(req.Validator) + if err != nil { + return nil, err + } + + val, found := k.stakingKeeper.GetValidator(ctx, valAddress) + if !found { + return nil, fmt.Errorf("validator not found") + } + + var delegatorPart sdk.Dec + delAddress := sdk.AccAddress(valAddress) + totalStakedTokens := sdk.ZeroInt() + // self delegation + if req.AmountDelegator == "" { + del, found := k.stakingKeeper.GetDelegation(ctx, delAddress, valAddress) + if !found { + return nil, fmt.Errorf("self delegation not found") + } + delegatorPart = del.Shares.Add(val.DelegatorShares.Sub(del.Shares).Mul(val.Commission.Rate)).Quo(val.DelegatorShares) + } else { + delAddress, err := sdk.AccAddressFromBech32(req.AmountDelegator) + // existing delegator + if err == nil { + del, found := k.stakingKeeper.GetDelegation(ctx, delAddress, valAddress) + if !found { + return nil, fmt.Errorf("delegation not found") + } + delegatorPart = del.Shares.Quo(val.DelegatorShares).Mul(sdk.OneDec().Sub(val.Commission.Rate)) + } else { // potential delegator + coins, err := sdk.ParseCoinsNormalized(req.AmountDelegator) + if err != nil { + return nil, fmt.Errorf("failed to parse input, input should be a valid lava delegator account or coins") + } + + totalStakedTokens = coins[0].Amount + var shares sdk.Dec + val, shares = val.AddTokensFromDel(coins[0].Amount) + delegatorPart = shares.Quo(val.DelegatorShares).Mul(sdk.OneDec().Sub(val.Commission.Rate)) + } + } + + validators := k.stakingKeeper.GetBondedValidatorsByPower(ctx) + + for _, v := range validators { + totalStakedTokens = totalStakedTokens.Add(v.Tokens) + } + delegatorPart = delegatorPart.MulInt(val.Tokens).QuoInt(totalStakedTokens) + + totalSubsRewards := sdk.Coins{} + subsIndices := k.GetAllSubscriptionsIndices(ctx) + for _, subIndex := range subsIndices { + sub, found := k.GetSubscription(ctx, subIndex) + if found { + sub.Credit.Amount = sub.Credit.Amount.Quo(sdk.NewIntFromUint64(sub.DurationLeft)) + totalSubsRewards = totalSubsRewards.Add(sub.Credit) + } + } + + valRewardsFromSubscriptions, _, err := k.rewardsKeeper.CalculateValidatorsAndCommunityParticipationRewards(ctx, totalSubsRewards[0]) + if err != nil { + return nil, fmt.Errorf("failed to calculate Validators And Community Participation Rewards") + } + + monthsLeft := k.rewardsKeeper.AllocationPoolMonthsLeft(ctx) + allocationPool := k.rewardsKeeper.TotalPoolTokens(ctx, rewardstypes.ValidatorsRewardsAllocationPoolName) + blockRewards := sdk.NewDecCoinsFromCoins(allocationPool...).QuoDec(sdk.NewDec(monthsLeft)) + communityTax := k.rewardsKeeper.GetCommunityTax(ctx) + blockRewards = blockRewards.MulDec(sdk.OneDec().Sub(communityTax)) + + iprpcReward, found := k.rewardsKeeper.GetIprpcReward(ctx, k.rewardsKeeper.GetIprpcRewardsCurrentId(ctx)) + if found { + for _, fund := range iprpcReward.SpecFunds { + coinsForSpec := sdk.NewCoins() + for _, coin := range fund.Fund { + validatorCoins, _, err := k.rewardsKeeper.CalculateValidatorsAndCommunityParticipationRewards(ctx, coin) + if err != nil { + return nil, fmt.Errorf("failed to calculate Validators And Community Participation Rewards for iprpc") + } + coinsForSpec = coinsForSpec.Add(validatorCoins...) + } + + res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "iprpc_" + fund.Spec, Amount: sdk.NewDecCoinsFromCoins(coinsForSpec...).MulDec(delegatorPart)}) + } + } + + res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "subscriptions", Amount: sdk.NewDecCoinsFromCoins(valRewardsFromSubscriptions...).MulDec(delegatorPart)}) + res.Info = append(res.Info, &types.EstimatedRewardInfo{Source: "blocks", Amount: blockRewards.MulDec(delegatorPart)}) + + res.Total = sdk.NewDecCoins() + for _, k := range res.Info { + res.Total = res.Total.Add(k.Amount...) + } + + return &res, nil +} diff --git a/x/subscription/keeper/grpc_query_list.go b/x/subscription/keeper/grpc_query_list.go index 63cffe4519..19e964c074 100644 --- a/x/subscription/keeper/grpc_query_list.go +++ b/x/subscription/keeper/grpc_query_list.go @@ -5,8 +5,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_list_projects.go b/x/subscription/keeper/grpc_query_list_projects.go index 97965980bb..9f47c1a0ba 100644 --- a/x/subscription/keeper/grpc_query_list_projects.go +++ b/x/subscription/keeper/grpc_query_list_projects.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_next_to_month_expiry.go b/x/subscription/keeper/grpc_query_next_to_month_expiry.go index 985474e385..123a185b0b 100644 --- a/x/subscription/keeper/grpc_query_next_to_month_expiry.go +++ b/x/subscription/keeper/grpc_query_next_to_month_expiry.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/subscription/types" - timertypes "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/subscription/types" + timertypes "github.com/lavanet/lava/v2/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_params.go b/x/subscription/keeper/grpc_query_params.go index 593cd6ab6a..6d2b889d88 100644 --- a/x/subscription/keeper/grpc_query_params.go +++ b/x/subscription/keeper/grpc_query_params.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/subscription/keeper/grpc_query_params_test.go b/x/subscription/keeper/grpc_query_params_test.go index 58736a61e9..7ae96d8001 100644 --- a/x/subscription/keeper/grpc_query_params_test.go +++ b/x/subscription/keeper/grpc_query_params_test.go @@ -4,8 +4,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/subscription/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/grpc_query_tracked_usage.go b/x/subscription/keeper/grpc_query_tracked_usage.go new file mode 100644 index 0000000000..5312864f53 --- /dev/null +++ b/x/subscription/keeper/grpc_query_tracked_usage.go @@ -0,0 +1,26 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/v2/x/subscription/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) TrackedUsage(goCtx context.Context, req *types.QuerySubscriptionTrackedUsageRequest) (*types.QuerySubscriptionTrackedUsageResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + res := types.QuerySubscriptionTrackedUsageResponse{} + + sub, _ := k.GetSubscription(ctx, req.Subscription) + + res.Subscription = &sub + res.Usage, res.TotalUsage = k.GetSubTrackedCuInfo(ctx, req.Subscription, sub.Block) + + return &res, nil +} diff --git a/x/subscription/keeper/keeper.go b/x/subscription/keeper/keeper.go index 651188f3bb..fc4f538693 100644 --- a/x/subscription/keeper/keeper.go +++ b/x/subscription/keeper/keeper.go @@ -10,9 +10,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - "github.com/lavanet/lava/x/subscription/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + "github.com/lavanet/lava/v2/x/subscription/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) type ( @@ -30,6 +30,7 @@ type ( dualstakingKeeper types.DualStakingKeeper rewardsKeeper types.RewardsKeeper stakingKeeper types.StakingKeeper + specKeeper types.SpecKeeper subsFS fixationtypes.FixationStore subsTS timerstoretypes.TimerStore @@ -52,6 +53,7 @@ func NewKeeper( plansKeeper types.PlansKeeper, dualstakingKeeper types.DualStakingKeeper, rewardsKeeper types.RewardsKeeper, + specKeeper types.SpecKeeper, fixationStoreKeeper types.FixationStoreKeeper, timerStoreKeeper types.TimerStoreKeeper, stakingKeeper types.StakingKeeper, @@ -78,6 +80,7 @@ func NewKeeper( dualstakingKeeper: dualstakingKeeper, rewardsKeeper: rewardsKeeper, stakingKeeper: stakingKeeper, + specKeeper: specKeeper, subsFS: fs, cuTrackerFS: cuTracker, diff --git a/x/subscription/keeper/migrations.go b/x/subscription/keeper/migrations.go index 94b8e5f1de..ebe1532cfb 100644 --- a/x/subscription/keeper/migrations.go +++ b/x/subscription/keeper/migrations.go @@ -6,12 +6,12 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - v2 "github.com/lavanet/lava/x/subscription/migrations/v2" - v5 "github.com/lavanet/lava/x/subscription/migrations/v5" - v6 "github.com/lavanet/lava/x/subscription/migrations/v6" - v8 "github.com/lavanet/lava/x/subscription/migrations/v8" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + v2 "github.com/lavanet/lava/v2/x/subscription/migrations/v2" + v5 "github.com/lavanet/lava/v2/x/subscription/migrations/v5" + v6 "github.com/lavanet/lava/v2/x/subscription/migrations/v6" + v8 "github.com/lavanet/lava/v2/x/subscription/migrations/v8" + "github.com/lavanet/lava/v2/x/subscription/types" ) type Migrator struct { diff --git a/x/subscription/keeper/msg_server.go b/x/subscription/keeper/msg_server.go index b1e4b66095..6244f433f9 100644 --- a/x/subscription/keeper/msg_server.go +++ b/x/subscription/keeper/msg_server.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) type msgServer struct { diff --git a/x/subscription/keeper/msg_server_add_project.go b/x/subscription/keeper/msg_server_add_project.go index 7353ba9b87..0e89ec3a31 100644 --- a/x/subscription/keeper/msg_server_add_project.go +++ b/x/subscription/keeper/msg_server_add_project.go @@ -5,9 +5,9 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - projectstypes "github.com/lavanet/lava/x/projects/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) func (k msgServer) AddProject(goCtx context.Context, msg *types.MsgAddProject) (*types.MsgAddProjectResponse, error) { diff --git a/x/subscription/keeper/msg_server_auto_renewal.go b/x/subscription/keeper/msg_server_auto_renewal.go index ee1d82f556..e6a6d8a281 100644 --- a/x/subscription/keeper/msg_server_auto_renewal.go +++ b/x/subscription/keeper/msg_server_auto_renewal.go @@ -6,9 +6,9 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + "github.com/lavanet/lava/v2/x/subscription/types" ) func (k msgServer) AutoRenewal(goCtx context.Context, msg *types.MsgAutoRenewal) (*types.MsgAutoRenewalResponse, error) { diff --git a/x/subscription/keeper/msg_server_buy.go b/x/subscription/keeper/msg_server_buy.go index 2bc729ae6f..030d34a46d 100644 --- a/x/subscription/keeper/msg_server_buy.go +++ b/x/subscription/keeper/msg_server_buy.go @@ -6,8 +6,8 @@ import ( "strconv" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" ) func (k msgServer) Buy(goCtx context.Context, msg *types.MsgBuy) (*types.MsgBuyResponse, error) { diff --git a/x/subscription/keeper/msg_server_del_project.go b/x/subscription/keeper/msg_server_del_project.go index d1bfaaa7af..f6173de95a 100644 --- a/x/subscription/keeper/msg_server_del_project.go +++ b/x/subscription/keeper/msg_server_del_project.go @@ -4,8 +4,8 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/x/subscription/types" ) func (k msgServer) DelProject(goCtx context.Context, msg *types.MsgDelProject) (*types.MsgDelProjectResponse, error) { diff --git a/x/subscription/keeper/msg_server_test.go b/x/subscription/keeper/msg_server_test.go index 45c08d3df9..6a0c71d913 100644 --- a/x/subscription/keeper/msg_server_test.go +++ b/x/subscription/keeper/msg_server_test.go @@ -5,9 +5,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/subscription/keeper/params.go b/x/subscription/keeper/params.go index 6e81b5224e..bc6bb0b36a 100644 --- a/x/subscription/keeper/params.go +++ b/x/subscription/keeper/params.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) // GetParams get all parameters as types.Params diff --git a/x/subscription/keeper/params_test.go b/x/subscription/keeper/params_test.go index b5b03402fd..c562fdcd56 100644 --- a/x/subscription/keeper/params_test.go +++ b/x/subscription/keeper/params_test.go @@ -3,8 +3,8 @@ package keeper_test import ( "testing" - testkeeper "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/x/subscription/types" + testkeeper "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/keeper/subscription.go b/x/subscription/keeper/subscription.go index 54a052110f..e2de43731c 100644 --- a/x/subscription/keeper/subscription.go +++ b/x/subscription/keeper/subscription.go @@ -8,11 +8,11 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/utils" - "github.com/lavanet/lava/utils/lavaslices" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/utils" + "github.com/lavanet/lava/v2/utils/lavaslices" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + "github.com/lavanet/lava/v2/x/subscription/types" ) // GetSubscription returns the subscription of a given consumer diff --git a/x/subscription/keeper/subscription_test.go b/x/subscription/keeper/subscription_test.go index 6b32f917df..b7bb2ffb14 100644 --- a/x/subscription/keeper/subscription_test.go +++ b/x/subscription/keeper/subscription_test.go @@ -8,15 +8,15 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/testutil/common" - keepertest "github.com/lavanet/lava/testutil/keeper" - "github.com/lavanet/lava/utils" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/utils/sigs" - pairingtypes "github.com/lavanet/lava/x/pairing/types" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/testutil/common" + keepertest "github.com/lavanet/lava/v2/testutil/keeper" + "github.com/lavanet/lava/v2/utils" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/utils/sigs" + pairingtypes "github.com/lavanet/lava/v2/x/pairing/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/module.go b/x/subscription/module.go index ee2bd83ac5..1d02c88e80 100644 --- a/x/subscription/module.go +++ b/x/subscription/module.go @@ -18,9 +18,9 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/lavanet/lava/x/subscription/client/cli" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/client/cli" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) var ( diff --git a/x/subscription/module_simulation.go b/x/subscription/module_simulation.go index 60127d4dc7..2c28a6afe3 100644 --- a/x/subscription/module_simulation.go +++ b/x/subscription/module_simulation.go @@ -10,9 +10,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/testutil/sample" - subscriptionsimulation "github.com/lavanet/lava/x/subscription/simulation" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/testutil/sample" + subscriptionsimulation "github.com/lavanet/lava/v2/x/subscription/simulation" + "github.com/lavanet/lava/v2/x/subscription/types" ) // avoid unused import issue diff --git a/x/subscription/simulation/add_project.go b/x/subscription/simulation/add_project.go index 3c12bd6483..680e714f31 100644 --- a/x/subscription/simulation/add_project.go +++ b/x/subscription/simulation/add_project.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) func SimulateMsgAddProject( diff --git a/x/subscription/simulation/auto_renewal.go b/x/subscription/simulation/auto_renewal.go index fb0bc91670..ddacdfad39 100644 --- a/x/subscription/simulation/auto_renewal.go +++ b/x/subscription/simulation/auto_renewal.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) func SimulateMsgAutoRenewal( diff --git a/x/subscription/simulation/buy.go b/x/subscription/simulation/buy.go index 1bde92ea20..d9ea211016 100644 --- a/x/subscription/simulation/buy.go +++ b/x/subscription/simulation/buy.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) func SimulateMsgBuy( diff --git a/x/subscription/simulation/del_project.go b/x/subscription/simulation/del_project.go index 36d65c5134..bf98f95019 100644 --- a/x/subscription/simulation/del_project.go +++ b/x/subscription/simulation/del_project.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/x/subscription/keeper" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/keeper" + "github.com/lavanet/lava/v2/x/subscription/types" ) func SimulateMsgDelProject( diff --git a/x/subscription/types/adjustment.pb.go b/x/subscription/types/adjustment.pb.go index 9c006ccb0c..93f1169df5 100644 --- a/x/subscription/types/adjustment.pb.go +++ b/x/subscription/types/adjustment.pb.go @@ -91,7 +91,7 @@ func init() { } var fileDescriptor_6061843cba96837b = []byte{ - // 195 bytes of a gzipped FileDescriptorProto + // 198 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xca, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc5, 0xa5, 0x49, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0x99, 0xf9, 0x79, 0xfa, 0x89, 0x29, 0x59, 0xa5, 0xc5, 0x25, 0xb9, 0xa9, 0x79, 0x25, 0x7a, 0x05, @@ -99,12 +99,12 @@ var fileDescriptor_6061843cba96837b = []byte{ 0x17, 0x97, 0x23, 0x5c, 0xb9, 0x90, 0x08, 0x17, 0x6b, 0x66, 0x5e, 0x4a, 0x6a, 0x85, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x84, 0x23, 0xa4, 0xc2, 0xc5, 0x0b, 0x31, 0x32, 0x35, 0x25, 0xb4, 0x38, 0x31, 0x3d, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x25, 0x08, 0x55, 0x50, 0x48, 0x8e, 0x8b, - 0xab, 0x24, 0xbf, 0x24, 0x31, 0x07, 0xa2, 0x84, 0x19, 0xac, 0x04, 0x49, 0xc4, 0xc9, 0xed, 0xc4, + 0xab, 0x24, 0xbf, 0x24, 0x31, 0x07, 0xa2, 0x84, 0x19, 0xac, 0x04, 0x49, 0xc4, 0xc9, 0xf3, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, - 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x74, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, - 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x7c, 0x55, 0x81, 0xea, 0xaf, 0x92, 0xca, 0x82, 0xd4, 0xe2, - 0x24, 0x36, 0xb0, 0x9f, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x87, 0x8e, 0x73, 0xb8, 0x01, - 0x01, 0x00, 0x00, + 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xf4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, + 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x51, 0x7c, 0x55, 0x66, 0xa4, 0x5f, 0x81, 0xea, 0xb5, 0x92, 0xca, + 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xb7, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xb7, + 0x3a, 0xdd, 0x04, 0x01, 0x00, 0x00, } func (m *Adjustment) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/codec.go b/x/subscription/types/codec.go index 909fa4c90c..c71a166695 100644 --- a/x/subscription/types/codec.go +++ b/x/subscription/types/codec.go @@ -5,6 +5,7 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" // this line is used by starport scaffolding # 1 + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -37,5 +38,12 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) + ModuleCdc = codec.NewAminoCodec(Amino) + // ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) + +func init() { + RegisterCodec(Amino) + cryptocodec.RegisterCrypto(Amino) + Amino.Seal() +} diff --git a/x/subscription/types/cu_tracker.pb.go b/x/subscription/types/cu_tracker.pb.go index d36ed37bbe..2d35a42a5d 100644 --- a/x/subscription/types/cu_tracker.pb.go +++ b/x/subscription/types/cu_tracker.pb.go @@ -120,9 +120,78 @@ func (m *CuTrackerTimerData) GetCredit() types.Coin { return types.Coin{} } +type TrackedCuInfo struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + ChainID string `protobuf:"bytes,2,opt,name=chainID,proto3" json:"chainID,omitempty"` + TrackedCu uint64 `protobuf:"varint,3,opt,name=trackedCu,proto3" json:"trackedCu,omitempty"` + Block uint64 `protobuf:"varint,4,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *TrackedCuInfo) Reset() { *m = TrackedCuInfo{} } +func (m *TrackedCuInfo) String() string { return proto.CompactTextString(m) } +func (*TrackedCuInfo) ProtoMessage() {} +func (*TrackedCuInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_5974e118ddf7c543, []int{2} +} +func (m *TrackedCuInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TrackedCuInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TrackedCuInfo.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 *TrackedCuInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TrackedCuInfo.Merge(m, src) +} +func (m *TrackedCuInfo) XXX_Size() int { + return m.Size() +} +func (m *TrackedCuInfo) XXX_DiscardUnknown() { + xxx_messageInfo_TrackedCuInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_TrackedCuInfo proto.InternalMessageInfo + +func (m *TrackedCuInfo) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *TrackedCuInfo) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" +} + +func (m *TrackedCuInfo) GetTrackedCu() uint64 { + if m != nil { + return m.TrackedCu + } + return 0 +} + +func (m *TrackedCuInfo) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + func init() { proto.RegisterType((*TrackedCu)(nil), "lavanet.lava.subscription.TrackedCu") proto.RegisterType((*CuTrackerTimerData)(nil), "lavanet.lava.subscription.CuTrackerTimerData") + proto.RegisterType((*TrackedCuInfo)(nil), "lavanet.lava.subscription.TrackedCuInfo") } func init() { @@ -130,24 +199,28 @@ func init() { } var fileDescriptor_5974e118ddf7c543 = []byte{ - // 268 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xcd, 0x4a, 0x03, 0x31, - 0x14, 0x85, 0x27, 0x43, 0x2d, 0x18, 0xc1, 0xc5, 0xd0, 0x45, 0x5b, 0x21, 0x96, 0xae, 0x8a, 0x48, - 0x42, 0x75, 0xe1, 0xbe, 0x23, 0x3e, 0x40, 0xe9, 0xca, 0x8d, 0x24, 0xb7, 0x61, 0x0c, 0xed, 0xcc, - 0x1d, 0xf2, 0x53, 0xf4, 0x2d, 0x7c, 0xac, 0x2e, 0xbb, 0x74, 0x25, 0x32, 0xf3, 0x22, 0x32, 0x3f, - 0x0b, 0xbb, 0x3a, 0x27, 0xc9, 0x17, 0xee, 0xb9, 0x87, 0xde, 0xed, 0xe5, 0x41, 0x16, 0xda, 0x8b, - 0x46, 0x85, 0x0b, 0xca, 0x81, 0x35, 0xa5, 0x37, 0x58, 0x08, 0x08, 0x6f, 0xde, 0x4a, 0xd8, 0x69, - 0xcb, 0x4b, 0x8b, 0x1e, 0x93, 0x49, 0xcf, 0xf2, 0x46, 0xf9, 0x7f, 0x76, 0xca, 0x00, 0x5d, 0x8e, - 0x4e, 0x28, 0xe9, 0xb4, 0x38, 0x2c, 0x95, 0xf6, 0x72, 0x29, 0x00, 0x4d, 0xd1, 0x7d, 0x9d, 0x8e, - 0x32, 0xcc, 0xb0, 0xb5, 0xa2, 0x71, 0xdd, 0xed, 0xfc, 0x86, 0x5e, 0x6e, 0xda, 0x09, 0xdb, 0x34, - 0x24, 0xd7, 0x34, 0x86, 0x30, 0x26, 0x33, 0xb2, 0x18, 0xac, 0x63, 0x08, 0x73, 0xa0, 0x49, 0x1a, - 0xba, 0x67, 0xbb, 0x31, 0xb9, 0xb6, 0xcf, 0xd2, 0xcb, 0x64, 0x44, 0x2f, 0xd4, 0x1e, 0x61, 0xd7, - 0x83, 0xdd, 0x21, 0x79, 0xa2, 0x43, 0xb0, 0x7a, 0x6b, 0xfc, 0x38, 0x9e, 0x91, 0xc5, 0xd5, 0xc3, - 0x84, 0x77, 0x79, 0x78, 0x93, 0x87, 0xf7, 0x79, 0x78, 0x8a, 0xa6, 0x58, 0x0d, 0x8e, 0x3f, 0xb7, - 0xd1, 0xba, 0xc7, 0x57, 0x2f, 0xc7, 0x8a, 0x91, 0x53, 0xc5, 0xc8, 0x6f, 0xc5, 0xc8, 0x57, 0xcd, - 0xa2, 0x53, 0xcd, 0xa2, 0xef, 0x9a, 0x45, 0xaf, 0xf7, 0x99, 0xf1, 0xef, 0x41, 0x71, 0xc0, 0x5c, - 0x9c, 0x75, 0xf4, 0x71, 0xde, 0x92, 0xff, 0x2c, 0xb5, 0x53, 0xc3, 0x76, 0xa1, 0xc7, 0xbf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x69, 0xac, 0xb1, 0xfe, 0x4f, 0x01, 0x00, 0x00, + // 323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xbd, 0x6e, 0xc2, 0x30, + 0x14, 0x85, 0x13, 0x4a, 0x69, 0xe3, 0xaa, 0x1d, 0x2c, 0x86, 0x40, 0x2b, 0x17, 0x31, 0xa1, 0x0e, + 0xb6, 0xa0, 0x43, 0x77, 0x60, 0x61, 0x8d, 0x98, 0xba, 0x54, 0x8e, 0x71, 0xc1, 0x02, 0x72, 0x23, + 0xc7, 0x8e, 0xca, 0x5b, 0xf4, 0xb1, 0x18, 0x19, 0x3b, 0x55, 0x15, 0x79, 0x91, 0x2a, 0x3f, 0xfc, + 0x4d, 0xf7, 0x9e, 0xeb, 0x63, 0x9f, 0x4f, 0xbe, 0xe8, 0x65, 0xc5, 0x53, 0x1e, 0x49, 0xc3, 0xf2, + 0xca, 0x12, 0x1b, 0x26, 0x42, 0xab, 0xd8, 0x28, 0x88, 0x98, 0xb0, 0x1f, 0x46, 0x73, 0xb1, 0x94, + 0x9a, 0xc6, 0x1a, 0x0c, 0xe0, 0x56, 0xe5, 0xa5, 0x79, 0xa5, 0xe7, 0xde, 0x36, 0x11, 0x90, 0xac, + 0x21, 0x61, 0x21, 0x4f, 0x24, 0x4b, 0xfb, 0xa1, 0x34, 0xbc, 0xcf, 0x04, 0xa8, 0xa8, 0xbc, 0xda, + 0x6e, 0xce, 0x61, 0x0e, 0x45, 0xcb, 0xf2, 0xae, 0x9c, 0x76, 0x1f, 0x91, 0x37, 0x2d, 0x12, 0x66, + 0x23, 0x8b, 0x1f, 0x50, 0x4d, 0x58, 0xdf, 0xed, 0xb8, 0xbd, 0x7a, 0x50, 0x13, 0xb6, 0x2b, 0x10, + 0x1e, 0xd9, 0xf2, 0x58, 0x4f, 0xd5, 0x5a, 0xea, 0x31, 0x37, 0x1c, 0x37, 0xd1, 0x75, 0xb8, 0x02, + 0xb1, 0xac, 0x8c, 0xa5, 0xc0, 0x6f, 0xa8, 0x21, 0xb4, 0x9c, 0x29, 0xe3, 0xd7, 0x3a, 0x6e, 0xef, + 0x6e, 0xd0, 0xa2, 0x25, 0x0f, 0xcd, 0x79, 0x68, 0xc5, 0x43, 0x47, 0xa0, 0xa2, 0x61, 0x7d, 0xfb, + 0xfb, 0xec, 0x04, 0x95, 0xbd, 0xbb, 0x41, 0xf7, 0x47, 0x82, 0x49, 0xf4, 0x09, 0xb8, 0x8d, 0x6e, + 0x63, 0x0d, 0xa9, 0x9a, 0x49, 0x5d, 0x44, 0x78, 0xc1, 0x51, 0x63, 0x1f, 0xdd, 0x88, 0x05, 0x57, + 0xd1, 0x64, 0x5c, 0xc4, 0x78, 0xc1, 0x41, 0xe2, 0x27, 0xe4, 0x99, 0xc3, 0x33, 0xfe, 0x55, 0x41, + 0x76, 0x1a, 0x9c, 0x98, 0xeb, 0x67, 0xcc, 0xc3, 0xc9, 0x76, 0x4f, 0xdc, 0xdd, 0x9e, 0xb8, 0x7f, + 0x7b, 0xe2, 0x7e, 0x67, 0xc4, 0xd9, 0x65, 0xc4, 0xf9, 0xc9, 0x88, 0xf3, 0xce, 0xe6, 0xca, 0x2c, + 0x6c, 0x48, 0x05, 0xac, 0xd9, 0xc5, 0x7a, 0xd2, 0x01, 0xfb, 0xba, 0xdc, 0x91, 0xd9, 0xc4, 0x32, + 0x09, 0x1b, 0xc5, 0x77, 0xbe, 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x83, 0x5d, 0x8e, 0xb1, 0xcd, + 0x01, 0x00, 0x00, } func (m *TrackedCu) Marshal() (dAtA []byte, err error) { @@ -216,6 +289,53 @@ func (m *CuTrackerTimerData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TrackedCuInfo) 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 *TrackedCuInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TrackedCuInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Block != 0 { + i = encodeVarintCuTracker(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x20 + } + if m.TrackedCu != 0 { + i = encodeVarintCuTracker(dAtA, i, uint64(m.TrackedCu)) + i-- + dAtA[i] = 0x18 + } + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintCuTracker(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintCuTracker(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintCuTracker(dAtA []byte, offset int, v uint64) int { offset -= sovCuTracker(v) base := offset @@ -253,6 +373,29 @@ func (m *CuTrackerTimerData) Size() (n int) { return n } +func (m *TrackedCuInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovCuTracker(uint64(l)) + } + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovCuTracker(uint64(l)) + } + if m.TrackedCu != 0 { + n += 1 + sovCuTracker(uint64(m.TrackedCu)) + } + if m.Block != 0 { + n += 1 + sovCuTracker(uint64(m.Block)) + } + return n +} + func sovCuTracker(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -430,6 +573,158 @@ func (m *CuTrackerTimerData) Unmarshal(dAtA []byte) error { } return nil } +func (m *TrackedCuInfo) 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 ErrIntOverflowCuTracker + } + 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: TrackedCuInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TrackedCuInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCuTracker + } + 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 ErrInvalidLengthCuTracker + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCuTracker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Provider = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCuTracker + } + 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 ErrInvalidLengthCuTracker + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCuTracker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TrackedCu", wireType) + } + m.TrackedCu = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCuTracker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TrackedCu |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCuTracker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCuTracker(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCuTracker + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipCuTracker(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/subscription/types/expected_keepers.go b/x/subscription/types/expected_keepers.go index 1cfd59e5d2..ec6e3cb6d4 100644 --- a/x/subscription/types/expected_keepers.go +++ b/x/subscription/types/expected_keepers.go @@ -5,11 +5,14 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types" - fixationtypes "github.com/lavanet/lava/x/fixationstore/types" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + dualstakingtypes "github.com/lavanet/lava/v2/x/dualstaking/types" + epochstoragetypes "github.com/lavanet/lava/v2/x/epochstorage/types" + fixationtypes "github.com/lavanet/lava/v2/x/fixationstore/types" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" + rewardstypes "github.com/lavanet/lava/v2/x/rewards/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -32,7 +35,8 @@ type EpochstorageKeeper interface { IsEpochStart(ctx sdk.Context) bool GetNextEpoch(ctx sdk.Context, block uint64) (nextEpoch uint64, erro error) GetCurrentNextEpoch(ctx sdk.Context) (nextEpoch uint64) - GetStakeEntryByAddressCurrent(ctx sdk.Context, chainID string, address string) (epochstoragetypes.StakeEntry, bool) + GetStakeEntryCurrent(ctx sdk.Context, chainID string, address string) (epochstoragetypes.StakeEntry, bool) + GetAllStakeEntriesCurrentForChainId(ctx sdk.Context, chainID string) []epochstoragetypes.StakeEntry // Methods imported from epochstorage should be defined here } @@ -64,7 +68,8 @@ type TimerStoreKeeper interface { } type DualStakingKeeper interface { - RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributer bool) (providerReward sdk.Coins, totalRewards sdk.Coins, err error) + RewardProvidersAndDelegators(ctx sdk.Context, providerAddr string, chainID string, totalReward sdk.Coins, senderModule string, calcOnlyProvider bool, calcOnlyDelegators bool, calcOnlyContributor bool) (providerReward sdk.Coins, totalRewards sdk.Coins, err error) + GetDelegation(ctx sdk.Context, delegator, provider, chainID string, epoch uint64) (dualstakingtypes.Delegation, bool) } type RewardsKeeper interface { @@ -75,8 +80,22 @@ type RewardsKeeper interface { IsIprpcSubscription(ctx sdk.Context, address string) bool AggregateCU(ctx sdk.Context, subscription, provider string, chainID string, cu uint64) CalculateValidatorsAndCommunityParticipationRewards(ctx sdk.Context, reward sdk.Coin) (validatorsCoins sdk.Coins, communityCoins sdk.Coins, err error) + TotalPoolTokens(ctx sdk.Context, pool rewardstypes.Pool) sdk.Coins + SpecEmissionParts(ctx sdk.Context) (emissions []rewardstypes.SpecEmissionPart) + SpecTotalPayout(ctx sdk.Context, totalMonthlyPayout math.Int, totalProvidersBaseRewards sdk.Dec, spec rewardstypes.SpecEmissionPart) math.LegacyDec + GetIprpcRewardsCurrentId(ctx sdk.Context) uint64 + GetIprpcReward(ctx sdk.Context, id uint64) (val rewardstypes.IprpcReward, found bool) + AllocationPoolMonthsLeft(ctx sdk.Context) int64 + GetCommunityTax(ctx sdk.Context) math.LegacyDec } type StakingKeeper interface { BondDenom(ctx sdk.Context) string + GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) + GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) + GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator +} + +type SpecKeeper interface { + GetContributorReward(ctx sdk.Context, chainId string) (contributors []sdk.AccAddress, percentage math.LegacyDec) } diff --git a/x/subscription/types/genesis.go b/x/subscription/types/genesis.go index fffaadb379..5ebeef2a4f 100644 --- a/x/subscription/types/genesis.go +++ b/x/subscription/types/genesis.go @@ -1,8 +1,8 @@ package types import ( - fixationstoretypes "github.com/lavanet/lava/x/fixationstore/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + fixationstoretypes "github.com/lavanet/lava/v2/x/fixationstore/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) // this line is used by starport scaffolding # genesis/types/import diff --git a/x/subscription/types/genesis.pb.go b/x/subscription/types/genesis.pb.go index 4defbe3e97..9eabf776df 100644 --- a/x/subscription/types/genesis.pb.go +++ b/x/subscription/types/genesis.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/x/fixationstore/types" - types1 "github.com/lavanet/lava/x/timerstore/types" + types "github.com/lavanet/lava/v2/x/fixationstore/types" + types1 "github.com/lavanet/lava/v2/x/timerstore/types" io "io" math "math" math_bits "math/bits" @@ -119,29 +119,29 @@ func init() { } var fileDescriptor_dc6c60f9c112fe52 = []byte{ - // 344 bytes of a gzipped FileDescriptorProto + // 347 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4e, 0xf3, 0x30, - 0x18, 0x86, 0x93, 0xbf, 0xfd, 0x33, 0xa4, 0x4c, 0x11, 0x43, 0xe8, 0x10, 0x0a, 0x08, 0x28, 0x08, - 0x39, 0x12, 0x1c, 0x00, 0x51, 0xa4, 0x30, 0x21, 0x55, 0x24, 0x13, 0x9b, 0x1b, 0x4c, 0x30, 0x90, - 0x38, 0xb2, 0x1d, 0x54, 0x6e, 0xc1, 0xb1, 0x3a, 0x30, 0x74, 0x64, 0x42, 0xa8, 0xb9, 0x08, 0xb2, - 0x9d, 0xb6, 0xb6, 0x50, 0x06, 0x98, 0xec, 0x48, 0xcf, 0xfb, 0xe4, 0xfd, 0x92, 0xcf, 0x3d, 0x7c, - 0x86, 0x2f, 0xb0, 0x40, 0x3c, 0x14, 0x67, 0xc8, 0xaa, 0x09, 0x4b, 0x29, 0x2e, 0x39, 0x26, 0x45, - 0x98, 0xa1, 0x02, 0x31, 0xcc, 0x40, 0x49, 0x09, 0x27, 0xde, 0x56, 0x03, 0x02, 0x71, 0x02, 0x1d, - 0xec, 0x6f, 0x66, 0x24, 0x23, 0x92, 0x0a, 0xc5, 0x4d, 0x05, 0xfa, 0x07, 0xed, 0xe6, 0x12, 0x52, - 0x98, 0x37, 0xe2, 0xfe, 0x71, 0x3b, 0x07, 0xef, 0x1e, 0x2b, 0xc6, 0x73, 0x54, 0xf0, 0x86, 0x3d, - 0x32, 0xd8, 0x7b, 0x3c, 0x85, 0x82, 0x63, 0x9c, 0x50, 0xb4, 0x7a, 0x6a, 0xd0, 0x3d, 0x03, 0xe5, - 0x38, 0x47, 0x54, 0x71, 0xf2, 0xaa, 0xa0, 0xdd, 0xf7, 0x8e, 0xbb, 0x71, 0xa5, 0xc6, 0x8c, 0x39, - 0xe4, 0xc8, 0x3b, 0x77, 0x1d, 0x55, 0xce, 0xb7, 0x07, 0xf6, 0xb0, 0x77, 0xba, 0x03, 0x5a, 0xc7, - 0x06, 0x63, 0x09, 0x8e, 0xba, 0xb3, 0xcf, 0x6d, 0xeb, 0xa6, 0x89, 0x79, 0x91, 0xeb, 0x08, 0x28, - 0x8a, 0xfd, 0x7f, 0x52, 0x30, 0x34, 0x05, 0x46, 0x65, 0xa0, 0xbf, 0x7a, 0xe9, 0x51, 0x69, 0xef, - 0x52, 0x79, 0x92, 0xd8, 0xef, 0x48, 0xcf, 0xbe, 0xe9, 0x59, 0xcf, 0xd3, 0x2a, 0x49, 0x62, 0x6f, - 0xec, 0xf6, 0xd2, 0x2a, 0xa1, 0x30, 0x7d, 0x42, 0x34, 0x8a, 0xfd, 0xee, 0x9f, 0x1a, 0xe9, 0x0a, - 0xef, 0x5a, 0x33, 0x26, 0xb1, 0xff, 0xff, 0xf7, 0xdd, 0xf4, 0xbc, 0xd0, 0xad, 0xff, 0x31, 0xf3, - 0x9d, 0x41, 0xe7, 0xa7, 0xce, 0xf8, 0xe6, 0x17, 0x2b, 0x7a, 0xa9, 0xd3, 0xf2, 0xa3, 0x68, 0xb6, - 0x08, 0xec, 0xf9, 0x22, 0xb0, 0xbf, 0x16, 0x81, 0xfd, 0x56, 0x07, 0xd6, 0xbc, 0x0e, 0xac, 0x8f, - 0x3a, 0xb0, 0x6e, 0x4f, 0x32, 0xcc, 0x1f, 0xaa, 0x09, 0x48, 0x49, 0x1e, 0x1a, 0x8b, 0x31, 0x35, - 0x37, 0x8e, 0xbf, 0x96, 0x88, 0x4d, 0x1c, 0xb9, 0x1d, 0x67, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xeb, 0x1a, 0x89, 0x93, 0x1d, 0x03, 0x00, 0x00, + 0x18, 0x86, 0x93, 0xbf, 0xfd, 0x33, 0xa4, 0x4c, 0x11, 0x43, 0xe8, 0x10, 0x0a, 0x08, 0x28, 0x0c, + 0xb6, 0x54, 0x0e, 0x80, 0x28, 0x52, 0x11, 0x03, 0x52, 0x45, 0x32, 0xb1, 0xb9, 0xc1, 0x84, 0x00, + 0x89, 0x23, 0xdb, 0xa9, 0xca, 0x2d, 0x38, 0x56, 0x07, 0x86, 0x8e, 0x4c, 0x08, 0x35, 0x17, 0x41, + 0xb6, 0xd3, 0xd6, 0x16, 0xca, 0x00, 0x93, 0x1d, 0xe9, 0x79, 0x9f, 0xbc, 0x5f, 0xf2, 0xb9, 0xc7, + 0x2f, 0x68, 0x8a, 0x72, 0xcc, 0xa1, 0x38, 0x21, 0x2b, 0x27, 0x2c, 0xa6, 0x69, 0xc1, 0x53, 0x92, + 0xc3, 0x04, 0xe7, 0x98, 0xa5, 0x0c, 0x14, 0x94, 0x70, 0xe2, 0xed, 0xd4, 0x20, 0x10, 0x27, 0xd0, + 0xc1, 0xee, 0x76, 0x42, 0x12, 0x22, 0x29, 0x28, 0x6e, 0x2a, 0xd0, 0x3d, 0x6a, 0x36, 0x17, 0x88, + 0xa2, 0xac, 0x16, 0x77, 0x4f, 0x9b, 0x39, 0x74, 0xff, 0x54, 0x32, 0x9e, 0xe1, 0x9c, 0xd7, 0xec, + 0x89, 0xc1, 0x3e, 0xa4, 0x33, 0x24, 0x38, 0xc6, 0x09, 0xc5, 0xeb, 0xa7, 0x1a, 0x3d, 0x30, 0x50, + 0x9e, 0x66, 0x98, 0x2a, 0x4e, 0x5e, 0x15, 0xb4, 0xff, 0xde, 0x72, 0xb7, 0xae, 0xd4, 0x98, 0x21, + 0x47, 0x1c, 0x7b, 0xe7, 0xae, 0xa3, 0xca, 0xf9, 0x76, 0xcf, 0xee, 0x77, 0x06, 0x7b, 0xa0, 0x71, + 0x6c, 0x30, 0x96, 0xe0, 0xb0, 0x3d, 0xff, 0xdc, 0xb5, 0x6e, 0xeb, 0x98, 0x37, 0x72, 0x1d, 0x01, + 0x8d, 0x42, 0xff, 0x9f, 0x14, 0xf4, 0x4d, 0x81, 0x51, 0x19, 0xe8, 0xaf, 0x5e, 0x79, 0x54, 0xda, + 0xbb, 0x54, 0x9e, 0x28, 0xf4, 0x5b, 0xd2, 0x73, 0x68, 0x7a, 0x36, 0xf3, 0x34, 0x4a, 0xa2, 0xd0, + 0x1b, 0xbb, 0x9d, 0xb8, 0x8c, 0x28, 0x8a, 0x9f, 0x31, 0x1d, 0x85, 0x7e, 0xfb, 0x4f, 0x8d, 0x74, + 0x85, 0x77, 0xa3, 0x19, 0xa3, 0xd0, 0xff, 0xff, 0xfb, 0x6e, 0x7a, 0x5e, 0xe8, 0x36, 0xff, 0x98, + 0xf9, 0x4e, 0xaf, 0xf5, 0x53, 0x67, 0x7c, 0xf3, 0x8b, 0x35, 0xbd, 0xd2, 0x69, 0xf9, 0xe1, 0xf5, + 0x7c, 0x19, 0xd8, 0x8b, 0x65, 0x60, 0x7f, 0x2d, 0x03, 0xfb, 0xad, 0x0a, 0xac, 0x45, 0x15, 0x58, + 0x1f, 0x55, 0x60, 0xdd, 0xc1, 0x24, 0xe5, 0x8f, 0xe5, 0x04, 0xc4, 0x24, 0x83, 0xc6, 0x62, 0x4c, + 0x07, 0x70, 0x66, 0x2e, 0x1d, 0x7f, 0x2d, 0x30, 0x9b, 0x38, 0x72, 0x41, 0xce, 0xbe, 0x03, 0x00, + 0x00, 0xff, 0xff, 0x3c, 0xd1, 0xb2, 0xd4, 0x20, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/genesis_test.go b/x/subscription/types/genesis_test.go index 3fdc672fca..74cecd15ca 100644 --- a/x/subscription/types/genesis_test.go +++ b/x/subscription/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/lavanet/lava/x/subscription/types" + "github.com/lavanet/lava/v2/x/subscription/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_add_project.go b/x/subscription/types/message_add_project.go index 43f04cb706..0143695a33 100644 --- a/x/subscription/types/message_add_project.go +++ b/x/subscription/types/message_add_project.go @@ -4,7 +4,7 @@ import ( sdkerrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - projectstypes "github.com/lavanet/lava/x/projects/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" ) const TypeMsgAddProject = "add_project" diff --git a/x/subscription/types/message_add_project_test.go b/x/subscription/types/message_add_project_test.go index d6f0e3a488..aafdb83f1a 100644 --- a/x/subscription/types/message_add_project_test.go +++ b/x/subscription/types/message_add_project_test.go @@ -4,9 +4,9 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" - planstypes "github.com/lavanet/lava/x/plans/types" - projectstypes "github.com/lavanet/lava/x/projects/types" + "github.com/lavanet/lava/v2/testutil/sample" + planstypes "github.com/lavanet/lava/v2/x/plans/types" + projectstypes "github.com/lavanet/lava/v2/x/projects/types" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_auto_renewal_test.go b/x/subscription/types/message_auto_renewal_test.go index abc691c820..e54a1c8547 100644 --- a/x/subscription/types/message_auto_renewal_test.go +++ b/x/subscription/types/message_auto_renewal_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_buy_test.go b/x/subscription/types/message_buy_test.go index 0fbbb4d5ea..d78a7147a9 100644 --- a/x/subscription/types/message_buy_test.go +++ b/x/subscription/types/message_buy_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/message_del_project_test.go b/x/subscription/types/message_del_project_test.go index a40b63aef2..0e23635dae 100644 --- a/x/subscription/types/message_del_project_test.go +++ b/x/subscription/types/message_del_project_test.go @@ -4,7 +4,7 @@ import ( "testing" legacyerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/lavanet/lava/testutil/sample" + "github.com/lavanet/lava/v2/testutil/sample" "github.com/stretchr/testify/require" ) diff --git a/x/subscription/types/params.pb.go b/x/subscription/types/params.pb.go index f1eb97bdf0..9afa8f96cb 100644 --- a/x/subscription/types/params.pb.go +++ b/x/subscription/types/params.pb.go @@ -68,17 +68,17 @@ func init() { } var fileDescriptor_8b1e38ca40b9ef74 = []byte{ - // 154 bytes of a gzipped FileDescriptorProto + // 157 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcb, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc5, 0xa5, 0x49, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0x99, 0xf9, 0x79, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x92, 0x50, 0x75, 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0x9d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x58, 0x95, 0x3e, 0x88, 0x05, 0xd1, 0xa0, 0xc4, 0xc7, 0xc5, 0x16, 0x00, 0x36, 0xc0, 0x8a, 0x65, - 0xc6, 0x02, 0x79, 0x06, 0x27, 0xb7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, + 0xc6, 0x02, 0x79, 0x06, 0x27, 0xcf, 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, - 0xd2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x71, 0x4d, 0x05, - 0xaa, 0x7b, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xc6, 0x1b, 0x03, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x51, 0x13, 0xf7, 0x58, 0xb9, 0x00, 0x00, 0x00, + 0xd2, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x71, 0x4d, 0x99, + 0x91, 0x7e, 0x05, 0xaa, 0x93, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x36, 0x18, 0x03, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x43, 0x4d, 0x04, 0x7a, 0xbc, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/query.pb.go b/x/subscription/types/query.pb.go index e385044e25..2c09be133d 100644 --- a/x/subscription/types/query.pb.go +++ b/x/subscription/types/query.pb.go @@ -6,8 +6,10 @@ package types import ( context "context" 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/query" + _ "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" @@ -634,6 +636,380 @@ func (m *QueryNextToMonthExpiryResponse) GetSubscriptions() []TimerExpiryInfo { return nil } +type QuerySubscriptionTrackedUsageRequest struct { + Subscription string `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"` +} + +func (m *QuerySubscriptionTrackedUsageRequest) Reset() { *m = QuerySubscriptionTrackedUsageRequest{} } +func (m *QuerySubscriptionTrackedUsageRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySubscriptionTrackedUsageRequest) ProtoMessage() {} +func (*QuerySubscriptionTrackedUsageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{12} +} +func (m *QuerySubscriptionTrackedUsageRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySubscriptionTrackedUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySubscriptionTrackedUsageRequest.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 *QuerySubscriptionTrackedUsageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubscriptionTrackedUsageRequest.Merge(m, src) +} +func (m *QuerySubscriptionTrackedUsageRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySubscriptionTrackedUsageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubscriptionTrackedUsageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySubscriptionTrackedUsageRequest proto.InternalMessageInfo + +func (m *QuerySubscriptionTrackedUsageRequest) GetSubscription() string { + if m != nil { + return m.Subscription + } + return "" +} + +type QuerySubscriptionTrackedUsageResponse struct { + Subscription *Subscription `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"` + Usage []*TrackedCuInfo `protobuf:"bytes,2,rep,name=usage,proto3" json:"usage,omitempty"` + TotalUsage uint64 `protobuf:"varint,3,opt,name=total_usage,json=totalUsage,proto3" json:"total_usage,omitempty"` +} + +func (m *QuerySubscriptionTrackedUsageResponse) Reset() { *m = QuerySubscriptionTrackedUsageResponse{} } +func (m *QuerySubscriptionTrackedUsageResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySubscriptionTrackedUsageResponse) ProtoMessage() {} +func (*QuerySubscriptionTrackedUsageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{13} +} +func (m *QuerySubscriptionTrackedUsageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySubscriptionTrackedUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySubscriptionTrackedUsageResponse.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 *QuerySubscriptionTrackedUsageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubscriptionTrackedUsageResponse.Merge(m, src) +} +func (m *QuerySubscriptionTrackedUsageResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySubscriptionTrackedUsageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubscriptionTrackedUsageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySubscriptionTrackedUsageResponse proto.InternalMessageInfo + +func (m *QuerySubscriptionTrackedUsageResponse) GetSubscription() *Subscription { + if m != nil { + return m.Subscription + } + return nil +} + +func (m *QuerySubscriptionTrackedUsageResponse) GetUsage() []*TrackedCuInfo { + if m != nil { + return m.Usage + } + return nil +} + +func (m *QuerySubscriptionTrackedUsageResponse) GetTotalUsage() uint64 { + if m != nil { + return m.TotalUsage + } + return 0 +} + +type QueryEstimatedRewardsRequest struct { + Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + AmountDelegator string `protobuf:"bytes,3,opt,name=amount_delegator,json=amountDelegator,proto3" json:"amount_delegator,omitempty"` +} + +func (m *QueryEstimatedRewardsRequest) Reset() { *m = QueryEstimatedRewardsRequest{} } +func (m *QueryEstimatedRewardsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEstimatedRewardsRequest) ProtoMessage() {} +func (*QueryEstimatedRewardsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{14} +} +func (m *QueryEstimatedRewardsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEstimatedRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEstimatedRewardsRequest.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 *QueryEstimatedRewardsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEstimatedRewardsRequest.Merge(m, src) +} +func (m *QueryEstimatedRewardsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEstimatedRewardsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEstimatedRewardsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEstimatedRewardsRequest proto.InternalMessageInfo + +func (m *QueryEstimatedRewardsRequest) GetProvider() string { + if m != nil { + return m.Provider + } + return "" +} + +func (m *QueryEstimatedRewardsRequest) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *QueryEstimatedRewardsRequest) GetAmountDelegator() string { + if m != nil { + return m.AmountDelegator + } + return "" +} + +type EstimatedRewardInfo struct { + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"amount"` +} + +func (m *EstimatedRewardInfo) Reset() { *m = EstimatedRewardInfo{} } +func (m *EstimatedRewardInfo) String() string { return proto.CompactTextString(m) } +func (*EstimatedRewardInfo) ProtoMessage() {} +func (*EstimatedRewardInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{15} +} +func (m *EstimatedRewardInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EstimatedRewardInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EstimatedRewardInfo.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 *EstimatedRewardInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_EstimatedRewardInfo.Merge(m, src) +} +func (m *EstimatedRewardInfo) XXX_Size() int { + return m.Size() +} +func (m *EstimatedRewardInfo) XXX_DiscardUnknown() { + xxx_messageInfo_EstimatedRewardInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_EstimatedRewardInfo proto.InternalMessageInfo + +func (m *EstimatedRewardInfo) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *EstimatedRewardInfo) GetAmount() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Amount + } + return nil +} + +type QueryEstimatedRewardsResponse struct { + Info []*EstimatedRewardInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"` + Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` +} + +func (m *QueryEstimatedRewardsResponse) Reset() { *m = QueryEstimatedRewardsResponse{} } +func (m *QueryEstimatedRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEstimatedRewardsResponse) ProtoMessage() {} +func (*QueryEstimatedRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{16} +} +func (m *QueryEstimatedRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEstimatedRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEstimatedRewardsResponse.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 *QueryEstimatedRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEstimatedRewardsResponse.Merge(m, src) +} +func (m *QueryEstimatedRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryEstimatedRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEstimatedRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEstimatedRewardsResponse proto.InternalMessageInfo + +func (m *QueryEstimatedRewardsResponse) GetInfo() []*EstimatedRewardInfo { + if m != nil { + return m.Info + } + return nil +} + +func (m *QueryEstimatedRewardsResponse) GetTotal() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Total + } + return nil +} + +type QueryEstimatedValidatorRewardsRequest struct { + Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"` + AmountDelegator string `protobuf:"bytes,2,opt,name=amount_delegator,json=amountDelegator,proto3" json:"amount_delegator,omitempty"` +} + +func (m *QueryEstimatedValidatorRewardsRequest) Reset() { *m = QueryEstimatedValidatorRewardsRequest{} } +func (m *QueryEstimatedValidatorRewardsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEstimatedValidatorRewardsRequest) ProtoMessage() {} +func (*QueryEstimatedValidatorRewardsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{17} +} +func (m *QueryEstimatedValidatorRewardsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEstimatedValidatorRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEstimatedValidatorRewardsRequest.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 *QueryEstimatedValidatorRewardsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEstimatedValidatorRewardsRequest.Merge(m, src) +} +func (m *QueryEstimatedValidatorRewardsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEstimatedValidatorRewardsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEstimatedValidatorRewardsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEstimatedValidatorRewardsRequest proto.InternalMessageInfo + +func (m *QueryEstimatedValidatorRewardsRequest) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func (m *QueryEstimatedValidatorRewardsRequest) GetAmountDelegator() string { + if m != nil { + return m.AmountDelegator + } + return "" +} + +type QueryEstimatedValidatorRewardsResponse struct { + Info []*EstimatedRewardInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"` + Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` +} + +func (m *QueryEstimatedValidatorRewardsResponse) Reset() { + *m = QueryEstimatedValidatorRewardsResponse{} +} +func (m *QueryEstimatedValidatorRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEstimatedValidatorRewardsResponse) ProtoMessage() {} +func (*QueryEstimatedValidatorRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e870698c9d8ccc09, []int{18} +} +func (m *QueryEstimatedValidatorRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEstimatedValidatorRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEstimatedValidatorRewardsResponse.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 *QueryEstimatedValidatorRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEstimatedValidatorRewardsResponse.Merge(m, src) +} +func (m *QueryEstimatedValidatorRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryEstimatedValidatorRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEstimatedValidatorRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEstimatedValidatorRewardsResponse proto.InternalMessageInfo + +func (m *QueryEstimatedValidatorRewardsResponse) GetInfo() []*EstimatedRewardInfo { + if m != nil { + return m.Info + } + return nil +} + +func (m *QueryEstimatedValidatorRewardsResponse) GetTotal() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Total + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "lavanet.lava.subscription.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "lavanet.lava.subscription.QueryParamsResponse") @@ -647,6 +1023,13 @@ func init() { proto.RegisterType((*QueryNextToMonthExpiryRequest)(nil), "lavanet.lava.subscription.QueryNextToMonthExpiryRequest") proto.RegisterType((*TimerExpiryInfo)(nil), "lavanet.lava.subscription.TimerExpiryInfo") proto.RegisterType((*QueryNextToMonthExpiryResponse)(nil), "lavanet.lava.subscription.QueryNextToMonthExpiryResponse") + proto.RegisterType((*QuerySubscriptionTrackedUsageRequest)(nil), "lavanet.lava.subscription.QuerySubscriptionTrackedUsageRequest") + proto.RegisterType((*QuerySubscriptionTrackedUsageResponse)(nil), "lavanet.lava.subscription.QuerySubscriptionTrackedUsageResponse") + proto.RegisterType((*QueryEstimatedRewardsRequest)(nil), "lavanet.lava.subscription.QueryEstimatedRewardsRequest") + proto.RegisterType((*EstimatedRewardInfo)(nil), "lavanet.lava.subscription.EstimatedRewardInfo") + proto.RegisterType((*QueryEstimatedRewardsResponse)(nil), "lavanet.lava.subscription.QueryEstimatedRewardsResponse") + proto.RegisterType((*QueryEstimatedValidatorRewardsRequest)(nil), "lavanet.lava.subscription.QueryEstimatedValidatorRewardsRequest") + proto.RegisterType((*QueryEstimatedValidatorRewardsResponse)(nil), "lavanet.lava.subscription.QueryEstimatedValidatorRewardsResponse") } func init() { @@ -654,64 +1037,91 @@ func init() { } var fileDescriptor_e870698c9d8ccc09 = []byte{ - // 911 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x26, 0xae, 0xe3, 0x3c, 0x3b, 0x69, 0x3b, 0x89, 0xd0, 0xc6, 0x02, 0x27, 0xd9, 0x52, - 0xd2, 0x96, 0x74, 0x57, 0x4e, 0x40, 0xa1, 0x17, 0x2a, 0x25, 0xa2, 0x12, 0x28, 0xa0, 0xe0, 0x46, - 0x45, 0xe2, 0xc0, 0x6a, 0xbd, 0x1d, 0x3b, 0x8b, 0xec, 0x9d, 0xed, 0xfc, 0x28, 0x8e, 0xaa, 0x5e, - 0x38, 0xf6, 0x84, 0xe0, 0x2f, 0xe0, 0xdf, 0xe0, 0xc6, 0xad, 0x27, 0x54, 0x89, 0x0b, 0x27, 0x84, - 0x12, 0xfe, 0x10, 0x34, 0x6f, 0x67, 0xcd, 0x6e, 0x53, 0xaf, 0x0d, 0x27, 0xef, 0x7c, 0xf3, 0xbd, - 0xef, 0x7d, 0xf3, 0xe6, 0xcd, 0x93, 0xe1, 0xe6, 0x20, 0x78, 0x1a, 0xc4, 0x54, 0x7a, 0xfa, 0xd7, - 0x13, 0xaa, 0x2b, 0x42, 0x1e, 0x25, 0x32, 0x62, 0xb1, 0xf7, 0x44, 0x51, 0x7e, 0xe6, 0x26, 0x9c, - 0x49, 0x46, 0xd6, 0x0d, 0xcd, 0xd5, 0xbf, 0x6e, 0x9e, 0xd6, 0x5c, 0xeb, 0xb3, 0x3e, 0x43, 0x96, - 0xa7, 0xbf, 0xd2, 0x80, 0xe6, 0xdb, 0x7d, 0xc6, 0xfa, 0x03, 0xea, 0x05, 0x49, 0xe4, 0x05, 0x71, - 0xcc, 0x64, 0xa0, 0xc9, 0xc2, 0xec, 0xde, 0x09, 0x99, 0x18, 0x32, 0xe1, 0x75, 0x03, 0x41, 0xd3, - 0x3c, 0xde, 0xd3, 0x76, 0x97, 0xca, 0xa0, 0xed, 0x25, 0x41, 0x3f, 0x8a, 0x91, 0x6c, 0xb8, 0xef, - 0x4d, 0x76, 0x98, 0x04, 0x3c, 0x18, 0x66, 0x9a, 0xad, 0xbc, 0x66, 0xa6, 0x16, 0xb2, 0x28, 0xd3, - 0xd9, 0x99, 0xac, 0x93, 0x5f, 0xa4, 0x6c, 0x67, 0x0d, 0xc8, 0x97, 0xda, 0xd7, 0x31, 0xa6, 0xe8, - 0xd0, 0x27, 0x8a, 0x0a, 0xe9, 0x3c, 0x82, 0xd5, 0x02, 0x2a, 0x12, 0x16, 0x0b, 0x4a, 0xee, 0x43, - 0x35, 0xb5, 0x62, 0x5b, 0x9b, 0xd6, 0xad, 0xfa, 0xee, 0x96, 0x3b, 0xb1, 0x5c, 0x6e, 0x1a, 0x7a, - 0x50, 0x79, 0xf9, 0xe7, 0xc6, 0x5c, 0xc7, 0x84, 0x39, 0x6d, 0xa3, 0x7b, 0xa8, 0x38, 0xa7, 0xb1, - 0x34, 0xe9, 0x48, 0x13, 0x6a, 0x21, 0x8b, 0x85, 0x1a, 0x52, 0x8e, 0xca, 0x4b, 0x9d, 0xf1, 0xda, - 0xf9, 0x0a, 0xd6, 0x8a, 0x21, 0x63, 0x2f, 0x0b, 0x42, 0x75, 0x8d, 0x91, 0xed, 0x12, 0x23, 0x0f, - 0x73, 0x0b, 0xb4, 0x63, 0x75, 0x74, 0xa4, 0xf3, 0x31, 0xd8, 0x28, 0x7c, 0x14, 0x09, 0x79, 0xcc, - 0xd9, 0xb7, 0x34, 0x94, 0xd9, 0xf9, 0x89, 0x03, 0x8d, 0xbc, 0x86, 0x31, 0x55, 0xc0, 0x9c, 0x7d, - 0x58, 0x7f, 0x43, 0xbc, 0x71, 0xd7, 0x84, 0x5a, 0x62, 0x30, 0xdb, 0xda, 0x5c, 0xd0, 0x27, 0xca, - 0xd6, 0x0e, 0x81, 0x6b, 0xe3, 0xc0, 0xac, 0xe0, 0x01, 0x5c, 0xcf, 0x61, 0x46, 0xe4, 0x08, 0x96, - 0x74, 0x46, 0x3f, 0x8a, 0x7b, 0x0c, 0x55, 0xea, 0xbb, 0xb7, 0x4b, 0x0e, 0xaa, 0x63, 0x3f, 0x8d, - 0x7b, 0xec, 0xa1, 0xe4, 0x2a, 0x94, 0xa6, 0xf2, 0x35, 0x4d, 0xd1, 0xa8, 0xf3, 0xa2, 0x02, 0x2b, - 0x45, 0x4a, 0x59, 0xdd, 0x09, 0x81, 0x4a, 0x32, 0x08, 0x62, 0x7b, 0x1e, 0x71, 0xfc, 0x26, 0xdb, - 0x70, 0xf5, 0xb1, 0xe2, 0xd8, 0xb4, 0x7e, 0x97, 0xa9, 0xfe, 0xa9, 0xb4, 0x17, 0x36, 0xad, 0x5b, - 0x95, 0xce, 0x4a, 0x06, 0x1f, 0x20, 0x4a, 0x6e, 0xc0, 0xf2, 0x98, 0x38, 0xa0, 0x3d, 0x69, 0x57, - 0x90, 0xd6, 0xc8, 0xc0, 0x23, 0xda, 0x93, 0x64, 0x0b, 0x1a, 0x43, 0x16, 0xcb, 0x53, 0x9f, 0x8e, - 0x92, 0x88, 0x9f, 0xd9, 0x57, 0x90, 0x53, 0x47, 0xec, 0x13, 0x84, 0xc8, 0xbb, 0xb0, 0x92, 0x52, - 0x42, 0xe5, 0x4b, 0x26, 0x83, 0x81, 0x5d, 0x4d, 0x85, 0x10, 0x3d, 0x54, 0x27, 0x1a, 0x23, 0x0e, - 0x2c, 0x8f, 0x59, 0x98, 0x6d, 0x31, 0xa7, 0x74, 0xa8, 0x30, 0x99, 0x0d, 0x8b, 0xe1, 0x40, 0x09, - 0x49, 0xb9, 0x5d, 0xc3, 0x13, 0x65, 0x4b, 0x72, 0x13, 0xc6, 0xee, 0x4d, 0x8e, 0x25, 0x0c, 0x1f, - 0x9f, 0x20, 0x4d, 0xb2, 0x07, 0x6f, 0x05, 0x4a, 0x32, 0x9f, 0xd3, 0x98, 0x7e, 0x17, 0x0c, 0xfc, - 0x98, 0x8e, 0xa4, 0x8f, 0x15, 0xaa, 0xa3, 0xde, 0xaa, 0xde, 0xed, 0xa4, 0x9b, 0x5f, 0xd0, 0x91, - 0x3c, 0xd6, 0x05, 0xfb, 0x06, 0x56, 0x7b, 0x4a, 0x2a, 0x4e, 0xfd, 0x42, 0x3b, 0x35, 0xb0, 0x69, - 0xef, 0x96, 0xdc, 0xe5, 0x03, 0x8c, 0xca, 0xb7, 0x6e, 0x87, 0xf4, 0x2e, 0x61, 0xa4, 0x0d, 0xd5, - 0x90, 0xd3, 0xc7, 0x91, 0xb4, 0x97, 0x51, 0x72, 0xdd, 0x4d, 0x87, 0x83, 0xab, 0x87, 0x83, 0x6b, - 0x86, 0x83, 0x7b, 0xc8, 0xa2, 0xb8, 0x63, 0x88, 0x9f, 0x55, 0x6a, 0x70, 0xad, 0xee, 0x6c, 0xc0, - 0x3b, 0xd8, 0x6f, 0xda, 0xe9, 0x09, 0xfb, 0xfc, 0xdf, 0x92, 0x67, 0x0d, 0x79, 0x0c, 0x57, 0x4f, - 0xa2, 0x21, 0xe5, 0x29, 0xaa, 0x7b, 0xa6, 0xb4, 0x5b, 0x5e, 0xbf, 0xcb, 0xf9, 0x4b, 0x77, 0xe9, - 0x8c, 0xa0, 0x35, 0x29, 0xa5, 0xe9, 0xf7, 0x47, 0xb0, 0x9c, 0x2f, 0x82, 0x30, 0x3d, 0x7f, 0xa7, - 0xa4, 0x4e, 0xaf, 0x79, 0x34, 0x4d, 0x5f, 0x94, 0xd9, 0xfd, 0xad, 0x0a, 0x57, 0x30, 0x35, 0xf9, - 0xd1, 0x82, 0x6a, 0x3a, 0x98, 0x48, 0x59, 0xf5, 0x2f, 0x4f, 0xc4, 0xa6, 0x3b, 0x2b, 0x3d, 0x3d, - 0x8b, 0x73, 0xfb, 0xfb, 0xdf, 0xff, 0xfe, 0x69, 0xfe, 0x06, 0xd9, 0xf2, 0xa6, 0x8d, 0x75, 0xf2, - 0xb3, 0x05, 0x8b, 0x66, 0xba, 0x91, 0xa9, 0x69, 0x8a, 0x93, 0xb3, 0xe9, 0xcd, 0xcc, 0x37, 0xbe, - 0x3e, 0x44, 0x5f, 0x1e, 0xb9, 0x5b, 0xe2, 0x2b, 0x4c, 0x63, 0xbc, 0x67, 0xd9, 0xf5, 0x3e, 0x27, - 0xbf, 0x58, 0xd0, 0xc8, 0x0f, 0x3a, 0xb2, 0x37, 0x2d, 0xf1, 0x1b, 0xc6, 0x6a, 0xf3, 0x83, 0xff, - 0x16, 0x64, 0x2c, 0xdf, 0x47, 0xcb, 0xf7, 0xc8, 0x7e, 0x89, 0xe5, 0x41, 0x24, 0xa4, 0x9f, 0x4d, - 0x58, 0xef, 0x59, 0x7e, 0xef, 0x39, 0x79, 0x61, 0x41, 0x45, 0x2b, 0x93, 0xf7, 0x67, 0xc9, 0x9f, - 0x99, 0xdd, 0x99, 0x8d, 0x6c, 0x4c, 0x6e, 0xa3, 0xc9, 0x2d, 0xb2, 0x31, 0xc5, 0x24, 0xf9, 0xd5, - 0x82, 0xeb, 0x97, 0x9e, 0x00, 0xf9, 0x68, 0x5a, 0xb2, 0x49, 0x0f, 0xb5, 0x79, 0xef, 0x7f, 0x44, - 0x1a, 0xcf, 0xfb, 0xe8, 0xb9, 0x4d, 0xbc, 0x12, 0xcf, 0x38, 0xe6, 0x24, 0xf3, 0xf3, 0xaf, 0xfb, - 0xe0, 0xc1, 0xcb, 0xf3, 0x96, 0xf5, 0xea, 0xbc, 0x65, 0xfd, 0x75, 0xde, 0xb2, 0x7e, 0xb8, 0x68, - 0xcd, 0xbd, 0xba, 0x68, 0xcd, 0xfd, 0x71, 0xd1, 0x9a, 0xfb, 0x7a, 0xa7, 0x1f, 0xc9, 0x53, 0xd5, - 0x75, 0x43, 0x36, 0x2c, 0x8a, 0x8e, 0x8a, 0xb2, 0xf2, 0x2c, 0xa1, 0xa2, 0x5b, 0xc5, 0xff, 0x20, - 0x7b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x07, 0x82, 0xce, 0xbb, 0x9d, 0x09, 0x00, 0x00, + // 1343 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcd, 0x6f, 0x13, 0x47, + 0x14, 0xcf, 0x06, 0xc7, 0x49, 0x5e, 0x1c, 0x08, 0x13, 0x84, 0x1c, 0x2b, 0x75, 0xc8, 0xf2, 0x1d, + 0x60, 0x47, 0x09, 0xad, 0x02, 0x17, 0xa0, 0x09, 0x54, 0x05, 0xd1, 0x2a, 0x2c, 0x01, 0xa4, 0x4a, + 0xed, 0x6a, 0xbc, 0x3b, 0x71, 0xb6, 0xd8, 0x3b, 0xcb, 0xee, 0x6c, 0x08, 0x8a, 0x22, 0x55, 0x3d, + 0xa2, 0x1e, 0xaa, 0xf6, 0xdc, 0x43, 0x6f, 0x55, 0x4f, 0x3d, 0xf7, 0xd6, 0x1b, 0x47, 0xd4, 0x1e, + 0x5a, 0xa9, 0x52, 0x8b, 0x00, 0xa9, 0x7f, 0x46, 0xab, 0xf9, 0x58, 0x67, 0xed, 0xd8, 0xeb, 0x84, + 0xaa, 0x87, 0x5e, 0xe2, 0x9d, 0x37, 0xef, 0xfd, 0xde, 0xef, 0xbd, 0x79, 0x33, 0xef, 0x05, 0x4e, + 0x36, 0xc8, 0x06, 0x09, 0x28, 0xc7, 0xe2, 0x17, 0xc7, 0x49, 0x2d, 0x76, 0x23, 0x3f, 0xe4, 0x3e, + 0x0b, 0xf0, 0xa3, 0x84, 0x46, 0x4f, 0xac, 0x30, 0x62, 0x9c, 0xa1, 0x29, 0xad, 0x66, 0x89, 0x5f, + 0x2b, 0xab, 0x56, 0x99, 0x73, 0x59, 0xdc, 0x64, 0x31, 0xae, 0x91, 0x98, 0x2a, 0x1b, 0xbc, 0x31, + 0x5f, 0xa3, 0x9c, 0xcc, 0xe3, 0x90, 0xd4, 0xfd, 0x80, 0x08, 0x2d, 0x05, 0x53, 0xa9, 0x66, 0x75, + 0x53, 0x2d, 0x97, 0xf9, 0xe9, 0xfe, 0x91, 0x3a, 0xab, 0x33, 0xf9, 0x89, 0xc5, 0x97, 0x96, 0x4e, + 0xd7, 0x19, 0xab, 0x37, 0x28, 0x26, 0xa1, 0x8f, 0x49, 0x10, 0x30, 0x2e, 0x21, 0x63, 0xbd, 0x3b, + 0xd7, 0x3b, 0x02, 0x37, 0x71, 0x78, 0x44, 0xdc, 0x87, 0x34, 0xd2, 0xba, 0xa7, 0x7a, 0xeb, 0x86, + 0x24, 0x22, 0xcd, 0x14, 0xf3, 0x7c, 0x6f, 0xbd, 0xec, 0x42, 0x6b, 0x1f, 0x26, 0x4d, 0x3f, 0x60, + 0x58, 0xfe, 0x55, 0x22, 0xf3, 0x08, 0xa0, 0x3b, 0x22, 0x15, 0x2b, 0x12, 0xd5, 0xa6, 0x8f, 0x12, + 0x1a, 0x73, 0xf3, 0x3e, 0x4c, 0xb6, 0x49, 0xe3, 0x90, 0x05, 0x31, 0x45, 0x57, 0xa1, 0xa8, 0xbc, + 0x97, 0x8d, 0x63, 0xc6, 0x99, 0xb1, 0x85, 0x59, 0xab, 0x67, 0xb6, 0x2d, 0x65, 0xba, 0x54, 0x78, + 0xf6, 0xc7, 0xcc, 0x80, 0xad, 0xcd, 0xcc, 0x79, 0x8d, 0xbb, 0x9c, 0x44, 0x11, 0x0d, 0xb8, 0x76, + 0x87, 0x2a, 0x30, 0xe2, 0xb2, 0x20, 0x4e, 0x9a, 0x34, 0x92, 0xc8, 0xa3, 0x76, 0x6b, 0x6d, 0x3e, + 0x80, 0x23, 0xed, 0x26, 0x2d, 0x2e, 0x07, 0xe2, 0xa4, 0xa6, 0x89, 0x9c, 0xce, 0x21, 0x72, 0x37, + 0xb3, 0x90, 0x74, 0x0c, 0x5b, 0x58, 0x9a, 0x57, 0xa0, 0x2c, 0x81, 0x6f, 0xfb, 0x31, 0x5f, 0x89, + 0xd8, 0xa7, 0xd4, 0xe5, 0x69, 0xfc, 0xc8, 0x84, 0x52, 0x16, 0x43, 0x93, 0x6a, 0x93, 0x99, 0x8b, + 0x30, 0xd5, 0xc5, 0x5e, 0xb3, 0xab, 0xc0, 0x48, 0xa8, 0x65, 0x65, 0xe3, 0xd8, 0x01, 0x11, 0x51, + 0xba, 0x36, 0x11, 0x4c, 0xb4, 0x0c, 0xd3, 0x84, 0x13, 0x38, 0x9c, 0x91, 0x69, 0x90, 0xdb, 0x30, + 0x2a, 0x3c, 0x3a, 0x7e, 0xb0, 0xc6, 0x24, 0xca, 0xd8, 0xc2, 0xd9, 0x9c, 0x40, 0x85, 0xed, 0xcd, + 0x60, 0x8d, 0xdd, 0xe5, 0x51, 0xe2, 0x72, 0x9d, 0xf9, 0x11, 0xa1, 0x22, 0xa4, 0xe6, 0xd3, 0x02, + 0x1c, 0x6c, 0x57, 0xc9, 0xcb, 0x3b, 0x42, 0x50, 0x08, 0x1b, 0x24, 0x28, 0x0f, 0x4a, 0xb9, 0xfc, + 0x46, 0xa7, 0xe1, 0x90, 0x97, 0x44, 0xb2, 0xa8, 0x9d, 0x1a, 0x4b, 0xea, 0xeb, 0xbc, 0x7c, 0xe0, + 0x98, 0x71, 0xa6, 0x60, 0x1f, 0x4c, 0xc5, 0x4b, 0x52, 0x8a, 0x8e, 0xc3, 0x78, 0x4b, 0xb1, 0x41, + 0xd7, 0x78, 0xb9, 0x20, 0xd5, 0x4a, 0xa9, 0xf0, 0x36, 0x5d, 0xe3, 0x68, 0x16, 0x4a, 0x4d, 0x16, + 0xf0, 0x75, 0x87, 0x6e, 0x86, 0x7e, 0xf4, 0xa4, 0x3c, 0x24, 0x75, 0xc6, 0xa4, 0xec, 0x86, 0x14, + 0xa1, 0x13, 0x70, 0x50, 0xa9, 0x88, 0x0b, 0xc2, 0x38, 0x69, 0x94, 0x8b, 0x0a, 0x48, 0x4a, 0x97, + 0x93, 0x55, 0x21, 0x43, 0x26, 0x8c, 0xb7, 0xb4, 0xa4, 0xb7, 0xe1, 0x0c, 0xd2, 0x72, 0x22, 0x9d, + 0x95, 0x61, 0xd8, 0x6d, 0x24, 0x31, 0xa7, 0x51, 0x79, 0x44, 0x46, 0x94, 0x2e, 0xd1, 0x49, 0x68, + 0xb1, 0xd7, 0x3e, 0x46, 0xa5, 0x79, 0x2b, 0x02, 0xe5, 0xe4, 0x22, 0x1c, 0x25, 0x09, 0x67, 0x4e, + 0x44, 0x03, 0xfa, 0x98, 0x34, 0x9c, 0x80, 0x6e, 0x72, 0x47, 0x66, 0x68, 0x4c, 0xe2, 0x4d, 0x8a, + 0x5d, 0x5b, 0x6d, 0x7e, 0x48, 0x37, 0xf9, 0x8a, 0x48, 0xd8, 0x27, 0x30, 0xb9, 0x96, 0xf0, 0x24, + 0xa2, 0x4e, 0x5b, 0x39, 0x95, 0x64, 0xd1, 0x5e, 0xc8, 0x39, 0xcb, 0xf7, 0xa4, 0x55, 0xb6, 0x74, + 0x6d, 0xb4, 0xb6, 0x4b, 0x86, 0xe6, 0xa1, 0xe8, 0x46, 0xd4, 0xf3, 0x79, 0x79, 0x5c, 0x42, 0x4e, + 0x59, 0xea, 0xdd, 0xb2, 0xc4, 0xbb, 0x65, 0xe9, 0x77, 0xcb, 0x5a, 0x66, 0x7e, 0x60, 0x6b, 0xc5, + 0x5b, 0x85, 0x11, 0x98, 0x18, 0x33, 0x67, 0xe0, 0x2d, 0x59, 0x6f, 0x82, 0xe9, 0x2a, 0xfb, 0x60, + 0x27, 0xe5, 0x69, 0x41, 0xae, 0xc0, 0xa1, 0x55, 0xbf, 0x49, 0x23, 0x25, 0x15, 0x35, 0x93, 0x5b, + 0x2d, 0x9d, 0x67, 0x39, 0xb8, 0xeb, 0x2c, 0xcd, 0x4d, 0xa8, 0xf6, 0x72, 0xa9, 0xeb, 0xfd, 0x3e, + 0x8c, 0x67, 0x93, 0x10, 0xeb, 0x9a, 0x9f, 0xcb, 0xc9, 0x53, 0x07, 0x47, 0x5d, 0xf4, 0xed, 0x30, + 0xe6, 0x2d, 0x38, 0x21, 0x3d, 0x67, 0x53, 0xb7, 0x2a, 0x9f, 0x5b, 0xef, 0x5e, 0x4c, 0xea, 0x74, + 0x3f, 0xb7, 0xfe, 0x77, 0x03, 0x4e, 0xf6, 0x01, 0xd3, 0xd1, 0xdc, 0xe9, 0x82, 0xb6, 0xef, 0x97, + 0xaa, 0x0d, 0x02, 0x5d, 0x81, 0xa1, 0x44, 0xf8, 0x28, 0x0f, 0xca, 0xc4, 0x9c, 0xc9, 0x4b, 0x8c, + 0xa2, 0xb4, 0x9c, 0x88, 0xb4, 0xd8, 0xca, 0x0c, 0xcd, 0xc0, 0x98, 0xac, 0x70, 0x47, 0xa1, 0xa8, + 0xbb, 0x0b, 0x52, 0x24, 0xb9, 0x9b, 0x9f, 0x19, 0x30, 0x2d, 0xa3, 0xbb, 0x11, 0x73, 0xbf, 0x49, + 0x38, 0xf5, 0x6c, 0xfa, 0x98, 0x44, 0x5e, 0x9c, 0x79, 0xa9, 0xc3, 0x88, 0x6d, 0xf8, 0xde, 0x4e, + 0x0d, 0xa4, 0x6b, 0x34, 0x05, 0x23, 0xee, 0x3a, 0xf1, 0x03, 0xc7, 0xf7, 0xf4, 0xab, 0x31, 0x2c, + 0xd7, 0x37, 0x3d, 0x74, 0x16, 0x26, 0x48, 0x93, 0x25, 0x01, 0x77, 0x3c, 0xda, 0xa0, 0x75, 0xc2, + 0x59, 0x24, 0xbd, 0x8f, 0xda, 0x87, 0x94, 0xfc, 0x7a, 0x2a, 0x36, 0xbf, 0x31, 0x60, 0xb2, 0xc3, + 0xbb, 0xac, 0xbe, 0xa3, 0x50, 0x8c, 0x59, 0x12, 0xb9, 0x54, 0xfb, 0xd5, 0x2b, 0x14, 0x40, 0x51, + 0x41, 0xe8, 0xa4, 0x4c, 0x77, 0xbd, 0x02, 0xd7, 0xa9, 0x2b, 0x6e, 0xc1, 0xd2, 0x25, 0x51, 0x1f, + 0xdf, 0xff, 0x39, 0x73, 0xae, 0xee, 0xf3, 0xf5, 0xa4, 0x66, 0xb9, 0xac, 0x89, 0x75, 0xab, 0x57, + 0x3f, 0x17, 0x62, 0xef, 0x21, 0xe6, 0x4f, 0x42, 0x1a, 0xa7, 0x36, 0xf1, 0x77, 0x7f, 0xfd, 0x30, + 0x67, 0xd8, 0xda, 0x8b, 0xf9, 0xab, 0xa1, 0xaf, 0xce, 0xee, 0x14, 0xe9, 0x83, 0x7f, 0x1f, 0x0a, + 0x99, 0x17, 0xdb, 0xca, 0x39, 0xa4, 0x2e, 0x71, 0xea, 0x73, 0x97, 0x08, 0xa8, 0x01, 0x43, 0xea, + 0x45, 0xfa, 0x6f, 0x43, 0x53, 0x4e, 0xcc, 0x50, 0x57, 0x76, 0x8b, 0xd5, 0x7d, 0xd2, 0xf0, 0x3d, + 0x71, 0x28, 0x1d, 0x45, 0x30, 0x0d, 0xa3, 0x1b, 0xe9, 0x96, 0x3e, 0x8d, 0x1d, 0x41, 0xd7, 0xb3, + 0x1e, 0xec, 0x7e, 0xd6, 0x2f, 0x0c, 0x38, 0xd5, 0xcf, 0xe5, 0xff, 0x3b, 0xa9, 0x0b, 0x5f, 0x94, + 0x60, 0x48, 0x86, 0x88, 0xbe, 0x32, 0xa0, 0xa8, 0x86, 0x22, 0x94, 0xf7, 0xf2, 0xef, 0x9e, 0xc6, + 0x2a, 0xd6, 0x5e, 0xd5, 0x55, 0xae, 0xcc, 0xb3, 0x9f, 0xff, 0xf2, 0xfa, 0xeb, 0xc1, 0xe3, 0x68, + 0x16, 0xf7, 0x9b, 0x22, 0xd1, 0xb7, 0x06, 0x0c, 0xeb, 0xc9, 0x0a, 0xf5, 0x75, 0xd3, 0x3e, 0xb5, + 0x55, 0xf0, 0x9e, 0xf5, 0x35, 0xaf, 0x77, 0x24, 0x2f, 0x8c, 0x2e, 0xe0, 0xbc, 0x49, 0x58, 0xda, + 0xe0, 0xad, 0xb4, 0xb5, 0x6c, 0xa3, 0x1f, 0x0d, 0x28, 0x65, 0x87, 0x2c, 0x74, 0xb1, 0x9f, 0xe3, + 0x2e, 0x23, 0x5d, 0xe5, 0xed, 0xfd, 0x19, 0x69, 0xca, 0x57, 0x25, 0xe5, 0xcb, 0x68, 0x31, 0x87, + 0x72, 0xc3, 0x8f, 0xb9, 0x93, 0x4e, 0x77, 0x78, 0x2b, 0xbb, 0xb7, 0x8d, 0x9e, 0x1a, 0x50, 0x10, + 0xc8, 0xe8, 0xdc, 0x5e, 0xfc, 0xa7, 0x64, 0xcf, 0xef, 0x4d, 0x59, 0x93, 0x3c, 0x2d, 0x49, 0xce, + 0xa2, 0x99, 0x3e, 0x24, 0xd1, 0x4f, 0x06, 0x1c, 0xde, 0xd5, 0x7e, 0xd1, 0xa5, 0x7e, 0xce, 0x7a, + 0x0d, 0x09, 0x95, 0xcb, 0x6f, 0x60, 0xa9, 0x39, 0x2f, 0x4a, 0xce, 0xf3, 0x08, 0xe7, 0x70, 0x96, + 0x23, 0x16, 0x67, 0x4e, 0x76, 0xb2, 0x40, 0x3f, 0x1b, 0x50, 0xca, 0xf6, 0x5b, 0x74, 0xb5, 0x1f, + 0x89, 0x3e, 0x6d, 0xbf, 0x72, 0xed, 0xcd, 0x01, 0xf6, 0x51, 0x25, 0xea, 0xff, 0x3b, 0x4f, 0xb5, + 0xde, 0xce, 0x2a, 0x79, 0x6d, 0xc0, 0x44, 0x67, 0x3f, 0x41, 0x8b, 0xfd, 0x78, 0xf5, 0x68, 0xd2, + 0x95, 0x4b, 0xfb, 0x37, 0xd4, 0x81, 0x7c, 0x2c, 0x03, 0x79, 0x80, 0xee, 0xe5, 0x04, 0x42, 0x53, + 0x63, 0x27, 0x52, 0xd6, 0x78, 0x2b, 0x1d, 0x01, 0xb6, 0xf1, 0x56, 0x3a, 0x01, 0x6c, 0xe3, 0xad, + 0xce, 0x2e, 0xb0, 0x8d, 0xfe, 0x36, 0x60, 0xaa, 0xe7, 0x53, 0x8f, 0xae, 0xed, 0x99, 0x76, 0x8f, + 0xc6, 0x54, 0x79, 0xf7, 0x5f, 0x20, 0xbc, 0x51, 0x06, 0x5a, 0x5d, 0x6f, 0x27, 0x17, 0x2d, 0x51, + 0xb7, 0x0c, 0x2c, 0xdd, 0x7c, 0xf6, 0xb2, 0x6a, 0x3c, 0x7f, 0x59, 0x35, 0x5e, 0xbc, 0xac, 0x1a, + 0x5f, 0xbe, 0xaa, 0x0e, 0x3c, 0x7f, 0x55, 0x1d, 0xf8, 0xed, 0x55, 0x75, 0xe0, 0x23, 0x9c, 0xe9, + 0x30, 0x6d, 0xae, 0x37, 0x16, 0xf0, 0x66, 0x47, 0x29, 0x89, 0x76, 0x53, 0x2b, 0xca, 0x7f, 0xe0, + 0x2f, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x8e, 0xd1, 0x11, 0x19, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -736,6 +1146,11 @@ type QueryClient interface { List(ctx context.Context, in *QueryListRequest, opts ...grpc.CallOption) (*QueryListResponse, error) // Queries the subscription with the closest month expiry NextToMonthExpiry(ctx context.Context, in *QueryNextToMonthExpiryRequest, opts ...grpc.CallOption) (*QueryNextToMonthExpiryResponse, error) + // Queries a list of Current items. + TrackedUsage(ctx context.Context, in *QuerySubscriptionTrackedUsageRequest, opts ...grpc.CallOption) (*QuerySubscriptionTrackedUsageResponse, error) + // Queries a rewards estimation. + EstimatedRewards(ctx context.Context, in *QueryEstimatedRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedRewardsResponse, error) + EstimatedValidatorRewards(ctx context.Context, in *QueryEstimatedValidatorRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedValidatorRewardsResponse, error) } type queryClient struct { @@ -791,6 +1206,33 @@ func (c *queryClient) NextToMonthExpiry(ctx context.Context, in *QueryNextToMont return out, nil } +func (c *queryClient) TrackedUsage(ctx context.Context, in *QuerySubscriptionTrackedUsageRequest, opts ...grpc.CallOption) (*QuerySubscriptionTrackedUsageResponse, error) { + out := new(QuerySubscriptionTrackedUsageResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/TrackedUsage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) EstimatedRewards(ctx context.Context, in *QueryEstimatedRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedRewardsResponse, error) { + out := new(QueryEstimatedRewardsResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/EstimatedRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) EstimatedValidatorRewards(ctx context.Context, in *QueryEstimatedValidatorRewardsRequest, opts ...grpc.CallOption) (*QueryEstimatedValidatorRewardsResponse, error) { + out := new(QueryEstimatedValidatorRewardsResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/EstimatedValidatorRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -803,6 +1245,11 @@ type QueryServer interface { List(context.Context, *QueryListRequest) (*QueryListResponse, error) // Queries the subscription with the closest month expiry NextToMonthExpiry(context.Context, *QueryNextToMonthExpiryRequest) (*QueryNextToMonthExpiryResponse, error) + // Queries a list of Current items. + TrackedUsage(context.Context, *QuerySubscriptionTrackedUsageRequest) (*QuerySubscriptionTrackedUsageResponse, error) + // Queries a rewards estimation. + EstimatedRewards(context.Context, *QueryEstimatedRewardsRequest) (*QueryEstimatedRewardsResponse, error) + EstimatedValidatorRewards(context.Context, *QueryEstimatedValidatorRewardsRequest) (*QueryEstimatedValidatorRewardsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -824,6 +1271,15 @@ func (*UnimplementedQueryServer) List(ctx context.Context, req *QueryListRequest func (*UnimplementedQueryServer) NextToMonthExpiry(ctx context.Context, req *QueryNextToMonthExpiryRequest) (*QueryNextToMonthExpiryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NextToMonthExpiry not implemented") } +func (*UnimplementedQueryServer) TrackedUsage(ctx context.Context, req *QuerySubscriptionTrackedUsageRequest) (*QuerySubscriptionTrackedUsageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TrackedUsage not implemented") +} +func (*UnimplementedQueryServer) EstimatedRewards(ctx context.Context, req *QueryEstimatedRewardsRequest) (*QueryEstimatedRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimatedRewards not implemented") +} +func (*UnimplementedQueryServer) EstimatedValidatorRewards(ctx context.Context, req *QueryEstimatedValidatorRewardsRequest) (*QueryEstimatedValidatorRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EstimatedValidatorRewards not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -919,13 +1375,67 @@ func _Query_NextToMonthExpiry_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lavanet.lava.subscription.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, +func _Query_TrackedUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySubscriptionTrackedUsageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TrackedUsage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.subscription.Query/TrackedUsage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TrackedUsage(ctx, req.(*QuerySubscriptionTrackedUsageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_EstimatedRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEstimatedRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EstimatedRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.subscription.Query/EstimatedRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EstimatedRewards(ctx, req.(*QueryEstimatedRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_EstimatedValidatorRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEstimatedValidatorRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EstimatedValidatorRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.subscription.Query/EstimatedValidatorRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EstimatedValidatorRewards(ctx, req.(*QueryEstimatedValidatorRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "lavanet.lava.subscription.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, }, { MethodName: "Current", @@ -943,6 +1453,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "NextToMonthExpiry", Handler: _Query_NextToMonthExpiry_Handler, }, + { + MethodName: "TrackedUsage", + Handler: _Query_TrackedUsage_Handler, + }, + { + MethodName: "EstimatedRewards", + Handler: _Query_EstimatedRewards_Handler, + }, + { + MethodName: "EstimatedValidatorRewards", + Handler: _Query_EstimatedValidatorRewards_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "lavanet/lava/subscription/query.proto", @@ -1391,126 +1913,437 @@ func (m *QueryNextToMonthExpiryResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QuerySubscriptionTrackedUsageRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QuerySubscriptionTrackedUsageRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryCurrentRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QuerySubscriptionTrackedUsageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.Subscription) > 0 { + i -= len(m.Subscription) + copy(dAtA[i:], m.Subscription) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subscription))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryCurrentResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sub != nil { - l = m.Sub.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QuerySubscriptionTrackedUsageResponse) 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 n + return dAtA[:n], nil } -func (m *QueryListProjectsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subscription) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QuerySubscriptionTrackedUsageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryListProjectsResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QuerySubscriptionTrackedUsageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Projects) > 0 { - for _, s := range m.Projects { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) + if m.TotalUsage != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TotalUsage)) + i-- + dAtA[i] = 0x18 + } + if len(m.Usage) > 0 { + for iNdEx := len(m.Usage) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Usage[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } } - return n + if m.Subscription != nil { + { + size, err := m.Subscription.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryListRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryEstimatedRewardsRequest) 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 *QueryEstimatedRewardsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEstimatedRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + if len(m.AmountDelegator) > 0 { + i -= len(m.AmountDelegator) + copy(dAtA[i:], m.AmountDelegator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AmountDelegator))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Provider) > 0 { + i -= len(m.Provider) + copy(dAtA[i:], m.Provider) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Provider))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryListResponse) Size() (n int) { - if m == nil { - return 0 +func (m *EstimatedRewardInfo) 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 *EstimatedRewardInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EstimatedRewardInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.SubsInfo) > 0 { - for _, e := range m.SubsInfo { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } } - return n + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *ListInfoStruct) Size() (n int) { - if m == nil { - return 0 +func (m *QueryEstimatedRewardsResponse) 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 *QueryEstimatedRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEstimatedRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.Total) > 0 { + for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } } - l = len(m.Plan) + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryEstimatedValidatorRewardsRequest) 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 *QueryEstimatedValidatorRewardsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEstimatedValidatorRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AmountDelegator) > 0 { + i -= len(m.AmountDelegator) + copy(dAtA[i:], m.AmountDelegator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AmountDelegator))) + i-- + dAtA[i] = 0x12 + } + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryEstimatedValidatorRewardsResponse) 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 *QueryEstimatedValidatorRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEstimatedValidatorRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Total) > 0 { + for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryCurrentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Consumer) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCurrentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sub != nil { + l = m.Sub.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryListProjectsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subscription) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryListProjectsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Projects) > 0 { + for _, s := range m.Projects { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryListRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryListResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SubsInfo) > 0 { + for _, e := range m.SubsInfo { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *ListInfoStruct) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Consumer) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Plan) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -1591,43 +2424,177 @@ func (m *QueryNextToMonthExpiryResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (m *QuerySubscriptionTrackedUsageRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subscription) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + +func (m *QuerySubscriptionTrackedUsageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Subscription != nil { + l = m.Subscription.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Usage) > 0 { + for _, e := range m.Usage { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) } - switch fieldNum { - default: - iNdEx = preIndex + } + if m.TotalUsage != 0 { + n += 1 + sovQuery(uint64(m.TotalUsage)) + } + return n +} + +func (m *QueryEstimatedRewardsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Provider) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AmountDelegator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *EstimatedRewardInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Source) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryEstimatedRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.Total) > 0 { + for _, e := range m.Total { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryEstimatedValidatorRewardsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AmountDelegator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryEstimatedValidatorRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.Total) > 0 { + for _, e := range m.Total { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) if err != nil { return err @@ -1843,7 +2810,669 @@ func (m *QueryCurrentResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sub", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sub", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Sub == nil { + m.Sub = &Subscription{} + } + if err := m.Sub.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListProjectsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryListProjectsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListProjectsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subscription = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListProjectsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryListProjectsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListProjectsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryListRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryListResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubsInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubsInfo = append(m.SubsInfo, ListInfoStruct{}) + if err := m.SubsInfo[len(m.SubsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListInfoStruct: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListInfoStruct: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Consumer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Plan = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) + } + m.DurationBought = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DurationBought |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationLeft", wireType) + } + m.DurationLeft = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DurationLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiry", wireType) + } + m.MonthExpiry = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MonthExpiry |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MonthCuTotal", wireType) + } + m.MonthCuTotal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MonthCuTotal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MonthCuLeft", wireType) + } + m.MonthCuLeft = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MonthCuLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cluster = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationTotal", wireType) + } + m.DurationTotal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DurationTotal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AutoRenewalNextPlan", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AutoRenewalNextPlan = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FutureSubscription", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FutureSubscription == nil { + m.FutureSubscription = &FutureSubscription{} + } + if err := m.FutureSubscription.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1870,10 +3499,10 @@ func (m *QueryCurrentResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Sub == nil { - m.Sub = &Subscription{} + if m.Credit == nil { + m.Credit = &types.Coin{} } - if err := m.Sub.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Credit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1898,7 +3527,7 @@ func (m *QueryCurrentResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryListProjectsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryNextToMonthExpiryRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1921,44 +3550,12 @@ func (m *QueryListProjectsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryListProjectsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryNextToMonthExpiryRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListProjectsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryNextToMonthExpiryRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subscription = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1980,7 +3577,7 @@ func (m *QueryListProjectsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryListProjectsResponse) Unmarshal(dAtA []byte) error { +func (m *TimerExpiryInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2003,15 +3600,15 @@ func (m *QueryListProjectsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryListProjectsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TimerExpiryInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListProjectsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TimerExpiryInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2039,8 +3636,27 @@ func (m *QueryListProjectsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) + m.Consumer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiry", wireType) + } + m.MonthExpiry = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MonthExpiry |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2062,7 +3678,7 @@ func (m *QueryListProjectsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryListRequest) Unmarshal(dAtA []byte) error { +func (m *QueryNextToMonthExpiryResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2085,12 +3701,46 @@ func (m *QueryListRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryListRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryNextToMonthExpiryResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryNextToMonthExpiryResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subscriptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subscriptions = append(m.Subscriptions, TimerExpiryInfo{}) + if err := m.Subscriptions[len(m.Subscriptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2112,7 +3762,7 @@ func (m *QueryListRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryListResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySubscriptionTrackedUsageRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2135,17 +3785,17 @@ func (m *QueryListResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryListResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySubscriptionTrackedUsageRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySubscriptionTrackedUsageRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubsInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2155,25 +3805,23 @@ func (m *QueryListResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.SubsInfo = append(m.SubsInfo, ListInfoStruct{}) - if err := m.SubsInfo[len(m.SubsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Subscription = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2196,7 +3844,7 @@ func (m *QueryListResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { +func (m *QuerySubscriptionTrackedUsageResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2219,17 +3867,17 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ListInfoStruct: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySubscriptionTrackedUsageResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ListInfoStruct: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySubscriptionTrackedUsageResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2239,29 +3887,33 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Consumer = string(dAtA[iNdEx:postIndex]) + if m.Subscription == nil { + m.Subscription = &Subscription{} + } + if err := m.Subscription.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2271,48 +3923,31 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Plan = string(dAtA[iNdEx:postIndex]) + m.Usage = append(m.Usage, &TrackedCuInfo{}) + if err := m.Usage[len(m.Usage)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) - } - m.DurationBought = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationBought |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationLeft", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TotalUsage", wireType) } - m.DurationLeft = 0 + m.TotalUsage = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2322,71 +3957,64 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DurationLeft |= uint64(b&0x7F) << shift + m.TotalUsage |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiry", wireType) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - m.MonthExpiry = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthExpiry |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuTotal", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.MonthCuTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryEstimatedRewardsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuLeft", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - m.MonthCuLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - case 8: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryEstimatedRewardsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEstimatedRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2414,13 +4042,13 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Cluster = string(dAtA[iNdEx:postIndex]) + m.Provider = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationTotal", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - m.DurationTotal = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2430,14 +4058,27 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DurationTotal |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 11: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AutoRenewalNextPlan", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountDelegator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2465,13 +4106,63 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AutoRenewalNextPlan = string(dAtA[iNdEx:postIndex]) + m.AmountDelegator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 12: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EstimatedRewardInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EstimatedRewardInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EstimatedRewardInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FutureSubscription", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2481,31 +4172,27 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.FutureSubscription == nil { - m.FutureSubscription = &FutureSubscription{} - } - if err := m.FutureSubscription.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Source = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 13: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Credit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2532,10 +4219,8 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Credit == nil { - m.Credit = &types.Coin{} - } - if err := m.Credit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Amount = append(m.Amount, types.DecCoin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2560,7 +4245,7 @@ func (m *ListInfoStruct) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryNextToMonthExpiryRequest) Unmarshal(dAtA []byte) error { +func (m *QueryEstimatedRewardsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2583,12 +4268,80 @@ func (m *QueryNextToMonthExpiryRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryNextToMonthExpiryRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEstimatedRewardsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNextToMonthExpiryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEstimatedRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Info = append(m.Info, &EstimatedRewardInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Total = append(m.Total, types.DecCoin{}) + if err := m.Total[len(m.Total)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2610,7 +4363,7 @@ func (m *QueryNextToMonthExpiryRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TimerExpiryInfo) Unmarshal(dAtA []byte) error { +func (m *QueryEstimatedValidatorRewardsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2633,15 +4386,15 @@ func (m *TimerExpiryInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TimerExpiryInfo: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEstimatedValidatorRewardsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TimerExpiryInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEstimatedValidatorRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2669,13 +4422,13 @@ func (m *TimerExpiryInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Consumer = string(dAtA[iNdEx:postIndex]) + m.Validator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiry", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AmountDelegator", wireType) } - m.MonthExpiry = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2685,11 +4438,24 @@ func (m *TimerExpiryInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MonthExpiry |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AmountDelegator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2711,7 +4477,7 @@ func (m *TimerExpiryInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryNextToMonthExpiryResponse) Unmarshal(dAtA []byte) error { +func (m *QueryEstimatedValidatorRewardsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2734,15 +4500,15 @@ func (m *QueryNextToMonthExpiryResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryNextToMonthExpiryResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEstimatedValidatorRewardsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNextToMonthExpiryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEstimatedValidatorRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscriptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2769,8 +4535,42 @@ func (m *QueryNextToMonthExpiryResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Subscriptions = append(m.Subscriptions, TimerExpiryInfo{}) - if err := m.Subscriptions[len(m.Subscriptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Info = append(m.Info, &EstimatedRewardInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Total = append(m.Total, types.DecCoin{}) + if err := m.Total[len(m.Total)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/subscription/types/query.pb.gw.go b/x/subscription/types/query.pb.gw.go index 4be3ab6a12..51e6e69a42 100644 --- a/x/subscription/types/query.pb.gw.go +++ b/x/subscription/types/query.pb.gw.go @@ -195,6 +195,234 @@ func local_request_Query_NextToMonthExpiry_0(ctx context.Context, marshaler runt } +func request_Query_TrackedUsage_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubscriptionTrackedUsageRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["subscription"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subscription") + } + + protoReq.Subscription, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subscription", err) + } + + msg, err := client.TrackedUsage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TrackedUsage_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubscriptionTrackedUsageRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["subscription"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subscription") + } + + protoReq.Subscription, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subscription", err) + } + + msg, err := server.TrackedUsage(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_EstimatedRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEstimatedRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + val, ok = pathParams["amount_delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount_delegator") + } + + protoReq.AmountDelegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount_delegator", err) + } + + msg, err := client.EstimatedRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_EstimatedRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEstimatedRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["provider"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "provider") + } + + protoReq.Provider, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "provider", err) + } + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + val, ok = pathParams["amount_delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount_delegator") + } + + protoReq.AmountDelegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount_delegator", err) + } + + msg, err := server.EstimatedRewards(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_EstimatedValidatorRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEstimatedValidatorRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator") + } + + protoReq.Validator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator", err) + } + + val, ok = pathParams["amount_delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount_delegator") + } + + protoReq.AmountDelegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount_delegator", err) + } + + msg, err := client.EstimatedValidatorRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_EstimatedValidatorRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEstimatedValidatorRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator") + } + + protoReq.Validator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator", err) + } + + val, ok = pathParams["amount_delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount_delegator") + } + + protoReq.AmountDelegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount_delegator", err) + } + + msg, err := server.EstimatedValidatorRewards(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -316,6 +544,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TrackedUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TrackedUsage_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TrackedUsage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_EstimatedRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_EstimatedRewards_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EstimatedRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_EstimatedValidatorRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_EstimatedValidatorRewards_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EstimatedValidatorRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -457,6 +754,66 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TrackedUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TrackedUsage_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TrackedUsage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_EstimatedRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_EstimatedRewards_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EstimatedRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_EstimatedValidatorRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_EstimatedValidatorRewards_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EstimatedValidatorRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -470,6 +827,12 @@ var ( pattern_Query_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "subscription", "list"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_NextToMonthExpiry_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "subscription", "next_to_month_expiry"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TrackedUsage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 2}, []string{"lavanet", "lava", "subscription", "tracked_usage"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_EstimatedRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"lavanet", "lava", "subscription", "estimated_rewards", "provider", "chain_id", "amount_delegator"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_EstimatedValidatorRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"lavanet", "lava", "subscription", "estimated_validator_rewards", "validator", "amount_delegator"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -482,4 +845,10 @@ var ( forward_Query_List_0 = runtime.ForwardResponseMessage forward_Query_NextToMonthExpiry_0 = runtime.ForwardResponseMessage + + forward_Query_TrackedUsage_0 = runtime.ForwardResponseMessage + + forward_Query_EstimatedRewards_0 = runtime.ForwardResponseMessage + + forward_Query_EstimatedValidatorRewards_0 = runtime.ForwardResponseMessage ) diff --git a/x/subscription/types/subscription.pb.go b/x/subscription/types/subscription.pb.go index 7e93fab785..6b8a38539d 100644 --- a/x/subscription/types/subscription.pb.go +++ b/x/subscription/types/subscription.pb.go @@ -266,41 +266,42 @@ func init() { } var fileDescriptor_c3bc5507ca237d79 = []byte{ - // 542 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcf, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0xb6, 0xb4, 0x6b, 0xdd, 0x9f, 0xf3, 0x26, 0xe4, 0x55, 0x22, 0x54, 0x05, 0x44, 0x85, - 0x46, 0xa2, 0xb1, 0x03, 0xf7, 0x4e, 0x4c, 0xa2, 0x42, 0x08, 0x95, 0x9d, 0x38, 0x10, 0x39, 0xa9, - 0xdb, 0x46, 0x24, 0x71, 0xe5, 0xd8, 0x23, 0xfb, 0x2f, 0xf8, 0xb3, 0x76, 0x42, 0x3b, 0x72, 0x42, - 0xa8, 0xfd, 0x3b, 0x90, 0x90, 0x5f, 0xd2, 0xd0, 0x6a, 0x30, 0xb1, 0x93, 0xfd, 0xbe, 0xf7, 0x7d, - 0x7e, 0xef, 0xd9, 0x9f, 0xd1, 0x71, 0x48, 0x2f, 0x69, 0xcc, 0xa4, 0xa3, 0x57, 0x27, 0x51, 0x5e, - 0xe2, 0x8b, 0x60, 0x21, 0x03, 0x1e, 0x6f, 0x05, 0xf6, 0x42, 0x70, 0xc9, 0xf1, 0x51, 0xce, 0xb6, - 0xf5, 0x6a, 0x6f, 0x12, 0xba, 0x96, 0xcf, 0x93, 0x88, 0x27, 0x8e, 0x47, 0x13, 0xe6, 0x5c, 0x9e, - 0x78, 0x4c, 0xd2, 0x13, 0xc7, 0xe7, 0x41, 0x2e, 0xed, 0x1e, 0xce, 0xf8, 0x8c, 0xc3, 0xd6, 0xd1, - 0xbb, 0x0c, 0xed, 0xff, 0x32, 0x51, 0xe3, 0xc3, 0xc6, 0x31, 0x98, 0xa0, 0x3d, 0x5f, 0x30, 0x2a, - 0xb9, 0x20, 0x46, 0xcf, 0x18, 0xd4, 0xc6, 0xeb, 0x10, 0x77, 0x51, 0xd5, 0xe7, 0x71, 0xa2, 0x22, - 0x26, 0xc8, 0x0e, 0xa4, 0x8a, 0x18, 0x1f, 0xa2, 0xb2, 0x17, 0x72, 0xff, 0x33, 0xd9, 0xed, 0x19, - 0x03, 0x73, 0x9c, 0x05, 0xf8, 0x21, 0x42, 0x8b, 0x90, 0xc6, 0x6e, 0x10, 0x4f, 0x58, 0x4a, 0x4c, - 0xd0, 0xd4, 0x34, 0xf2, 0x46, 0x03, 0x45, 0x3a, 0x53, 0x96, 0x41, 0x09, 0xe9, 0x21, 0xa8, 0x9f, - 0xa1, 0xf6, 0x44, 0x09, 0xaa, 0xbb, 0x72, 0x3d, 0xae, 0x66, 0x73, 0x49, 0x2a, 0xc0, 0x69, 0xad, - 0xe1, 0x21, 0xa0, 0xf8, 0x31, 0x6a, 0x16, 0xc4, 0x90, 0x4d, 0x25, 0xd9, 0x03, 0x5a, 0x63, 0x0d, - 0xbe, 0x65, 0x53, 0x89, 0x9f, 0xa3, 0xfd, 0x88, 0xc7, 0x72, 0xee, 0xb2, 0x74, 0x11, 0x88, 0x2b, - 0x57, 0x06, 0x11, 0x23, 0x55, 0x20, 0xb6, 0x21, 0xf1, 0x1a, 0xf0, 0x8b, 0x20, 0x62, 0xf8, 0x09, - 0x6a, 0x65, 0x5c, 0x5f, 0xb9, 0x92, 0x4b, 0x1a, 0x12, 0x94, 0x9d, 0x08, 0xe8, 0x99, 0xba, 0xd0, - 0x18, 0xee, 0xa3, 0x66, 0xc1, 0x82, 0xb2, 0x75, 0x20, 0xd5, 0x73, 0x12, 0x54, 0xd5, 0xb7, 0x19, - 0xaa, 0x44, 0x32, 0x41, 0x9a, 0xf9, 0x6d, 0x66, 0x21, 0x7e, 0x8a, 0x8a, 0x31, 0xf2, 0x1a, 0x2d, - 0x90, 0x17, 0xa3, 0x64, 0x45, 0x3e, 0xa1, 0x83, 0xa9, 0x92, 0x4a, 0x30, 0x77, 0xf3, 0xb1, 0x49, - 0xa7, 0x67, 0x0c, 0xea, 0x2f, 0x5f, 0xd8, 0xff, 0xb4, 0x83, 0x7d, 0x0e, 0xaa, 0xcd, 0xa7, 0x1d, - 0xe3, 0xe9, 0x2d, 0x0c, 0x9f, 0xa2, 0x07, 0x54, 0x49, 0xee, 0x0a, 0x16, 0xb3, 0x2f, 0x34, 0x74, - 0x63, 0x96, 0x4a, 0x57, 0xbf, 0x01, 0xd9, 0x87, 0x7e, 0x0f, 0x74, 0x76, 0x9c, 0x25, 0xdf, 0xb1, - 0x54, 0xbe, 0x0f, 0x69, 0x8c, 0x5f, 0xa1, 0x8a, 0x2f, 0xd8, 0x24, 0x90, 0x04, 0x43, 0x1f, 0x47, - 0x76, 0xe6, 0x3d, 0x5b, 0x7b, 0xcf, 0xce, 0xbd, 0x67, 0x9f, 0xf1, 0x20, 0x1e, 0x9a, 0xd7, 0x3f, - 0x1e, 0x95, 0xc6, 0x39, 0x7d, 0x64, 0x56, 0x6b, 0x1d, 0x34, 0x32, 0xab, 0x8d, 0x4e, 0x73, 0x64, - 0x56, 0xdb, 0x9d, 0x4e, 0xff, 0x9b, 0x81, 0xf0, 0xed, 0x56, 0xef, 0x70, 0xe1, 0xb6, 0xa7, 0x76, - 0xee, 0xf6, 0xd4, 0xee, 0x7f, 0x78, 0xca, 0xfc, 0xab, 0xa7, 0xfe, 0x8c, 0x58, 0xbe, 0xd7, 0x88, - 0xc3, 0xf3, 0xeb, 0xa5, 0x65, 0xdc, 0x2c, 0x2d, 0xe3, 0xe7, 0xd2, 0x32, 0xbe, 0xae, 0xac, 0xd2, - 0xcd, 0xca, 0x2a, 0x7d, 0x5f, 0x59, 0xa5, 0x8f, 0xc7, 0xb3, 0x40, 0xce, 0x95, 0x67, 0xfb, 0x3c, - 0x72, 0xb6, 0x3e, 0x7d, 0xba, 0xfd, 0xed, 0xe5, 0xd5, 0x82, 0x25, 0x5e, 0x05, 0xfe, 0xe7, 0xe9, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x53, 0x38, 0x5f, 0x20, 0x04, 0x00, 0x00, + // 545 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x5f, 0x6f, 0xd3, 0x3e, + 0x14, 0x6d, 0xb6, 0xb4, 0x6b, 0xdd, 0xbf, 0xf3, 0xa6, 0x9f, 0xbc, 0x4a, 0xbf, 0x50, 0x15, 0x10, + 0x15, 0x82, 0x44, 0xdb, 0x1e, 0x78, 0xef, 0x04, 0xd2, 0x2a, 0x84, 0x50, 0xd9, 0x13, 0x0f, 0x44, + 0x4e, 0xea, 0xb6, 0x11, 0x49, 0x5c, 0x39, 0x76, 0xc9, 0xbe, 0x05, 0x1f, 0x6b, 0x4f, 0x68, 0x8f, + 0x3c, 0x21, 0xd4, 0x7e, 0x0e, 0x24, 0xe4, 0x9b, 0x34, 0xb4, 0x1a, 0x4c, 0xf0, 0x64, 0xdf, 0x73, + 0xcf, 0xf1, 0xbd, 0xd7, 0x3e, 0x46, 0xcf, 0x42, 0xba, 0xa4, 0x31, 0x93, 0x8e, 0x5e, 0x9d, 0x44, + 0x79, 0x89, 0x2f, 0x82, 0x85, 0x0c, 0x78, 0xbc, 0x13, 0xd8, 0x0b, 0xc1, 0x25, 0xc7, 0x27, 0x39, + 0xdb, 0xd6, 0xab, 0xbd, 0x4d, 0xe8, 0x5a, 0x3e, 0x4f, 0x22, 0x9e, 0x38, 0x1e, 0x4d, 0x98, 0xb3, + 0x3c, 0xf5, 0x98, 0xa4, 0xa7, 0x8e, 0xcf, 0x83, 0x5c, 0xda, 0x3d, 0x9e, 0xf1, 0x19, 0x87, 0xad, + 0xa3, 0x77, 0x19, 0xda, 0xff, 0x61, 0xa2, 0xc6, 0xbb, 0xad, 0x63, 0x30, 0x41, 0x07, 0xbe, 0x60, + 0x54, 0x72, 0x41, 0x8c, 0x9e, 0x31, 0xa8, 0x8d, 0x37, 0x21, 0xee, 0xa2, 0xaa, 0xcf, 0xe3, 0x44, + 0x45, 0x4c, 0x90, 0x3d, 0x48, 0x15, 0x31, 0x3e, 0x46, 0x65, 0x2f, 0xe4, 0xfe, 0x47, 0xb2, 0xdf, + 0x33, 0x06, 0xe6, 0x38, 0x0b, 0xf0, 0xff, 0x08, 0x2d, 0x42, 0x1a, 0xbb, 0x41, 0x3c, 0x61, 0x29, + 0x31, 0x41, 0x53, 0xd3, 0xc8, 0xa5, 0x06, 0x8a, 0x74, 0xa6, 0x2c, 0x83, 0x12, 0xd2, 0x43, 0x50, + 0x3f, 0x41, 0xed, 0x89, 0x12, 0x54, 0x77, 0xe5, 0x7a, 0x5c, 0xcd, 0xe6, 0x92, 0x54, 0x80, 0xd3, + 0xda, 0xc0, 0x43, 0x40, 0xf1, 0x43, 0xd4, 0x2c, 0x88, 0x21, 0x9b, 0x4a, 0x72, 0x00, 0xb4, 0xc6, + 0x06, 0x7c, 0xcd, 0xa6, 0x12, 0x3f, 0x45, 0x87, 0x11, 0x8f, 0xe5, 0xdc, 0x65, 0xe9, 0x22, 0x10, + 0xd7, 0xae, 0x0c, 0x22, 0x46, 0xaa, 0x40, 0x6c, 0x43, 0xe2, 0x25, 0xe0, 0x57, 0x41, 0xc4, 0xf0, + 0x23, 0xd4, 0xca, 0xb8, 0xbe, 0x72, 0x25, 0x97, 0x34, 0x24, 0x28, 0x3b, 0x11, 0xd0, 0x0b, 0x75, + 0xa5, 0x31, 0xdc, 0x47, 0xcd, 0x82, 0x05, 0x65, 0xeb, 0x40, 0xaa, 0xe7, 0x24, 0xa8, 0xaa, 0x6f, + 0x33, 0x54, 0x89, 0x64, 0x82, 0x34, 0xf3, 0xdb, 0xcc, 0x42, 0xfc, 0x18, 0x15, 0x63, 0xe4, 0x35, + 0x5a, 0x20, 0x2f, 0x46, 0xc9, 0x8a, 0x7c, 0x40, 0x47, 0x53, 0x25, 0x95, 0x60, 0xee, 0xf6, 0x63, + 0x93, 0x4e, 0xcf, 0x18, 0xd4, 0xcf, 0x9e, 0xdb, 0x7f, 0xb4, 0x83, 0xfd, 0x0a, 0x54, 0xdb, 0x4f, + 0x3b, 0xc6, 0xd3, 0x3b, 0x18, 0x3e, 0x47, 0xff, 0x51, 0x25, 0xb9, 0x2b, 0x58, 0xcc, 0x3e, 0xd1, + 0xd0, 0x8d, 0x59, 0x2a, 0x5d, 0xfd, 0x06, 0xe4, 0x10, 0xfa, 0x3d, 0xd2, 0xd9, 0x71, 0x96, 0x7c, + 0xc3, 0x52, 0xf9, 0x36, 0xa4, 0x31, 0x7e, 0x81, 0x2a, 0xbe, 0x60, 0x93, 0x40, 0x12, 0x0c, 0x7d, + 0x9c, 0xd8, 0x99, 0xf7, 0x6c, 0xed, 0x3d, 0x3b, 0xf7, 0x9e, 0x7d, 0xc1, 0x83, 0x78, 0x68, 0xde, + 0x7c, 0x7b, 0x50, 0x1a, 0xe7, 0xf4, 0x91, 0x59, 0xad, 0x75, 0xd0, 0xc8, 0xac, 0x36, 0x3a, 0xcd, + 0x91, 0x59, 0x6d, 0x77, 0x3a, 0xfd, 0x2f, 0x06, 0xc2, 0x77, 0x5b, 0xbd, 0xc7, 0x85, 0xbb, 0x9e, + 0xda, 0xbb, 0xdf, 0x53, 0xfb, 0x7f, 0xe1, 0x29, 0xf3, 0xb7, 0x9e, 0xfa, 0x35, 0x62, 0xf9, 0x9f, + 0x46, 0x1c, 0x5e, 0xde, 0xac, 0x2c, 0xe3, 0x76, 0x65, 0x19, 0xdf, 0x57, 0x96, 0xf1, 0x79, 0x6d, + 0x95, 0x6e, 0xd7, 0x56, 0xe9, 0xeb, 0xda, 0x2a, 0xbd, 0x77, 0x66, 0x81, 0x9c, 0x2b, 0xcf, 0xf6, + 0x79, 0xe4, 0xec, 0x7c, 0xfa, 0xe5, 0x99, 0x93, 0xee, 0xfe, 0x7c, 0x79, 0xbd, 0x60, 0x89, 0x57, + 0x81, 0x2f, 0x7a, 0xfe, 0x33, 0x00, 0x00, 0xff, 0xff, 0x46, 0xe0, 0x22, 0x71, 0x23, 0x04, 0x00, + 0x00, } func (m *Subscription) Marshal() (dAtA []byte, err error) { diff --git a/x/subscription/types/tx.pb.go b/x/subscription/types/tx.pb.go index c61435b249..7b05cfadf2 100644 --- a/x/subscription/types/tx.pb.go +++ b/x/subscription/types/tx.pb.go @@ -6,10 +6,11 @@ package types import ( context "context" fmt "fmt" + _ "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" - types "github.com/lavanet/lava/x/projects/types" + types "github.com/lavanet/lava/v2/x/projects/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -445,39 +446,42 @@ func init() { } var fileDescriptor_b1bb075a6865b817 = []byte{ - // 498 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0x8f, 0xb1, 0xeb, 0x86, 0x97, 0x02, 0xd1, 0xa9, 0x14, 0xe3, 0xc1, 0xa4, 0x66, 0x49, 0x25, - 0x64, 0x43, 0x99, 0x19, 0x1a, 0x55, 0x0c, 0xa0, 0x48, 0x95, 0xd9, 0x58, 0xa2, 0x8b, 0x7d, 0x72, - 0x02, 0xc9, 0x9d, 0x75, 0x77, 0x0e, 0xe9, 0xb7, 0x60, 0xe7, 0xeb, 0x30, 0x74, 0xec, 0xc8, 0x84, - 0x50, 0xf2, 0x45, 0x90, 0xcf, 0x76, 0x6c, 0x83, 0x52, 0x77, 0xba, 0xf7, 0xde, 0xfd, 0xde, 0xbf, - 0xdf, 0xef, 0x74, 0xe0, 0x2e, 0xf0, 0x0a, 0x53, 0x22, 0xfd, 0xec, 0xf4, 0x45, 0x3a, 0x15, 0x21, - 0x9f, 0x27, 0x72, 0xce, 0xa8, 0x2f, 0xd7, 0x5e, 0xc2, 0x99, 0x64, 0xe8, 0x79, 0x81, 0xf1, 0xb2, - 0xd3, 0xab, 0x63, 0xec, 0x97, 0x8d, 0xf4, 0x84, 0xb3, 0x2f, 0x24, 0x94, 0xa2, 0x34, 0xf2, 0x7c, - 0xfb, 0x38, 0x66, 0x31, 0x53, 0xa6, 0x9f, 0x59, 0x79, 0xd4, 0xfd, 0xa9, 0x81, 0x39, 0x16, 0xf1, - 0x28, 0xbd, 0x46, 0x16, 0x1c, 0x86, 0x9c, 0x60, 0xc9, 0xb8, 0xa5, 0x0d, 0xb4, 0xe1, 0xc3, 0xa0, - 0x74, 0x91, 0x0d, 0xdd, 0x90, 0x51, 0x91, 0x2e, 0x09, 0xb7, 0x1e, 0xa8, 0xab, 0x9d, 0x8f, 0x8e, - 0xe1, 0x60, 0x4e, 0x23, 0xb2, 0xb6, 0x74, 0x75, 0x91, 0x3b, 0x59, 0x46, 0x94, 0x72, 0x9c, 0x4d, - 0x67, 0x19, 0x03, 0x6d, 0x68, 0x04, 0x3b, 0x1f, 0x9d, 0xc2, 0x11, 0x4e, 0x25, 0x9b, 0x70, 0x42, - 0xc9, 0x37, 0xbc, 0xb0, 0xcc, 0x81, 0x36, 0xec, 0x06, 0xbd, 0x2c, 0x16, 0xe4, 0x21, 0x74, 0x06, - 0x7d, 0x1c, 0xad, 0x30, 0x0d, 0xc9, 0x24, 0x49, 0x79, 0x38, 0xc3, 0x82, 0x58, 0x87, 0x0a, 0xf6, - 0xa4, 0x88, 0x5f, 0x15, 0xe1, 0x0f, 0x46, 0xf7, 0xa0, 0x6f, 0xba, 0x7d, 0x78, 0x9c, 0x6f, 0x11, - 0x10, 0x91, 0x30, 0x2a, 0x88, 0xbb, 0x82, 0x47, 0x63, 0x11, 0x5f, 0x44, 0xd1, 0x55, 0xce, 0xc2, - 0x1d, 0xeb, 0x7d, 0x84, 0xa3, 0x82, 0xaa, 0x49, 0x84, 0x25, 0x56, 0x2b, 0xf6, 0xce, 0x5d, 0xaf, - 0x41, 0x78, 0xc9, 0xaa, 0x57, 0xd4, 0xbb, 0xc4, 0x12, 0x8f, 0x8c, 0x9b, 0xdf, 0x2f, 0x3a, 0x41, - 0x2f, 0xa9, 0x42, 0xee, 0x33, 0x78, 0xda, 0xe8, 0xbb, 0x1b, 0xe8, 0x9d, 0x1a, 0xe8, 0x92, 0x2c, - 0xda, 0x07, 0x42, 0x60, 0x50, 0xbc, 0x24, 0x05, 0xd7, 0xca, 0x2e, 0xea, 0x56, 0xe9, 0xbb, 0xba, - 0x52, 0xad, 0x7e, 0x51, 0x63, 0x6f, 0x7f, 0xe1, 0x13, 0x30, 0x09, 0xc5, 0xd3, 0x45, 0x5e, 0xba, - 0x1b, 0x14, 0x5e, 0x43, 0x60, 0x7d, 0x9f, 0xc0, 0x46, 0x4d, 0x60, 0xd7, 0x82, 0x93, 0x66, 0xd7, - 0x72, 0x9e, 0xf3, 0x1f, 0x3a, 0xe8, 0x63, 0x11, 0xa3, 0x4f, 0xa0, 0x67, 0xaf, 0xea, 0xd4, 0xdb, - 0xfb, 0x6e, 0xbd, 0x5c, 0x32, 0xfb, 0xac, 0x15, 0x52, 0x16, 0x47, 0x33, 0x80, 0x9a, 0xa4, 0xc3, - 0xbb, 0x13, 0x2b, 0xa4, 0xfd, 0xfa, 0xbe, 0xc8, 0x7a, 0xa7, 0x9a, 0x56, 0x2d, 0x9d, 0x2a, 0x64, - 0x5b, 0xa7, 0xff, 0x05, 0x44, 0x5f, 0xa1, 0x57, 0x57, 0xaf, 0x85, 0x8d, 0x1a, 0xd4, 0x7e, 0x73, - 0x6f, 0x68, 0xd9, 0x6c, 0xf4, 0xfe, 0x66, 0xe3, 0x68, 0xb7, 0x1b, 0x47, 0xfb, 0xb3, 0x71, 0xb4, - 0xef, 0x5b, 0xa7, 0x73, 0xbb, 0x75, 0x3a, 0xbf, 0xb6, 0x4e, 0xe7, 0xf3, 0xab, 0x78, 0x2e, 0x67, - 0xe9, 0xd4, 0x0b, 0xd9, 0xd2, 0x6f, 0xfc, 0x27, 0xeb, 0x7f, 0x3e, 0xa4, 0xeb, 0x84, 0x88, 0xa9, - 0xa9, 0xbe, 0x8f, 0xb7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x95, 0xe6, 0xe6, 0xba, 0x04, - 0x00, 0x00, + // 554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x8e, 0xd3, 0x30, + 0x10, 0xae, 0x69, 0xb6, 0x5b, 0xdc, 0x05, 0x8a, 0xb5, 0x3f, 0x21, 0x82, 0xd0, 0x0d, 0x97, 0x2e, + 0x87, 0x04, 0xca, 0xad, 0xb7, 0xad, 0xf6, 0x02, 0xa8, 0xd2, 0x2a, 0xdc, 0xe0, 0x50, 0xb9, 0x89, + 0x95, 0x06, 0x5a, 0x3b, 0x8a, 0x9d, 0xd2, 0xbe, 0x02, 0x27, 0x24, 0xb8, 0xf1, 0x12, 0x3c, 0xc6, + 0x1e, 0xf7, 0x88, 0x84, 0x84, 0x50, 0x7b, 0xe0, 0x35, 0x50, 0x9c, 0xa4, 0x49, 0x60, 0xbb, 0xd9, + 0x4b, 0x3c, 0x33, 0xfe, 0x3c, 0xdf, 0xe7, 0x99, 0x89, 0xa1, 0x31, 0xc5, 0x73, 0x4c, 0x89, 0xb0, + 0xe2, 0xd5, 0xe2, 0xd1, 0x98, 0x3b, 0xa1, 0x1f, 0x08, 0x9f, 0x51, 0x4b, 0x2c, 0xcc, 0x20, 0x64, + 0x82, 0xa1, 0x07, 0x29, 0xc6, 0x8c, 0x57, 0xb3, 0x88, 0xd1, 0xee, 0xe3, 0x99, 0x4f, 0x99, 0x25, + 0xbf, 0x09, 0x5a, 0x7b, 0x52, 0xca, 0x18, 0x84, 0xec, 0x3d, 0x71, 0x04, 0xcf, 0x8c, 0x14, 0xb4, + 0xef, 0x31, 0x8f, 0x49, 0xd3, 0x8a, 0xad, 0x24, 0x6a, 0xfc, 0x04, 0xb0, 0x31, 0xe4, 0xde, 0x20, + 0x5a, 0x22, 0x15, 0xee, 0x3a, 0x21, 0xc1, 0x82, 0x85, 0x2a, 0xe8, 0x80, 0xee, 0x6d, 0x3b, 0x73, + 0x91, 0x06, 0x9b, 0x0e, 0xa3, 0x3c, 0x9a, 0x91, 0x50, 0xbd, 0x25, 0xb7, 0x36, 0x3e, 0xda, 0x87, + 0x3b, 0x3e, 0x75, 0xc9, 0x42, 0xad, 0xcb, 0x8d, 0xc4, 0x89, 0x4f, 0xb8, 0x51, 0x88, 0x63, 0xc1, + 0xaa, 0xd2, 0x01, 0x5d, 0xc5, 0xde, 0xf8, 0xe8, 0x18, 0xee, 0xe1, 0x48, 0xb0, 0x51, 0x48, 0x28, + 0xf9, 0x88, 0xa7, 0x6a, 0xa3, 0x03, 0xba, 0x4d, 0xbb, 0x15, 0xc7, 0xec, 0x24, 0x84, 0x4e, 0x60, + 0x1b, 0xbb, 0x73, 0x4c, 0x1d, 0x32, 0x0a, 0xa2, 0xd0, 0x99, 0x60, 0x4e, 0xd4, 0x5d, 0x09, 0xbb, + 0x97, 0xc6, 0xcf, 0xd3, 0x70, 0xff, 0xe0, 0xd3, 0x9f, 0xef, 0x4f, 0xdb, 0xa5, 0x2a, 0x0e, 0xa2, + 0xe5, 0x2b, 0xa5, 0xb9, 0xd3, 0x6e, 0x18, 0x6d, 0x78, 0x37, 0xb9, 0x9c, 0x4d, 0x78, 0xc0, 0x28, + 0x27, 0xc6, 0x57, 0x00, 0xef, 0x0c, 0xb9, 0x77, 0xea, 0xba, 0xe7, 0x49, 0x75, 0xae, 0xb9, 0xf6, + 0x6b, 0xb8, 0x97, 0x96, 0x70, 0xe4, 0x62, 0x81, 0xe5, 0xd5, 0x5b, 0x3d, 0xc3, 0x2c, 0xf5, 0x26, + 0xab, 0xb6, 0x99, 0xe6, 0x3b, 0xc3, 0x02, 0x0f, 0x94, 0x8b, 0x5f, 0x8f, 0x6b, 0x76, 0x2b, 0xc8, + 0x43, 0xfd, 0x87, 0xb1, 0xce, 0xa3, 0x92, 0xce, 0x5c, 0x84, 0x71, 0x04, 0x0f, 0x4a, 0xaa, 0x36, + 0x7a, 0xdf, 0x49, 0xb9, 0x67, 0x64, 0x5a, 0x2d, 0x17, 0x41, 0x85, 0xe2, 0x19, 0x49, 0x3b, 0x24, + 0xed, 0xab, 0x58, 0xf3, 0x5c, 0x29, 0x6b, 0x1e, 0xd8, 0xb0, 0x7e, 0x01, 0xb2, 0x70, 0xa7, 0x85, + 0x96, 0x6c, 0xe7, 0x3d, 0x84, 0x0d, 0x42, 0xf1, 0x78, 0x9a, 0x30, 0x37, 0xed, 0xd4, 0x2b, 0x4d, + 0x4d, 0x7d, 0xdb, 0xd4, 0x28, 0x85, 0xa9, 0xe9, 0x3f, 0x8a, 0xd5, 0xaa, 0xe5, 0x1a, 0xe5, 0x12, + 0x0c, 0x15, 0x1e, 0x96, 0x45, 0x65, 0x7a, 0x7b, 0xdf, 0xea, 0xb0, 0x3e, 0xe4, 0x1e, 0x7a, 0x03, + 0xeb, 0xf1, 0x24, 0x1f, 0x9b, 0x5b, 0x7f, 0x1f, 0x33, 0x99, 0x07, 0xed, 0xa4, 0x12, 0x92, 0x25, + 0x47, 0x13, 0x08, 0x0b, 0xe3, 0xd2, 0xbd, 0xfe, 0x60, 0x8e, 0xd4, 0x9e, 0xdd, 0x14, 0x59, 0x64, + 0x2a, 0x74, 0xba, 0x82, 0x29, 0x47, 0x56, 0x31, 0xfd, 0xdf, 0x60, 0xf4, 0x01, 0xb6, 0x8a, 0xcd, + 0xad, 0xa8, 0x46, 0x01, 0xaa, 0x3d, 0xbf, 0x31, 0x34, 0x23, 0x1b, 0xbc, 0xbc, 0x58, 0xe9, 0xe0, + 0x72, 0xa5, 0x83, 0xdf, 0x2b, 0x1d, 0x7c, 0x5e, 0xeb, 0xb5, 0xcb, 0xb5, 0x5e, 0xfb, 0xb1, 0xd6, + 0x6b, 0x6f, 0x2d, 0xcf, 0x17, 0x93, 0x68, 0x6c, 0x3a, 0x6c, 0x66, 0x95, 0xde, 0xb0, 0x79, 0xcf, + 0x5a, 0xfc, 0xf3, 0x34, 0x2e, 0x03, 0xc2, 0xc7, 0x0d, 0xf9, 0x6a, 0xbd, 0xf8, 0x1b, 0x00, 0x00, + 0xff, 0xff, 0xaa, 0xd2, 0x69, 0xd2, 0x44, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/subscription/types/types.go b/x/subscription/types/types.go index a7751856fd..c84947a1d1 100644 --- a/x/subscription/types/types.go +++ b/x/subscription/types/types.go @@ -11,5 +11,5 @@ const ( DelProjectEventName = "del_project_to_subscription_event" AddTrackedCuEventName = "add_tracked_cu_event" MonthlyCuTrackerProviderRewardEventName = "monthly_cu_tracker_provider_reward" - RemainingCreditEventName = "subscription_remaining_credit" + SubscriptionPayoutEventName = "subscription_payout" ) diff --git a/x/timerstore/client/cli/query.go b/x/timerstore/client/cli/query.go index 3a43a07b9e..06602296e2 100644 --- a/x/timerstore/client/cli/query.go +++ b/x/timerstore/client/cli/query.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client" - "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/client/cli/query_all_timers.go b/x/timerstore/client/cli/query_all_timers.go index f98be0f616..75a8cab925 100644 --- a/x/timerstore/client/cli/query_all_timers.go +++ b/x/timerstore/client/cli/query_all_timers.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/client/cli/query_next.go b/x/timerstore/client/cli/query_next.go index 32bc00930b..abe4508d09 100644 --- a/x/timerstore/client/cli/query_next.go +++ b/x/timerstore/client/cli/query_next.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/client/cli/query_store_keys.go b/x/timerstore/client/cli/query_store_keys.go index f169a71539..defa2e6133 100644 --- a/x/timerstore/client/cli/query_store_keys.go +++ b/x/timerstore/client/cli/query_store_keys.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/keeper/grpc_query_all_timers.go b/x/timerstore/keeper/grpc_query_all_timers.go index c489ceea06..6cbcef6ae0 100644 --- a/x/timerstore/keeper/grpc_query_all_timers.go +++ b/x/timerstore/keeper/grpc_query_all_timers.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/timerstore/keeper/grpc_query_next.go b/x/timerstore/keeper/grpc_query_next.go index 18338acab2..f2a5fc3f87 100644 --- a/x/timerstore/keeper/grpc_query_next.go +++ b/x/timerstore/keeper/grpc_query_next.go @@ -5,8 +5,8 @@ import ( "math" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/utils/common/types" - "github.com/lavanet/lava/x/timerstore/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" + "github.com/lavanet/lava/v2/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/timerstore/keeper/grpc_query_store_keys.go b/x/timerstore/keeper/grpc_query_store_keys.go index a372373f16..9153a7bfe9 100644 --- a/x/timerstore/keeper/grpc_query_store_keys.go +++ b/x/timerstore/keeper/grpc_query_store_keys.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/timerstore/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/x/timerstore/keeper/keeper.go b/x/timerstore/keeper/keeper.go index 060cdc353f..158872f789 100644 --- a/x/timerstore/keeper/keeper.go +++ b/x/timerstore/keeper/keeper.go @@ -4,7 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - timerstoretypes "github.com/lavanet/lava/x/timerstore/types" + timerstoretypes "github.com/lavanet/lava/v2/x/timerstore/types" ) func NewKeeper(cdc codec.BinaryCodec) *Keeper { diff --git a/x/timerstore/module.go b/x/timerstore/module.go index b0183f1409..7234bf857e 100644 --- a/x/timerstore/module.go +++ b/x/timerstore/module.go @@ -8,9 +8,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/lavanet/lava/x/timerstore/client/cli" - timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper" - "github.com/lavanet/lava/x/timerstore/types" + "github.com/lavanet/lava/v2/x/timerstore/client/cli" + timerstorekeeper "github.com/lavanet/lava/v2/x/timerstore/keeper" + "github.com/lavanet/lava/v2/x/timerstore/types" "github.com/spf13/cobra" ) diff --git a/x/timerstore/types/query.pb.go b/x/timerstore/types/query.pb.go index d115031cf8..533b769e04 100644 --- a/x/timerstore/types/query.pb.go +++ b/x/timerstore/types/query.pb.go @@ -502,45 +502,45 @@ func init() { } var fileDescriptor_67348a2ef655ad3f = []byte{ - // 593 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xb6, 0x1b, 0xb7, 0xbf, 0x9f, 0xa7, 0xa0, 0x36, 0x2b, 0x68, 0xa3, 0x80, 0x4c, 0xe4, 0x82, - 0x14, 0x82, 0x64, 0x4b, 0x81, 0x03, 0xea, 0x89, 0x46, 0x95, 0x08, 0xa2, 0x42, 0xc5, 0x70, 0xe2, - 0x40, 0xe5, 0xa4, 0x5b, 0xd7, 0x8a, 0xeb, 0x4d, 0xe3, 0x0d, 0x24, 0xaa, 0xca, 0x81, 0x27, 0x40, - 0xe2, 0xc4, 0x4b, 0xf0, 0x1c, 0x3d, 0x70, 0xa8, 0xc4, 0x85, 0x13, 0x42, 0x09, 0x0f, 0xc0, 0x23, - 0xa0, 0x1d, 0x6f, 0x5c, 0xe7, 0x8f, 0x69, 0x04, 0x27, 0x8f, 0x67, 0xbf, 0xfd, 0xe6, 0x9b, 0x6f, - 0xc6, 0x86, 0x8d, 0xc0, 0x7d, 0xe3, 0x86, 0x94, 0xdb, 0xe2, 0x69, 0x73, 0xff, 0x88, 0x76, 0x22, - 0xce, 0x3a, 0xd4, 0x3e, 0xee, 0xd2, 0x4e, 0xdf, 0x6a, 0x77, 0x18, 0x67, 0x64, 0x5d, 0x82, 0x2c, - 0xf1, 0xb4, 0x2e, 0x40, 0xc5, 0x6b, 0x1e, 0xf3, 0x18, 0x62, 0x6c, 0x11, 0xc5, 0xf0, 0xe2, 0x4d, - 0x8f, 0x31, 0x2f, 0xa0, 0xb6, 0xdb, 0xf6, 0x6d, 0x37, 0x0c, 0x19, 0x77, 0xb9, 0xcf, 0xc2, 0x48, - 0x9e, 0x66, 0x56, 0xc4, 0x30, 0x06, 0x99, 0x3b, 0x70, 0xfd, 0xb9, 0x10, 0xb0, 0x15, 0x04, 0x2f, - 0x11, 0xe1, 0xd0, 0xe3, 0x2e, 0x8d, 0x38, 0xb9, 0x01, 0x3a, 0xa2, 0xf7, 0x5a, 0xb4, 0x5f, 0x50, - 0x4b, 0x6a, 0x59, 0x77, 0xfe, 0xc7, 0xc4, 0x53, 0xda, 0x27, 0x6b, 0xb0, 0xd4, 0xee, 0xd0, 0x03, - 0xbf, 0x57, 0x58, 0xc0, 0x13, 0xf9, 0x66, 0xbe, 0x03, 0x1d, 0x59, 0x9e, 0x84, 0x07, 0x8c, 0x18, - 0xa0, 0x37, 0x02, 0xd6, 0x6c, 0x89, 0x4c, 0xcc, 0x50, 0x57, 0x9c, 0x8b, 0x14, 0x31, 0x61, 0x19, - 0x5f, 0xea, 0xd4, 0xf7, 0x0e, 0x39, 0x32, 0x69, 0x75, 0xc5, 0x49, 0x27, 0xc9, 0x2a, 0xe4, 0x44, - 0xfd, 0x1c, 0x56, 0x11, 0x21, 0x21, 0xa0, 0xed, 0xbb, 0xdc, 0x2d, 0x68, 0x25, 0xb5, 0x7c, 0xc5, - 0xc1, 0xb8, 0xf6, 0x1f, 0x2c, 0xe2, 0x25, 0xf3, 0x8b, 0x0a, 0x6b, 0x93, 0xed, 0x44, 0x6d, 0x16, - 0x46, 0x94, 0xec, 0xc0, 0x4a, 0x52, 0x3a, 0x3e, 0x2a, 0xa8, 0xa5, 0x5c, 0x79, 0xb9, 0x6a, 0x5a, - 0x19, 0xa6, 0x5b, 0x49, 0x2b, 0xce, 0xe4, 0x55, 0xb2, 0x0b, 0xf9, 0x94, 0x4c, 0xc9, 0xb7, 0x30, - 0x37, 0xdf, 0xf4, 0x65, 0xd1, 0x17, 0xf7, 0x9b, 0x2d, 0xd9, 0x2a, 0xc6, 0xe6, 0xba, 0x1c, 0xce, - 0x0b, 0xe9, 0xfb, 0x68, 0x38, 0x66, 0x1d, 0xf2, 0xa3, 0xdc, 0x56, 0xb8, 0xbf, 0x8b, 0xe6, 0xff, - 0xdd, 0xc4, 0x5e, 0x4b, 0xc3, 0x52, 0x25, 0xa4, 0x61, 0xdb, 0xa0, 0xb5, 0x68, 0x7f, 0xe4, 0x52, - 0x25, 0xb3, 0xab, 0x29, 0x21, 0x35, 0xed, 0xec, 0xfb, 0x2d, 0xc5, 0xc1, 0xdb, 0xe6, 0x63, 0x58, - 0x45, 0xfe, 0x67, 0xb4, 0xc7, 0xff, 0x69, 0xb5, 0xde, 0x42, 0x3e, 0x45, 0x24, 0x35, 0x96, 0x61, - 0x25, 0xa4, 0x3d, 0x5e, 0x4b, 0xad, 0x91, 0xe0, 0xd3, 0x9c, 0xc9, 0x34, 0xb9, 0x0d, 0x57, 0x93, - 0x14, 0x2e, 0x64, 0xcc, 0x3e, 0x9e, 0x9c, 0x35, 0x84, 0xea, 0xaf, 0x1c, 0x2c, 0x62, 0x65, 0xf2, - 0x59, 0x05, 0x3d, 0x59, 0x2c, 0x62, 0x65, 0x3a, 0x32, 0xf3, 0x83, 0x2a, 0xda, 0x73, 0xe3, 0xe3, - 0xe6, 0xcc, 0x47, 0xef, 0xbf, 0xfe, 0xfc, 0xb8, 0xb0, 0x49, 0x1e, 0xda, 0x59, 0x1f, 0xb2, 0x1b, - 0x04, 0x7b, 0xf1, 0xab, 0x7d, 0x92, 0x38, 0x7a, 0x6a, 0x9f, 0xc4, 0x96, 0x9d, 0x92, 0x4f, 0x2a, - 0xe8, 0xc9, 0x60, 0x2f, 0x13, 0x3c, 0xb9, 0x64, 0x97, 0x09, 0x9e, 0xda, 0x18, 0xf3, 0x1e, 0x0a, - 0xbe, 0x43, 0x36, 0x32, 0x05, 0x27, 0x22, 0x23, 0xa1, 0x4d, 0x13, 0xb3, 0x24, 0x77, 0xff, 0x5c, - 0x26, 0xb5, 0x38, 0xc5, 0xca, 0x3c, 0x50, 0x29, 0x66, 0x13, 0xc5, 0x3c, 0x20, 0xd5, 0x4c, 0x31, - 0x62, 0xf4, 0x33, 0x7d, 0xab, 0x6d, 0x9f, 0x0d, 0x0c, 0xf5, 0x7c, 0x60, 0xa8, 0x3f, 0x06, 0x86, - 0xfa, 0x61, 0x68, 0x28, 0xe7, 0x43, 0x43, 0xf9, 0x36, 0x34, 0x94, 0x57, 0x15, 0xcf, 0xe7, 0x87, - 0xdd, 0x86, 0xd5, 0x64, 0x47, 0xe3, 0xbc, 0xbd, 0xb1, 0x1f, 0x6c, 0xbf, 0x4d, 0xa3, 0xc6, 0x12, - 0xfe, 0x61, 0xef, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x67, 0xb7, 0x03, 0x3f, 0xfa, 0x05, 0x00, - 0x00, + // 595 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xb6, 0x13, 0xb7, 0xe0, 0x29, 0xa8, 0xcd, 0x0a, 0xda, 0x28, 0x20, 0x13, 0xb9, 0x20, 0x85, + 0x22, 0xbc, 0x52, 0xe0, 0x80, 0x7a, 0xa2, 0x11, 0x52, 0x83, 0xa8, 0x50, 0x31, 0x9c, 0x38, 0x50, + 0x39, 0xe9, 0xd6, 0xb5, 0xe2, 0x7a, 0xd3, 0x78, 0x53, 0x62, 0x55, 0xe5, 0xc0, 0x13, 0x20, 0x71, + 0xe2, 0x25, 0x78, 0x8e, 0x1e, 0x38, 0x54, 0xe2, 0xc2, 0x09, 0xa1, 0x84, 0x07, 0xe0, 0x11, 0xd0, + 0xae, 0x37, 0xae, 0xf3, 0x63, 0x1a, 0xd1, 0x93, 0xc7, 0xb3, 0xdf, 0x7e, 0xf3, 0xcd, 0x37, 0x63, + 0xc3, 0xaa, 0xef, 0x1c, 0x39, 0x01, 0x61, 0x98, 0x3f, 0x31, 0xf3, 0x0e, 0x48, 0x27, 0x64, 0xb4, + 0x43, 0xf0, 0x61, 0x97, 0x74, 0x22, 0xab, 0xdd, 0xa1, 0x8c, 0xa2, 0x15, 0x09, 0xb2, 0xf8, 0xd3, + 0x3a, 0x07, 0x95, 0x6e, 0xb8, 0xd4, 0xa5, 0x02, 0x83, 0x79, 0x14, 0xc3, 0x4b, 0xb7, 0x5d, 0x4a, + 0x5d, 0x9f, 0x60, 0xa7, 0xed, 0x61, 0x27, 0x08, 0x28, 0x73, 0x98, 0x47, 0x83, 0x50, 0x9e, 0x66, + 0x56, 0x14, 0x61, 0x0c, 0x32, 0xb7, 0xe0, 0xe6, 0x2b, 0x2e, 0x60, 0xc3, 0xf7, 0xdf, 0x08, 0x84, + 0x4d, 0x0e, 0xbb, 0x24, 0x64, 0xe8, 0x16, 0xe8, 0x02, 0xbd, 0xd3, 0x22, 0x51, 0x51, 0x2d, 0xab, + 0x15, 0xdd, 0xbe, 0x2a, 0x12, 0x2f, 0x48, 0x84, 0x96, 0x61, 0xbe, 0xdd, 0x21, 0x7b, 0x5e, 0xaf, + 0x98, 0x13, 0x27, 0xf2, 0xcd, 0xfc, 0x00, 0xba, 0x60, 0x79, 0x1e, 0xec, 0x51, 0x64, 0x80, 0xde, + 0xf0, 0x69, 0xb3, 0xc5, 0x33, 0x31, 0x43, 0x5d, 0xb1, 0xcf, 0x53, 0xc8, 0x84, 0x05, 0xf1, 0x52, + 0x27, 0x9e, 0xbb, 0xcf, 0x04, 0x93, 0x56, 0x57, 0xec, 0x74, 0x12, 0x2d, 0x41, 0x9e, 0xd7, 0xcf, + 0x8b, 0x2a, 0x3c, 0x44, 0x08, 0xb4, 0x5d, 0x87, 0x39, 0x45, 0xad, 0xac, 0x56, 0xae, 0xd9, 0x22, + 0xae, 0x5d, 0x81, 0x39, 0x71, 0xc9, 0xfc, 0xa6, 0xc2, 0xf2, 0x78, 0x3b, 0x61, 0x9b, 0x06, 0x21, + 0x41, 0x5b, 0xb0, 0x98, 0x94, 0x8e, 0x8f, 0x8a, 0x6a, 0x39, 0x5f, 0x59, 0xa8, 0x9a, 0x56, 0x86, + 0xe9, 0x56, 0xd2, 0x8a, 0x3d, 0x7e, 0x15, 0x6d, 0x43, 0x21, 0x25, 0x53, 0xf2, 0xe5, 0x66, 0xe6, + 0x9b, 0xbc, 0xcc, 0xfb, 0x62, 0x5e, 0xb3, 0x25, 0x5b, 0x15, 0xb1, 0xb9, 0x22, 0x87, 0xf3, 0x5a, + 0xfa, 0x3e, 0x1c, 0x8e, 0x59, 0x87, 0xc2, 0x30, 0xb7, 0x11, 0xec, 0x6e, 0x0b, 0xf3, 0xff, 0x6f, + 0x62, 0xef, 0xa4, 0x61, 0xa9, 0x12, 0xd2, 0xb0, 0x67, 0xa0, 0xb5, 0x48, 0x34, 0x74, 0x69, 0x2d, + 0xb3, 0xab, 0x09, 0x21, 0x35, 0xed, 0xf4, 0xe7, 0x1d, 0xc5, 0x16, 0xb7, 0xcd, 0x4d, 0x58, 0x12, + 0xfc, 0x2f, 0x49, 0x8f, 0x5d, 0x6a, 0xb5, 0xde, 0x43, 0x21, 0x45, 0x24, 0x35, 0x56, 0x60, 0x31, + 0x20, 0x3d, 0x56, 0x4b, 0xad, 0x11, 0xe7, 0xd3, 0xec, 0xf1, 0x34, 0xba, 0x0b, 0xd7, 0x93, 0x94, + 0x58, 0xc8, 0x98, 0x7d, 0x34, 0x39, 0x6d, 0x08, 0xd5, 0x3f, 0x79, 0x98, 0x13, 0x95, 0xd1, 0x57, + 0x15, 0xf4, 0x64, 0xb1, 0x90, 0x95, 0xe9, 0xc8, 0xd4, 0x0f, 0xaa, 0x84, 0x67, 0xc6, 0xc7, 0xcd, + 0x99, 0x4f, 0x3f, 0x7e, 0xff, 0xfd, 0x39, 0xb7, 0x8e, 0x9e, 0xe0, 0xac, 0x0f, 0xd9, 0xf1, 0xfd, + 0x9d, 0xf8, 0x15, 0x1f, 0x27, 0x8e, 0x9e, 0xe0, 0xe3, 0xd8, 0xb2, 0x13, 0xf4, 0x45, 0x05, 0x3d, + 0x19, 0xec, 0x45, 0x82, 0xc7, 0x97, 0xec, 0x22, 0xc1, 0x13, 0x1b, 0x63, 0x3e, 0x10, 0x82, 0xef, + 0xa1, 0xd5, 0x4c, 0xc1, 0x89, 0xc8, 0x90, 0x6b, 0xd3, 0xf8, 0x2c, 0xd1, 0xfd, 0x7f, 0x97, 0x49, + 0x2d, 0x4e, 0x69, 0x6d, 0x16, 0xa8, 0x14, 0xb3, 0x2e, 0xc4, 0x3c, 0x46, 0xd5, 0x4c, 0x31, 0x7c, + 0xf4, 0x53, 0x7d, 0xab, 0x6d, 0x9e, 0xf6, 0x0d, 0xf5, 0xac, 0x6f, 0xa8, 0xbf, 0xfa, 0x86, 0xfa, + 0x69, 0x60, 0x28, 0x67, 0x03, 0x43, 0xf9, 0x31, 0x30, 0x94, 0xb7, 0x0f, 0x5d, 0x8f, 0xed, 0x77, + 0x1b, 0x56, 0x93, 0x1e, 0x8c, 0xf2, 0x1e, 0x55, 0x71, 0x6f, 0xe4, 0x1f, 0x1b, 0xb5, 0x49, 0xd8, + 0x98, 0x17, 0x3f, 0xd9, 0x47, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0d, 0xe2, 0x6d, 0xfc, 0xfd, + 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/timerstore/types/timer.go b/x/timerstore/types/timer.go index fa5990a004..d1498009dc 100644 --- a/x/timerstore/types/timer.go +++ b/x/timerstore/types/timer.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - commontypes "github.com/lavanet/lava/utils/common/types" + commontypes "github.com/lavanet/lava/v2/utils/common/types" ) // TimerStore manages timers to efficiently support future timeouts. Timeouts diff --git a/x/timerstore/types/timer.pb.go b/x/timerstore/types/timer.pb.go index a0aed40edd..495a2a7a9e 100644 --- a/x/timerstore/types/timer.pb.go +++ b/x/timerstore/types/timer.pb.go @@ -169,28 +169,28 @@ func init() { } var fileDescriptor_0bfa2b3f0d19f843 = []byte{ - // 334 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0xc1, 0x4e, 0xf2, 0x40, - 0x10, 0xc7, 0x5b, 0x28, 0xdf, 0x17, 0x97, 0x12, 0x64, 0x43, 0x62, 0xe3, 0xa1, 0x12, 0x4c, 0x0c, - 0xe1, 0xd0, 0x26, 0xfa, 0x06, 0x44, 0xa2, 0x37, 0x93, 0xa2, 0x17, 0x2f, 0x64, 0xc1, 0x49, 0xd9, - 0x00, 0xbb, 0x64, 0x77, 0x20, 0xf0, 0x16, 0x3e, 0x86, 0x8f, 0xc2, 0x91, 0xa3, 0x27, 0x63, 0xe0, - 0x45, 0xcc, 0x6e, 0x8b, 0x4a, 0x8c, 0x17, 0x4f, 0xf3, 0x9f, 0x99, 0x5f, 0xff, 0x9d, 0x9d, 0x21, - 0xe7, 0x13, 0xb6, 0x60, 0x02, 0x30, 0x36, 0x31, 0x46, 0x3e, 0x05, 0xa5, 0x51, 0x2a, 0xc8, 0x64, - 0x34, 0x53, 0x12, 0x25, 0x3d, 0xc9, 0xa1, 0xc8, 0xc4, 0xe8, 0x0b, 0x3a, 0xad, 0xa7, 0x32, 0x95, - 0x96, 0x89, 0x8d, 0xca, 0xf0, 0xe6, 0x4b, 0x81, 0xf8, 0x37, 0x20, 0x40, 0x73, 0xdd, 0x43, 0x86, - 0x40, 0x03, 0xf2, 0x7f, 0x01, 0x4a, 0x73, 0x29, 0x02, 0xb7, 0xe1, 0xb6, 0xbc, 0x64, 0x9f, 0xd2, - 0x36, 0xa9, 0x09, 0x58, 0x62, 0x7f, 0x30, 0x91, 0xc3, 0x71, 0x7f, 0x04, 0x3c, 0x1d, 0x61, 0x50, - 0xb0, 0x4c, 0xd5, 0x34, 0x3a, 0xa6, 0x7e, 0x6b, 0xcb, 0xf4, 0x82, 0x54, 0xbf, 0xb1, 0x66, 0x8a, - 0xa0, 0x68, 0xc9, 0xca, 0x27, 0x79, 0xcf, 0xa7, 0x40, 0x7b, 0xc4, 0x37, 0xcd, 0x3e, 0x08, 0x54, - 0x1c, 0x74, 0xe0, 0x35, 0x8a, 0xad, 0xf2, 0x65, 0x3b, 0xfa, 0xe5, 0x11, 0x51, 0x3e, 0xaa, 0xf9, - 0x56, 0x75, 0x05, 0xaa, 0x55, 0xc7, 0x5b, 0xbf, 0x9d, 0x39, 0x49, 0xd9, 0x30, 0xdd, 0xcc, 0x84, - 0x3e, 0x90, 0x4a, 0xf6, 0xdf, 0xbd, 0x6b, 0xe9, 0x8f, 0xae, 0xbe, 0xb5, 0xc9, 0x6d, 0x9b, 0x77, - 0xa4, 0xf6, 0x03, 0xa4, 0xc7, 0xa4, 0x38, 0x86, 0x95, 0x5d, 0xd5, 0x51, 0x62, 0x24, 0xad, 0x93, - 0xd2, 0x82, 0x4d, 0xe6, 0x90, 0xaf, 0x26, 0x4b, 0x28, 0x25, 0xde, 0x13, 0x43, 0x66, 0xb7, 0xe0, - 0x27, 0x56, 0x77, 0xae, 0xd7, 0xdb, 0xd0, 0xdd, 0x6c, 0x43, 0xf7, 0x7d, 0x1b, 0xba, 0xcf, 0xbb, - 0xd0, 0xd9, 0xec, 0x42, 0xe7, 0x75, 0x17, 0x3a, 0x8f, 0xed, 0x94, 0xe3, 0x68, 0x3e, 0x88, 0x86, - 0x72, 0x1a, 0x1f, 0x1c, 0x7d, 0x79, 0x70, 0xf6, 0xd5, 0x0c, 0xf4, 0xe0, 0x9f, 0x3d, 0xe4, 0xd5, - 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x73, 0x7e, 0x21, 0x1e, 0x02, 0x00, 0x00, + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0xc1, 0x6a, 0xf2, 0x40, + 0x10, 0xc7, 0x13, 0x8d, 0xdf, 0x47, 0xd7, 0x88, 0x75, 0x11, 0x1a, 0x7a, 0x48, 0xc5, 0x42, 0x11, + 0xa1, 0x09, 0xd8, 0x37, 0x10, 0xc4, 0xde, 0x0a, 0xb1, 0xbd, 0xf4, 0x22, 0xd1, 0x0e, 0x71, 0x51, + 0x77, 0x65, 0x77, 0x0c, 0xfa, 0x16, 0x7d, 0x8c, 0x3e, 0x8a, 0x47, 0x8f, 0x3d, 0x95, 0xa2, 0x2f, + 0x52, 0x76, 0x13, 0xdb, 0x4a, 0xe9, 0xa5, 0xa7, 0xf9, 0xcf, 0xcc, 0x2f, 0xff, 0xcc, 0xce, 0x90, + 0xcb, 0x59, 0x9c, 0xc6, 0x1c, 0x30, 0xd4, 0x31, 0x44, 0x36, 0x07, 0xa9, 0x50, 0x48, 0xc8, 0x64, + 0xb0, 0x90, 0x02, 0x05, 0x3d, 0xcb, 0xa1, 0x40, 0xc7, 0xe0, 0x0b, 0x3a, 0xaf, 0x27, 0x22, 0x11, + 0x86, 0x09, 0xb5, 0xca, 0xf0, 0xe6, 0x4b, 0x81, 0xb8, 0x7d, 0xe0, 0xa0, 0x98, 0x1a, 0x60, 0x8c, + 0x40, 0x3d, 0xf2, 0x3f, 0x05, 0xa9, 0x98, 0xe0, 0x9e, 0xdd, 0xb0, 0x5b, 0x4e, 0x74, 0x48, 0x69, + 0x9b, 0xd4, 0x38, 0xac, 0x70, 0x38, 0x9a, 0x89, 0xf1, 0x74, 0x38, 0x01, 0x96, 0x4c, 0xd0, 0x2b, + 0x18, 0xa6, 0xaa, 0x1b, 0x5d, 0x5d, 0xbf, 0x35, 0x65, 0x7a, 0x45, 0xaa, 0xdf, 0x58, 0x3d, 0x85, + 0x57, 0x34, 0x64, 0xe5, 0x93, 0xbc, 0x67, 0x73, 0xa0, 0x03, 0xe2, 0xea, 0xe6, 0x10, 0x38, 0x4a, + 0x06, 0xca, 0x73, 0x1a, 0xc5, 0x56, 0xb9, 0xd3, 0x0e, 0x7e, 0x79, 0x44, 0x90, 0x8f, 0xaa, 0xbf, + 0x95, 0x3d, 0x8e, 0x72, 0xdd, 0x75, 0x36, 0x6f, 0x17, 0x56, 0x54, 0xd6, 0x4c, 0x2f, 0x33, 0xa1, + 0x0f, 0xa4, 0x92, 0xfd, 0xf7, 0xe0, 0x5a, 0xfa, 0xa3, 0xab, 0x6b, 0x6c, 0x72, 0xdb, 0xe6, 0x1d, + 0xa9, 0xfd, 0x00, 0xe9, 0x29, 0x29, 0x4e, 0x61, 0x6d, 0x56, 0x75, 0x12, 0x69, 0x49, 0xeb, 0xa4, + 0x94, 0xc6, 0xb3, 0x25, 0xe4, 0xab, 0xc9, 0x12, 0x4a, 0x89, 0xf3, 0x14, 0x63, 0x6c, 0xb6, 0xe0, + 0x46, 0x46, 0x77, 0xfb, 0x9b, 0x9d, 0x6f, 0x6f, 0x77, 0xbe, 0xfd, 0xbe, 0xf3, 0xed, 0xe7, 0xbd, + 0x6f, 0x6d, 0xf7, 0xbe, 0xf5, 0xba, 0xf7, 0xad, 0xc7, 0xeb, 0x84, 0xe1, 0x64, 0x39, 0x0a, 0xc6, + 0x62, 0x1e, 0x1e, 0x1d, 0x3d, 0xed, 0x84, 0xab, 0xa3, 0xcb, 0xaf, 0x17, 0xa0, 0x46, 0xff, 0xcc, + 0x2d, 0x6f, 0x3e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0xf3, 0x17, 0xff, 0x21, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) {