From e37d71ad246cb47a0f00956692720bc25deeaa1e Mon Sep 17 00:00:00 2001 From: Akhil Kumar P <36399231+akhilkumarpilli@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:45:02 +0530 Subject: [PATCH 01/24] test: migrate remaining e2e tests to integration tests (#22364) Co-authored-by: Julien Robert Co-authored-by: Marko --- .github/workflows/test.yml | 33 +------------------ scripts/build/testing.mk | 8 +---- tests/Makefile | 6 ---- .../accounts/lockup/lockup_account_test.go | 11 ------- .../accounts/base_account_test.go | 0 .../lockup/continous_lockup_test_suite.go | 2 +- .../lockup/delayed_lockup_test_suite.go | 2 +- .../accounts/lockup/lockup_account_test.go | 11 +++++++ .../lockup/periodic_lockup_test_suite.go | 2 +- .../lockup/permanent_lockup_test_suite.go | 2 +- .../accounts/lockup/utils.go | 22 ++++++------- .../accounts/multisig/account_test.go | 8 ++--- .../accounts/multisig/test_suite.go | 22 ++++++------- .../accounts/wiring_test.go | 0 .../auth/keeper/account_retriever_test.go | 5 +-- .../auth/keeper/app_config.go | 0 .../auth/keeper/keeper_bench_test.go | 7 ++-- .../auth/keeper/module_test.go | 5 +-- .../tx/benchmark}/benchmarks_test.go | 16 ++++----- 19 files changed, 61 insertions(+), 101 deletions(-) delete mode 100644 tests/e2e/accounts/lockup/lockup_account_test.go rename tests/{e2e => integration}/accounts/base_account_test.go (100%) rename tests/{e2e => integration}/accounts/lockup/continous_lockup_test_suite.go (99%) rename tests/{e2e => integration}/accounts/lockup/delayed_lockup_test_suite.go (98%) create mode 100644 tests/integration/accounts/lockup/lockup_account_test.go rename tests/{e2e => integration}/accounts/lockup/periodic_lockup_test_suite.go (99%) rename tests/{e2e => integration}/accounts/lockup/permanent_lockup_test_suite.go (98%) rename tests/{e2e => integration}/accounts/lockup/utils.go (58%) rename tests/{e2e => integration}/accounts/multisig/account_test.go (97%) rename tests/{e2e => integration}/accounts/multisig/test_suite.go (72%) rename tests/{e2e => integration}/accounts/wiring_test.go (100%) rename tests/{e2e => integration}/auth/keeper/account_retriever_test.go (87%) rename tests/{e2e => integration}/auth/keeper/app_config.go (100%) rename tests/{e2e => integration}/auth/keeper/keeper_bench_test.go (92%) rename tests/{e2e => integration}/auth/keeper/module_test.go (85%) rename tests/{e2e/tx => integration/tx/benchmark}/benchmarks_test.go (93%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48c7e82a9677..2a215b89747a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -113,37 +113,6 @@ jobs: name: "${{ github.sha }}-integration-coverage" path: ./tests/integration-profile.out - test-e2e: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: "1.23" - check-latest: true - cache: true - cache-dependency-path: go.sum - - uses: technote-space/get-diff-action@v6.1.2 - id: git_diff - with: - PATTERNS: | - **/*.go - go.mod - go.sum - **/go.mod - **/go.sum - **/Makefile - Makefile - - name: e2e tests - if: env.GIT_DIFF - run: | - make test-e2e-cov - - uses: actions/upload-artifact@v3 - if: env.GIT_DIFF - with: - name: "${{ github.sha }}-e2e-coverage" - path: ./tests/e2e-profile.out - test-system: # v2 system tests are in v2-test.yml runs-on: ubuntu-latest steps: @@ -186,7 +155,7 @@ jobs: repo-analysis: runs-on: ubuntu-latest - needs: [tests, test-integration, test-e2e] + needs: [tests, test-integration] steps: - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6.1.2 diff --git a/scripts/build/testing.mk b/scripts/build/testing.mk index 8fcdcb7a61f6..2e58da7a4284 100644 --- a/scripts/build/testing.mk +++ b/scripts/build/testing.mk @@ -11,12 +11,6 @@ init-simapp-v2: #? test: Run `make test-unit` test: test-unit -#? test-e2e: Run `make -C tests test-e2e` -test-e2e: - $(MAKE) -C tests test-e2e -#? test-e2e-cov: Run `make -C tests test-e2e-cov` -test-e2e-cov: - $(MAKE) -C tests test-e2e-cov #? test-integration: Run `make -C tests test-integration` test-integration: $(MAKE) -C tests test-integration @@ -24,7 +18,7 @@ test-integration: test-integration-cov: $(MAKE) -C tests test-integration-cov #? test-all: Run all test -test-all: test-unit test-e2e test-integration test-ledger-mock test-race +test-all: test-unit test-integration test-ledger-mock test-race .PHONY: test-system test-system: build diff --git a/tests/Makefile b/tests/Makefile index 95df468c7728..04266002f7e8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,9 +3,3 @@ test-integration: test-integration-cov: go test ./integration/... -timeout 30m -coverpkg=../... -coverprofile=integration-profile.out -covermode=atomic - -test-e2e: - go test ./e2e/... -mod=readonly -timeout 30m -race -tags='e2e' - -test-e2e-cov: - go test ./e2e/... -mod=readonly -timeout 30m -race -tags='e2e' -coverpkg=../... -coverprofile=e2e-profile.out -covermode=atomic \ No newline at end of file diff --git a/tests/e2e/accounts/lockup/lockup_account_test.go b/tests/e2e/accounts/lockup/lockup_account_test.go deleted file mode 100644 index 38d4893e8606..000000000000 --- a/tests/e2e/accounts/lockup/lockup_account_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package lockup - -import ( - "testing" - - "github.com/stretchr/testify/suite" -) - -func TestE2ETestSuite(t *testing.T) { - suite.Run(t, NewE2ETestSuite()) -} diff --git a/tests/e2e/accounts/base_account_test.go b/tests/integration/accounts/base_account_test.go similarity index 100% rename from tests/e2e/accounts/base_account_test.go rename to tests/integration/accounts/base_account_test.go diff --git a/tests/e2e/accounts/lockup/continous_lockup_test_suite.go b/tests/integration/accounts/lockup/continous_lockup_test_suite.go similarity index 99% rename from tests/e2e/accounts/lockup/continous_lockup_test_suite.go rename to tests/integration/accounts/lockup/continous_lockup_test_suite.go index 654cb055f7f1..40da6a5a9ad0 100644 --- a/tests/e2e/accounts/lockup/continous_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/continous_lockup_test_suite.go @@ -16,7 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (s *E2ETestSuite) TestContinuousLockingAccount() { +func (s *IntegrationTestSuite) TestContinuousLockingAccount() { t := s.T() app := setupApp(t) currentTime := time.Now() diff --git a/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go similarity index 98% rename from tests/e2e/accounts/lockup/delayed_lockup_test_suite.go rename to tests/integration/accounts/lockup/delayed_lockup_test_suite.go index 27f7c9202e63..09aa153a468f 100644 --- a/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go @@ -16,7 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (s *E2ETestSuite) TestDelayedLockingAccount() { +func (s *IntegrationTestSuite) TestDelayedLockingAccount() { t := s.T() app := setupApp(t) currentTime := time.Now() diff --git a/tests/integration/accounts/lockup/lockup_account_test.go b/tests/integration/accounts/lockup/lockup_account_test.go new file mode 100644 index 000000000000..c8f409d7985e --- /dev/null +++ b/tests/integration/accounts/lockup/lockup_account_test.go @@ -0,0 +1,11 @@ +package lockup + +import ( + "testing" + + "github.com/stretchr/testify/suite" +) + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, NewIntegrationTestSuite()) +} diff --git a/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go similarity index 99% rename from tests/e2e/accounts/lockup/periodic_lockup_test_suite.go rename to tests/integration/accounts/lockup/periodic_lockup_test_suite.go index 0bce9a267558..f0f1937b623d 100644 --- a/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go @@ -16,7 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (s *E2ETestSuite) TestPeriodicLockingAccount() { +func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { t := s.T() app := setupApp(t) currentTime := time.Now() diff --git a/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go similarity index 98% rename from tests/e2e/accounts/lockup/permanent_lockup_test_suite.go rename to tests/integration/accounts/lockup/permanent_lockup_test_suite.go index f1d4b33f3bd5..e94107f668d8 100644 --- a/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go @@ -16,7 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (s *E2ETestSuite) TestPermanentLockingAccount() { +func (s *IntegrationTestSuite) TestPermanentLockingAccount() { t := s.T() app := setupApp(t) currentTime := time.Now() diff --git a/tests/e2e/accounts/lockup/utils.go b/tests/integration/accounts/lockup/utils.go similarity index 58% rename from tests/e2e/accounts/lockup/utils.go rename to tests/integration/accounts/lockup/utils.go index 79658d236036..a0ce8f4e0c23 100644 --- a/tests/e2e/accounts/lockup/utils.go +++ b/tests/integration/accounts/lockup/utils.go @@ -20,23 +20,23 @@ var ( accOwner = sdk.AccAddress(ownerAddr) ) -type E2ETestSuite struct { +type IntegrationTestSuite struct { suite.Suite app *simapp.SimApp } -func NewE2ETestSuite() *E2ETestSuite { - return &E2ETestSuite{} +func NewIntegrationTestSuite() *IntegrationTestSuite { + return &IntegrationTestSuite{} } -func (s *E2ETestSuite) SetupSuite() { - s.T().Log("setting up e2e test suite") +func (s *IntegrationTestSuite) SetupSuite() { + s.T().Log("setting up integration test suite") s.app = setupApp(s.T()) } -func (s *E2ETestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite") +func (s *IntegrationTestSuite) TearDownSuite() { + s.T().Log("tearing down integration test suite") } func setupApp(t *testing.T) *simapp.SimApp { @@ -45,21 +45,21 @@ func setupApp(t *testing.T) *simapp.SimApp { return app } -func (s *E2ETestSuite) executeTx(ctx sdk.Context, msg sdk.Msg, app *simapp.SimApp, accAddr, sender []byte) error { +func (s *IntegrationTestSuite) executeTx(ctx sdk.Context, msg sdk.Msg, app *simapp.SimApp, accAddr, sender []byte) error { _, err := app.AccountsKeeper.Execute(ctx, accAddr, sender, msg, nil) return err } -func (s *E2ETestSuite) queryAcc(ctx sdk.Context, req sdk.Msg, app *simapp.SimApp, accAddr []byte) (transaction.Msg, error) { +func (s *IntegrationTestSuite) queryAcc(ctx sdk.Context, req sdk.Msg, app *simapp.SimApp, accAddr []byte) (transaction.Msg, error) { resp, err := app.AccountsKeeper.Query(ctx, accAddr, req) return resp, err } -func (s *E2ETestSuite) fundAccount(app *simapp.SimApp, ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) { +func (s *IntegrationTestSuite) fundAccount(app *simapp.SimApp, ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) { require.NoError(s.T(), testutil.FundAccount(ctx, app.BankKeeper, addr, amt)) } -func (s *E2ETestSuite) queryLockupAccInfo(ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryLockupAccountInfoResponse { +func (s *IntegrationTestSuite) queryLockupAccInfo(ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryLockupAccountInfoResponse { req := &types.QueryLockupAccountInfoRequest{} resp, err := s.queryAcc(ctx, req, app, accAddr) require.NoError(s.T(), err) diff --git a/tests/e2e/accounts/multisig/account_test.go b/tests/integration/accounts/multisig/account_test.go similarity index 97% rename from tests/e2e/accounts/multisig/account_test.go rename to tests/integration/accounts/multisig/account_test.go index f3fc0c8da926..8e03674ec480 100644 --- a/tests/e2e/accounts/multisig/account_test.go +++ b/tests/integration/accounts/multisig/account_test.go @@ -18,12 +18,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func TestE2ETestSuite(t *testing.T) { - suite.Run(t, NewE2ETestSuite()) +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, NewIntegrationTestSuite()) } // TestSimpleSendProposal creates a multisig account with 1 member, sends a tx, votes and executes it. -func (s *E2ETestSuite) TestSimpleSendProposal() { +func (s *IntegrationTestSuite) TestSimpleSendProposal() { ctx := sdk.NewContext(s.app.CommitMultiStore(), false, s.app.Logger()).WithHeaderInfo(header.Info{ Time: time.Now(), }) @@ -110,7 +110,7 @@ func (s *E2ETestSuite) TestSimpleSendProposal() { // TestConfigUpdate creates a multisig with 1 member, adds 2 more members and // changes the config to require 2/3 majority (also through a proposal). -func (s *E2ETestSuite) TestConfigUpdate() { +func (s *IntegrationTestSuite) TestConfigUpdate() { ctx := sdk.NewContext(s.app.CommitMultiStore(), false, s.app.Logger()).WithHeaderInfo(header.Info{ Time: time.Now(), }) diff --git a/tests/e2e/accounts/multisig/test_suite.go b/tests/integration/accounts/multisig/test_suite.go similarity index 72% rename from tests/e2e/accounts/multisig/test_suite.go rename to tests/integration/accounts/multisig/test_suite.go index d2e6debb6de6..e22fd9ed3365 100644 --- a/tests/e2e/accounts/multisig/test_suite.go +++ b/tests/integration/accounts/multisig/test_suite.go @@ -18,7 +18,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type E2ETestSuite struct { +type IntegrationTestSuite struct { suite.Suite app *simapp.SimApp @@ -26,11 +26,11 @@ type E2ETestSuite struct { membersAddr []string } -func NewE2ETestSuite() *E2ETestSuite { - return &E2ETestSuite{} +func NewIntegrationTestSuite() *IntegrationTestSuite { + return &IntegrationTestSuite{} } -func (s *E2ETestSuite) SetupSuite() { +func (s *IntegrationTestSuite) SetupSuite() { s.app = setupApp(s.T()) s.members = []sdk.AccAddress{} @@ -43,7 +43,7 @@ func (s *E2ETestSuite) SetupSuite() { } } -func (s *E2ETestSuite) TearDownSuite() {} +func (s *IntegrationTestSuite) TearDownSuite() {} func setupApp(t *testing.T) *simapp.SimApp { t.Helper() @@ -51,23 +51,23 @@ func setupApp(t *testing.T) *simapp.SimApp { return app } -func (s *E2ETestSuite) executeTx(ctx context.Context, msg sdk.Msg, accAddr, sender []byte) error { +func (s *IntegrationTestSuite) executeTx(ctx context.Context, msg sdk.Msg, accAddr, sender []byte) error { _, err := s.app.AccountsKeeper.Execute(ctx, accAddr, sender, msg, nil) return err } -func (s *E2ETestSuite) queryAcc(ctx context.Context, req sdk.Msg, accAddr []byte) (transaction.Msg, error) { +func (s *IntegrationTestSuite) queryAcc(ctx context.Context, req sdk.Msg, accAddr []byte) (transaction.Msg, error) { resp, err := s.app.AccountsKeeper.Query(ctx, accAddr, req) return resp, err } -func (s *E2ETestSuite) fundAccount(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) { +func (s *IntegrationTestSuite) fundAccount(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) { require.NoError(s.T(), testutil.FundAccount(ctx, s.app.BankKeeper, addr, amt)) } // initAccount initializes a multisig account with the given members and powers // and returns the account address -func (s *E2ETestSuite) initAccount(ctx context.Context, sender []byte, membersPowers map[string]uint64) ([]byte, string) { +func (s *IntegrationTestSuite) initAccount(ctx context.Context, sender []byte, membersPowers map[string]uint64) ([]byte, string) { s.fundAccount(ctx, sender, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) members := []*v1.Member{} @@ -95,7 +95,7 @@ func (s *E2ETestSuite) initAccount(ctx context.Context, sender []byte, membersPo } // createProposal -func (s *E2ETestSuite) createProposal(ctx context.Context, accAddr, sender []byte, msgs ...*codectypes.Any) { +func (s *IntegrationTestSuite) createProposal(ctx context.Context, accAddr, sender []byte, msgs ...*codectypes.Any) { propReq := &v1.MsgCreateProposal{ Proposal: &v1.Proposal{ Title: "test", @@ -107,7 +107,7 @@ func (s *E2ETestSuite) createProposal(ctx context.Context, accAddr, sender []byt s.NoError(err) } -func (s *E2ETestSuite) executeProposal(ctx context.Context, accAddr, sender []byte, proposalID uint64) error { +func (s *IntegrationTestSuite) executeProposal(ctx context.Context, accAddr, sender []byte, proposalID uint64) error { execReq := &v1.MsgExecuteProposal{ ProposalId: proposalID, } diff --git a/tests/e2e/accounts/wiring_test.go b/tests/integration/accounts/wiring_test.go similarity index 100% rename from tests/e2e/accounts/wiring_test.go rename to tests/integration/accounts/wiring_test.go diff --git a/tests/e2e/auth/keeper/account_retriever_test.go b/tests/integration/auth/keeper/account_retriever_test.go similarity index 87% rename from tests/e2e/auth/keeper/account_retriever_test.go rename to tests/integration/auth/keeper/account_retriever_test.go index 7fcfcaa98c2b..68481cdebc5c 100644 --- a/tests/e2e/auth/keeper/account_retriever_test.go +++ b/tests/integration/auth/keeper/account_retriever_test.go @@ -1,16 +1,17 @@ -package keeper +package keeper_test import ( "testing" "github.com/stretchr/testify/require" + authTest "github.com/cosmos/cosmos-sdk/tests/integration/auth/keeper" "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/cosmos/cosmos-sdk/x/auth/types" ) func TestAccountRetriever(t *testing.T) { - cfg, err := network.DefaultConfigWithAppConfig(AppConfig) + cfg, err := network.DefaultConfigWithAppConfig(authTest.AppConfig) require.NoError(t, err) cfg.NumValidators = 1 diff --git a/tests/e2e/auth/keeper/app_config.go b/tests/integration/auth/keeper/app_config.go similarity index 100% rename from tests/e2e/auth/keeper/app_config.go rename to tests/integration/auth/keeper/app_config.go diff --git a/tests/e2e/auth/keeper/keeper_bench_test.go b/tests/integration/auth/keeper/keeper_bench_test.go similarity index 92% rename from tests/e2e/auth/keeper/keeper_bench_test.go rename to tests/integration/auth/keeper/keeper_bench_test.go index 345c46ae9d5d..09bde3bd7e80 100644 --- a/tests/e2e/auth/keeper/keeper_bench_test.go +++ b/tests/integration/auth/keeper/keeper_bench_test.go @@ -1,4 +1,4 @@ -package keeper +package keeper_test import ( "testing" @@ -8,6 +8,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" + authTest "github.com/cosmos/cosmos-sdk/tests/integration/auth/keeper" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -19,7 +20,7 @@ func BenchmarkAccountMapperGetAccountFound(b *testing.B) { app, err := simtestutil.Setup( depinject.Configs( depinject.Supply(log.NewNopLogger()), - AppConfig, + authTest.AppConfig, ), &accountKeeper, ) @@ -48,7 +49,7 @@ func BenchmarkAccountMapperSetAccount(b *testing.B) { app, err := simtestutil.Setup( depinject.Configs( depinject.Supply(log.NewNopLogger()), - AppConfig, + authTest.AppConfig, ), &accountKeeper) require.NoError(b, err) diff --git a/tests/e2e/auth/keeper/module_test.go b/tests/integration/auth/keeper/module_test.go similarity index 85% rename from tests/e2e/auth/keeper/module_test.go rename to tests/integration/auth/keeper/module_test.go index d9724bde6267..3937da28912c 100644 --- a/tests/e2e/auth/keeper/module_test.go +++ b/tests/integration/auth/keeper/module_test.go @@ -1,4 +1,4 @@ -package keeper +package keeper_test import ( "testing" @@ -8,6 +8,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" + authTest "github.com/cosmos/cosmos-sdk/tests/integration/auth/keeper" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -17,7 +18,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { var accountKeeper keeper.AccountKeeper app, err := simtestutil.SetupAtGenesis( depinject.Configs( - AppConfig, + authTest.AppConfig, depinject.Supply(log.NewNopLogger()), ), &accountKeeper) diff --git a/tests/e2e/tx/benchmarks_test.go b/tests/integration/tx/benchmark/benchmarks_test.go similarity index 93% rename from tests/e2e/tx/benchmarks_test.go rename to tests/integration/tx/benchmark/benchmarks_test.go index e16850f61952..4d26bc3e3d53 100644 --- a/tests/e2e/tx/benchmarks_test.go +++ b/tests/integration/tx/benchmark/benchmarks_test.go @@ -1,4 +1,4 @@ -package tx_test +package benchmark_test import ( "context" @@ -21,7 +21,7 @@ import ( authclient "github.com/cosmos/cosmos-sdk/x/auth/client" ) -type E2EBenchmarkSuite struct { +type TxBenchmarkSuite struct { cfg network.Config network network.NetworkI @@ -29,7 +29,7 @@ type E2EBenchmarkSuite struct { queryClient tx.ServiceClient } -// BenchmarkTx is lifted from E2ETestSuite from this package, with irrelevant state checks removed. +// BenchmarkTx is lifted from TestSuite from this package, with irrelevant state checks removed. // // Benchmark results: // @@ -41,7 +41,7 @@ type E2EBenchmarkSuite struct { // // BenchmarkTx-8 3772 301750 ns/op func BenchmarkTx(b *testing.B) { - s := NewE2EBenchmarkSuite(b) + s := NewTxBenchmarkSuite(b) b.Cleanup(s.Close) val := s.network.GetValidators()[0] @@ -82,10 +82,10 @@ func BenchmarkTx(b *testing.B) { } } -func NewE2EBenchmarkSuite(tb testing.TB) *E2EBenchmarkSuite { +func NewTxBenchmarkSuite(tb testing.TB) *TxBenchmarkSuite { tb.Helper() - s := new(E2EBenchmarkSuite) + s := new(TxBenchmarkSuite) cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) cfg.NumValidators = 1 @@ -151,11 +151,11 @@ func NewE2EBenchmarkSuite(tb testing.TB) *E2EBenchmarkSuite { return s } -func (s *E2EBenchmarkSuite) Close() { +func (s *TxBenchmarkSuite) Close() { s.network.Cleanup() } -func mkTxBuilder(tb testing.TB, s *E2EBenchmarkSuite) client.TxBuilder { +func mkTxBuilder(tb testing.TB, s *TxBenchmarkSuite) client.TxBuilder { tb.Helper() val := s.network.GetValidators()[0] From 94919dc99a2bfe76a8488d372893abe5d13ebc5a Mon Sep 17 00:00:00 2001 From: Akhil Kumar P <36399231+akhilkumarpilli@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:06:40 +0530 Subject: [PATCH 02/24] ci: increase test-system timeout (#22386) --- tests/systemtests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/systemtests/Makefile b/tests/systemtests/Makefile index 634f2a39e9d7..ad00d32310eb 100644 --- a/tests/systemtests/Makefile +++ b/tests/systemtests/Makefile @@ -5,7 +5,7 @@ WAIT_TIME ?= 45s all: test format test: - go test -mod=readonly -failfast -tags='system_test' ./... --wait-time=$(WAIT_TIME) --verbose $(if $(findstring v2,$(COSMOS_BUILD_OPTIONS)),--binary=simdv2) + go test -mod=readonly -failfast -timeout=15m -tags='system_test' ./... --wait-time=$(WAIT_TIME) --verbose $(if $(findstring v2,$(COSMOS_BUILD_OPTIONS)),--binary=simdv2) format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w From 6e3b2df7f905ee8faf506177e13590a2920dc88f Mon Sep 17 00:00:00 2001 From: Marko Date: Mon, 28 Oct 2024 14:08:08 +0100 Subject: [PATCH 03/24] feat(core): add a new codec to core (#22326) --- .github/dependabot.yml | 9 + .github/pr_labeler.yml | 2 + .github/workflows/test.yml | 31 +++ collections/protocodec/collections.go | 137 +++++++++++++ collections/protocodec/collections_test.go | 55 ++++++ collections/protocodec/go.mod | 55 ++++++ collections/protocodec/go.sum | 215 +++++++++++++++++++++ core/CHANGELOG.md | 1 + core/codec/codec.go | 21 ++ go.work.example | 1 + 10 files changed, 527 insertions(+) create mode 100644 collections/protocodec/collections.go create mode 100644 collections/protocodec/collections_test.go create mode 100644 collections/protocodec/go.mod create mode 100644 collections/protocodec/go.sum create mode 100644 core/codec/codec.go diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 82413815cb76..f8033e258c15 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -178,6 +178,15 @@ updates: labels: - "A:automerge" - dependencies + - package-ecosystem: gomod + directory: "/collections/protocodec" + schedule: + interval: weekly + day: friday + time: "02:20" + labels: + - "A:automerge" + - dependencies - package-ecosystem: gomod directory: "x/accounts" schedule: diff --git a/.github/pr_labeler.yml b/.github/pr_labeler.yml index b3a4ddfbe37b..8855dc2efff3 100644 --- a/.github/pr_labeler.yml +++ b/.github/pr_labeler.yml @@ -18,6 +18,8 @@ - store/**/* "C:collections": - collections/**/* +"C:collections/protocodec": + - collections/protocodec/* "C:core/testing": - core/testing/**/* "C:log": diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a215b89747a..b1762032c33b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -604,6 +604,37 @@ jobs: with: projectBaseDir: collections/ + test-collections-protocodec: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + cache: true + cache-dependency-path: collections/protocodec/go.sum + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + collections/protocodec/**/*.go + collections/protocodec/go.mod + collections/protocodec/go.sum + - name: tests + if: env.GIT_DIFF + run: | + cd collections/protocodec + go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... + - name: sonarcloud + if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: collections/protocodec + test-orm: runs-on: ubuntu-latest steps: diff --git a/collections/protocodec/collections.go b/collections/protocodec/collections.go new file mode 100644 index 000000000000..0b6c2c230f6e --- /dev/null +++ b/collections/protocodec/collections.go @@ -0,0 +1,137 @@ +package codec + +import ( + "fmt" + + "github.com/cosmos/gogoproto/proto" + gogotypes "github.com/cosmos/gogoproto/types" + "google.golang.org/protobuf/encoding/protojson" + protov2 "google.golang.org/protobuf/proto" + + "cosmossdk.io/collections" + collcodec "cosmossdk.io/collections/codec" + corecodec "cosmossdk.io/core/codec" +) + +// BoolValue implements a ValueCodec that saves the bool value +// as if it was a prototypes.BoolValue. Required for backwards +// compatibility of state. +var BoolValue collcodec.ValueCodec[bool] = boolValue{} + +type boolValue struct{} + +func (boolValue) Encode(value bool) ([]byte, error) { + return (&gogotypes.BoolValue{Value: value}).Marshal() +} + +func (boolValue) Decode(b []byte) (bool, error) { + v := new(gogotypes.BoolValue) + err := v.Unmarshal(b) + return v.Value, err +} + +func (boolValue) EncodeJSON(value bool) ([]byte, error) { + return collections.BoolValue.EncodeJSON(value) +} + +func (boolValue) DecodeJSON(b []byte) (bool, error) { + return collections.BoolValue.DecodeJSON(b) +} + +func (boolValue) Stringify(value bool) string { + return collections.BoolValue.Stringify(value) +} + +func (boolValue) ValueType() string { + return "protobuf/bool" +} + +type protoMessage[T any] interface { + *T + proto.Message +} + +// CollValue inits a collections.ValueCodec for a generic gogo protobuf message. +func CollValue[T any, PT protoMessage[T]](cdc interface { + Marshal(proto.Message) ([]byte, error) + Unmarshal([]byte, proto.Message) error +}, +) collcodec.ValueCodec[T] { + return &collValue[T, PT]{cdc.(corecodec.Codec), proto.MessageName(PT(new(T)))} +} + +type collValue[T any, PT protoMessage[T]] struct { + cdc corecodec.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 +} + +type protoMessageV2[T any] interface { + *T + protov2.Message +} + +// CollValueV2 is used for protobuf values of the newest google.golang.org/protobuf API. +func CollValueV2[T any, PT protoMessageV2[T]]() collcodec.ValueCodec[PT] { + return &collValue2[T, PT]{ + messageName: string(PT(new(T)).ProtoReflect().Descriptor().FullName()), + } +} + +type collValue2[T any, PT protoMessageV2[T]] struct { + messageName string +} + +func (c collValue2[T, PT]) Encode(value PT) ([]byte, error) { + protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} + return protov2MarshalOpts.Marshal(value) +} + +func (c collValue2[T, PT]) Decode(b []byte) (PT, error) { + var value T + err := protov2.Unmarshal(b, PT(&value)) + return &value, err +} + +func (c collValue2[T, PT]) EncodeJSON(value PT) ([]byte, error) { + return protojson.Marshal(value) +} + +func (c collValue2[T, PT]) DecodeJSON(b []byte) (PT, error) { + var value T + err := protojson.Unmarshal(b, PT(&value)) + return &value, err +} + +func (c collValue2[T, PT]) Stringify(value PT) string { + return fmt.Sprintf("%v", value) +} + +func (c collValue2[T, PT]) ValueType() string { + return "google.golang.org/protobuf/" + c.messageName +} diff --git a/collections/protocodec/collections_test.go b/collections/protocodec/collections_test.go new file mode 100644 index 000000000000..f98e3d3d7409 --- /dev/null +++ b/collections/protocodec/collections_test.go @@ -0,0 +1,55 @@ +package codec_test + +import ( + "testing" + + gogotypes "github.com/cosmos/gogoproto/types" + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/wrapperspb" + + "cosmossdk.io/collections/colltest" + codec "cosmossdk.io/collections/protocodec" +) + +func TestCollectionsCorrectness(t *testing.T) { + t.Run("CollValueV2", func(t *testing.T) { + // NOTE: we cannot use colltest.TestValueCodec because protov2 has different + // compare semantics than protov1. We need to use protocmp.Transform() alongside + // cmp to ensure equality. + encoder := codec.CollValueV2[wrapperspb.UInt64Value]() + value := &wrapperspb.UInt64Value{Value: 500} + encodedValue, err := encoder.Encode(value) + require.NoError(t, err) + decodedValue, err := encoder.Decode(encodedValue) + require.NoError(t, err) + require.True(t, cmp.Equal(value, decodedValue, protocmp.Transform()), "encoding and decoding produces different values") + + encodedJSONValue, err := encoder.EncodeJSON(value) + require.NoError(t, err) + decodedJSONValue, err := encoder.DecodeJSON(encodedJSONValue) + require.NoError(t, err) + require.True(t, cmp.Equal(value, decodedJSONValue, protocmp.Transform()), "encoding and decoding produces different values") + require.NotEmpty(t, encoder.ValueType()) + + _ = encoder.Stringify(value) + }) + + t.Run("BoolValue", func(t *testing.T) { + colltest.TestValueCodec(t, codec.BoolValue, true) + colltest.TestValueCodec(t, codec.BoolValue, false) + + // asserts produced bytes are equal + valueAssert := func(b bool) { + wantBytes, err := (&gogotypes.BoolValue{Value: b}).Marshal() + require.NoError(t, err) + gotBytes, err := codec.BoolValue.Encode(b) + require.NoError(t, err) + require.Equal(t, wantBytes, gotBytes) + } + + valueAssert(true) + valueAssert(false) + }) +} diff --git a/collections/protocodec/go.mod b/collections/protocodec/go.mod new file mode 100644 index 000000000000..69040e046041 --- /dev/null +++ b/collections/protocodec/go.mod @@ -0,0 +1,55 @@ +module cosmossdk.io/collections/protocodec + +go 1.23.2 + +require ( + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.11.1 + github.com/cosmos/gogoproto v1.7.0 + github.com/google/go-cmp v0.6.0 + github.com/stretchr/testify v1.9.0 + google.golang.org/protobuf v1.35.1 +) + +require ( + cosmossdk.io/schema v0.3.0 // indirect + github.com/DataDog/zstd v1.5.5 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v1.1.1 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cosmos/cosmos-db v1.0.2 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.2 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.20.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +// TODO: remove this once core is tagged. +replace cosmossdk.io/core => ../../core diff --git a/collections/protocodec/go.sum b/collections/protocodec/go.sum new file mode 100644 index 000000000000..fc3bee6b5be5 --- /dev/null +++ b/collections/protocodec/go.sum @@ -0,0 +1,215 @@ +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/schema v0.3.0 h1:01lcaM4trhzZ1HQTfTV8z6Ma1GziOZ/YmdzBN3F720c= +cosmossdk.io/schema v0.3.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +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 v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +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/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +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/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/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.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +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.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +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/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +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/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +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= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 62460682a648..7dceec3d9e8c 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* [#22326](https://github.com/cosmos/cosmos-sdk/pull/22326) Introduce codec package in order to facilitate removal of Cosmos SDK dependency in modules. * [*22267](https://github.com/cosmos/cosmos-sdk/pull/22267) Add `server.ConfigMap` and `server.ModuleConfigMap` to replace `server.DynamicConfig` in module configuration. ## [v1.0.0-alpha.3](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv1.0.0-alpha.3) diff --git a/core/codec/codec.go b/core/codec/codec.go new file mode 100644 index 000000000000..674be3fd688a --- /dev/null +++ b/core/codec/codec.go @@ -0,0 +1,21 @@ +package codec + +import "cosmossdk.io/core/transaction" + +// Codec defines a Binary Codec and JSON Codec for modules to encode and decode data. +type Codec interface { + BinaryCodec + JSONCodec +} + +// BinaryCodec defines a binary encoding and decoding interface for modules to encode and decode data. +type BinaryCodec interface { + Marshal(transaction.Msg) ([]byte, error) + Unmarshal([]byte, transaction.Msg) error +} + +// JSONCodec defines a JSON encoding and decoding interface for modules to encode and decode data. +type JSONCodec interface { + MarshalJSON(transaction.Msg) ([]byte, error) + UnmarshalJSON([]byte, transaction.Msg) error +} diff --git a/go.work.example b/go.work.example index ebc3f15e4f8d..d402f72de0dc 100644 --- a/go.work.example +++ b/go.work.example @@ -5,6 +5,7 @@ use ( ./api ./client/v2 ./collections + ./collections/protocodec ./core ./core/testing ./depinject From 22231f7c6d23393284fcd2ac00e6746458e6b738 Mon Sep 17 00:00:00 2001 From: Marko Date: Mon, 28 Oct 2024 14:40:42 +0100 Subject: [PATCH 04/24] refactor(x/slashing): remove extra get (#22376) --- x/slashing/keeper/infractions.go | 120 ++++++++++++++----------------- 1 file changed, 54 insertions(+), 66 deletions(-) diff --git a/x/slashing/keeper/infractions.go b/x/slashing/keeper/infractions.go index 997f854dae7d..a352f4243fef 100644 --- a/x/slashing/keeper/infractions.go +++ b/x/slashing/keeper/infractions.go @@ -137,76 +137,64 @@ func (k Keeper) HandleValidatorSignatureWithParams(ctx context.Context, params t // if we are past the minimum height and the validator has missed too many blocks, punish them if height > minHeight && signInfo.MissedBlocksCounter > maxMissed { modifiedSignInfo = true - validator, err := k.sk.ValidatorByConsAddr(ctx, consAddr) + // Downtime confirmed: slash and jail the validator + // We need to retrieve the stake distribution that signed the block. To do this, we subtract ValidatorUpdateDelay from the evidence height, + // and subtract an additional 1 since this is the LastCommit. + // Note that this *can* result in a negative "distributionHeight" of up to -ValidatorUpdateDelay-1, + // i.e. at the end of the pre-genesis block (none) = at the beginning of the genesis block. + // This is acceptable since it's only used to filter unbonding delegations & redelegations. + distributionHeight := height - sdk.ValidatorUpdateDelay - 1 + + slashFractionDowntime, err := k.SlashFractionDowntime(ctx) if err != nil { return err } - if validator != nil && !validator.IsJailed() { - // Downtime confirmed: slash and jail the validator - // We need to retrieve the stake distribution that signed the block. To do this, we subtract ValidatorUpdateDelay from the evidence height, - // and subtract an additional 1 since this is the LastCommit. - // Note that this *can* result in a negative "distributionHeight" of up to -ValidatorUpdateDelay-1, - // i.e. at the end of the pre-genesis block (none) = at the beginning of the genesis block. - // This is acceptable since it's only used to filter unbonding delegations & redelegations. - distributionHeight := height - sdk.ValidatorUpdateDelay - 1 - - slashFractionDowntime, err := k.SlashFractionDowntime(ctx) - if err != nil { - return err - } - - coinsBurned, err := k.sk.SlashWithInfractionReason(ctx, consAddr, distributionHeight, power, slashFractionDowntime, st.Infraction_INFRACTION_DOWNTIME) - if err != nil { - return err - } - - if err := k.EventService.EventManager(ctx).EmitKV( - types.EventTypeSlash, - event.NewAttribute(types.AttributeKeyAddress, consStr), - event.NewAttribute(types.AttributeKeyPower, fmt.Sprintf("%d", power)), - event.NewAttribute(types.AttributeKeyReason, types.AttributeValueMissingSignature), - event.NewAttribute(types.AttributeKeyJailed, consStr), - event.NewAttribute(types.AttributeKeyBurnedCoins, coinsBurned.String()), - ); err != nil { - return err - } - - err = k.sk.Jail(ctx, consAddr) - if err != nil { - return err - } - downtimeJailDur, err := k.DowntimeJailDuration(ctx) - if err != nil { - return err - } - signInfo.JailedUntil = k.HeaderService.HeaderInfo(ctx).Time.Add(downtimeJailDur) - - // We need to reset the counter & bitmap so that the validator won't be - // immediately slashed for downtime upon re-bonding. - // We don't set the start height as this will get correctly set - // once they bond again in the AfterValidatorBonded hook! - signInfo.MissedBlocksCounter = 0 - err = k.DeleteMissedBlockBitmap(ctx, consAddr) - if err != nil { - return err - } - - k.Logger.Info( - "slashing and jailing validator due to liveness fault", - "height", height, - "validator", consStr, - "min_height", minHeight, - "threshold", minSignedPerWindow, - "slashed", slashFractionDowntime.String(), - "jailed_until", signInfo.JailedUntil, - ) - } else { - // validator was (a) not found or (b) already jailed so we do not slash - k.Logger.Info( - "validator would have been slashed for downtime, but was either not found in store or already jailed", - "validator", consStr, - ) + + coinsBurned, err := k.sk.SlashWithInfractionReason(ctx, consAddr, distributionHeight, power, slashFractionDowntime, st.Infraction_INFRACTION_DOWNTIME) + if err != nil { + return err + } + + if err := k.EventService.EventManager(ctx).EmitKV( + types.EventTypeSlash, + event.NewAttribute(types.AttributeKeyAddress, consStr), + event.NewAttribute(types.AttributeKeyPower, fmt.Sprintf("%d", power)), + event.NewAttribute(types.AttributeKeyReason, types.AttributeValueMissingSignature), + event.NewAttribute(types.AttributeKeyJailed, consStr), + event.NewAttribute(types.AttributeKeyBurnedCoins, coinsBurned.String()), + ); err != nil { + return err + } + + err = k.sk.Jail(ctx, consAddr) + if err != nil { + return err + } + downtimeJailDur, err := k.DowntimeJailDuration(ctx) + if err != nil { + return err + } + signInfo.JailedUntil = k.HeaderService.HeaderInfo(ctx).Time.Add(downtimeJailDur) + + // We need to reset the counter & bitmap so that the validator won't be + // immediately slashed for downtime upon re-bonding. + // We don't set the start height as this will get correctly set + // once they bond again in the AfterValidatorBonded hook! + signInfo.MissedBlocksCounter = 0 + err = k.DeleteMissedBlockBitmap(ctx, consAddr) + if err != nil { + return err } + + k.Logger.Info( + "slashing and jailing validator due to liveness fault", + "height", height, + "validator", consStr, + "min_height", minHeight, + "threshold", minSignedPerWindow, + "slashed", slashFractionDowntime.String(), + "jailed_until", signInfo.JailedUntil, + ) } // Set the updated signing info From 7b9a89b5689c1faf0db8ab01fabde3ebffeb8043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Toledano?= Date: Mon, 28 Oct 2024 19:59:35 +0100 Subject: [PATCH 05/24] test(system): check feePayers signature (#22389) --- tests/systemtests/auth_test.go | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tests/systemtests/auth_test.go b/tests/systemtests/auth_test.go index 975a7909265b..feae7f4f1bee 100644 --- a/tests/systemtests/auth_test.go +++ b/tests/systemtests/auth_test.go @@ -492,3 +492,56 @@ func TestTxEncodeandDecode(t *testing.T) { decodedTx := cli.RunCommandWithArgs("tx", "decode", encodedText) require.Equal(t, gjson.Get(decodedTx, "body.memo").String(), memoText) } + +func TestTxWithFeePayer(t *testing.T) { + // Scenario: + // send a tx with FeePayer without his signature + // check tx fails + // send tx with feePayers signature + // check tx executed ok + // check fees had been deducted from feePayers balance + + sut.ResetChain(t) + cli := NewCLIWrapper(t, sut, verbose).WithRunErrorsIgnored() + + // add sender and feePayer accounts + senderAddr := cli.AddKey("sender") + sut.ModifyGenesisCLI(t, + []string{"genesis", "add-genesis-account", senderAddr, "10000000stake"}, + ) + feePayerAddr := cli.AddKey("feePayer") + sut.ModifyGenesisCLI(t, + []string{"genesis", "add-genesis-account", feePayerAddr, "10000000stake"}, + ) + + sut.StartChain(t) + + // send a tx with FeePayer without his signature + rsp := cli.RunCommandWithArgs(cli.withTXFlags( + "tx", "bank", "send", senderAddr, "cosmos108jsm625z3ejy63uef2ke7t67h6nukt4ty93nr", "1000stake", "--fees", "1000000stake", "--fee-payer", feePayerAddr, + )...) + RequireTxFailure(t, rsp, "invalid number of signatures") + + // send tx with feePayers signature + rsp = cli.RunCommandWithArgs(cli.withTXFlags( + "tx", "bank", "send", senderAddr, "cosmos108jsm625z3ejy63uef2ke7t67h6nukt4ty93nr", "1000stake", "--fees", "1000000stake", "--fee-payer", feePayerAddr, "--generate-only", + )...) + tempFile := StoreTempFile(t, []byte(rsp)) + + rsp = cli.RunCommandWithArgs(cli.withTXFlags( + "tx", "sign", tempFile.Name(), "--from", senderAddr, "--sign-mode", "amino-json", + )...) + tempFile = StoreTempFile(t, []byte(rsp)) + + rsp = cli.RunCommandWithArgs(cli.withTXFlags( + "tx", "sign", tempFile.Name(), "--from", feePayerAddr, "--sign-mode", "amino-json", + )...) + tempFile = StoreTempFile(t, []byte(rsp)) + + rsp = cli.RunAndWait([]string{"tx", "broadcast", tempFile.Name()}...) + RequireTxSuccess(t, rsp) + + // Query to check fee has been deducted from feePayer + balance := cli.QueryBalance(feePayerAddr, authTestDenom) + assert.Equal(t, balance, int64(9000000)) +} From 31f97e934e726125051e6272730538881ddccf70 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Tue, 29 Oct 2024 01:09:16 -0500 Subject: [PATCH 06/24] refactor(server/v2): eager config loading (#22267) --- .github/CODEOWNERS | 2 +- runtime/config.go | 46 +++++++ runtime/module.go | 2 + runtime/v2/app.go | 2 +- runtime/v2/builder.go | 10 +- runtime/v2/config.go | 67 +++++++++ runtime/v2/module.go | 6 +- server/v2/api/grpc/server.go | 53 ++++--- server/v2/api/grpcgateway/server.go | 41 +++--- server/v2/api/rest/server.go | 45 +++--- server/v2/api/rest/server_test.go | 4 +- server/v2/api/telemetry/server.go | 40 +++--- server/v2/cometbft/server.go | 103 ++++++++------ server/v2/command_factory.go | 185 +++++++++++++++++++++++++ server/v2/commands.go | 149 ++++++++------------ server/v2/logger.go | 37 +++-- server/v2/server.go | 30 +--- server/v2/server_mock_test.go | 8 -- server/v2/server_test.go | 12 +- server/v2/store/server.go | 21 +-- server/v2/store/snapshot.go | 6 +- server/v2/util.go | 12 +- simapp/app_di.go | 6 +- simapp/v2/app_config.go | 4 +- simapp/v2/app_di.go | 186 ++++++++++++------------- simapp/v2/app_test.go | 8 +- simapp/v2/simdv2/cmd/commands.go | 177 +++++++++++++++--------- simapp/v2/simdv2/cmd/depinject.go | 69 ++++++++++ simapp/v2/simdv2/cmd/root_di.go | 197 +++++++++------------------ simapp/v2/simdv2/cmd/root_test.go | 24 ++-- simapp/v2/simdv2/cmd/testnet.go | 14 +- simapp/v2/simdv2/cmd/testnet_test.go | 13 +- simapp/v2/simdv2/main.go | 21 ++- x/genutil/client/cli/collect.go | 7 +- x/genutil/v2/cli/commands.go | 23 +++- x/genutil/v2/cli/export.go | 13 +- x/genutil/v2/types.go | 9 -- x/upgrade/depinject.go | 30 ++-- x/validate/depinject.go | 39 ++++-- 39 files changed, 1045 insertions(+), 676 deletions(-) create mode 100644 runtime/config.go create mode 100644 runtime/v2/config.go create mode 100644 server/v2/command_factory.go create mode 100644 simapp/v2/simdv2/cmd/depinject.go diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 308c61887003..e360907353d9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -25,7 +25,7 @@ /runtime/v2/ @julienrbrt @hieuvubk @cosmos/sdk-core-dev /schema/ @aaronc @testinginprod @cosmos/sdk-core-dev /server/ @cosmos/sdk-core-dev -/server/v2/ @julienrbrt @hieuvubk @cosmos/sdk-core-dev +/server/v2/ @julienrbrt @hieuvubk @kocubinski @cosmos/sdk-core-dev /server/v2/stf/ @testinginprod @kocubinski @cosmos/sdk-core-dev /server/v2/appmanager/ @testinginprod @facundomedica @cosmos/sdk-core-dev /server/v2/cometbft/ @facundomedica @sontrinh16 @cosmos/sdk-core-dev diff --git a/runtime/config.go b/runtime/config.go new file mode 100644 index 000000000000..6474ebafbe02 --- /dev/null +++ b/runtime/config.go @@ -0,0 +1,46 @@ +package runtime + +import ( + "cosmossdk.io/core/server" + "cosmossdk.io/depinject" +) + +// ModuleConfigMaps is a map module scoped ConfigMaps +type ModuleConfigMaps map[string]server.ConfigMap + +type ModuleConfigMapsInput struct { + depinject.In + + ModuleConfigs []server.ModuleConfigMap + DynamicConfig server.DynamicConfig `optional:"true"` +} + +// ProvideModuleConfigMaps returns a map of module name to module config map. +// The module config map is a map of flag to value. +func ProvideModuleConfigMaps(in ModuleConfigMapsInput) ModuleConfigMaps { + moduleConfigMaps := make(ModuleConfigMaps) + if in.DynamicConfig == nil { + return moduleConfigMaps + } + for _, moduleConfig := range in.ModuleConfigs { + cfg := moduleConfig.Config + name := moduleConfig.Module + moduleConfigMaps[name] = make(server.ConfigMap) + for flag, df := range cfg { + val := in.DynamicConfig.Get(flag) + if val != nil { + moduleConfigMaps[name][flag] = val + } else { + moduleConfigMaps[name][flag] = df + } + } + } + return moduleConfigMaps +} + +func ProvideModuleScopedConfigMap( + key depinject.ModuleKey, + moduleConfigs ModuleConfigMaps, +) server.ConfigMap { + return moduleConfigs[key.Name()] +} diff --git a/runtime/module.go b/runtime/module.go index 773efe10a3e2..3cf7be226421 100644 --- a/runtime/module.go +++ b/runtime/module.go @@ -103,6 +103,8 @@ func init() { ProvideTransientStoreService, ProvideModuleManager, ProvideCometService, + ProvideModuleConfigMaps, + ProvideModuleScopedConfigMap, ), appconfig.Invoke(SetupAppBuilder), ) diff --git a/runtime/v2/app.go b/runtime/v2/app.go index b7887ab77f54..0c017fdcbcd9 100644 --- a/runtime/v2/app.go +++ b/runtime/v2/app.go @@ -83,7 +83,7 @@ func (a *App[T]) LoadLatestHeight() (uint64, error) { return a.db.GetLatestVersion() } -// GetQueryHandlers returns the query handlers. +// QueryHandlers returns the query handlers. func (a *App[T]) QueryHandlers() map[string]appmodulev2.Handler { return a.queryHandlers } diff --git a/runtime/v2/builder.go b/runtime/v2/builder.go index 8556e35745a8..e6e8cb7c4ea5 100644 --- a/runtime/v2/builder.go +++ b/runtime/v2/builder.go @@ -24,6 +24,7 @@ import ( type AppBuilder[T transaction.Tx] struct { app *App[T] storeBuilder root.Builder + storeConfig *root.Config // the following fields are used to overwrite the default branch func(state store.ReaderMap) store.WriterMap @@ -82,12 +83,13 @@ func (a *AppBuilder[T]) Build(opts ...AppBuilderOption[T]) (*App[T], error) { } } - a.app.db = a.storeBuilder.Get() - if a.app.db == nil { - return nil, fmt.Errorf("storeBuilder did not return a db") + var err error + a.app.db, err = a.storeBuilder.Build(a.app.logger, a.storeConfig) + if err != nil { + return nil, err } - if err := a.app.moduleManager.RegisterServices(a.app); err != nil { + if err = a.app.moduleManager.RegisterServices(a.app); err != nil { return nil, err } diff --git a/runtime/v2/config.go b/runtime/v2/config.go new file mode 100644 index 000000000000..4cddadd7be20 --- /dev/null +++ b/runtime/v2/config.go @@ -0,0 +1,67 @@ +package runtime + +import ( + "strings" + + "cosmossdk.io/core/server" + "cosmossdk.io/depinject" +) + +// GlobalConfig is a recursive configuration map containing configuration +// key-value pairs parsed from the configuration file, flags, or other +// input sources. +// +// It is aliased to server.ConfigMap so that DI can distinguish between +// module-scoped and global configuration maps. In the DI container `server.ConfigMap` +// objects are module-scoped and `GlobalConfig` is global-scoped. +type GlobalConfig server.ConfigMap + +// ModuleConfigMaps is a map module scoped ConfigMaps +type ModuleConfigMaps map[string]server.ConfigMap + +// ProvideModuleConfigMaps returns a map of module name to module config map. +// The module config map is a map of flag to value. +func ProvideModuleConfigMaps( + moduleConfigs []server.ModuleConfigMap, + globalConfig GlobalConfig, +) ModuleConfigMaps { + moduleConfigMaps := make(ModuleConfigMaps) + for _, moduleConfig := range moduleConfigs { + cfg := moduleConfig.Config + name := moduleConfig.Module + moduleConfigMaps[name] = make(server.ConfigMap) + for flag, df := range cfg { + m := globalConfig + fetchFlag := flag + // splitting on "." is required to handle nested flags which are defined + // in other modules that are not the current module + // for example: "server.minimum-gas-prices" is defined in the server module + // but required by x/validate + for _, part := range strings.Split(flag, ".") { + if maybeMap, ok := m[part]; ok { + innerMap, ok := maybeMap.(map[string]any) + if !ok { + fetchFlag = part + break + } + m = innerMap + } else { + break + } + } + if val, ok := m[fetchFlag]; ok { + moduleConfigMaps[name][flag] = val + } else { + moduleConfigMaps[name][flag] = df + } + } + } + return moduleConfigMaps +} + +func ProvideModuleScopedConfigMap( + key depinject.ModuleKey, + moduleConfigs ModuleConfigMaps, +) server.ConfigMap { + return moduleConfigs[key.Name()] +} diff --git a/runtime/v2/module.go b/runtime/v2/module.go index 54d77dc2742f..a2cca4a96337 100644 --- a/runtime/v2/module.go +++ b/runtime/v2/module.go @@ -99,6 +99,8 @@ func init() { ProvideModuleManager[transaction.Tx], ProvideEnvironment, ProvideKVService, + ProvideModuleConfigMaps, + ProvideModuleScopedConfigMap, ), appconfig.Invoke(SetupAppBuilder), ) @@ -108,6 +110,7 @@ func ProvideAppBuilder[T transaction.Tx]( interfaceRegistrar registry.InterfaceRegistrar, amino registry.AminoRegistrar, storeBuilder root.Builder, + storeConfig *root.Config, ) ( *AppBuilder[T], *stf.MsgRouterBuilder, @@ -134,7 +137,7 @@ func ProvideAppBuilder[T transaction.Tx]( queryHandlers: map[string]appmodulev2.Handler{}, storeLoader: DefaultStoreLoader, } - appBuilder := &AppBuilder[T]{app: app, storeBuilder: storeBuilder} + appBuilder := &AppBuilder[T]{app: app, storeBuilder: storeBuilder, storeConfig: storeConfig} return appBuilder, msgRouterBuilder, appModule[T]{app}, protoFiles, protoTypes } @@ -142,6 +145,7 @@ func ProvideAppBuilder[T transaction.Tx]( type AppInputs struct { depinject.In + StoreConfig *root.Config Config *runtimev2.Module AppBuilder *AppBuilder[transaction.Tx] ModuleManager *MM[transaction.Tx] diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index 10e22a514a1e..4768b74ca1c8 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -21,6 +21,7 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/log" serverv2 "cosmossdk.io/server/v2" @@ -42,40 +43,50 @@ type Server[T transaction.Tx] struct { } // New creates a new grpc server. -func New[T transaction.Tx](cfgOptions ...CfgOption) *Server[T] { - return &Server[T]{ +func New[T transaction.Tx]( + logger log.Logger, + interfaceRegistry server.InterfaceRegistry, + queryHandlers map[string]appmodulev2.Handler, + queryable interface { + Query(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error) + }, + cfg server.ConfigMap, + cfgOptions ...CfgOption, +) (*Server[T], error) { + srv := &Server[T]{ cfgOptions: cfgOptions, } -} - -// Init returns a correctly configured and initialized gRPC server. -// Note, the caller is responsible for starting the server. -func (s *Server[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logger log.Logger) error { - serverCfg := s.Config().(*Config) + serverCfg := srv.Config().(*Config) if len(cfg) > 0 { - if err := serverv2.UnmarshalSubConfig(cfg, s.Name(), &serverCfg); err != nil { - return fmt.Errorf("failed to unmarshal config: %w", err) + if err := serverv2.UnmarshalSubConfig(cfg, srv.Name(), &serverCfg); err != nil { + return nil, fmt.Errorf("failed to unmarshal config: %w", err) } } - methodsMap := appI.QueryHandlers() grpcSrv := grpc.NewServer( - grpc.ForceServerCodec(newProtoCodec(appI.InterfaceRegistry()).GRPCCodec()), + grpc.ForceServerCodec(newProtoCodec(interfaceRegistry).GRPCCodec()), grpc.MaxSendMsgSize(serverCfg.MaxSendMsgSize), grpc.MaxRecvMsgSize(serverCfg.MaxRecvMsgSize), - grpc.UnknownServiceHandler( - makeUnknownServiceHandler(methodsMap, appI), - ), + grpc.UnknownServiceHandler(makeUnknownServiceHandler(queryHandlers, queryable)), ) // Reflection allows external clients to see what services and methods the gRPC server exposes. - gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(methodsMap)), logger.With("sub-module", "grpc-reflection")) + gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) - s.grpcSrv = grpcSrv - s.config = serverCfg - s.logger = logger.With(log.ModuleKey, s.Name()) + srv.grpcSrv = grpcSrv + srv.config = serverCfg + srv.logger = logger.With(log.ModuleKey, srv.Name()) - return nil + return srv, nil +} + +// NewWithConfigOptions creates a new GRPC server with the provided config options. +// It is *not* a fully functional server (since it has been created without dependencies) +// The returned server should only be used to get and set configuration. +func NewWithConfigOptions[T transaction.Tx](opts ...CfgOption) *Server[T] { + return &Server[T]{ + cfgOptions: opts, + } } func (s *Server[T]) StartCmdFlags() *pflag.FlagSet { @@ -186,7 +197,7 @@ func (s *Server[T]) Config() any { return s.config } -func (s *Server[T]) Start(ctx context.Context) error { +func (s *Server[T]) Start(context.Context) error { if !s.config.Enable { s.logger.Info(fmt.Sprintf("%s server is disabled via config", s.Name())) return nil diff --git a/server/v2/api/grpcgateway/server.go b/server/v2/api/grpcgateway/server.go index 412c4e4ad81d..7fba8ce1be20 100644 --- a/server/v2/api/grpcgateway/server.go +++ b/server/v2/api/grpcgateway/server.go @@ -11,6 +11,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/log" serverv2 "cosmossdk.io/server/v2" @@ -34,7 +35,13 @@ type Server[T transaction.Tx] struct { } // New creates a new gRPC-gateway server. -func New[T transaction.Tx](grpcSrv *grpc.Server, ir jsonpb.AnyResolver, cfgOptions ...CfgOption) *Server[T] { +func New[T transaction.Tx]( + logger log.Logger, + config server.ConfigMap, + grpcSrv *grpc.Server, + ir jsonpb.AnyResolver, + cfgOptions ...CfgOption, +) (*Server[T], error) { // The default JSON marshaller used by the gRPC-Gateway is unable to marshal non-nullable non-scalar fields. // Using the gogo/gateway package with the gRPC-Gateway WithMarshaler option fixes the scalar field marshaling issue. marshalerOption := &gateway.JSONPb{ @@ -44,7 +51,7 @@ func New[T transaction.Tx](grpcSrv *grpc.Server, ir jsonpb.AnyResolver, cfgOptio AnyResolver: ir, } - return &Server[T]{ + s := &Server[T]{ gRPCSrv: grpcSrv, gRPCGatewayRouter: runtime.NewServeMux( // Custom marshaler option is required for gogo proto @@ -60,6 +67,20 @@ func New[T transaction.Tx](grpcSrv *grpc.Server, ir jsonpb.AnyResolver, cfgOptio ), cfgOptions: cfgOptions, } + + serverCfg := s.Config().(*Config) + if len(config) > 0 { + if err := serverv2.UnmarshalSubConfig(config, s.Name(), &serverCfg); err != nil { + return s, fmt.Errorf("failed to unmarshal config: %w", err) + } + } + + // TODO: register the gRPC-Gateway routes + + s.logger = logger.With(log.ModuleKey, s.Name()) + s.config = serverCfg + + return s, nil } func (s *Server[T]) Name() string { @@ -80,22 +101,6 @@ func (s *Server[T]) Config() any { return s.config } -func (s *Server[T]) Init(appI serverv2.AppI[transaction.Tx], cfg map[string]any, logger log.Logger) error { - serverCfg := s.Config().(*Config) - if len(cfg) > 0 { - if err := serverv2.UnmarshalSubConfig(cfg, s.Name(), &serverCfg); err != nil { - return fmt.Errorf("failed to unmarshal config: %w", err) - } - } - - // TODO: register the gRPC-Gateway routes - - s.logger = logger.With(log.ModuleKey, s.Name()) - s.config = serverCfg - - return nil -} - func (s *Server[T]) Start(ctx context.Context) error { if !s.config.Enable { s.logger.Info(fmt.Sprintf("%s server is disabled via config", s.Name())) diff --git a/server/v2/api/rest/server.go b/server/v2/api/rest/server.go index 0f2b1777973a..327ec9d0d69b 100644 --- a/server/v2/api/rest/server.go +++ b/server/v2/api/rest/server.go @@ -6,9 +6,11 @@ import ( "fmt" "net/http" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/log" serverv2 "cosmossdk.io/server/v2" + "cosmossdk.io/server/v2/appmanager" ) const ( @@ -24,31 +26,42 @@ type Server[T transaction.Tx] struct { cfgOptions []CfgOption } -func New[T transaction.Tx](cfgOptions ...CfgOption) *Server[T] { - return &Server[T]{ +func New[T transaction.Tx]( + appManager appmanager.AppManager[T], + logger log.Logger, + cfg server.ConfigMap, + cfgOptions ...CfgOption, +) (*Server[T], error) { + srv := &Server[T]{ cfgOptions: cfgOptions, + logger: logger.With(log.ModuleKey, ServerName), + router: http.NewServeMux(), } -} -func (s *Server[T]) Name() string { - return ServerName -} - -func (s *Server[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logger log.Logger) error { - s.logger = logger.With(log.ModuleKey, s.Name()) + srv.router.Handle("/", NewDefaultHandler(appManager)) - serverCfg := s.Config().(*Config) + serverCfg := srv.Config().(*Config) if len(cfg) > 0 { - if err := serverv2.UnmarshalSubConfig(cfg, s.Name(), &serverCfg); err != nil { - return fmt.Errorf("failed to unmarshal config: %w", err) + if err := serverv2.UnmarshalSubConfig(cfg, srv.Name(), &serverCfg); err != nil { + return nil, fmt.Errorf("failed to unmarshal config: %w", err) } } + srv.config = serverCfg + + return srv, nil +} - s.router = http.NewServeMux() - s.router.Handle("/", NewDefaultHandler(appI)) - s.config = serverCfg +// NewWithConfigOptions creates a new REST server with the provided config options. +// It is *not* a fully functional server (since it has been created without dependencies) +// The returned server should only be used to get and set configuration. +func NewWithConfigOptions[T transaction.Tx](opts ...CfgOption) *Server[T] { + return &Server[T]{ + cfgOptions: opts, + } +} - return nil +func (s *Server[T]) Name() string { + return ServerName } func (s *Server[T]) Start(ctx context.Context) error { diff --git a/server/v2/api/rest/server_test.go b/server/v2/api/rest/server_test.go index cec027f5d24b..3fb798979a4b 100644 --- a/server/v2/api/rest/server_test.go +++ b/server/v2/api/rest/server_test.go @@ -17,7 +17,7 @@ func TestServerConfig(t *testing.T) { { name: "Default configuration, no custom configuration", setupFunc: func() *Config { - s := New[transaction.Tx]() + s := &Server[transaction.Tx]{} return s.Config().(*Config) }, expectedConfig: DefaultConfig(), @@ -25,7 +25,7 @@ func TestServerConfig(t *testing.T) { { name: "Custom configuration", setupFunc: func() *Config { - s := New[transaction.Tx](func(config *Config) { + s := NewWithConfigOptions[transaction.Tx](func(config *Config) { config.Enable = false }) return s.Config().(*Config) diff --git a/server/v2/api/telemetry/server.go b/server/v2/api/telemetry/server.go index 411b1bda797d..42c501fe2534 100644 --- a/server/v2/api/telemetry/server.go +++ b/server/v2/api/telemetry/server.go @@ -7,6 +7,7 @@ import ( "net/http" "strings" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/log" serverv2 "cosmossdk.io/server/v2" @@ -27,8 +28,23 @@ type Server[T transaction.Tx] struct { } // New creates a new telemetry server. -func New[T transaction.Tx]() *Server[T] { - return &Server[T]{} +func New[T transaction.Tx](cfg server.ConfigMap, logger log.Logger) (*Server[T], error) { + srv := &Server[T]{} + serverCfg := srv.Config().(*Config) + if len(cfg) > 0 { + if err := serverv2.UnmarshalSubConfig(cfg, srv.Name(), &serverCfg); err != nil { + return nil, fmt.Errorf("failed to unmarshal config: %w", err) + } + } + srv.config = serverCfg + srv.logger = logger.With(log.ModuleKey, srv.Name()) + + metrics, err := NewMetrics(srv.config) + if err != nil { + return nil, fmt.Errorf("failed to initialize metrics: %w", err) + } + srv.metrics = metrics + return srv, nil } // Name returns the server name. @@ -44,26 +60,6 @@ func (s *Server[T]) Config() any { return s.config } -// Init implements serverv2.ServerComponent. -func (s *Server[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logger log.Logger) error { - serverCfg := s.Config().(*Config) - if len(cfg) > 0 { - if err := serverv2.UnmarshalSubConfig(cfg, s.Name(), &serverCfg); err != nil { - return fmt.Errorf("failed to unmarshal config: %w", err) - } - } - s.config = serverCfg - s.logger = logger.With(log.ModuleKey, s.Name()) - - metrics, err := NewMetrics(s.config) - if err != nil { - return fmt.Errorf("failed to initialize metrics: %w", err) - } - s.metrics = metrics - - return nil -} - func (s *Server[T]) Start(ctx context.Context) error { if !s.config.Enable { s.logger.Info(fmt.Sprintf("%s server is disabled via config", s.Name())) diff --git a/server/v2/cometbft/server.go b/server/v2/cometbft/server.go index 1ad285bb99e7..33f7a31f1ca5 100644 --- a/server/v2/cometbft/server.go +++ b/server/v2/cometbft/server.go @@ -18,12 +18,17 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" + appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/log" + "cosmossdk.io/schema/decoding" "cosmossdk.io/schema/indexer" serverv2 "cosmossdk.io/server/v2" + "cosmossdk.io/server/v2/appmanager" cometlog "cosmossdk.io/server/v2/cometbft/log" "cosmossdk.io/server/v2/cometbft/mempool" + "cosmossdk.io/server/v2/cometbft/types" "cosmossdk.io/store/v2/snapshots" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" @@ -49,34 +54,39 @@ type CometBFTServer[T transaction.Tx] struct { } func New[T transaction.Tx]( + logger log.Logger, + appName string, + store types.Store, + appManager appmanager.AppManager[T], + queryHandlers map[string]appmodulev2.Handler, + decoderResolver decoding.DecoderResolver, txCodec transaction.Codec[T], + cfg server.ConfigMap, serverOptions ServerOptions[T], cfgOptions ...CfgOption, -) *CometBFTServer[T] { - return &CometBFTServer[T]{ +) (*CometBFTServer[T], error) { + srv := &CometBFTServer[T]{ initTxCodec: txCodec, serverOptions: serverOptions, cfgOptions: cfgOptions, } -} -func (s *CometBFTServer[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logger log.Logger) error { home, _ := cfg[serverv2.FlagHome].(string) // get configs (app.toml + config.toml) from viper - appTomlConfig := s.Config().(*AppTomlConfig) + appTomlConfig := srv.Config().(*AppTomlConfig) configTomlConfig := cmtcfg.DefaultConfig().SetRoot(home) if len(cfg) > 0 { - if err := serverv2.UnmarshalSubConfig(cfg, s.Name(), &appTomlConfig); err != nil { - return fmt.Errorf("failed to unmarshal config: %w", err) + if err := serverv2.UnmarshalSubConfig(cfg, srv.Name(), &appTomlConfig); err != nil { + return nil, fmt.Errorf("failed to unmarshal config: %w", err) } if err := serverv2.UnmarshalSubConfig(cfg, "", &configTomlConfig); err != nil { - return fmt.Errorf("failed to unmarshal config: %w", err) + return nil, fmt.Errorf("failed to unmarshal config: %w", err) } } - s.config = Config{ + srv.config = Config{ ConfigTomlConfig: configTomlConfig, AppTomlConfig: appTomlConfig, } @@ -96,59 +106,68 @@ func (s *CometBFTServer[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logg } } - indexEvents := make(map[string]struct{}, len(s.config.AppTomlConfig.IndexEvents)) - for _, e := range s.config.AppTomlConfig.IndexEvents { + indexEvents := make(map[string]struct{}, len(srv.config.AppTomlConfig.IndexEvents)) + for _, e := range srv.config.AppTomlConfig.IndexEvents { indexEvents[e] = struct{}{} } - s.logger = logger.With(log.ModuleKey, s.Name()) - rs := appI.Store() + srv.logger = logger.With(log.ModuleKey, srv.Name()) consensus := NewConsensus( - s.logger, - appI.Name(), - appI, - appI.Close, - s.serverOptions.Mempool(cfg), + logger, + appName, + appManager, + nil, + srv.serverOptions.Mempool(cfg), indexEvents, - appI.QueryHandlers(), - rs, - s.config, - s.initTxCodec, + queryHandlers, + store, + srv.config, + srv.initTxCodec, chainID, ) - consensus.prepareProposalHandler = s.serverOptions.PrepareProposalHandler - consensus.processProposalHandler = s.serverOptions.ProcessProposalHandler - consensus.checkTxHandler = s.serverOptions.CheckTxHandler - consensus.verifyVoteExt = s.serverOptions.VerifyVoteExtensionHandler - consensus.extendVote = s.serverOptions.ExtendVoteHandler - consensus.addrPeerFilter = s.serverOptions.AddrPeerFilter - consensus.idPeerFilter = s.serverOptions.IdPeerFilter - - ss := rs.GetStateStorage().(snapshots.StorageSnapshotter) - sc := rs.GetStateCommitment().(snapshots.CommitSnapshotter) - - snapshotStore, err := GetSnapshotStore(s.config.ConfigTomlConfig.RootDir) + consensus.prepareProposalHandler = srv.serverOptions.PrepareProposalHandler + consensus.processProposalHandler = srv.serverOptions.ProcessProposalHandler + consensus.checkTxHandler = srv.serverOptions.CheckTxHandler + consensus.verifyVoteExt = srv.serverOptions.VerifyVoteExtensionHandler + consensus.extendVote = srv.serverOptions.ExtendVoteHandler + consensus.addrPeerFilter = srv.serverOptions.AddrPeerFilter + consensus.idPeerFilter = srv.serverOptions.IdPeerFilter + + ss := store.GetStateStorage().(snapshots.StorageSnapshotter) + sc := store.GetStateCommitment().(snapshots.CommitSnapshotter) + + snapshotStore, err := GetSnapshotStore(srv.config.ConfigTomlConfig.RootDir) if err != nil { - return err + return nil, err } - consensus.snapshotManager = snapshots.NewManager(snapshotStore, s.serverOptions.SnapshotOptions(cfg), sc, ss, nil, s.logger) + consensus.snapshotManager = snapshots.NewManager( + snapshotStore, srv.serverOptions.SnapshotOptions(cfg), sc, ss, nil, logger) + + srv.Consensus = consensus // initialize the indexer - if indexerCfg := s.config.AppTomlConfig.Indexer; len(indexerCfg.Target) > 0 { + if indexerCfg := srv.config.AppTomlConfig.Indexer; len(indexerCfg.Target) > 0 { listener, err := indexer.StartIndexing(indexer.IndexingOptions{ Config: indexerCfg, - Resolver: appI.SchemaDecoderResolver(), - Logger: s.logger.With(log.ModuleKey, "indexer"), + Resolver: decoderResolver, + Logger: logger.With(log.ModuleKey, "indexer"), }) if err != nil { - return fmt.Errorf("failed to start indexing: %w", err) + return nil, fmt.Errorf("failed to start indexing: %w", err) } consensus.listener = &listener.Listener } - s.Consensus = consensus + return srv, nil +} - return nil +// NewWithConfigOptions creates a new CometBFT server with the provided config options. +// It is *not* a fully functional server (since it has been created without dependencies) +// The returned server should only be used to get and set configuration. +func NewWithConfigOptions[T transaction.Tx](opts ...CfgOption) *CometBFTServer[T] { + return &CometBFTServer[T]{ + cfgOptions: opts, + } } func (s *CometBFTServer[T]) Name() string { diff --git a/server/v2/command_factory.go b/server/v2/command_factory.go new file mode 100644 index 000000000000..a9f544a2f3b8 --- /dev/null +++ b/server/v2/command_factory.go @@ -0,0 +1,185 @@ +package serverv2 + +import ( + "errors" + "io" + "os" + "path/filepath" + "strings" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/spf13/viper" + + "cosmossdk.io/core/server" + "cosmossdk.io/log" +) + +// CommandFactory is a factory help create server/v2 root commands. +// For example usage see simapp/v2/cmd/root_di.go +type CommandFactory struct { + defaultHomeDir string + envPrefix string + configWriter ConfigWriter + loggerFactory func(server.ConfigMap, io.Writer) (log.Logger, error) + + logger log.Logger + // TODO remove this field + // this viper handle is kept because certain commands in server/v2 fetch a viper instance + // from the command context in order to read the config. + // After merging #22267 this is no longer required, and server.ConfigMap can be used instead. + // See issue #22388 + vipr *viper.Viper +} + +type CommandFactoryOption func(*CommandFactory) error + +// NewCommandFactory creates a new CommandFactory with the given options. +func NewCommandFactory(opts ...CommandFactoryOption) (*CommandFactory, error) { + f := &CommandFactory{} + for _, opt := range opts { + err := opt(f) + if err != nil { + return nil, err + } + } + return f, nil +} + +// WithEnvPrefix sets the environment variable prefix for the command factory. +func WithEnvPrefix(envPrefix string) CommandFactoryOption { + return func(f *CommandFactory) error { + f.envPrefix = envPrefix + return nil + } +} + +// WithStdDefaultHomeDir sets the server's default home directory `user home directory`/`defaultHomeBasename`. +func WithStdDefaultHomeDir(defaultHomeBasename string) CommandFactoryOption { + return func(f *CommandFactory) error { + // get the home directory from the environment variable + // to not clash with the $HOME system variable, when no prefix is set + // we check the NODE_HOME environment variable + homeDir, envHome := "", "HOME" + if len(f.envPrefix) > 0 { + homeDir = os.Getenv(f.envPrefix + "_" + envHome) + } else { + homeDir = os.Getenv("NODE_" + envHome) + } + if homeDir != "" { + f.defaultHomeDir = filepath.Clean(homeDir) + return nil + } + + // get user home directory + userHomeDir, err := os.UserHomeDir() + if err != nil { + return err + } + + f.defaultHomeDir = filepath.Join(userHomeDir, defaultHomeBasename) + return nil + } +} + +// WithDefaultHomeDir sets the server's default home directory. +func WithDefaultHomeDir(homedir string) CommandFactoryOption { + return func(f *CommandFactory) error { + f.defaultHomeDir = homedir + return nil + } +} + +// WithConfigWriter sets the config writer for the command factory. +// If set the config writer will be used to write TOML config files during ParseCommand invocations. +func WithConfigWriter(configWriter ConfigWriter) CommandFactoryOption { + return func(f *CommandFactory) error { + f.configWriter = configWriter + return nil + } +} + +// WithLoggerFactory sets the logger factory for the command factory. +func WithLoggerFactory(loggerFactory func(server.ConfigMap, io.Writer) (log.Logger, error)) CommandFactoryOption { + return func(f *CommandFactory) error { + f.loggerFactory = loggerFactory + return nil + } +} + +// enhanceCommand adds the following flags to the command: +// +// --log-level: The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:,:') +// --log-format: The logging format (json|plain) +// --log-no-color: Disable colored logs +// --home: directory for config and data +// +// It also sets the environment variable prefix for the viper instance. +func (f *CommandFactory) enhanceCommand(cmd *cobra.Command) { + pflags := cmd.PersistentFlags() + pflags.String(FlagLogLevel, "info", "The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:,:')") + pflags.String(FlagLogFormat, "plain", "The logging format (json|plain)") + pflags.Bool(FlagLogNoColor, false, "Disable colored logs") + pflags.StringP(FlagHome, "", f.defaultHomeDir, "directory for config and data") + viper.SetEnvPrefix(f.envPrefix) + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) + viper.AutomaticEnv() +} + +// EnhanceRootCommand sets the viper and logger in the command context. +func (f *CommandFactory) EnhanceRootCommand(cmd *cobra.Command) { + f.enhanceCommand(cmd) + SetCmdServerContext(cmd, f.vipr, f.logger) +} + +// ParseCommand parses args against the input rootCmd CLI skeleton then returns the target subcommand, +// a fully realized config map, and a properly configured logger. +// If `WithConfigWriter` was set in the factory options, the config writer will be used to write the app.toml file. +// Internally a viper instance is created and used to bind the flags to the config map. +// Future invocations of EnhanceCommandContext will set the viper instance and logger in the command context. +func (f *CommandFactory) ParseCommand( + rootCmd *cobra.Command, + args []string, +) (*cobra.Command, server.ConfigMap, log.Logger, error) { + f.enhanceCommand(rootCmd) + cmd, _, err := rootCmd.Traverse(args) + if err != nil { + return nil, nil, nil, err + } + if err = cmd.ParseFlags(args); err != nil { + // help requested, return the command early + if errors.Is(err, pflag.ErrHelp) { + return cmd, nil, nil, nil + } + return nil, nil, nil, err + } + home, err := cmd.Flags().GetString(FlagHome) + if err != nil { + return nil, nil, nil, err + } + configDir := filepath.Join(home, "config") + if f.configWriter != nil { + // create app.toml if it does not already exist + if _, err = os.Stat(filepath.Join(configDir, "app.toml")); os.IsNotExist(err) { + if err = f.configWriter.WriteConfig(configDir); err != nil { + return nil, nil, nil, err + } + } + } + f.vipr, err = ReadConfig(configDir) + if err != nil { + return nil, nil, nil, err + } + if err = f.vipr.BindPFlags(cmd.Flags()); err != nil { + return nil, nil, nil, err + } + + if f.loggerFactory != nil { + f.logger, err = f.loggerFactory(f.vipr.AllSettings(), cmd.OutOrStdout()) + if err != nil { + return nil, nil, nil, err + } + } + + return cmd, f.vipr.AllSettings(), f.logger, nil +} diff --git a/server/v2/commands.go b/server/v2/commands.go index c64fbc1f0de4..aab0e8eb3667 100644 --- a/server/v2/commands.go +++ b/server/v2/commands.go @@ -5,68 +5,33 @@ import ( "errors" "os" "os/signal" - "path/filepath" "runtime/pprof" + "slices" "strings" "syscall" "github.com/spf13/cobra" - "github.com/spf13/viper" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/log" ) -// Execute executes the root command of an application. -// It handles adding core CLI flags, specifically the logging flags. -func Execute(rootCmd *cobra.Command, envPrefix, defaultHome string) error { - rootCmd.PersistentFlags().String(FlagLogLevel, "info", "The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:,:')") - rootCmd.PersistentFlags().String(FlagLogFormat, "plain", "The logging format (json|plain)") - rootCmd.PersistentFlags().Bool(FlagLogNoColor, false, "Disable colored logs") - rootCmd.PersistentFlags().StringP(FlagHome, "", defaultHome, "directory for config and data") - - // update the global viper with the root command's configuration - viper.SetEnvPrefix(envPrefix) - viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) - viper.AutomaticEnv() - - return rootCmd.Execute() -} - // AddCommands add the server commands to the root command // It configures the config handling and the logger handling func AddCommands[T transaction.Tx]( rootCmd *cobra.Command, - newApp AppCreator[T], - globalServerCfg ServerConfig, + logger log.Logger, + globalAppConfig server.ConfigMap, + globalServerConfig ServerConfig, components ...ServerComponent[T], -) error { +) (ConfigWriter, error) { if len(components) == 0 { - return errors.New("no components provided") - } - - server := NewServer(globalServerCfg, components...) - originalPersistentPreRunE := rootCmd.PersistentPreRunE - rootCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error { - // set the default command outputs - cmd.SetOut(cmd.OutOrStdout()) - cmd.SetErr(cmd.ErrOrStderr()) - - if err := configHandle(server, cmd); err != nil { - return err - } - - // call the original PersistentPreRun(E) if it exists - if rootCmd.PersistentPreRun != nil { - rootCmd.PersistentPreRun(cmd, args) - return nil - } - - return originalPersistentPreRunE(cmd, args) + return nil, errors.New("no components provided") } - - cmds := server.CLICommands() - startCmd := createStartCommand(server, newApp) + srv := NewServer(globalServerConfig, components...) + cmds := srv.CLICommands() + startCmd := createStartCommand(srv, globalAppConfig, logger) startCmd.SetContext(rootCmd.Context()) cmds.Commands = append(cmds.Commands, startCmd) rootCmd.AddCommand(cmds.Commands...) @@ -92,13 +57,14 @@ func AddCommands[T transaction.Tx]( } } - return nil + return srv, nil } // createStartCommand creates the start command for the application. func createStartCommand[T transaction.Tx]( server *Server[T], - newApp AppCreator[T], + config server.ConfigMap, + logger log.Logger, ) *cobra.Command { flags := server.StartFlags() @@ -106,16 +72,6 @@ func createStartCommand[T transaction.Tx]( Use: "start", Short: "Run the application", RunE: func(cmd *cobra.Command, args []string) error { - v := GetViperFromCmd(cmd) - l := GetLoggerFromCmd(cmd) - if err := v.BindPFlags(cmd.Flags()); err != nil { - return err - } - - if err := server.Init(newApp(l, v), v.AllSettings(), l); err != nil { - return err - } - ctx, cancelFn := context.WithCancel(cmd.Context()) go func() { sigCh := make(chan os.Signal, 1) @@ -135,7 +91,7 @@ func createStartCommand[T transaction.Tx]( } }() - return wrapCPUProfile(l, v, func() error { + return wrapCPUProfile(logger, config, func() error { return server.Start(ctx) }) }, @@ -151,14 +107,14 @@ func createStartCommand[T transaction.Tx]( // wrapCPUProfile starts CPU profiling, if enabled, and executes the provided // callbackFn, then waits for it to return. -func wrapCPUProfile(logger log.Logger, v *viper.Viper, callbackFn func() error) error { - cpuProfileFile := v.GetString(FlagCPUProfiling) - if len(cpuProfileFile) == 0 { +func wrapCPUProfile(logger log.Logger, cfg server.ConfigMap, callbackFn func() error) error { + cpuProfileFile, ok := cfg[FlagCPUProfiling] + if !ok { // if cpu profiling is not enabled, just run the callback return callbackFn() } - f, err := os.Create(cpuProfileFile) + f, err := os.Create(cpuProfileFile.(string)) if err != nil { return err } @@ -180,39 +136,6 @@ func wrapCPUProfile(logger log.Logger, v *viper.Viper, callbackFn func() error) return callbackFn() } -// configHandle writes the default config to the home directory if it does not exist and sets the server context -func configHandle[T transaction.Tx](s *Server[T], cmd *cobra.Command) error { - home, err := cmd.Flags().GetString(FlagHome) - if err != nil { - return err - } - - configDir := filepath.Join(home, "config") - - // we need to check app.toml as the config folder can already exist for the client.toml - if _, err := os.Stat(filepath.Join(configDir, "app.toml")); os.IsNotExist(err) { - if err = s.WriteConfig(configDir); err != nil { - return err - } - } - - v, err := ReadConfig(configDir) - if err != nil { - return err - } - - if err := v.BindPFlags(cmd.Flags()); err != nil { - return err - } - - logger, err := NewLogger(v, cmd.OutOrStdout()) - if err != nil { - return err - } - - return SetCmdServerContext(cmd, v, logger) -} - // findSubCommand finds a sub-command of the provided command whose Use // string is or begins with the provided subCmdName. // It verifies the command's aliases as well. @@ -246,3 +169,39 @@ func topLevelCmd(ctx context.Context, use, short string) *cobra.Command { return cmd } + +// appBuildingCommands are the commands which need a full application to be built +var appBuildingCommands = [][]string{ + {"start"}, + {"genesis", "export"}, +} + +// IsAppRequired determines if a command requires a full application to be built by +// recursively checking the command hierarchy against known command paths. +// +// The function works by: +// 1. Combining default appBuildingCommands with additional required commands +// 2. Building command paths by traversing up the command tree +// 3. Checking if any known command path matches the current command path +// +// Time Complexity: O(d * p) where d is command depth and p is number of paths +// Space Complexity: O(p) where p is total number of command paths +func IsAppRequired(cmd *cobra.Command, required ...[]string) bool { + m := make(map[string]bool) + cmds := append(appBuildingCommands, required...) + for _, c := range cmds { + slices.Reverse(c) + m[strings.Join(c, "")] = true + } + cmdPath := make([]string, 0, 5) // Pre-allocate with reasonable capacity + for { + cmdPath = append(cmdPath, cmd.Use) + if _, ok := m[strings.Join(cmdPath, "")]; ok { + return true + } + if cmd.Parent() == nil { + return false + } + cmd = cmd.Parent() + } +} diff --git a/server/v2/logger.go b/server/v2/logger.go index 8ca80e4cce45..33ef557ca540 100644 --- a/server/v2/logger.go +++ b/server/v2/logger.go @@ -4,33 +4,52 @@ import ( "io" "github.com/rs/zerolog" - "github.com/spf13/viper" + "cosmossdk.io/core/server" "cosmossdk.io/log" ) // NewLogger creates the default SDK logger. // It reads the log level and format from the server context. -func NewLogger(v *viper.Viper, out io.Writer) (log.Logger, error) { +func NewLogger(cfg server.ConfigMap, out io.Writer) (log.Logger, error) { var opts []log.Option - if v.GetString(FlagLogFormat) == OutputFormatJSON { + var ( + format string + noColor bool + trace bool + level string + ) + if v, ok := cfg[FlagLogFormat]; ok { + format = v.(string) + } + if v, ok := cfg[FlagLogNoColor]; ok { + noColor = v.(bool) + } + if v, ok := cfg[FlagTrace]; ok { + trace = v.(bool) + } + if v, ok := cfg[FlagLogLevel]; ok { + level = v.(string) + } + + if format == OutputFormatJSON { opts = append(opts, log.OutputJSONOption()) } opts = append(opts, - log.ColorOption(!v.GetBool(FlagLogNoColor)), - log.TraceOption(v.GetBool(FlagTrace))) + log.ColorOption(!noColor), + log.TraceOption(trace), + ) // check and set filter level or keys for the logger if any - logLvlStr := v.GetString(FlagLogLevel) - if logLvlStr == "" { + if level == "" { return log.NewLogger(out, opts...), nil } - logLvl, err := zerolog.ParseLevel(logLvlStr) + logLvl, err := zerolog.ParseLevel(level) switch { case err != nil: // If the log level is not a valid zerolog level, then we try to parse it as a key filter. - filterFunc, err := log.ParseLogLevel(logLvlStr) + filterFunc, err := log.ParseLogLevel(level) if err != nil { return nil, err } diff --git a/server/v2/server.go b/server/v2/server.go index 980cb3e5fed2..063be7d1df24 100644 --- a/server/v2/server.go +++ b/server/v2/server.go @@ -22,7 +22,6 @@ type ServerComponent[T transaction.Tx] interface { Start(context.Context) error Stop(context.Context) error - Init(AppI[T], map[string]any, log.Logger) error } // HasStartFlags is a server module that has start flags. @@ -38,6 +37,11 @@ type HasConfig interface { Config() any } +// ConfigWriter is a server module that can write its config to a file. +type ConfigWriter interface { + WriteConfig(path string) error +} + // HasCLICommands is a server module that has CLI commands. type HasCLICommands interface { CLICommands() CLIConfig @@ -186,30 +190,6 @@ func (s *Server[T]) StartCmdFlags() *pflag.FlagSet { return flags } -// Init initializes all server components with the provided application, configuration, and logger. -// It returns an error if any component fails to initialize. -func (s *Server[T]) Init(appI AppI[T], cfg map[string]any, logger log.Logger) error { - serverCfg := s.config - if len(cfg) > 0 { - if err := UnmarshalSubConfig(cfg, s.Name(), &serverCfg); err != nil { - return fmt.Errorf("failed to unmarshal config: %w", err) - } - } - - var components []ServerComponent[T] - for _, mod := range s.components { - if err := mod.Init(appI, cfg, logger); err != nil { - return err - } - - components = append(components, mod) - } - - s.config = serverCfg - s.components = components - return nil -} - // WriteConfig writes the config to the given path. // Note: it does not use viper.WriteConfigAs because we do not want to store flag values in the config. func (s *Server[T]) WriteConfig(configPath string) error { diff --git a/server/v2/server_mock_test.go b/server/v2/server_mock_test.go index 8b590ba2d32f..2158549eed0c 100644 --- a/server/v2/server_mock_test.go +++ b/server/v2/server_mock_test.go @@ -4,10 +4,6 @@ import ( "context" "fmt" "math/rand" - - "cosmossdk.io/core/transaction" - "cosmossdk.io/log" - serverv2 "cosmossdk.io/server/v2" ) type mockServerConfig struct { @@ -31,10 +27,6 @@ func (s *mockServer) Name() string { return s.name } -func (s *mockServer) Init(appI serverv2.AppI[transaction.Tx], cfg map[string]any, logger log.Logger) error { - return nil -} - func (s *mockServer) Start(ctx context.Context) error { for ctx.Err() == nil { s.ch <- fmt.Sprintf("%s mock server: %d", s.name, rand.Int()) diff --git a/server/v2/server_test.go b/server/v2/server_test.go index a53b71fc35b9..d71416dfb3fd 100644 --- a/server/v2/server_test.go +++ b/server/v2/server_test.go @@ -61,20 +61,18 @@ func TestServer(t *testing.T) { logger := log.NewLogger(os.Stdout) - ctx, err := serverv2.SetServerContext(context.Background(), v, logger) - require.NoError(t, err) + ctx := serverv2.SetServerContext(context.Background(), v, logger) + app := &mockApp[transaction.Tx]{} - grpcServer := grpc.New[transaction.Tx]() - err = grpcServer.Init(&mockApp[transaction.Tx]{}, cfg, logger) + grpcServer, err := grpc.New[transaction.Tx](logger, app.InterfaceRegistry(), app.QueryHandlers(), app, cfg) require.NoError(t, err) - storeServer := store.New[transaction.Tx]() - err = storeServer.Init(&mockApp[transaction.Tx]{}, cfg, logger) + storeServer, err := store.New[transaction.Tx](app.Store(), cfg) require.NoError(t, err) mockServer := &mockServer{name: "mock-server-1", ch: make(chan string, 100)} - server := serverv2.NewServer( + server := serverv2.NewServer[transaction.Tx]( serverv2.DefaultServerConfig(), grpcServer, storeServer, diff --git a/server/v2/store/server.go b/server/v2/store/server.go index 1fafe4e25d53..897773abf28e 100644 --- a/server/v2/store/server.go +++ b/server/v2/store/server.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" - "cosmossdk.io/log" serverv2 "cosmossdk.io/server/v2" storev2 "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/root" @@ -27,14 +27,15 @@ type Server[T transaction.Tx] struct { backend storev2.Backend } -func New[T transaction.Tx]() *Server[T] { - return &Server[T]{} -} - -func (s *Server[T]) Init(app serverv2.AppI[T], v map[string]any, _ log.Logger) (err error) { - s.backend = app.Store() - s.config, err = UnmarshalConfig(v) - return err +func New[T transaction.Tx](store storev2.Backend, cfg server.ConfigMap) (*Server[T], error) { + config, err := UnmarshalConfig(cfg) + if err != nil { + return nil, err + } + return &Server[T]{ + backend: store, + config: config, + }, nil } func (s *Server[T]) Name() string { @@ -58,7 +59,7 @@ func (s *Server[T]) CLICommands() serverv2.CLIConfig { s.ListSnapshotsCmd(), s.DumpArchiveCmd(), s.LoadArchiveCmd(), - s.RestoreSnapshotCmd(s.backend), + s.RestoreSnapshotCmd(), }, } } diff --git a/server/v2/store/snapshot.go b/server/v2/store/snapshot.go index cbde7cd9a7d9..c858d47757a9 100644 --- a/server/v2/store/snapshot.go +++ b/server/v2/store/snapshot.go @@ -75,7 +75,7 @@ func (s *Server[T]) ExportSnapshotCmd() *cobra.Command { } // RestoreSnapshotCmd returns a command to restore a snapshot -func (s *Server[T]) RestoreSnapshotCmd(rootStore storev2.Backend) *cobra.Command { +func (s *Server[T]) RestoreSnapshotCmd() *cobra.Command { cmd := &cobra.Command{ Use: "restore ", Short: "Restore app state from local snapshot", @@ -95,6 +95,10 @@ func (s *Server[T]) RestoreSnapshotCmd(rootStore storev2.Backend) *cobra.Command logger := log.NewLogger(cmd.OutOrStdout()) + rootStore, _, err := createRootStore(v, logger) + if err != nil { + return fmt.Errorf("failed to create root store: %w", err) + } sm, err := createSnapshotsManager(cmd, v, logger, rootStore) if err != nil { return err diff --git a/server/v2/util.go b/server/v2/util.go index d02ea30125e5..f17faf031595 100644 --- a/server/v2/util.go +++ b/server/v2/util.go @@ -15,26 +15,22 @@ import ( // SetServerContext sets the logger and viper in the context. // The server manager expects the logger and viper to be set in the context. -func SetServerContext(ctx context.Context, viper *viper.Viper, logger log.Logger) (context.Context, error) { +func SetServerContext(ctx context.Context, viper *viper.Viper, logger log.Logger) context.Context { if ctx == nil { ctx = context.Background() } ctx = context.WithValue(ctx, corectx.LoggerContextKey, logger) ctx = context.WithValue(ctx, corectx.ViperContextKey, viper) - return ctx, nil + return ctx } // SetCmdServerContext sets a command's Context value to the provided argument. // The server manager expects the logger and viper to be set in the context. // If the context has not been set, set the given context as the default. -func SetCmdServerContext(cmd *cobra.Command, viper *viper.Viper, logger log.Logger) error { - ctx, err := SetServerContext(cmd.Context(), viper, logger) - if err != nil { - return err - } +func SetCmdServerContext(cmd *cobra.Command, viper *viper.Viper, logger log.Logger) { + ctx := SetServerContext(cmd.Context(), viper, logger) cmd.SetContext(ctx) - return nil } // GetViperFromContext returns the viper instance from the context. diff --git a/simapp/app_di.go b/simapp/app_di.go index b26220892e0d..0704cbdc38ca 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -93,8 +93,10 @@ func init() { // AppConfig returns the default app config. func AppConfig() depinject.Config { return depinject.Configs( - appConfig, // Alternatively use appconfig.LoadYAML(AppConfigYAML) - depinject.Provide(ProvideExampleMintFn), // optional: override the mint module's mint function with epoched minting + appConfig, // Alternatively use appconfig.LoadYAML(AppConfigYAML) + depinject.Provide( + ProvideExampleMintFn, // optional: override the mint module's mint function with epoched minting + ), ) } diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index 2f1337aec398..5ade503e6403 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -106,8 +106,8 @@ var ( // pooltypes.ModuleName } - // application configuration (used by depinject) - appConfig = appconfig.Compose(&appv1alpha1.Config{ + // ModuleConfig is the application module configuration used by depinject + ModuleConfig = appconfig.Compose(&appv1alpha1.Config{ Modules: []*appv1alpha1.ModuleConfig{ { Name: runtime.ModuleName, diff --git a/simapp/v2/app_di.go b/simapp/v2/app_di.go index 593c8d0c275f..5fa97c224161 100644 --- a/simapp/v2/app_di.go +++ b/simapp/v2/app_di.go @@ -2,10 +2,8 @@ package simapp import ( _ "embed" + "fmt" - "github.com/spf13/viper" - - clienthelpers "cosmossdk.io/client/v2/helpers" "cosmossdk.io/core/registry" "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" @@ -28,9 +26,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/genutil" ) -// DefaultNodeHome default home directories for the application daemon -var DefaultNodeHome string - // SimApp extends an ABCI application, but with most of its parameters exported. // They are exported for convenience in creating helper functions, as object // capabilities aren't needed for testing. @@ -48,24 +43,24 @@ type SimApp[T transaction.Tx] struct { StakingKeeper *stakingkeeper.Keeper } -func init() { - var err error - DefaultNodeHome, err = clienthelpers.GetNodeHomeDirectory(".simappv2") - if err != nil { - panic(err) - } -} - // AppConfig returns the default app config. func AppConfig() depinject.Config { return depinject.Configs( - appConfig, // Alternatively use appconfig.LoadYAML(AppConfigYAML) + ModuleConfig, // Alternatively use appconfig.LoadYAML(AppConfigYAML) runtime.DefaultServiceBindings(), depinject.Provide( codec.ProvideInterfaceRegistry, codec.ProvideAddressCodec, codec.ProvideProtoCodec, codec.ProvideLegacyAmino, + ProvideRootStoreConfig, + // inject desired account types: + multisigdepinject.ProvideAccount, + basedepinject.ProvideAccount, + lockupdepinject.ProvideAllLockupAccounts, + + // provide base account options + basedepinject.ProvideSecp256K1PubKey, ), depinject.Invoke( std.RegisterInterfaces, @@ -74,89 +69,80 @@ func AppConfig() depinject.Config { ) } -// NewSimApp returns a reference to an initialized SimApp. func NewSimApp[T transaction.Tx]( - logger log.Logger, - viper *viper.Viper, -) *SimApp[T] { + config depinject.Config, + outputs ...any, +) (*SimApp[T], error) { var ( app = &SimApp[T]{} appBuilder *runtime.AppBuilder[T] - err error storeBuilder root.Builder + logger log.Logger // merge the AppConfig and other configuration in one config appConfig = depinject.Configs( AppConfig(), + config, depinject.Supply( - logger, - viper, - - // ADVANCED CONFIGURATION - - // - // AUTH - // - // For providing a custom function required in auth to generate custom account types - // add it below. By default the auth module uses simulation.RandomGenesisAccounts. - // - // authtypes.RandomGenesisAccountsFn(simulation.RandomGenesisAccounts), - // - // For providing a custom a base account type add it below. - // By default the auth module uses authtypes.ProtoBaseAccount(). - // - // func() sdk.AccountI { return authtypes.ProtoBaseAccount() }, - // - // For providing a different address codec, add it below. - // By default the auth module uses a Bech32 address codec, - // with the prefix defined in the auth module configuration. - // - // func() address.Codec { return <- custom address codec type -> } - - // - // STAKING - // - // For provinding a different validator and consensus address codec, add it below. - // By default the staking module uses the bech32 prefix provided in the auth config, - // and appends "valoper" and "valcons" for validator and consensus addresses respectively. - // When providing a custom address codec in auth, custom address codecs must be provided here as well. - // - // func() runtime.ValidatorAddressCodec { return <- custom validator address codec type -> } - // func() runtime.ConsensusAddressCodec { return <- custom consensus address codec type -> } - - // - // MINT - // - - // For providing a custom inflation function for x/mint add here your - // custom function that implements the minttypes.InflationCalculationFn - // interface. + // ADVANCED CONFIGURATION + + // + // AUTH + // + // For providing a custom function required in auth to generate custom account types + // add it below. By default the auth module uses simulation.RandomGenesisAccounts. + // + // authtypes.RandomGenesisAccountsFn(simulation.RandomGenesisAccounts), + // + // For providing a custom a base account type add it below. + // By default the auth module uses authtypes.ProtoBaseAccount(). + // + // func() sdk.AccountI { return authtypes.ProtoBaseAccount() }, + // + // For providing a different address codec, add it below. + // By default the auth module uses a Bech32 address codec, + // with the prefix defined in the auth module configuration. + // + // func() address.Codec { return <- custom address codec type -> } + + // + // STAKING + // + // For provinding a different validator and consensus address codec, add it below. + // By default the staking module uses the bech32 prefix provided in the auth config, + // and appends "valoper" and "valcons" for validator and consensus addresses respectively. + // When providing a custom address codec in auth, custom address codecs must be provided here as well. + // + // func() runtime.ValidatorAddressCodec { return <- custom validator address codec type -> } + // func() runtime.ConsensusAddressCodec { return <- custom consensus address codec type -> } + + // + // MINT + // + + // For providing a custom inflation function for x/mint add here your + // custom function that implements the minttypes.InflationCalculationFn + // interface. ), depinject.Provide( - // inject desired account types: - multisigdepinject.ProvideAccount, - basedepinject.ProvideAccount, - lockupdepinject.ProvideAllLockupAccounts, - - // provide base account options - basedepinject.ProvideSecp256K1PubKey, - // if you want to provide a custom public key you - // can do it from here. - // Example: - // basedepinject.ProvideCustomPubkey[Ed25519PublicKey]() - // - // You can also provide a custom public key with a custom validation function: - // - // basedepinject.ProvideCustomPubKeyAndValidationFunc(func(pub Ed25519PublicKey) error { - // if len(pub.Key) != 64 { - // return fmt.Errorf("invalid pub key size") - // } - // }) + // if you want to provide a custom public key you + // can do it from here. + // Example: + // basedepinject.ProvideCustomPubkey[Ed25519PublicKey]() + // + // You can also provide a custom public key with a custom validation function: + // + // basedepinject.ProvideCustomPubKeyAndValidationFunc(func(pub Ed25519PublicKey) error { + // if len(pub.Key) != 64 { + // return fmt.Errorf("invalid pub key size") + // } + // }) ), ) ) - if err := depinject.Inject(appConfig, + outputs = append(outputs, + &logger, &storeBuilder, &appBuilder, &app.appCodec, @@ -164,25 +150,21 @@ func NewSimApp[T transaction.Tx]( &app.txConfig, &app.interfaceRegistry, &app.UpgradeKeeper, - &app.StakingKeeper, - ); err != nil { - panic(err) - } + &app.StakingKeeper) - // store/v2 follows a slightly more eager config life cycle than server components - storeConfig, err := serverstore.UnmarshalConfig(viper.AllSettings()) - if err != nil { - panic(err) + if err := depinject.Inject(appConfig, outputs...); err != nil { + return nil, err } - app.store, err = storeBuilder.Build(logger, storeConfig) + var err error + app.App, err = appBuilder.Build() if err != nil { - panic(err) + return nil, err } - app.App, err = appBuilder.Build() - if err != nil { - panic(err) + app.store = storeBuilder.Get() + if app.store == nil { + return nil, fmt.Errorf("store builder did not return a db") } /**** Module Options ****/ @@ -190,14 +172,10 @@ func NewSimApp[T transaction.Tx]( // RegisterUpgradeHandlers is used for registering any on-chain upgrades. app.RegisterUpgradeHandlers() - // TODO (here or in runtime/v2) - // wire simulation manager - // wire unordered tx manager - - if err := app.LoadLatest(); err != nil { - panic(err) + if err = app.LoadLatest(); err != nil { + return nil, err } - return app + return app, nil } // AppCodec returns SimApp's app codec. @@ -231,3 +209,7 @@ func (app *SimApp[T]) Close() error { return app.App.Close() } + +func ProvideRootStoreConfig(config runtime.GlobalConfig) (*root.Config, error) { + return serverstore.UnmarshalConfig(config) +} diff --git a/simapp/v2/app_test.go b/simapp/v2/app_test.go index 61ace5e4ef29..c3c51489a7e5 100644 --- a/simapp/v2/app_test.go +++ b/simapp/v2/app_test.go @@ -16,8 +16,10 @@ import ( "cosmossdk.io/core/server" "cosmossdk.io/core/store" "cosmossdk.io/core/transaction" + "cosmossdk.io/depinject" "cosmossdk.io/log" sdkmath "cosmossdk.io/math" + "cosmossdk.io/runtime/v2" serverv2 "cosmossdk.io/server/v2" serverv2store "cosmossdk.io/server/v2/store" "cosmossdk.io/store/v2/db" @@ -39,7 +41,11 @@ func NewTestApp(t *testing.T) (*SimApp[transaction.Tx], context.Context) { vp.Set(serverv2store.FlagAppDBBackend, string(db.DBTypeGoLevelDB)) vp.Set(serverv2.FlagHome, t.TempDir()) - app := NewSimApp[transaction.Tx](logger, vp) + app, err := NewSimApp[transaction.Tx](depinject.Configs( + depinject.Supply(logger, runtime.GlobalConfig(vp.AllSettings()))), + ) + require.NoError(t, err) + genesis := app.ModuleManager().DefaultGenesis() privVal := mock.NewPV() diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index cf940ac67e96..c001db4dff92 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -1,15 +1,12 @@ package cmd import ( - "context" "errors" - "fmt" "github.com/spf13/cobra" - "github.com/spf13/viper" "cosmossdk.io/client/v2/offchain" - corectx "cosmossdk.io/core/context" + coreserver "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" "cosmossdk.io/log" runtimev2 "cosmossdk.io/runtime/v2" @@ -17,82 +14,140 @@ import ( "cosmossdk.io/server/v2/api/grpc" "cosmossdk.io/server/v2/api/rest" "cosmossdk.io/server/v2/api/telemetry" + "cosmossdk.io/server/v2/cometbft" serverstore "cosmossdk.io/server/v2/store" "cosmossdk.io/simapp/v2" confixcmd "cosmossdk.io/tools/confix/cmd" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/genutil" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - genutilv2 "github.com/cosmos/cosmos-sdk/x/genutil/v2" v2 "github.com/cosmos/cosmos-sdk/x/genutil/v2/cli" ) -func newApp[T transaction.Tx](logger log.Logger, viper *viper.Viper) serverv2.AppI[T] { - viper.SetDefault(serverv2.FlagHome, simapp.DefaultNodeHome) - return serverv2.AppI[T](simapp.NewSimApp[T](logger, viper)) +// CommandDependencies is a struct that contains all the dependencies needed to initialize the root command. +// an alternative design could fetch these even later from the command context +type CommandDependencies[T transaction.Tx] struct { + GlobalConfig coreserver.ConfigMap + TxConfig client.TxConfig + ModuleManager *runtimev2.MM[T] + SimApp *simapp.SimApp[T] + Consensus serverv2.ServerComponent[T] } -func initRootCmd[T transaction.Tx]( +func InitRootCmd[T transaction.Tx]( rootCmd *cobra.Command, - moduleManager *runtimev2.MM[T], - consensusComponent serverv2.ServerComponent[T], -) { + logger log.Logger, + deps CommandDependencies[T], +) (serverv2.ConfigWriter, error) { cfg := sdk.GetConfig() cfg.Seal() rootCmd.AddCommand( - genutilcli.InitCmd(moduleManager), + genutilcli.InitCmd(deps.ModuleManager), + genesisCommand(deps.ModuleManager, deps.SimApp), + NewTestnetCmd(deps.ModuleManager), debug.Cmd(), confixcmd.ConfigCommand(), - NewTestnetCmd(moduleManager), - ) - - // add keybase, auxiliary RPC, query, genesis, and tx child commands - rootCmd.AddCommand( - genesisCommand(moduleManager), + // add keybase, auxiliary RPC, query, genesis, and tx child commands queryCommand(), txCommand(), keys.Commands(), offchain.OffChain(), ) + // build CLI skeleton for initial config parsing or a client application invocation + if deps.SimApp == nil { + if deps.Consensus == nil { + deps.Consensus = cometbft.NewWithConfigOptions[T](initCometConfig()) + } + return serverv2.AddCommands[T]( + rootCmd, + logger, + deps.GlobalConfig, + initServerConfig(), + deps.Consensus, + &grpc.Server[T]{}, + &serverstore.Server[T]{}, + &telemetry.Server[T]{}, + &rest.Server[T]{}, + ) + } + + // build full app! + simApp := deps.SimApp + grpcServer, err := grpc.New[T](logger, simApp.InterfaceRegistry(), simApp.QueryHandlers(), simApp, deps.GlobalConfig) + if err != nil { + return nil, err + } + // store component (not a server) + storeComponent, err := serverstore.New[T](simApp.Store(), deps.GlobalConfig) + if err != nil { + return nil, err + } + restServer, err := rest.New[T](simApp.App.AppManager, logger, deps.GlobalConfig) + if err != nil { + return nil, err + } + + // consensus component + if deps.Consensus == nil { + deps.Consensus, err = cometbft.New( + logger, + simApp.Name(), + simApp.Store(), + simApp.App.AppManager, + simApp.App.QueryHandlers(), + simApp.App.SchemaDecoderResolver(), + &genericTxDecoder[T]{deps.TxConfig}, + deps.GlobalConfig, + initCometOptions[T](), + ) + if err != nil { + return nil, err + } + } + telemetryServer, err := telemetry.New[T](deps.GlobalConfig, logger) + if err != nil { + return nil, err + } + // wire server commands - if err := serverv2.AddCommands( + return serverv2.AddCommands[T]( rootCmd, - newApp, + logger, + deps.GlobalConfig, initServerConfig(), - consensusComponent, - grpc.New[T](), - serverstore.New[T](), - telemetry.New[T](), - rest.New[T](), - ); err != nil { - panic(err) - } + deps.Consensus, + grpcServer, + storeComponent, + telemetryServer, + restServer, + ) } // genesisCommand builds genesis-related `simd genesis` command. func genesisCommand[T transaction.Tx]( moduleManager *runtimev2.MM[T], - cmds ...*cobra.Command, + app *simapp.SimApp[T], ) *cobra.Command { + var genTxValidator func([]transaction.Msg) error + if moduleManager != nil { + genTxValidator = moduleManager.Modules()[genutiltypes.ModuleName].(genutil.AppModule).GenTxValidator() + } cmd := v2.Commands( - moduleManager.Modules()[genutiltypes.ModuleName].(genutil.AppModule), + genTxValidator, moduleManager, - appExport[T], + app, ) - for _, subCmd := range cmds { - cmd.AddCommand(subCmd) - } return cmd } @@ -139,41 +194,31 @@ func txCommand() *cobra.Command { return cmd } -// appExport creates a new simapp (optionally at a given height) and exports state. -func appExport[T transaction.Tx]( - ctx context.Context, - height int64, - jailAllowedAddrs []string, -) (genutilv2.ExportedApp, error) { - value := ctx.Value(corectx.ViperContextKey) - viper, ok := value.(*viper.Viper) - if !ok { - return genutilv2.ExportedApp{}, - fmt.Errorf("incorrect viper type %T: expected *viper.Viper in context", value) - } - value = ctx.Value(corectx.LoggerContextKey) - logger, ok := value.(log.Logger) - if !ok { - return genutilv2.ExportedApp{}, - fmt.Errorf("incorrect logger type %T: expected log.Logger in context", value) - } +func RootCommandPersistentPreRun(clientCtx client.Context) func(*cobra.Command, []string) error { + return func(cmd *cobra.Command, args []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) - // overwrite the FlagInvCheckPeriod - viper.Set(server.FlagInvCheckPeriod, 1) - viper.SetDefault(serverv2.FlagHome, simapp.DefaultNodeHome) + clientCtx = clientCtx.WithCmdContext(cmd.Context()) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } - var simApp *simapp.SimApp[T] - if height != -1 { - simApp = simapp.NewSimApp[T](logger, viper) + customClientTemplate, customClientConfig := initClientConfig() + clientCtx, err = config.CreateClientConfig( + clientCtx, customClientTemplate, customClientConfig) + if err != nil { + return err + } - if err := simApp.LoadHeight(uint64(height)); err != nil { - return genutilv2.ExportedApp{}, err + if err = client.SetCmdClientContextHandler(clientCtx, cmd); err != nil { + return err } - } else { - simApp = simapp.NewSimApp[T](logger, viper) - } - return simApp.ExportAppStateAndValidators(jailAllowedAddrs) + return nil + } } var _ transaction.Codec[transaction.Tx] = &genericTxDecoder[transaction.Tx]{} diff --git a/simapp/v2/simdv2/cmd/depinject.go b/simapp/v2/simdv2/cmd/depinject.go new file mode 100644 index 000000000000..f59140f29399 --- /dev/null +++ b/simapp/v2/simdv2/cmd/depinject.go @@ -0,0 +1,69 @@ +package cmd + +import ( + "os" + + "cosmossdk.io/core/address" + "cosmossdk.io/core/registry" + "cosmossdk.io/runtime/v2" + serverv2 "cosmossdk.io/server/v2" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// ProvideClientContext is a depinject Provider function which assembles and returns a client.Context. +func ProvideClientContext( + configMap runtime.GlobalConfig, + appCodec codec.Codec, + interfaceRegistry codectypes.InterfaceRegistry, + txConfigOpts tx.ConfigOptions, + legacyAmino registry.AminoRegistrar, + addressCodec address.Codec, + validatorAddressCodec address.ValidatorAddressCodec, + consensusAddressCodec address.ConsensusAddressCodec, +) client.Context { + var err error + amino, ok := legacyAmino.(*codec.LegacyAmino) + if !ok { + panic("registry.AminoRegistrar must be an *codec.LegacyAmino instance for legacy ClientContext") + } + homeDir, ok := configMap[serverv2.FlagHome].(string) + if !ok { + panic("server.ConfigMap must contain a string value for serverv2.FlagHome") + } + + clientCtx := client.Context{}. + WithCodec(appCodec). + WithInterfaceRegistry(interfaceRegistry). + WithLegacyAmino(amino). + WithInput(os.Stdin). + WithAccountRetriever(types.AccountRetriever{}). + WithAddressCodec(addressCodec). + WithValidatorAddressCodec(validatorAddressCodec). + WithConsensusAddressCodec(consensusAddressCodec). + WithHomeDir(homeDir). + WithViper("") // uses by default the binary name as prefix + + // Read the config to overwrite the default values with the values from the config file + customClientTemplate, customClientConfig := initClientConfig() + clientCtx, err = config.CreateClientConfig(clientCtx, customClientTemplate, customClientConfig) + if err != nil { + panic(err) + } + + // textual is enabled by default, we need to re-create the tx config grpc instead of bank keeper. + txConfigOpts.TextualCoinMetadataQueryFn = authtxconfig.NewGRPCCoinMetadataQueryFn(clientCtx) + txConfig, err := tx.NewTxConfigWithOptions(clientCtx.Codec, txConfigOpts) + if err != nil { + panic(err) + } + clientCtx = clientCtx.WithTxConfig(txConfig) + + return clientCtx +} diff --git a/simapp/v2/simdv2/cmd/root_di.go b/simapp/v2/simdv2/cmd/root_di.go index da1bcf77061a..0bbae702becb 100644 --- a/simapp/v2/simdv2/cmd/root_di.go +++ b/simapp/v2/simdv2/cmd/root_di.go @@ -1,161 +1,98 @@ package cmd import ( - "os" - "github.com/spf13/cobra" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/client/v2/autocli" - "cosmossdk.io/core/address" - "cosmossdk.io/core/registry" "cosmossdk.io/core/transaction" "cosmossdk.io/depinject" "cosmossdk.io/log" "cosmossdk.io/runtime/v2" serverv2 "cosmossdk.io/server/v2" - "cosmossdk.io/server/v2/cometbft" "cosmossdk.io/simapp/v2" - basedepinject "cosmossdk.io/x/accounts/defaults/base/depinject" - lockupdepinject "cosmossdk.io/x/accounts/defaults/lockup/depinject" - multisigdepinject "cosmossdk.io/x/accounts/defaults/multisig/depinject" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/config" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtxconfig "github.com/cosmos/cosmos-sdk/x/auth/tx/config" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) -// NewCometBFTRootCmd creates a new root command for simd, -// using the CometBFT server component for consensus. -// It is called once in the main function. -func NewCometBFTRootCmd[T transaction.Tx]() *cobra.Command { - return NewRootCmdWithConsensusComponent(func(cc client.Context) serverv2.ServerComponent[T] { - return cometbft.New[T]( - &genericTxDecoder[T]{cc.TxConfig}, - initCometOptions[T](), - initCometConfig(), - ) - }) -} - -// NewRootCmdWithConsensusComponent returns a new root command, -// using the provided callback to instantiate the server component for the consensus layer. -// Callers who want to use CometBFT should call [NewCometBFTRootCmd] directly. -func NewRootCmdWithConsensusComponent[T transaction.Tx]( - makeConsensusComponent func(cc client.Context) serverv2.ServerComponent[T], -) *cobra.Command { - var ( - autoCliOpts autocli.AppOptions - moduleManager *runtime.MM[T] - clientCtx client.Context +func NewRootCmd[T transaction.Tx]( + args ...string, +) (*cobra.Command, error) { + rootCommand := &cobra.Command{ + Use: "simdv2", + SilenceErrors: true, + } + configWriter, err := InitRootCmd(rootCommand, log.NewNopLogger(), CommandDependencies[T]{}) + if err != nil { + return nil, err + } + factory, err := serverv2.NewCommandFactory( + serverv2.WithConfigWriter(configWriter), + serverv2.WithStdDefaultHomeDir(".simappv2"), + serverv2.WithLoggerFactory(serverv2.NewLogger), ) - - if err := depinject.Inject( - depinject.Configs( - simapp.AppConfig(), - depinject.Provide( - ProvideClientContext, - // inject desired account types: - multisigdepinject.ProvideAccount, - basedepinject.ProvideAccount, - lockupdepinject.ProvideAllLockupAccounts, - - // provide base account options - basedepinject.ProvideSecp256K1PubKey), - depinject.Supply(log.NewNopLogger()), - ), - &autoCliOpts, - &moduleManager, - &clientCtx, - ); err != nil { - panic(err) + if err != nil { + return nil, err } - rootCmd := &cobra.Command{ - Use: "simd", - Short: "simulation app", - SilenceErrors: true, - PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - clientCtx = clientCtx.WithCmdContext(cmd.Context()) - clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) - if err != nil { - return err - } - - customClientTemplate, customClientConfig := initClientConfig() - clientCtx, err = config.CreateClientConfig(clientCtx, customClientTemplate, customClientConfig) - if err != nil { - return err - } - - if err := client.SetCmdClientContextHandler(clientCtx, cmd); err != nil { - return err - } - - return nil - }, + subCommand, configMap, logger, err := factory.ParseCommand(rootCommand, args) + if err != nil { + return nil, err } - consensusComponent := makeConsensusComponent(clientCtx) - initRootCmd(rootCmd, moduleManager, consensusComponent) - - nodeCmds := nodeservice.NewNodeCommands() - autoCliOpts.ModuleOptions = make(map[string]*autocliv1.ModuleOptions) - autoCliOpts.ModuleOptions[nodeCmds.Name()] = nodeCmds.AutoCLIOptions() - if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { - panic(err) + var ( + autoCliOpts autocli.AppOptions + moduleManager *runtime.MM[T] + clientCtx client.Context + simApp *simapp.SimApp[T] + depinjectConfig = depinject.Configs( + depinject.Supply(logger, runtime.GlobalConfig(configMap)), + depinject.Provide(ProvideClientContext), + ) + ) + if serverv2.IsAppRequired(subCommand) { + // server construction + simApp, err = simapp.NewSimApp[T](depinjectConfig, &autoCliOpts, &moduleManager, &clientCtx) + if err != nil { + return nil, err + } + } else { + // client construction + if err = depinject.Inject( + depinject.Configs( + simapp.AppConfig(), + depinjectConfig, + ), + &autoCliOpts, &moduleManager, &clientCtx, + ); err != nil { + return nil, err + } } - return rootCmd -} - -func ProvideClientContext( - appCodec codec.Codec, - interfaceRegistry codectypes.InterfaceRegistry, - txConfigOpts tx.ConfigOptions, - legacyAmino registry.AminoRegistrar, - addressCodec address.Codec, - validatorAddressCodec address.ValidatorAddressCodec, - consensusAddressCodec address.ConsensusAddressCodec, -) client.Context { - var err error - - amino, ok := legacyAmino.(*codec.LegacyAmino) - if !ok { - panic("registry.AminoRegistrar must be an *codec.LegacyAmino instance for legacy ClientContext") + commandDeps := CommandDependencies[T]{ + GlobalConfig: configMap, + TxConfig: clientCtx.TxConfig, + ModuleManager: moduleManager, + SimApp: simApp, } - - clientCtx := client.Context{}. - WithCodec(appCodec). - WithInterfaceRegistry(interfaceRegistry). - WithLegacyAmino(amino). - WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). - WithAddressCodec(addressCodec). - WithValidatorAddressCodec(validatorAddressCodec). - WithConsensusAddressCodec(consensusAddressCodec). - WithHomeDir(simapp.DefaultNodeHome). - WithViper("") // uses by default the binary name as prefix - - // Read the config to overwrite the default values with the values from the config file - customClientTemplate, customClientConfig := initClientConfig() - clientCtx, err = config.CreateClientConfig(clientCtx, customClientTemplate, customClientConfig) - if err != nil { - panic(err) + rootCommand = &cobra.Command{ + Use: "simdv2", + Short: "simulation app", + SilenceErrors: true, + PersistentPreRunE: RootCommandPersistentPreRun(clientCtx), } - - // textual is enabled by default, we need to re-create the tx config grpc instead of bank keeper. - txConfigOpts.TextualCoinMetadataQueryFn = authtxconfig.NewGRPCCoinMetadataQueryFn(clientCtx) - txConfig, err := tx.NewTxConfigWithOptions(clientCtx.Codec, txConfigOpts) + factory.EnhanceRootCommand(rootCommand) + _, err = InitRootCmd(rootCommand, logger, commandDeps) if err != nil { - panic(err) + return nil, err + } + nodeCmds := nodeservice.NewNodeCommands() + autoCliOpts.ModuleOptions = make(map[string]*autocliv1.ModuleOptions) + autoCliOpts.ModuleOptions[nodeCmds.Name()] = nodeCmds.AutoCLIOptions() + if err := autoCliOpts.EnhanceRootCommand(rootCommand); err != nil { + return nil, err } - clientCtx = clientCtx.WithTxConfig(txConfig) - return clientCtx + return rootCommand, nil } diff --git a/simapp/v2/simdv2/cmd/root_test.go b/simapp/v2/simdv2/cmd/root_test.go index 87678bc4b909..7f7d6a07d95a 100644 --- a/simapp/v2/simdv2/cmd/root_test.go +++ b/simapp/v2/simdv2/cmd/root_test.go @@ -7,8 +7,6 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/core/transaction" - svrcmd "cosmossdk.io/server/v2" - "cosmossdk.io/simapp/v2" "cosmossdk.io/simapp/v2/simdv2/cmd" "github.com/cosmos/cosmos-sdk/client/flags" @@ -16,27 +14,29 @@ import ( ) func TestInitCmd(t *testing.T) { - rootCmd := cmd.NewCometBFTRootCmd[transaction.Tx]() - rootCmd.SetArgs([]string{ + args := []string{ "init", // Test the init cmd "simapp-test", // Moniker fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists - }) - - require.NoError(t, svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome)) + } + rootCmd, err := cmd.NewRootCmd[transaction.Tx](args...) + require.NoError(t, err) + rootCmd.SetArgs(args) + require.NoError(t, rootCmd.Execute()) } func TestHomeFlagRegistration(t *testing.T) { homeDir := "/tmp/foo" - - rootCmd := cmd.NewCometBFTRootCmd[transaction.Tx]() - rootCmd.SetArgs([]string{ + args := []string{ "query", fmt.Sprintf("--%s", flags.FlagHome), homeDir, - }) + } - require.NoError(t, svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome)) + rootCmd, err := cmd.NewRootCmd[transaction.Tx](args...) + require.NoError(t, err) + rootCmd.SetArgs(args) + require.NoError(t, rootCmd.Execute()) result, err := rootCmd.Flags().GetString(flags.FlagHome) require.NoError(t, err) diff --git a/simapp/v2/simdv2/cmd/testnet.go b/simapp/v2/simdv2/cmd/testnet.go index 7b71e98b588d..46a19c039c86 100644 --- a/simapp/v2/simdv2/cmd/testnet.go +++ b/simapp/v2/simdv2/cmd/testnet.go @@ -335,15 +335,10 @@ func initTestnetFiles[T transaction.Tx]( serverCfg := serverv2.DefaultServerConfig() serverCfg.MinGasPrices = args.minGasPrices - // Write server config - cometServer := cometbft.New[T]( - &genericTxDecoder[T]{clientCtx.TxConfig}, - cometbft.ServerOptions[T]{}, - cometbft.OverwriteDefaultConfigTomlConfig(nodeConfig), - ) - storeServer := store.New[T]() - grpcServer := grpc.New[T](grpc.OverwriteDefaultConfig(grpcConfig)) - server := serverv2.NewServer[T](serverCfg, cometServer, grpcServer, storeServer) + cometServer := cometbft.NewWithConfigOptions[T](cometbft.OverwriteDefaultConfigTomlConfig(nodeConfig)) + storeServer := &store.Server[T]{} + grpcServer := grpc.NewWithConfigOptions[T](grpc.OverwriteDefaultConfig(grpcConfig)) + server := serverv2.NewServer[T](serverCfg, cometServer, storeServer, grpcServer) err = server.WriteConfig(filepath.Join(nodeDir, "config")) if err != nil { return err @@ -363,7 +358,6 @@ func initTestnetFiles[T transaction.Tx]( return err } - // Update viper root since root dir become rootdir/node/simd serverv2.GetViperFromCmd(cmd).Set(flags.FlagHome, nodeConfig.RootDir) cmd.PrintErrf("Successfully initialized %d node directories\n", args.numValidators) diff --git a/simapp/v2/simdv2/cmd/testnet_test.go b/simapp/v2/simdv2/cmd/testnet_test.go index 3c7769d912e8..acf57dd37b80 100644 --- a/simapp/v2/simdv2/cmd/testnet_test.go +++ b/simapp/v2/simdv2/cmd/testnet_test.go @@ -7,8 +7,6 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/core/transaction" - svrcmd "cosmossdk.io/server/v2" - "cosmossdk.io/simapp/v2" "cosmossdk.io/simapp/v2/simdv2/cmd" "github.com/cosmos/cosmos-sdk/client/flags" @@ -16,12 +14,13 @@ import ( ) func TestInitTestFilesCmd(t *testing.T) { - rootCmd := cmd.NewCometBFTRootCmd[transaction.Tx]() - rootCmd.SetArgs([]string{ + args := []string{ "testnet", // Test the testnet init-files command "init-files", fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), // Set keyring-backend to test - }) - - require.NoError(t, svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome)) + } + rootCmd, err := cmd.NewRootCmd[transaction.Tx](args...) + require.NoError(t, err) + rootCmd.SetArgs(args) + require.NoError(t, rootCmd.Execute()) } diff --git a/simapp/v2/simdv2/main.go b/simapp/v2/simdv2/main.go index 84248ceed0a6..d01a45030cb9 100644 --- a/simapp/v2/simdv2/main.go +++ b/simapp/v2/simdv2/main.go @@ -1,20 +1,29 @@ package main import ( + "errors" "fmt" "os" - clientv2helpers "cosmossdk.io/client/v2/helpers" "cosmossdk.io/core/transaction" - serverv2 "cosmossdk.io/server/v2" - "cosmossdk.io/simapp/v2" "cosmossdk.io/simapp/v2/simdv2/cmd" ) func main() { - rootCmd := cmd.NewCometBFTRootCmd[transaction.Tx]() - if err := serverv2.Execute(rootCmd, clientv2helpers.EnvPrefix, simapp.DefaultNodeHome); err != nil { - fmt.Fprintln(rootCmd.OutOrStderr(), err) + // reproduce default cobra behavior so that eager parsing of flags is possible. + // see: https://github.com/spf13/cobra/blob/e94f6d0dd9a5e5738dca6bce03c4b1207ffbc0ec/command.go#L1082 + args := os.Args[1:] + rootCmd, err := cmd.NewRootCmd[transaction.Tx](args...) + if err != nil { + if _, pErr := fmt.Fprintln(os.Stderr, err); pErr != nil { + panic(errors.Join(err, pErr)) + } + os.Exit(1) + } + if err = rootCmd.Execute(); err != nil { + if _, pErr := fmt.Fprintln(rootCmd.OutOrStderr(), err); pErr != nil { + panic(errors.Join(err, pErr)) + } os.Exit(1) } } diff --git a/x/genutil/client/cli/collect.go b/x/genutil/client/cli/collect.go index ff3da30d5bdb..10d9db0cdc38 100644 --- a/x/genutil/client/cli/collect.go +++ b/x/genutil/client/cli/collect.go @@ -6,6 +6,7 @@ import ( "github.com/spf13/cobra" + "cosmossdk.io/core/transaction" "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" @@ -16,7 +17,7 @@ import ( const flagGenTxDir = "gentx-dir" // CollectGenTxsCmd - return the cobra command to collect genesis transactions -func CollectGenTxsCmd(validator types.MessageValidator) *cobra.Command { +func CollectGenTxsCmd(validator func([]transaction.Msg) error) *cobra.Command { cmd := &cobra.Command{ Use: "collect-gentxs", Short: "Collect genesis txs and output a genesis.json file", @@ -50,7 +51,9 @@ func CollectGenTxsCmd(validator types.MessageValidator) *cobra.Command { toPrint := newPrintInfo(config.Moniker, appGenesis.ChainID, nodeID, genTxsDir, json.RawMessage("")) initCfg := types.NewInitConfig(appGenesis.ChainID, genTxsDir, nodeID, valPubKey) - appMessage, err := genutil.GenAppStateFromConfig(cdc, clientCtx.TxConfig, config, initCfg, appGenesis, validator, clientCtx.ValidatorAddressCodec, clientCtx.AddressCodec) + appMessage, err := genutil.GenAppStateFromConfig( + cdc, clientCtx.TxConfig, config, initCfg, appGenesis, + validator, clientCtx.ValidatorAddressCodec, clientCtx.AddressCodec) if err != nil { return errors.Wrap(err, "failed to get genesis app state from config") } diff --git a/x/genutil/v2/cli/commands.go b/x/genutil/v2/cli/commands.go index 7b871ec074a4..6812345d23ba 100644 --- a/x/genutil/v2/cli/commands.go +++ b/x/genutil/v2/cli/commands.go @@ -5,10 +5,10 @@ import ( "github.com/spf13/cobra" + "cosmossdk.io/core/transaction" banktypes "cosmossdk.io/x/bank/types" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" v2 "github.com/cosmos/cosmos-sdk/x/genutil/v2" @@ -19,17 +19,26 @@ type genesisMM interface { ValidateGenesis(genesisData map[string]json.RawMessage) error } +type ExportableApp interface { + ExportAppStateAndValidators([]string) (v2.ExportedApp, error) + LoadHeight(uint64) error +} + // Commands adds core sdk's sub-commands into genesis command. -func Commands(genutilModule genutil.AppModule, genMM genesisMM, appExport v2.AppExporter) *cobra.Command { - return CommandsWithCustomMigrationMap(genutilModule, genMM, appExport, cli.MigrationMap) +func Commands( + genTxValidator func([]transaction.Msg) error, + genMM genesisMM, + exportable ExportableApp, +) *cobra.Command { + return CommandsWithCustomMigrationMap(genTxValidator, genMM, exportable, cli.MigrationMap) } // CommandsWithCustomMigrationMap adds core sdk's sub-commands into genesis command with custom migration map. // This custom migration map can be used by the application to add its own migration map. func CommandsWithCustomMigrationMap( - genutilModule genutil.AppModule, + genTxValidator func([]transaction.Msg) error, genMM genesisMM, - appExport v2.AppExporter, + exportable ExportableApp, migrationMap genutiltypes.MigrationMap, ) *cobra.Command { cmd := &cobra.Command{ @@ -42,10 +51,10 @@ func CommandsWithCustomMigrationMap( cmd.AddCommand( cli.GenTxCmd(genMM, banktypes.GenesisBalancesIterator{}), cli.MigrateGenesisCmd(migrationMap), - cli.CollectGenTxsCmd(genutilModule.GenTxValidator()), + cli.CollectGenTxsCmd(genTxValidator), cli.ValidateGenesisCmd(genMM), cli.AddGenesisAccountCmd(), - ExportCmd(appExport), + ExportCmd(exportable), ) return cmd diff --git a/x/genutil/v2/cli/export.go b/x/genutil/v2/cli/export.go index 9b0d992bad0a..c53236d49329 100644 --- a/x/genutil/v2/cli/export.go +++ b/x/genutil/v2/cli/export.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - v2 "github.com/cosmos/cosmos-sdk/x/genutil/v2" ) const ( @@ -22,7 +21,7 @@ const ( ) // ExportCmd dumps app state to JSON. -func ExportCmd(appExporter v2.AppExporter) *cobra.Command { +func ExportCmd(app ExportableApp) *cobra.Command { cmd := &cobra.Command{ Use: "export", Short: "Export state to JSON", @@ -34,7 +33,7 @@ func ExportCmd(appExporter v2.AppExporter) *cobra.Command { return err } - if appExporter == nil { + if app == nil { if _, err := fmt.Fprintln(cmd.ErrOrStderr(), "WARNING: App exporter not defined. Returning genesis file."); err != nil { return err } @@ -59,8 +58,12 @@ func ExportCmd(appExporter v2.AppExporter) *cobra.Command { height, _ := cmd.Flags().GetInt64(flagHeight) jailAllowedAddrs, _ := cmd.Flags().GetStringSlice(flagJailAllowedAddrs) outputDocument, _ := cmd.Flags().GetString(flags.FlagOutputDocument) - - exported, err := appExporter(cmd.Context(), height, jailAllowedAddrs) + if height != -1 { + if err := app.LoadHeight(uint64(height)); err != nil { + return err + } + } + exported, err := app.ExportAppStateAndValidators(jailAllowedAddrs) if err != nil { return fmt.Errorf("error exporting state: %w", err) } diff --git a/x/genutil/v2/types.go b/x/genutil/v2/types.go index fbf288365a57..1509f09f59b8 100644 --- a/x/genutil/v2/types.go +++ b/x/genutil/v2/types.go @@ -1,20 +1,11 @@ package v2 import ( - "context" "encoding/json" sdk "github.com/cosmos/cosmos-sdk/types" ) -// AppExporter is a function that dumps all app state to -// JSON-serializable structure and returns the current validator set. -type AppExporter func( - ctx context.Context, - height int64, - jailAllowedAddrs []string, -) (ExportedApp, error) - // ExportedApp represents an exported app state, along with // validators, consensus params and latest app height. type ExportedApp struct { diff --git a/x/upgrade/depinject.go b/x/upgrade/depinject.go index d0ad08a1c34e..01b93356fdf0 100644 --- a/x/upgrade/depinject.go +++ b/x/upgrade/depinject.go @@ -26,22 +26,31 @@ func (am AppModule) IsOnePerModuleType() {} func init() { appconfig.RegisterModule(&modulev1.Module{}, - appconfig.Provide(ProvideModule), + appconfig.Provide(ProvideModule, ProvideConfig), appconfig.Invoke(PopulateVersionMap), ) } +func ProvideConfig(key depinject.OwnModuleKey) coreserver.ModuleConfigMap { + return coreserver.ModuleConfigMap{ + Module: depinject.ModuleKey(key).Name(), + Config: coreserver.ConfigMap{ + server.FlagUnsafeSkipUpgrades: []int{}, + flags.FlagHome: "", + }, + } +} + type ModuleInputs struct { depinject.In Config *modulev1.Module + ConfigMap coreserver.ConfigMap Environment appmodule.Environment Cdc codec.Codec AddressCodec address.Codec AppVersionModifier coreserver.VersionModifier ConsensusKeeper types.ConsensusKeeper - - DynamicConfig coreserver.DynamicConfig `optional:"true"` } type ModuleOutputs struct { @@ -57,14 +66,15 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { skipUpgradeHeights = make(map[int64]bool) ) - if in.DynamicConfig != nil { - skipUpgrades := cast.ToIntSlice(in.DynamicConfig.Get(server.FlagUnsafeSkipUpgrades)) - for _, h := range skipUpgrades { - skipUpgradeHeights[int64(h)] = true - } - - homePath = in.DynamicConfig.GetString(flags.FlagHome) + skipUpgrades, ok := in.ConfigMap[server.FlagUnsafeSkipUpgrades] + if !ok || skipUpgrades == nil { + skipUpgrades = []int{} + } + heights := cast.ToIntSlice(skipUpgrades) // safe to use cast here as we've handled nil case + for _, h := range heights { + skipUpgradeHeights[int64(h)] = true } + homePath = cast.ToString(in.ConfigMap[flags.FlagHome]) // default to governance authority if not provided authority := authtypes.NewModuleAddress(types.GovModuleName) diff --git a/x/validate/depinject.go b/x/validate/depinject.go index 9f508717f04f..0c383f457abe 100644 --- a/x/validate/depinject.go +++ b/x/validate/depinject.go @@ -3,6 +3,8 @@ package validate import ( "fmt" + "github.com/spf13/cast" + modulev1 "cosmossdk.io/api/cosmos/validate/module/v1" appmodulev2 "cosmossdk.io/core/appmodule/v2" "cosmossdk.io/core/server" @@ -25,17 +27,28 @@ const flagMinGasPricesV2 = "server.minimum-gas-prices" func init() { appconfig.RegisterModule(&modulev1.Module{}, - appconfig.Provide(ProvideModule), + appconfig.Provide(ProvideModule, ProvideConfig), ) } +// ProvideConfig specifies the configuration key for the minimum gas prices. +// During dependency injection, a configuration map is provided with the key set. +func ProvideConfig(key depinject.OwnModuleKey) server.ModuleConfigMap { + return server.ModuleConfigMap{ + Module: depinject.ModuleKey(key).Name(), + Config: server.ConfigMap{ + flagMinGasPricesV2: "", + }, + } +} + type ModuleInputs struct { depinject.In - ModuleConfig *modulev1.Module - Environment appmodulev2.Environment - TxConfig client.TxConfig - DynamicConfig server.DynamicConfig `optional:"true"` + ModuleConfig *modulev1.Module + Environment appmodulev2.Environment + TxConfig client.TxConfig + ConfigMap server.ConfigMap AccountKeeper ante.AccountKeeper BankKeeper authtypes.BankKeeper @@ -69,17 +82,15 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { unorderedTxValidator *ante.UnorderedTxDecorator ) - if in.DynamicConfig != nil { - minGasPricesStr := in.DynamicConfig.GetString(flagMinGasPricesV2) - minGasPrices, err = sdk.ParseDecCoins(minGasPricesStr) - if err != nil { - panic(fmt.Sprintf("invalid minimum gas prices: %v", err)) - } - - feeTxValidator = ante.NewDeductFeeDecorator(in.AccountKeeper, in.BankKeeper, in.FeeGrantKeeper, in.TxFeeChecker) - feeTxValidator.SetMinGasPrices(minGasPrices) // set min gas price in deduct fee decorator + minGasPricesStr := cast.ToString(in.ConfigMap[flagMinGasPricesV2]) + minGasPrices, err = sdk.ParseDecCoins(minGasPricesStr) + if err != nil { + panic(fmt.Sprintf("invalid minimum gas prices: %v", err)) } + feeTxValidator = ante.NewDeductFeeDecorator(in.AccountKeeper, in.BankKeeper, in.FeeGrantKeeper, in.TxFeeChecker) + feeTxValidator.SetMinGasPrices(minGasPrices) // set min gas price in deduct fee decorator + if in.UnorderedTxManager != nil { unorderedTxValidator = ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxTimeoutDuration, in.UnorderedTxManager, in.Environment, ante.DefaultSha256Cost) } From 78cfc68c83af8684bc4d346c4e29606e7e937c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Toledano?= Date: Tue, 29 Oct 2024 10:20:41 +0100 Subject: [PATCH 07/24] feat(client/v2): broadcast logic (#22282) --- client/v2/CHANGELOG.md | 1 + client/v2/broadcast/broadcaster.go | 15 + client/v2/broadcast/comet/comet.go | 197 ++++++++++++ client/v2/broadcast/comet/comet_test.go | 149 +++++++++ .../v2/broadcast/comet/testutil/comet_mock.go | 285 ++++++++++++++++++ client/v2/go.mod | 6 +- client/v2/go.sum | 4 +- client/v2/tx/tx.go | 36 ++- scripts/mockgen.sh | 1 + simapp/go.mod | 2 +- simapp/go.sum | 4 +- simapp/v2/go.mod | 2 +- tests/go.mod | 2 +- tests/go.sum | 4 +- 14 files changed, 688 insertions(+), 20 deletions(-) create mode 100644 client/v2/broadcast/broadcaster.go create mode 100644 client/v2/broadcast/comet/comet.go create mode 100644 client/v2/broadcast/comet/comet_test.go create mode 100644 client/v2/broadcast/comet/testutil/comet_mock.go diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index 8bd7877b448a..86a5704ed2a8 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#18461](https://github.com/cosmos/cosmos-sdk/pull/18461) Support governance proposals. * [#20623](https://github.com/cosmos/cosmos-sdk/pull/20623) Introduce client/v2 tx factory. * [#20623](https://github.com/cosmos/cosmos-sdk/pull/20623) Extend client/v2 keyring interface with `KeyType` and `KeyInfo`. +* [#22282](https://github.com/cosmos/cosmos-sdk/pull/22282) Added custom broadcast logic. ### Improvements diff --git a/client/v2/broadcast/broadcaster.go b/client/v2/broadcast/broadcaster.go new file mode 100644 index 000000000000..bcee034be740 --- /dev/null +++ b/client/v2/broadcast/broadcaster.go @@ -0,0 +1,15 @@ +package broadcast + +import "context" + +// Broadcaster defines an interface for broadcasting transactions to the consensus engine. +type Broadcaster interface { + // Broadcast sends a transaction to the network and returns the result. + // + // It returns a byte slice containing the formatted result that will be + // passed to the output writer, and an error if the broadcast failed. + Broadcast(ctx context.Context, txBytes []byte) ([]byte, error) + + // Consensus returns the consensus engine identifier for this Broadcaster. + Consensus() string +} diff --git a/client/v2/broadcast/comet/comet.go b/client/v2/broadcast/comet/comet.go new file mode 100644 index 000000000000..0a04d94a2829 --- /dev/null +++ b/client/v2/broadcast/comet/comet.go @@ -0,0 +1,197 @@ +package comet + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "strings" + + "github.com/cometbft/cometbft/mempool" + rpcclient "github.com/cometbft/cometbft/rpc/client" + rpchttp "github.com/cometbft/cometbft/rpc/client/http" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + cmttypes "github.com/cometbft/cometbft/types" + + apiacbci "cosmossdk.io/api/cosmos/base/abci/v1beta1" + "cosmossdk.io/client/v2/broadcast" + + "github.com/cosmos/cosmos-sdk/codec" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const ( + // BroadcastSync defines a tx broadcasting mode where the client waits for + // a CheckTx execution response only. + BroadcastSync = "sync" + // BroadcastAsync defines a tx broadcasting mode where the client returns + // immediately. + BroadcastAsync = "async" + + // cometBftConsensus is the identifier for the CometBFT consensus engine. + cometBFTConsensus = "comet" +) + +// CometRPC defines the interface of a CometBFT RPC client needed for +// queries and transaction handling. +type CometRPC interface { + rpcclient.ABCIClient + + Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error) + Status(context.Context) (*coretypes.ResultStatus, error) + Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) + BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error) + BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) + BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) + Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) + Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error) + TxSearch( + ctx context.Context, + query string, + prove bool, + page, perPage *int, + orderBy string, + ) (*coretypes.ResultTxSearch, error) + BlockSearch( + ctx context.Context, + query string, + page, perPage *int, + orderBy string, + ) (*coretypes.ResultBlockSearch, error) +} + +var _ broadcast.Broadcaster = &CometBFTBroadcaster{} + +// CometBFTBroadcaster implements the Broadcaster interface for CometBFT consensus engine. +type CometBFTBroadcaster struct { + rpcClient CometRPC + mode string + cdc codec.JSONCodec +} + +// NewCometBFTBroadcaster creates a new CometBFTBroadcaster. +func NewCometBFTBroadcaster(rpcURL, mode string, cdc codec.JSONCodec) (*CometBFTBroadcaster, error) { + if cdc == nil { + return nil, errors.New("codec can't be nil") + } + + if mode == "" { + mode = BroadcastSync + } + + rpcClient, err := rpchttp.New(rpcURL) + if err != nil { + return nil, fmt.Errorf("failed to create CometBft RPC client: %w", err) + } + + return &CometBFTBroadcaster{ + rpcClient: rpcClient, + mode: mode, + cdc: cdc, + }, nil +} + +// Consensus returns the consensus engine name used by the broadcaster. +// It always returns "comet" for CometBFTBroadcaster. +func (c *CometBFTBroadcaster) Consensus() string { + return cometBFTConsensus +} + +// Broadcast sends a transaction to the network and returns the result. +// returns a byte slice containing the JSON-encoded result and an error if the broadcast failed. +func (c *CometBFTBroadcaster) Broadcast(ctx context.Context, txBytes []byte) ([]byte, error) { + if c.cdc == nil { + return []byte{}, fmt.Errorf("JSON codec is not initialized") + } + + var broadcastFunc func(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error) + switch c.mode { + case BroadcastSync: + broadcastFunc = c.rpcClient.BroadcastTxSync + case BroadcastAsync: + broadcastFunc = c.rpcClient.BroadcastTxAsync + default: + return []byte{}, fmt.Errorf("unknown broadcast mode: %s", c.mode) + } + + res, err := c.broadcast(ctx, txBytes, broadcastFunc) + if err != nil { + return []byte{}, err + } + + return c.cdc.MarshalJSON(res) +} + +// broadcast sends a transaction to the CometBFT network using the provided function. +func (c *CometBFTBroadcaster) broadcast(ctx context.Context, txBytes []byte, + fn func(ctx context.Context, tx cmttypes.Tx) (*coretypes.ResultBroadcastTx, error), +) (*apiacbci.TxResponse, error) { + bResult, err := fn(ctx, txBytes) + if errRes := checkCometError(err, txBytes); errRes != nil { + return errRes, nil + } + + return newResponseFormatBroadcastTx(bResult), err +} + +// checkCometError checks for errors returned by the CometBFT network and returns an appropriate TxResponse. +// It extracts error information and constructs a TxResponse with the error details. +func checkCometError(err error, tx cmttypes.Tx) *apiacbci.TxResponse { + if err == nil { + return nil + } + + errStr := strings.ToLower(err.Error()) + txHash := fmt.Sprintf("%X", tx.Hash()) + + switch { + case strings.Contains(errStr, strings.ToLower(mempool.ErrTxInCache.Error())): + return &apiacbci.TxResponse{ + Code: sdkerrors.ErrTxInMempoolCache.ABCICode(), + Codespace: sdkerrors.ErrTxInMempoolCache.Codespace(), + Txhash: txHash, + } + + case strings.Contains(errStr, "mempool is full"): + return &apiacbci.TxResponse{ + Code: sdkerrors.ErrMempoolIsFull.ABCICode(), + Codespace: sdkerrors.ErrMempoolIsFull.Codespace(), + Txhash: txHash, + } + + case strings.Contains(errStr, "tx too large"): + return &apiacbci.TxResponse{ + Code: sdkerrors.ErrTxTooLarge.ABCICode(), + Codespace: sdkerrors.ErrTxTooLarge.Codespace(), + Txhash: txHash, + } + + default: + return nil + } +} + +// newResponseFormatBroadcastTx returns a TxResponse given a ResultBroadcastTx from cometbft +func newResponseFormatBroadcastTx(res *coretypes.ResultBroadcastTx) *apiacbci.TxResponse { + if res == nil { + return nil + } + + parsedLogs, _ := parseABCILogs(res.Log) + + return &apiacbci.TxResponse{ + Code: res.Code, + Codespace: res.Codespace, + Data: res.Data.String(), + RawLog: res.Log, + Logs: parsedLogs, + Txhash: res.Hash.String(), + } +} + +// parseABCILogs attempts to parse a stringified ABCI tx log into a slice of +// ABCIMessageLog types. It returns an error upon JSON decoding failure. +func parseABCILogs(logs string) (res []*apiacbci.ABCIMessageLog, err error) { + err = json.Unmarshal([]byte(logs), &res) + return res, err +} diff --git a/client/v2/broadcast/comet/comet_test.go b/client/v2/broadcast/comet/comet_test.go new file mode 100644 index 000000000000..0eb8b81685ed --- /dev/null +++ b/client/v2/broadcast/comet/comet_test.go @@ -0,0 +1,149 @@ +package comet + +import ( + "context" + "errors" + "testing" + + "github.com/cometbft/cometbft/mempool" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + + apiacbci "cosmossdk.io/api/cosmos/base/abci/v1beta1" + mockrpc "cosmossdk.io/client/v2/broadcast/comet/testutil" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/testutil" +) + +var cdc = testutil.CodecOptions{}.NewCodec() + +func TestNewCometBftBroadcaster(t *testing.T) { + tests := []struct { + name string + cdc codec.JSONCodec + mode string + want *CometBFTBroadcaster + wantErr bool + }{ + { + name: "constructor", + mode: BroadcastSync, + cdc: cdc, + want: &CometBFTBroadcaster{ + mode: BroadcastSync, + cdc: cdc, + }, + }, + { + name: "nil codec", + mode: BroadcastSync, + cdc: nil, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := NewCometBFTBroadcaster("localhost:26657", tt.mode, tt.cdc) + if tt.wantErr { + require.Error(t, err) + require.Nil(t, got) + } else { + require.Equal(t, got.mode, tt.want.mode) + require.Equal(t, got.cdc, tt.want.cdc) + } + }) + } +} + +func TestCometBftBroadcaster_Broadcast(t *testing.T) { + ctrl := gomock.NewController(t) + cometMock := mockrpc.NewMockCometRPC(ctrl) + c := CometBFTBroadcaster{ + rpcClient: cometMock, + mode: BroadcastSync, + cdc: cdc, + } + tests := []struct { + name string + mode string + setupMock func(*mockrpc.MockCometRPC) + wantErr bool + }{ + { + name: "sync", + mode: BroadcastSync, + setupMock: func(m *mockrpc.MockCometRPC) { + m.EXPECT().BroadcastTxSync(context.Background(), gomock.Any()).Return(&coretypes.ResultBroadcastTx{ + Code: 0, + Data: []byte{}, + Log: "", + Codespace: "", + Hash: []byte("%�����\u0010\n�T�\u0017\u0016�N^H[5�\u0006}�n�w�/Vi� "), + }, nil) + }, + }, + { + name: "async", + mode: BroadcastAsync, + setupMock: func(m *mockrpc.MockCometRPC) { + m.EXPECT().BroadcastTxAsync(context.Background(), gomock.Any()).Return(&coretypes.ResultBroadcastTx{ + Code: 0, + Data: []byte{}, + Log: "", + Codespace: "", + Hash: []byte("%�����\u0010\n�T�\u0017\u0016�N^H[5�\u0006}�n�w�/Vi� "), + }, nil) + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c.mode = tt.mode + tt.setupMock(cometMock) + got, err := c.Broadcast(context.Background(), []byte{}) + if tt.wantErr { + require.Error(t, err) + } else { + require.NotNil(t, got) + } + }) + } +} + +func Test_checkCometError(t *testing.T) { + tests := []struct { + name string + err error + want *apiacbci.TxResponse + }{ + { + name: "tx already in cache", + err: errors.New("tx already exists in cache"), + want: &apiacbci.TxResponse{ + Code: 19, + }, + }, + { + name: "mempool is full", + err: mempool.ErrMempoolIsFull{}, + want: &apiacbci.TxResponse{ + Code: 20, + }, + }, + { + name: "tx too large", + err: mempool.ErrTxTooLarge{}, + want: &apiacbci.TxResponse{ + Code: 21, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := checkCometError(tt.err, []byte{}) + require.Equal(t, got.Code, tt.want.Code) + }) + } +} diff --git a/client/v2/broadcast/comet/testutil/comet_mock.go b/client/v2/broadcast/comet/testutil/comet_mock.go new file mode 100644 index 000000000000..75cdc50af713 --- /dev/null +++ b/client/v2/broadcast/comet/testutil/comet_mock.go @@ -0,0 +1,285 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: client/v2/broadcast/comet/comet.go +// +// Generated by this command: +// +// mockgen -source=client/v2/broadcast/comet/comet.go -package testutil -destination client/v2/broadcast/comet/testutil/comet_mock.go +// + +// Package testutil is a generated GoMock package. +package testutil + +import ( + context "context" + reflect "reflect" + + bytes "github.com/cometbft/cometbft/libs/bytes" + client "github.com/cometbft/cometbft/rpc/client" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + types "github.com/cometbft/cometbft/types" + gomock "go.uber.org/mock/gomock" +) + +// MockCometRPC is a mock of CometRPC interface. +type MockCometRPC struct { + ctrl *gomock.Controller + recorder *MockCometRPCMockRecorder + isgomock struct{} +} + +// MockCometRPCMockRecorder is the mock recorder for MockCometRPC. +type MockCometRPCMockRecorder struct { + mock *MockCometRPC +} + +// NewMockCometRPC creates a new mock instance. +func NewMockCometRPC(ctrl *gomock.Controller) *MockCometRPC { + mock := &MockCometRPC{ctrl: ctrl} + mock.recorder = &MockCometRPCMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockCometRPC) EXPECT() *MockCometRPCMockRecorder { + return m.recorder +} + +// ABCIInfo mocks base method. +func (m *MockCometRPC) ABCIInfo(ctx context.Context) (*coretypes.ResultABCIInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ABCIInfo", ctx) + ret0, _ := ret[0].(*coretypes.ResultABCIInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ABCIInfo indicates an expected call of ABCIInfo. +func (mr *MockCometRPCMockRecorder) ABCIInfo(ctx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ABCIInfo", reflect.TypeOf((*MockCometRPC)(nil).ABCIInfo), ctx) +} + +// ABCIQuery mocks base method. +func (m *MockCometRPC) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ABCIQuery", ctx, path, data) + ret0, _ := ret[0].(*coretypes.ResultABCIQuery) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ABCIQuery indicates an expected call of ABCIQuery. +func (mr *MockCometRPCMockRecorder) ABCIQuery(ctx, path, data any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ABCIQuery", reflect.TypeOf((*MockCometRPC)(nil).ABCIQuery), ctx, path, data) +} + +// ABCIQueryWithOptions mocks base method. +func (m *MockCometRPC) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ABCIQueryWithOptions", ctx, path, data, opts) + ret0, _ := ret[0].(*coretypes.ResultABCIQuery) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ABCIQueryWithOptions indicates an expected call of ABCIQueryWithOptions. +func (mr *MockCometRPCMockRecorder) ABCIQueryWithOptions(ctx, path, data, opts any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ABCIQueryWithOptions", reflect.TypeOf((*MockCometRPC)(nil).ABCIQueryWithOptions), ctx, path, data, opts) +} + +// Block mocks base method. +func (m *MockCometRPC) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Block", ctx, height) + ret0, _ := ret[0].(*coretypes.ResultBlock) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Block indicates an expected call of Block. +func (mr *MockCometRPCMockRecorder) Block(ctx, height any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Block", reflect.TypeOf((*MockCometRPC)(nil).Block), ctx, height) +} + +// BlockByHash mocks base method. +func (m *MockCometRPC) BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockByHash", ctx, hash) + ret0, _ := ret[0].(*coretypes.ResultBlock) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BlockByHash indicates an expected call of BlockByHash. +func (mr *MockCometRPCMockRecorder) BlockByHash(ctx, hash any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByHash", reflect.TypeOf((*MockCometRPC)(nil).BlockByHash), ctx, hash) +} + +// BlockResults mocks base method. +func (m *MockCometRPC) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockResults", ctx, height) + ret0, _ := ret[0].(*coretypes.ResultBlockResults) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BlockResults indicates an expected call of BlockResults. +func (mr *MockCometRPCMockRecorder) BlockResults(ctx, height any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockResults", reflect.TypeOf((*MockCometRPC)(nil).BlockResults), ctx, height) +} + +// BlockSearch mocks base method. +func (m *MockCometRPC) BlockSearch(ctx context.Context, query string, page, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockSearch", ctx, query, page, perPage, orderBy) + ret0, _ := ret[0].(*coretypes.ResultBlockSearch) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BlockSearch indicates an expected call of BlockSearch. +func (mr *MockCometRPCMockRecorder) BlockSearch(ctx, query, page, perPage, orderBy any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockSearch", reflect.TypeOf((*MockCometRPC)(nil).BlockSearch), ctx, query, page, perPage, orderBy) +} + +// BlockchainInfo mocks base method. +func (m *MockCometRPC) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockchainInfo", ctx, minHeight, maxHeight) + ret0, _ := ret[0].(*coretypes.ResultBlockchainInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BlockchainInfo indicates an expected call of BlockchainInfo. +func (mr *MockCometRPCMockRecorder) BlockchainInfo(ctx, minHeight, maxHeight any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockchainInfo", reflect.TypeOf((*MockCometRPC)(nil).BlockchainInfo), ctx, minHeight, maxHeight) +} + +// BroadcastTxAsync mocks base method. +func (m *MockCometRPC) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BroadcastTxAsync", ctx, tx) + ret0, _ := ret[0].(*coretypes.ResultBroadcastTx) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BroadcastTxAsync indicates an expected call of BroadcastTxAsync. +func (mr *MockCometRPCMockRecorder) BroadcastTxAsync(ctx, tx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BroadcastTxAsync", reflect.TypeOf((*MockCometRPC)(nil).BroadcastTxAsync), ctx, tx) +} + +// BroadcastTxCommit mocks base method. +func (m *MockCometRPC) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BroadcastTxCommit", ctx, tx) + ret0, _ := ret[0].(*coretypes.ResultBroadcastTxCommit) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BroadcastTxCommit indicates an expected call of BroadcastTxCommit. +func (mr *MockCometRPCMockRecorder) BroadcastTxCommit(ctx, tx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BroadcastTxCommit", reflect.TypeOf((*MockCometRPC)(nil).BroadcastTxCommit), ctx, tx) +} + +// BroadcastTxSync mocks base method. +func (m *MockCometRPC) BroadcastTxSync(ctx context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BroadcastTxSync", ctx, tx) + ret0, _ := ret[0].(*coretypes.ResultBroadcastTx) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BroadcastTxSync indicates an expected call of BroadcastTxSync. +func (mr *MockCometRPCMockRecorder) BroadcastTxSync(ctx, tx any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BroadcastTxSync", reflect.TypeOf((*MockCometRPC)(nil).BroadcastTxSync), ctx, tx) +} + +// Commit mocks base method. +func (m *MockCometRPC) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Commit", ctx, height) + ret0, _ := ret[0].(*coretypes.ResultCommit) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Commit indicates an expected call of Commit. +func (mr *MockCometRPCMockRecorder) Commit(ctx, height any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Commit", reflect.TypeOf((*MockCometRPC)(nil).Commit), ctx, height) +} + +// Status mocks base method. +func (m *MockCometRPC) Status(arg0 context.Context) (*coretypes.ResultStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Status", arg0) + ret0, _ := ret[0].(*coretypes.ResultStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Status indicates an expected call of Status. +func (mr *MockCometRPCMockRecorder) Status(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockCometRPC)(nil).Status), arg0) +} + +// Tx mocks base method. +func (m *MockCometRPC) Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Tx", ctx, hash, prove) + ret0, _ := ret[0].(*coretypes.ResultTx) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Tx indicates an expected call of Tx. +func (mr *MockCometRPCMockRecorder) Tx(ctx, hash, prove any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tx", reflect.TypeOf((*MockCometRPC)(nil).Tx), ctx, hash, prove) +} + +// TxSearch mocks base method. +func (m *MockCometRPC) TxSearch(ctx context.Context, query string, prove bool, page, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TxSearch", ctx, query, prove, page, perPage, orderBy) + ret0, _ := ret[0].(*coretypes.ResultTxSearch) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TxSearch indicates an expected call of TxSearch. +func (mr *MockCometRPCMockRecorder) TxSearch(ctx, query, prove, page, perPage, orderBy any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TxSearch", reflect.TypeOf((*MockCometRPC)(nil).TxSearch), ctx, query, prove, page, perPage, orderBy) +} + +// Validators mocks base method. +func (m *MockCometRPC) Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Validators", ctx, height, page, perPage) + ret0, _ := ret[0].(*coretypes.ResultValidators) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Validators indicates an expected call of Validators. +func (mr *MockCometRPCMockRecorder) Validators(ctx, height, page, perPage any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validators", reflect.TypeOf((*MockCometRPC)(nil).Validators), ctx, height, page, perPage) +} diff --git a/client/v2/go.mod b/client/v2/go.mod index c488f2bedcae..46ffa46d19d4 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -13,6 +13,7 @@ require ( github.com/cosmos/cosmos-sdk v0.53.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 + go.uber.org/mock v0.5.0 google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.35.1 gotest.tools/v3 v3.5.1 @@ -27,7 +28,7 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/math v1.3.0 - cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect + cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -47,7 +48,7 @@ require ( github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v1.0.0-rc1.0.20240908111210-ab0be101882f // indirect + github.com/cometbft/cometbft v1.0.0-rc1.0.20240908111210-ab0be101882f github.com/cometbft/cometbft-db v0.15.0 // indirect github.com/cometbft/cometbft/api v1.0.0-rc.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -150,7 +151,6 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect - go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 825bb7f91a05..840cb42b9f38 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -18,8 +18,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= -cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac h1:3joNZZWZ3k7fMsrBDL1ktuQ2xQwYLZOaDhkruadDFmc= +cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o= cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= diff --git a/client/v2/tx/tx.go b/client/v2/tx/tx.go index 64e0199d8172..ab82c813ac20 100644 --- a/client/v2/tx/tx.go +++ b/client/v2/tx/tx.go @@ -2,6 +2,7 @@ package tx import ( "bufio" + "context" "errors" "fmt" "os" @@ -10,6 +11,8 @@ import ( "github.com/spf13/pflag" apitxsigning "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + "cosmossdk.io/client/v2/broadcast" + "cosmossdk.io/client/v2/broadcast/comet" "cosmossdk.io/client/v2/internal/account" "cosmossdk.io/core/transaction" @@ -18,9 +21,9 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" ) -// GenerateOrBroadcastTxCLI will either generate and print an unsigned transaction -// or sign it and broadcast it returning an error upon failure. -func GenerateOrBroadcastTxCLI(ctx client.Context, flagSet *pflag.FlagSet, msgs ...transaction.Msg) error { +// GenerateOrBroadcastTxCLIWithBroadcaster will either generate and print an unsigned transaction +// or sign it and broadcast it with the specified broadcaster returning an error upon failure. +func GenerateOrBroadcastTxCLIWithBroadcaster(ctx client.Context, flagSet *pflag.FlagSet, broadcaster broadcast.Broadcaster, msgs ...transaction.Msg) error { if err := validateMessages(msgs...); err != nil { return err } @@ -40,7 +43,25 @@ func GenerateOrBroadcastTxCLI(ctx client.Context, flagSet *pflag.FlagSet, msgs . return dryRun(txf, msgs...) } - return BroadcastTx(ctx, txf, msgs...) + return BroadcastTx(ctx, txf, broadcaster, msgs...) +} + +// GenerateOrBroadcastTxCLI will either generate and print an unsigned transaction +// or sign it and broadcast it using default CometBFT broadcaster, returning an error upon failure. +func GenerateOrBroadcastTxCLI(ctx client.Context, flagSet *pflag.FlagSet, msgs ...transaction.Msg) error { + cometBroadcaster, err := getCometBroadcaster(ctx, flagSet) + if err != nil { + return err + } + + return GenerateOrBroadcastTxCLIWithBroadcaster(ctx, flagSet, cometBroadcaster, msgs...) +} + +// getCometBroadcaster returns a new CometBFT broadcaster based on the provided context and flag set. +func getCometBroadcaster(ctx client.Context, flagSet *pflag.FlagSet) (broadcast.Broadcaster, error) { + url, _ := flagSet.GetString("node") + mode, _ := flagSet.GetString("broadcast-mode") + return comet.NewCometBFTBroadcaster(url, mode, ctx.Codec) } // newFactory creates a new transaction Factory based on the provided context and flag set. @@ -129,7 +150,7 @@ func SimulateTx(ctx client.Context, flagSet *pflag.FlagSet, msgs ...transaction. // BroadcastTx attempts to generate, sign and broadcast a transaction with the // given set of messages. It will also simulate gas requirements if necessary. // It will return an error upon failure. -func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...transaction.Msg) error { +func BroadcastTx(clientCtx client.Context, txf Factory, broadcaster broadcast.Broadcaster, msgs ...transaction.Msg) error { if txf.simulateAndExecute() { err := txf.calculateGas(msgs...) if err != nil { @@ -183,13 +204,12 @@ func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...transaction.Msg) return err } - // broadcast to a CometBFT node - res, err := clientCtx.BroadcastTx(txBytes) + res, err := broadcaster.Broadcast(context.Background(), txBytes) if err != nil { return err } - return clientCtx.PrintProto(res) + return clientCtx.PrintString(string(res)) } // countDirectSigners counts the number of DIRECT signers in a signature data. diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index 1018534c81bc..4a13745c0f63 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -28,3 +28,4 @@ $mockgen_cmd -source=x/auth/vesting/types/expected_keepers.go -package testutil $mockgen_cmd -source=x/protocolpool/types/expected_keepers.go -package testutil -destination x/protocolpool/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/upgrade/types/expected_keepers.go -package testutil -destination x/upgrade/testutil/expected_keepers_mocks.go $mockgen_cmd -source=core/gas/service.go -package gas -destination core/testing/gas/service_mocks.go +$mockgen_cmd -source=client/v2/broadcast/comet/comet.go -package testutil -destination client/v2/broadcast/comet/testutil/comet_mock.go diff --git a/simapp/go.mod b/simapp/go.mod index 3172b015543f..96e451a955e7 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -59,7 +59,7 @@ require ( cloud.google.com/go/iam v1.1.13 // indirect cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect + cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index d31cb914410e..753a95f0dcf5 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -204,8 +204,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= -cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac h1:3joNZZWZ3k7fMsrBDL1ktuQ2xQwYLZOaDhkruadDFmc= +cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index f98bb35c54ec..0e803ed0f86d 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -11,7 +11,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/runtime/v2 v2.0.0-00010101000000-000000000000 cosmossdk.io/server/v2 v2.0.0-20240718121635-a877e3e8048a - cosmossdk.io/server/v2/cometbft v0.0.0-00010101000000-000000000000 + cosmossdk.io/server/v2/cometbft v0.0.0-20241015140036-ee3d320eaa55 cosmossdk.io/store/v2 v2.0.0 cosmossdk.io/tools/confix v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e diff --git a/tests/go.mod b/tests/go.mod index 8fdb15329927..a98402d39de5 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -65,7 +65,7 @@ require ( cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect + cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/tests/go.sum b/tests/go.sum index fc4b21bab7b7..6e624911ccd2 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -204,8 +204,8 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 h1:DmOoS/1PeY6Ih0hAVlJ69kLMUrLV+TCbfICrZtB1vdU= -cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= +cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac h1:3joNZZWZ3k7fMsrBDL1ktuQ2xQwYLZOaDhkruadDFmc= +cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= From fa3eadccf6d9b6821ff8038021f4dc418f671a8b Mon Sep 17 00:00:00 2001 From: KI Date: Wed, 30 Oct 2024 16:47:54 +0600 Subject: [PATCH 08/24] docs: fix KWallet Handbook (#22395) --- docs/user/run-node/00-keyring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/run-node/00-keyring.md b/docs/user/run-node/00-keyring.md index b4a2020068fe..f307f4bbf90f 100644 --- a/docs/user/run-node/00-keyring.md +++ b/docs/user/run-node/00-keyring.md @@ -90,7 +90,7 @@ one you may want to use specifically to encrypt the password store. The `kwallet` backend uses `KDE Wallet Manager`, which comes installed by default on the GNU/Linux distributions that ships KDE as default desktop environment. Please refer to -[KWallet Handbook](https://docs.kde.org/stable5/en/kdeutils/kwallet5/index.html) for more +[KWallet Handbook](https://docs.kde.org/stable5/en/kwalletmanager/kwallet5/index.html) for more information. ### The `test` backend From ee16adb09295fdc0b98c7bfdc60d0f74a2b6b28c Mon Sep 17 00:00:00 2001 From: xujiangyu <47973791+xujiangyu@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:49:00 +0800 Subject: [PATCH 09/24] refactor(math): refactor ApproxRoot for readality (#22263) Co-authored-by: heren-ke --- math/dec.go | 20 ++++++++++++++------ math/dec_test.go | 3 +++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/math/dec.go b/math/dec.go index 3ed930d5c484..76a37113b6b8 100644 --- a/math/dec.go +++ b/math/dec.go @@ -467,33 +467,41 @@ func (d LegacyDec) ApproxRoot(root uint64) (guess LegacyDec, err error) { } }() + if root == 0 { + // Return 1 as root 0 of any number is considered 1. + return LegacyOneDec(), nil + } + if d.IsNegative() { absRoot, err := d.Neg().ApproxRoot(root) return absRoot.NegMut(), err } - // One decimal, that we invalidate later. Helps us save a heap allocation. + // Direct return for base cases: d^1 = d or when d is 0 or 1. scratchOneDec := LegacyOneDec() if root == 1 || d.IsZero() || d.Equal(scratchOneDec) { return d, nil } - if root == 0 { - return scratchOneDec, nil - } - guess, delta := scratchOneDec, LegacyOneDec() - for iter := 0; iter < maxApproxRootIterations && delta.Abs().GT(smallestDec); iter++ { + for iter := 0; iter < maxApproxRootIterations; iter++ { prev := guess.Power(root - 1) if prev.IsZero() { prev = smallestDec } + + // Compute delta = (d/prev - guess) / root delta.Set(d).QuoMut(prev) delta.SubMut(guess) delta.QuoInt64Mut(int64(root)) guess.AddMut(delta) + + // Stop when delta is small enough + if delta.Abs().LTE(smallestDec) { + break + } } return guess, nil diff --git a/math/dec_test.go b/math/dec_test.go index 90d610199f3f..316b6aaa63dc 100644 --- a/math/dec_test.go +++ b/math/dec_test.go @@ -449,6 +449,9 @@ func (s *decimalTestSuite) TestApproxRoot() { root uint64 expected math.LegacyDec }{ + {math.LegacyNewDecFromInt(math.NewInt(2)), 0, math.LegacyOneDec()}, // 2 ^ 0 => 1.0 + {math.LegacyNewDecWithPrec(4, 2), 0, math.LegacyOneDec()}, // 0.04 ^ 0 => 1.0 + {math.LegacyNewDec(0), 1, math.LegacyNewDec(0)}, // 0 ^ 1 => 0 {math.LegacyOneDec(), 10, math.LegacyOneDec()}, // 1.0 ^ (0.1) => 1.0 {math.LegacyNewDecWithPrec(25, 2), 2, math.LegacyNewDecWithPrec(5, 1)}, // 0.25 ^ (0.5) => 0.5 {math.LegacyNewDecWithPrec(4, 2), 2, math.LegacyNewDecWithPrec(2, 1)}, // 0.04 ^ (0.5) => 0.2 From 6b6e71594a65920ff6a1d37449d07c0ec4781e00 Mon Sep 17 00:00:00 2001 From: cool-developer <51834436+cool-develope@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:13:12 -0400 Subject: [PATCH 10/24] feat(indexer): implement `schema.HasModuleCodec` interface in the `bank` module (#22349) Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> --- x/bank/go.mod | 3 ++- x/bank/keeper/view.go | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/x/bank/go.mod b/x/bank/go.mod index 87e20a338b7f..8f3ff02f12b1 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -160,8 +160,9 @@ require ( sigs.k8s.io/yaml v1.4.0 // indirect ) +require cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 + require ( - cosmossdk.io/schema v0.3.1-0.20240930054013-7c6e0388a3f9 // indirect github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cosmos/cosmos-db v1.0.3-0.20240911104526-ddc3f09bfc22 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/x/bank/keeper/view.go b/x/bank/keeper/view.go index 496e907de8ca..08dc56300077 100644 --- a/x/bank/keeper/view.go +++ b/x/bank/keeper/view.go @@ -10,6 +10,7 @@ import ( "cosmossdk.io/core/appmodule" errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" + "cosmossdk.io/schema" "cosmossdk.io/x/bank/types" "github.com/cosmos/cosmos-sdk/codec" @@ -78,10 +79,10 @@ func NewBaseViewKeeper(env appmodule.Environment, cdc codec.BinaryCodec, ak type cdc: cdc, ak: ak, addrCdc: ak.AddressCodec(), - Supply: collections.NewMap(sb, types.SupplyKey, "supply", collections.StringKey, sdk.IntValue), - DenomMetadata: collections.NewMap(sb, types.DenomMetadataPrefix, "denom_metadata", collections.StringKey, codec.CollValue[types.Metadata](cdc)), - SendEnabled: collections.NewMap(sb, types.SendEnabledPrefix, "send_enabled", collections.StringKey, codec.BoolValue), // NOTE: we use a bool value which uses protobuf to retain state backwards compat - Balances: collections.NewIndexedMap(sb, types.BalancesPrefix, "balances", collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), types.BalanceValueCodec, newBalancesIndexes(sb)), + Supply: collections.NewMap(sb, types.SupplyKey, "supply", collections.StringKey.WithName("supply"), sdk.IntValue), + DenomMetadata: collections.NewMap(sb, types.DenomMetadataPrefix, "denom_metadata", collections.StringKey.WithName("denom_metadata"), codec.CollValue[types.Metadata](cdc)), + SendEnabled: collections.NewMap(sb, types.SendEnabledPrefix, "send_enabled", collections.StringKey.WithName("send_enabled"), codec.BoolValue), // NOTE: we use a bool value which uses protobuf to retain state backwards compat + Balances: collections.NewIndexedMap(sb, types.BalancesPrefix, "balances", collections.NamedPairKeyCodec("address", sdk.AccAddressKey, "balances", collections.StringKey), types.BalanceValueCodec, newBalancesIndexes(sb)), Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), } @@ -256,3 +257,9 @@ func (k BaseViewKeeper) ValidateBalance(ctx context.Context, addr sdk.AccAddress return nil } + +// ModuleCodec implements `schema.HasModuleCodec` interface. +// It allows the indexer to decode the module's KVPairUpdate. +func (k BaseViewKeeper) ModuleCodec() (schema.ModuleCodec, error) { + return k.Schema.ModuleCodec(collections.IndexingOptions{}) +} From 470e0859462b28a53adb411843539561d11d7bf5 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Wed, 30 Oct 2024 10:35:07 -0500 Subject: [PATCH 11/24] fix(server/v2): return ErrHelp (#22399) --- server/v2/command_factory.go | 2 +- simapp/v2/simdv2/cmd/root_di.go | 6 ++++++ simapp/v2/simdv2/cmd/root_test.go | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/server/v2/command_factory.go b/server/v2/command_factory.go index a9f544a2f3b8..999f3565c22e 100644 --- a/server/v2/command_factory.go +++ b/server/v2/command_factory.go @@ -149,7 +149,7 @@ func (f *CommandFactory) ParseCommand( if err = cmd.ParseFlags(args); err != nil { // help requested, return the command early if errors.Is(err, pflag.ErrHelp) { - return cmd, nil, nil, nil + return cmd, nil, nil, err } return nil, nil, nil, err } diff --git a/simapp/v2/simdv2/cmd/root_di.go b/simapp/v2/simdv2/cmd/root_di.go index 0bbae702becb..d1e3f62c5e12 100644 --- a/simapp/v2/simdv2/cmd/root_di.go +++ b/simapp/v2/simdv2/cmd/root_di.go @@ -1,7 +1,10 @@ package cmd import ( + "errors" + "github.com/spf13/cobra" + "github.com/spf13/pflag" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/client/v2/autocli" @@ -38,6 +41,9 @@ func NewRootCmd[T transaction.Tx]( subCommand, configMap, logger, err := factory.ParseCommand(rootCommand, args) if err != nil { + if errors.Is(err, pflag.ErrHelp) { + return rootCommand, nil + } return nil, err } diff --git a/simapp/v2/simdv2/cmd/root_test.go b/simapp/v2/simdv2/cmd/root_test.go index 7f7d6a07d95a..687e8aa510f0 100644 --- a/simapp/v2/simdv2/cmd/root_test.go +++ b/simapp/v2/simdv2/cmd/root_test.go @@ -1,6 +1,7 @@ package cmd_test import ( + "bytes" "fmt" "testing" @@ -42,3 +43,25 @@ func TestHomeFlagRegistration(t *testing.T) { require.NoError(t, err) require.Equal(t, result, homeDir) } + +func TestHelpRequested(t *testing.T) { + argz := [][]string{ + {"query", "--help"}, + {"query", "tx", "-h"}, + {"--help"}, + {"start", "-h"}, + } + + for _, args := range argz { + rootCmd, err := cmd.NewRootCmd[transaction.Tx](args...) + require.NoError(t, err) + + var out bytes.Buffer + rootCmd.SetArgs(args) + rootCmd.SetOut(&out) + require.NoError(t, rootCmd.Execute()) + require.Contains(t, out.String(), args[0]) + require.Contains(t, out.String(), "--help") + require.Contains(t, out.String(), "Usage:") + } +} From c754b206c21ee2d374203bc83f723123a476fe24 Mon Sep 17 00:00:00 2001 From: testinginprod <98415576+testinginprod@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:23:34 +0100 Subject: [PATCH 12/24] refactor(serverv2): remove unused interface methods, honuor context (#22394) --- runtime/v2/store.go | 23 ----------------------- server/v2/api/grpc/server.go | 8 ++++---- server/v2/api/utils.go | 22 ++++++++++++++++++++++ server/v2/api/utils_test.go | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 27 deletions(-) create mode 100644 server/v2/api/utils.go create mode 100644 server/v2/api/utils_test.go diff --git a/runtime/v2/store.go b/runtime/v2/store.go index 5d37c321c1fe..0d9b4422844f 100644 --- a/runtime/v2/store.go +++ b/runtime/v2/store.go @@ -7,7 +7,6 @@ import ( "cosmossdk.io/core/store" "cosmossdk.io/server/v2/stf" storev2 "cosmossdk.io/store/v2" - "cosmossdk.io/store/v2/proof" ) // NewKVStoreService creates a new KVStoreService. @@ -29,34 +28,12 @@ type Store interface { // version. Must error when the version does not exist. StateAt(version uint64) (store.ReaderMap, error) - // SetInitialVersion sets the initial version of the store. - SetInitialVersion(uint64) error - - // WorkingHash writes the provided changeset to the state and returns - // the working hash of the state. - WorkingHash(changeset *store.Changeset) (store.Hash, error) - - // Commit commits the provided changeset and returns the new state root of the state. - Commit(changeset *store.Changeset) (store.Hash, error) - - // Query is a key/value query directly to the underlying database. This skips the appmanager - Query(storeKey []byte, version uint64, key []byte, prove bool) (storev2.QueryResult, error) - - // GetStateStorage returns the SS backend. - GetStateStorage() storev2.VersionedWriter - - // GetStateCommitment returns the SC backend. - GetStateCommitment() storev2.Committer - // LoadVersion loads the RootStore to the given version. LoadVersion(version uint64) error // LoadLatestVersion behaves identically to LoadVersion except it loads the // latest version implicitly. LoadLatestVersion() error - - // LastCommitID returns the latest commit ID - LastCommitID() (proof.CommitID, error) } // StoreLoader allows for custom loading of the store, this is useful when upgrading the store from a previous version diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index 4768b74ca1c8..e163bf3183c1 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -25,6 +25,7 @@ import ( "cosmossdk.io/core/transaction" "cosmossdk.io/log" serverv2 "cosmossdk.io/server/v2" + "cosmossdk.io/server/v2/api" "cosmossdk.io/server/v2/api/grpc/gogoreflection" ) @@ -197,13 +198,13 @@ func (s *Server[T]) Config() any { return s.config } -func (s *Server[T]) Start(context.Context) error { +func (s *Server[T]) Start(ctx context.Context) error { if !s.config.Enable { s.logger.Info(fmt.Sprintf("%s server is disabled via config", s.Name())) return nil } - listener, err := net.Listen("tcp", s.config.Address) + listener, err := (&net.ListenConfig{}).Listen(ctx, "tcp", s.config.Address) if err != nil { return fmt.Errorf("failed to listen on address %s: %w", s.config.Address, err) } @@ -222,8 +223,7 @@ func (s *Server[T]) Stop(ctx context.Context) error { } s.logger.Info("stopping gRPC server...", "address", s.config.Address) - s.grpcSrv.GracefulStop() - return nil + return api.DoUntilCtxExpired(ctx, s.grpcSrv.GracefulStop) } // GetGRPCServer returns the underlying gRPC server. diff --git a/server/v2/api/utils.go b/server/v2/api/utils.go new file mode 100644 index 000000000000..a6bef1224db5 --- /dev/null +++ b/server/v2/api/utils.go @@ -0,0 +1,22 @@ +package api + +import "context" + +// DoUntilCtxExpired runs the given function until the context is expired or +// the function exits. +// This forces context to be honored. +func DoUntilCtxExpired(ctx context.Context, f func()) error { + done := make(chan struct{}) + go func() { + defer close(done) + + f() + }() + + select { + case <-ctx.Done(): + return ctx.Err() + case <-done: + return nil + } +} diff --git a/server/v2/api/utils_test.go b/server/v2/api/utils_test.go new file mode 100644 index 000000000000..3c181d7653d1 --- /dev/null +++ b/server/v2/api/utils_test.go @@ -0,0 +1,35 @@ +package api + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestDoUntilCtxExpired(t *testing.T) { + t.Run("success", func(t *testing.T) { + ctx := context.Background() + + funcRan := false + err := DoUntilCtxExpired(ctx, func() { + funcRan = true + }) + require.NoError(t, err) + require.True(t, funcRan) + }) + + t.Run("context expired", func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + + funcRan := false + err := DoUntilCtxExpired(ctx, func() { + cancel() + funcRan = true + <-time.After(time.Second) + }) + require.ErrorIs(t, err, context.Canceled) + require.True(t, funcRan) + }) +} From 5b7fc8ae90a74f9ed66a7391caa760046dace373 Mon Sep 17 00:00:00 2001 From: Troy Date: Thu, 31 Oct 2024 21:21:46 +0100 Subject: [PATCH 13/24] docs: redirect the remote generation page (#22404) --- docs/architecture/adr-054-semver-compatible-modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/adr-054-semver-compatible-modules.md b/docs/architecture/adr-054-semver-compatible-modules.md index 40dd60810633..88132e7773ae 100644 --- a/docs/architecture/adr-054-semver-compatible-modules.md +++ b/docs/architecture/adr-054-semver-compatible-modules.md @@ -370,7 +370,7 @@ approach described in approach A. Either way, types implementing interfaces woul with an `InterfaceRegistry` as they are now because there would be no way to retrieve them via the global registry. In order to simplify access to other modules using ADR 033, a public API module (maybe even one -[remotely generated by Buf](https://docs.buf.build/bsr/remote-generation/go)) could be used by client modules instead +[remotely generated by Buf](https://buf.build/docs/migration-guides/migrate-remote-generation-alpha)) could be used by client modules instead of requiring to generate all client types internally. The big downsides of this approach are that it requires big changes to how people use protobuf types and would be a From 838f1557af0adf2f37bb620027a07bc843eb1978 Mon Sep 17 00:00:00 2001 From: Hwangjae Lee Date: Mon, 4 Nov 2024 17:42:51 +0900 Subject: [PATCH 14/24] docs: Update Twitter Links to X in Documentation (#22408) Signed-off-by: Hwangjae Lee --- docs/build/building-apps/04-security-part-1.md | 2 +- x/staking/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/build/building-apps/04-security-part-1.md b/docs/build/building-apps/04-security-part-1.md index bdda5c1e260d..65090f38ff35 100644 --- a/docs/build/building-apps/04-security-part-1.md +++ b/docs/build/building-apps/04-security-part-1.md @@ -1,6 +1,6 @@ # The Cosmos Security Handbook: Part 1 - Core Chain -> Thank you to **[Roman Akhtariev](https://twitter.com/akhtariev) and [Alpin Yukseloglu](https://twitter.com/0xalpo)** for authoring this post. The original post can be found [here](https://www.faulttolerant.xyz/2024-01-16-cosmos-security-1/). +> Thank you to **[Roman Akhtariev](https://x.com/akhtariev) and [Alpin Yukseloglu](https://x.com/0xalpo)** for authoring this post. The original post can be found [here](https://www.faulttolerant.xyz/2024-01-16-cosmos-security-1/). > [Trail of bits](https://www.trailofbits.com/) hosts another set of guidelines [here](https://github.com/crytic/building-secure-contracts/tree/master/not-so-smart-contracts/cosmos) diff --git a/x/staking/README.md b/x/staking/README.md index e09065481d86..45c204041b88 100644 --- a/x/staking/README.md +++ b/x/staking/README.md @@ -2481,7 +2481,7 @@ Example Output: "description": { "moniker": "jabbey", "identity": "", - "website": "https://twitter.com/JoeAbbey", + "website": "https://x.com/JoeAbbey", "security_contact": "", "details": "just another dad in the cosmos" }, @@ -2538,7 +2538,7 @@ Example Output: "description": { "moniker": "jabbey", "identity": "", - "website": "https://twitter.com/JoeAbbey", + "website": "https://x.com/JoeAbbey", "security_contact": "", "details": "just another dad in the cosmos" }, From 80402e7dce72c05aab53d01461495833ee3aa922 Mon Sep 17 00:00:00 2001 From: Eric Mokaya <4112301+ziscky@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:17:28 +0300 Subject: [PATCH 15/24] feat(baseapp): add per message telemetry (#22175) --- CHANGELOG.md | 1 + baseapp/baseapp.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6d9cc8c6a55..7d88d88ad2d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,6 +89,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (x/validate) [#21822](https://github.com/cosmos/cosmos-sdk/pull/21822) New module solely responsible for providing ante/post handlers and tx validators for v2. It can be extended by the app developer to provide extra tx validators. * In comparison to x/auth/tx/config, there is no app config to skip ante/post handlers, as overwriting them in baseapp or not injecting the x/validate module has the same effect. * (baseapp) [#21979](https://github.com/cosmos/cosmos-sdk/pull/21979) Create CheckTxHandler to allow extending the logic of CheckTx. +* (baseapp) [[#13981](https://github.com/cosmos/cosmos-sdk/issues/13981)] Add per-message telemetry. ### Improvements diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 4d51fea669b7..98adf6e1a94e 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -1030,13 +1030,14 @@ func (app *BaseApp) runTx(mode execMode, txBytes []byte, tx sdk.Tx) (gInfo sdk.G func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, reflectMsgs []protoreflect.Message, mode execMode) (*sdk.Result, error) { events := sdk.EmptyEvents() msgResponses := make([]*codectypes.Any, 0, len(msgs)) - // NOTE: GasWanted is determined by the AnteHandler and GasUsed by the GasMeter. for i, msg := range msgs { if mode != execModeFinalize && mode != execModeSimulate { break } + start := telemetry.Now() + handler := app.msgServiceRouter.Handler(msg) if handler == nil { return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "no message handler found for %T", msg) @@ -1076,6 +1077,8 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, reflectMsgs []proto } msgResponses = append(msgResponses, msgResponse) } + + telemetry.MeasureSince(start, "tx", "msg", "processing_time", sdk.MsgTypeURL(msg)) } data, err := makeABCIData(msgResponses) From 3ba4661dc7cf9a3ee6517764d6b0b5c7268ed33c Mon Sep 17 00:00:00 2001 From: Eric Mokaya <4112301+ziscky@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:04:56 +0300 Subject: [PATCH 16/24] docs: Module account address documentation (#22289) --- docs/learn/beginner/03-accounts.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/learn/beginner/03-accounts.md b/docs/learn/beginner/03-accounts.md index 99c9b30267f8..3d626f0d2d56 100644 --- a/docs/learn/beginner/03-accounts.md +++ b/docs/learn/beginner/03-accounts.md @@ -95,6 +95,26 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.2/codec/address/bech32_co | Validator Operator | cosmosvaloper | | Consensus Nodes | cosmosvalcons | + +### Module Accounts + +Module accounts are special accounts used by modules to perform specific operations within the blockchain. These accounts are not controlled by users but by the modules themselves. Each module account has a unique name and a set of permissions that define what operations it can perform. Examples of module accounts include the distribution module account, which handles the distribution of staking rewards and the governance module account, which manages the funds related to governance proposals. + + +#### Address Generation + +Module account addresses are generated deterministically from the module name, as defined in [ADR-028](../../architecture/adr-028-public-key-addresses.md) + +Definition of account permissions is done during the app initialization. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/3a03804c148d0da8d6df1ad839b08c50f6896fa1/simapp/app.go#L130-L141 +``` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/3a03804c148d0da8d6df1ad839b08c50f6896fa1/simapp/app.go#L328 +``` + ### Public Keys Public keys in Cosmos SDK are defined by `cryptotypes.PubKey` interface. Since public keys are saved in a store, the `cryptotypes.PubKey` extends the `proto.Message` interface: From e0f644beb972b47fe181952676e32d0ee05880e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:54:49 +0000 Subject: [PATCH 17/24] build(deps): Bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0 in /tools/cosmovisor (#22407) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Julien Robert --- .github/workflows/test.yml | 8 -------- client/v2/go.mod | 4 ++-- client/v2/go.sum | 8 ++++---- collections/protocodec/go.mod | 4 ++-- collections/protocodec/go.sum | 8 ++++---- go.mod | 2 +- go.sum | 4 ++-- orm/go.mod | 4 ++-- orm/go.sum | 9 ++++----- runtime/v2/go.sum | 4 ++-- server/v2/cometbft/go.mod | 2 +- server/v2/cometbft/go.sum | 4 ++-- server/v2/go.mod | 2 +- server/v2/go.sum | 4 ++-- simapp/go.mod | 4 ++-- simapp/go.sum | 4 ++-- simapp/v2/go.mod | 4 ++-- simapp/v2/go.sum | 4 ++-- store/v2/go.mod | 2 +- store/v2/go.sum | 4 ++-- tests/go.mod | 4 ++-- tests/go.sum | 4 ++-- tests/systemtests/go.mod | 2 +- tests/systemtests/go.sum | 4 ++-- tools/confix/go.mod | 2 +- tools/confix/go.sum | 4 ++-- tools/cosmovisor/go.mod | 2 +- tools/cosmovisor/go.sum | 4 ++-- tools/hubl/go.mod | 2 +- tools/hubl/go.sum | 4 ++-- x/accounts/defaults/base/go.mod | 2 +- x/accounts/defaults/base/go.sum | 4 ++-- x/accounts/defaults/lockup/go.mod | 2 +- x/accounts/defaults/lockup/go.sum | 4 ++-- x/accounts/defaults/multisig/go.mod | 2 +- x/accounts/defaults/multisig/go.sum | 4 ++-- x/accounts/go.mod | 2 +- x/accounts/go.sum | 4 ++-- x/authz/go.mod | 2 +- x/authz/go.sum | 4 ++-- x/bank/go.mod | 2 +- x/bank/go.sum | 4 ++-- x/circuit/go.mod | 2 +- x/circuit/go.sum | 4 ++-- x/consensus/go.mod | 2 +- x/consensus/go.sum | 4 ++-- x/distribution/go.mod | 2 +- x/distribution/go.sum | 4 ++-- x/epochs/go.mod | 2 +- x/epochs/go.sum | 4 ++-- x/evidence/go.mod | 2 +- x/evidence/go.sum | 4 ++-- x/feegrant/go.mod | 2 +- x/feegrant/go.sum | 4 ++-- x/gov/go.mod | 2 +- x/gov/go.sum | 4 ++-- x/group/go.mod | 2 +- x/group/go.sum | 4 ++-- x/mint/go.mod | 2 +- x/mint/go.sum | 4 ++-- x/nft/go.mod | 2 +- x/nft/go.sum | 4 ++-- x/params/go.mod | 2 +- x/params/go.sum | 4 ++-- x/protocolpool/go.mod | 2 +- x/protocolpool/go.sum | 4 ++-- x/slashing/go.mod | 2 +- x/slashing/go.sum | 4 ++-- x/staking/go.mod | 2 +- x/staking/go.sum | 4 ++-- x/upgrade/go.mod | 2 +- x/upgrade/go.sum | 4 ++-- 72 files changed, 119 insertions(+), 128 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1762032c33b..ff9f72c16038 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -626,14 +626,6 @@ jobs: run: | cd collections/protocodec go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... - - name: sonarcloud - if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: collections/protocodec test-orm: runs-on: ubuntu-latest diff --git a/client/v2/go.mod b/client/v2/go.mod index 46ffa46d19d4..b1b709154c1d 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -23,7 +23,7 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.1-20240701160653-fedbb9acfd2f.1 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.1-20240130113600-88ef6483f90f.1 // indirect - cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a // indirect cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.4.1 // indirect @@ -70,7 +70,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 840cb42b9f38..a8bd0b7d3a18 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -4,8 +4,8 @@ buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.1-20240130113600-88e buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.1-20240130113600-88ef6483f90f.1/go.mod h1:zqi/LZjZhyvjCMTEVIwAf5VRlkLduuCfqmZxgoormq0= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= -cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a h1:9DxUD+82dO3c+R3XqwW+a7i4nVLiN6I0g2rp2rLOh7E= +cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a/go.mod h1:DcD++Yfcq0OFtM3CJNYLIBjfZ+4DEyeJ/AUk6gkwlOE= cosmossdk.io/core v1.0.0-alpha.5 h1:McjYXAQ6XcT20v2uHyH7PhoWH8V+mebzfVFqT3GinsI= cosmossdk.io/core v1.0.0-alpha.5/go.mod h1:3u9cWq1FAVtiiCrDPpo4LhR+9V6k/ycSG4/Y/tREWCY= cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 h1:NxxUo0GMJUbIuVg0R70e3cbn9eFTEuMr7ev1AFvypdY= @@ -180,8 +180,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/collections/protocodec/go.mod b/collections/protocodec/go.mod index 69040e046041..265d6403c748 100644 --- a/collections/protocodec/go.mod +++ b/collections/protocodec/go.mod @@ -24,7 +24,7 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -46,7 +46,7 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.17.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collections/protocodec/go.sum b/collections/protocodec/go.sum index fc3bee6b5be5..8f599ceb47d1 100644 --- a/collections/protocodec/go.sum +++ b/collections/protocodec/go.sum @@ -39,8 +39,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -169,8 +169,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/go.mod b/go.mod index daeab6e96816..1fa88112b32c 100644 --- a/go.mod +++ b/go.mod @@ -95,7 +95,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/go.sum b/go.sum index ca8c3fd1f0ec..dcf09e6b2575 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/orm/go.mod b/orm/go.mod index a0a5d522fcf0..e711a8b5f7d1 100644 --- a/orm/go.mod +++ b/orm/go.mod @@ -39,7 +39,7 @@ require ( github.com/cucumber/messages/go/v22 v22.0.0 // indirect github.com/cucumber/tag-expressions/go/v6 v6.1.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -64,7 +64,7 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect golang.org/x/net v0.29.0 // indirect - golang.org/x/sys v0.25.0 // indirect + golang.org/x/sys v0.26.0 // indirect golang.org/x/text v0.18.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect diff --git a/orm/go.sum b/orm/go.sum index ec80bb604aac..65c2db9d6a72 100644 --- a/orm/go.sum +++ b/orm/go.sum @@ -57,8 +57,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -208,9 +208,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index cdf94ffd213b..c56de5b9d391 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -66,8 +66,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index e582690cd789..ccc8de2d3e16 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -86,7 +86,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 0fcabe91037e..e381294209fc 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -174,8 +174,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/server/v2/go.mod b/server/v2/go.mod index 1e2e76342465..0331cd942b46 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -58,7 +58,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index c35326ca5bbf..4ea1c4e1b328 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -93,8 +93,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/simapp/go.mod b/simapp/go.mod index 96e451a955e7..bb3eb06a565e 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -5,7 +5,7 @@ go 1.23.1 require ( cosmossdk.io/api v0.7.6 cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 - cosmossdk.io/collections v0.4.0 + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a cosmossdk.io/core v1.0.0-alpha.5 cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 cosmossdk.io/depinject v1.0.0 @@ -104,7 +104,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 753a95f0dcf5..0a415935f1f8 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -391,8 +391,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 0e803ed0f86d..ef88fcec0440 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -57,7 +57,7 @@ require ( cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/iam v1.1.13 // indirect cloud.google.com/go/storage v1.43.0 // indirect - cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a // indirect cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 // indirect @@ -112,7 +112,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index beee381cb4ec..4d66c383748f 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -393,8 +393,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/store/v2/go.mod b/store/v2/go.mod index f906dfb1c4b2..79fe623e278e 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -34,7 +34,7 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect diff --git a/store/v2/go.sum b/store/v2/go.sum index e0f9db427cea..9e18be21fa29 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -60,8 +60,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= diff --git a/tests/go.mod b/tests/go.mod index a98402d39de5..5ad97cc1d0bc 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -4,7 +4,7 @@ go 1.23.1 require ( cosmossdk.io/api v0.7.6 - cosmossdk.io/collections v0.4.0 + cosmossdk.io/collections v0.4.1-0.20241104084251-838f1557af0a cosmossdk.io/core v1.0.0-alpha.5 cosmossdk.io/depinject v1.0.0 cosmossdk.io/log v1.4.1 @@ -109,7 +109,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tests/go.sum b/tests/go.sum index 6e624911ccd2..e26179dd6cda 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -384,8 +384,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod index 9c5a0c17f730..e5f1a1f93e0b 100644 --- a/tests/systemtests/go.mod +++ b/tests/systemtests/go.mod @@ -74,7 +74,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tests/systemtests/go.sum b/tests/systemtests/go.sum index 7232a393bde0..da77593ee370 100644 --- a/tests/systemtests/go.sum +++ b/tests/systemtests/go.sum @@ -228,8 +228,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index 47ae673fb289..8ee1923db41e 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -62,7 +62,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index 193080cfdb06..92d56e555cff 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -231,8 +231,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 48154be2187f..3947e67e83d5 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -6,7 +6,7 @@ require ( cosmossdk.io/log v1.4.1 cosmossdk.io/x/upgrade v0.1.4 github.com/cosmos/cosmos-sdk v0.50.10 - github.com/fsnotify/fsnotify v1.7.0 + github.com/fsnotify/fsnotify v1.8.0 github.com/otiai10/copy v1.14.0 github.com/pelletier/go-toml/v2 v2.2.3 github.com/spf13/cobra v1.8.1 diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 5c997f7804df..808cdebbe509 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -405,8 +405,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.28.0 h1:7Rqx9M3ythTKy2J6uZLHmc8Sz9OGgIlseuO1iBX/s0M= github.com/getsentry/sentry-go v0.28.0/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 98daa924a6cf..f3768da0b4db 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -63,7 +63,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index 34ada5b5b36d..e3867e5769de 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -231,8 +231,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/defaults/base/go.mod b/x/accounts/defaults/base/go.mod index 583b3566a4ea..8c48af24a5bf 100644 --- a/x/accounts/defaults/base/go.mod +++ b/x/accounts/defaults/base/go.mod @@ -64,7 +64,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/defaults/base/go.sum b/x/accounts/defaults/base/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/accounts/defaults/base/go.sum +++ b/x/accounts/defaults/base/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index 27a9f2c75618..d261f5672a0b 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -57,7 +57,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index cfc3d316eda8..c6ace37c13b6 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -142,8 +142,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/defaults/multisig/go.mod b/x/accounts/defaults/multisig/go.mod index 2806370ee198..f7d8659b157b 100644 --- a/x/accounts/defaults/multisig/go.mod +++ b/x/accounts/defaults/multisig/go.mod @@ -64,7 +64,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/defaults/multisig/go.sum b/x/accounts/defaults/multisig/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/accounts/defaults/multisig/go.sum +++ b/x/accounts/defaults/multisig/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/accounts/go.mod b/x/accounts/go.mod index 1a3ed9587264..16e2c6ef3c1d 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -69,7 +69,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/accounts/go.sum b/x/accounts/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/authz/go.mod b/x/authz/go.mod index 7ba6f70ba494..1e34eb17d8be 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/authz/go.sum b/x/authz/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/bank/go.mod b/x/bank/go.mod index 8f3ff02f12b1..984ef646b580 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 8756e26d5ba3..54a731e78ffe 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/consensus/go.mod b/x/consensus/go.mod index 89e2f6d9cb09..d12915607923 100644 --- a/x/consensus/go.mod +++ b/x/consensus/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/consensus/go.sum b/x/consensus/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/consensus/go.sum +++ b/x/consensus/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 05372fa90a99..7ee993aae9f4 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -69,7 +69,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index 90f72e1109ad..284e7f2deab2 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 3483f37956ad..4de7e8a97cf8 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -69,7 +69,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 67e20a2a6def..959204ea7189 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -77,7 +77,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 3b4e589acd78..efdf24e13ba5 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -178,8 +178,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/gov/go.mod b/x/gov/go.mod index 80be4bd43ad7..1de77256af1e 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -73,7 +73,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index 41729611ac1d..4e6d843a385a 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -176,8 +176,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/group/go.mod b/x/group/go.mod index 807a3ee6316f..5c0a41a54ada 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -79,7 +79,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index bc6f40b75f38..827315f69da4 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -178,8 +178,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/mint/go.mod b/x/mint/go.mod index 037e259b420d..5780be9ba0aa 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/nft/go.mod b/x/nft/go.mod index fe2b0686cc96..a07aafaacf3a 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -67,7 +67,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/params/go.mod b/x/params/go.mod index 3a98f4369c81..c4d16f371bda 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -66,7 +66,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index 73f87a32b18f..4c27f0ad454a 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -158,8 +158,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 5b1f53b294b9..ce68008aadb4 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -68,7 +68,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index d535cd725fc9..8fceb55731a7 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -172,8 +172,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/slashing/go.mod b/x/slashing/go.mod index e6aadcf88add..b08e4a964bac 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -70,7 +70,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index ef6a4385622d..58ca35c37a24 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -174,8 +174,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/staking/go.mod b/x/staking/go.mod index 47b7b3420730..fac99dfe7a4b 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -63,7 +63,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index 0f35d51f6fa0..cd9371822af4 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -170,8 +170,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 38a9b7aa420b..6f2aedce1541 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -84,7 +84,7 @@ require ( github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index ec36d8af32c2..829d69c67197 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -384,8 +384,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= From e9436a6a1b53d32dc4c8e62dbcb8b858f1b88d1c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 5 Nov 2024 11:38:08 +0400 Subject: [PATCH 18/24] docs: update ADR 59 (#22423) --- docs/architecture/adr-059-test-scopes.md | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/architecture/adr-059-test-scopes.md b/docs/architecture/adr-059-test-scopes.md index cb1263443bcc..c8d126a0d170 100644 --- a/docs/architecture/adr-059-test-scopes.md +++ b/docs/architecture/adr-059-test-scopes.md @@ -5,10 +5,11 @@ * 2022-08-02: Initial Draft * 2023-03-02: Add precision for integration tests * 2023-03-23: Add precision for E2E tests +* 2024-11-04: Update E2E mention by system tests ## Status -PROPOSED Partially Implemented +PROPOSED Implemented ## Abstract @@ -141,9 +142,13 @@ Modules not returning simulation operations: ### E2E tests +:::note +End-to-end tests have been removed from v0.52+ and have been replaced fully by system tests. +::: + End to end tests exercise the entire system as we understand it in as close an approximation to a production environment as is practical. Presently these tests are located at -[tests/e2e](https://github.com/cosmos/cosmos-sdk/tree/main/tests/e2e) and rely on [testutil/network](https://github.com/cosmos/cosmos-sdk/tree/main/testutil/network) to start up an in-process Tendermint node. +[tests/e2e](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/tests/e2e) and rely on [testutil/network](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/testutil/network) to start up an in-process Tendermint node. An application should be built as minimally as possible to exercise the desired functionality. The SDK uses an application will only the required modules for the tests. The application developer is advised to use its own application for e2e tests. @@ -168,7 +173,7 @@ We accept these test scopes and identify the following decisions points for each | Unit | None | Yes | | Integration | integration helpers | Some | | Simulation | minimal app | No | -| E2E | minimal app | No | +| System Test | full app | No | The decision above is valid for the SDK. An application developer should test their application with their full application instead of the minimal app. @@ -205,16 +210,14 @@ Simulations shall use a minimal application (usually via app wiring). They are l ### E2E Tests -Existing e2e tests shall be migrated to integration tests by removing the dependency on the -test network and in-process Tendermint node to ensure we do not lose test coverage. - -The e2e rest runner shall transition from in process Tendermint to a runner powered by -Docker via [dockertest](https://github.com/ory/dockertest). +:::note +End-to-end tests have been removed from v0.52+ and have been replaced fully by system tests. +::: -E2E tests exercising a full network upgrade shall be written. +Existing E2E tests have been removed from the SDK and migrated to [system tests](https://github.com/cosmos/cosmos-sdk/issues/20800). System tests are running for v0.xx applications and v2 applications. +They ensure that the application, CLI, and REST API are working as expected on both v0.xx and v2 applications. -The CLI testing aspect of existing e2e tests shall be rewritten using the network mocking -demonstrated in [PR#12706](https://github.com/cosmos/cosmos-sdk/pull/12706). +Learn more about system tests [here](https://github.com/cosmos/cosmos-sdk/blob/main/tests/systemtests/README.md). ## Consequences @@ -234,7 +237,7 @@ demonstrated in [PR#12706](https://github.com/cosmos/cosmos-sdk/pull/12706). ### Neutral -* some discovery required for e2e transition to dockertest +* ~~some discovery required for e2e transition to dockertest~~ (e2e tests have been migrated to system tests) ## Further Discussions From 55f7cfcebae4511ba12049b510eb6539e490da2d Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:39:32 +0700 Subject: [PATCH 19/24] refactor(serevr/v2/cometbft): update `RegisterQueryHandlers` and GRPC queries (#22403) --- runtime/v2/manager.go | 13 ++++++++++--- server/v2/cometbft/abci.go | 9 ++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index e2e90c27f808..9e99a2b08c4f 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -642,7 +642,7 @@ func registerServices[T transaction.Tx](s appmodulev2.AppModule, app *App[T], re // if module implements register msg handlers if module, ok := s.(appmodulev2.HasMsgHandlers); ok { - wrapper := stfRouterWrapper{stfRouter: app.msgRouterBuilder} + wrapper := newStfRouterWrapper(app.msgRouterBuilder) module.RegisterMsgHandlers(&wrapper) if wrapper.error != nil { return fmt.Errorf("unable to register handlers: %w", wrapper.error) @@ -651,7 +651,7 @@ func registerServices[T transaction.Tx](s appmodulev2.AppModule, app *App[T], re // if module implements register query handlers if module, ok := s.(appmodulev2.HasQueryHandlers); ok { - wrapper := stfRouterWrapper{stfRouter: app.queryRouterBuilder} + wrapper := newStfRouterWrapper(app.queryRouterBuilder) module.RegisterQueryHandlers(&wrapper) for path, handler := range wrapper.handlers { @@ -842,6 +842,13 @@ type stfRouterWrapper struct { handlers map[string]appmodulev2.Handler } +func newStfRouterWrapper(stfRouterBuilder *stf.MsgRouterBuilder) stfRouterWrapper { + wrapper := stfRouterWrapper{stfRouter: stfRouterBuilder} + wrapper.error = nil + wrapper.handlers = map[string]appmodulev2.Handler{} + return wrapper +} + func (s *stfRouterWrapper) RegisterHandler(handler appmodulev2.Handler) { req := handler.MakeMsg() requestName := gogoproto.MessageName(req) @@ -854,7 +861,7 @@ func (s *stfRouterWrapper) RegisterHandler(handler appmodulev2.Handler) { s.error = errors.Join(s.error, err) // also make the decoder - if s.error == nil { + if s.handlers == nil { s.handlers = map[string]appmodulev2.Handler{} } s.handlers[requestName] = handler diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 5daf0c103038..45a5be69da89 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -259,12 +259,15 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq return nil, false, err } + var handlerFullName string md, isGRPC := desc.(protoreflect.MethodDescriptor) if !isGRPC { - return nil, false, nil + handlerFullName = string(desc.FullName()) + } else { + handlerFullName = string(md.Input().FullName()) } - handler, found := c.queryHandlersMap[string(md.Input().FullName())] + handler, found := c.queryHandlersMap[handlerFullName] if !found { return nil, true, fmt.Errorf("no query handler found for %s", req.Path) } @@ -282,7 +285,7 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq } resp, err = queryResponse(res, req.Height) - return resp, isGRPC, err + return resp, true, err } // InitChain implements types.Application. From 8c24b6bef1f7480314aaade52f6b2154413856f2 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 5 Nov 2024 13:02:47 +0400 Subject: [PATCH 20/24] fix(x/group): proper address rendering in error (#22425) --- x/group/keeper/proposal_executor.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/group/keeper/proposal_executor.go b/x/group/keeper/proposal_executor.go index 4ecef52d1927..24d372daca3b 100644 --- a/x/group/keeper/proposal_executor.go +++ b/x/group/keeper/proposal_executor.go @@ -70,7 +70,13 @@ func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Cod if err != nil { return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; error retrieving group policy address") } - return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAddr, acct) + + acctStr, _ := addressCodec.BytesToString(acct) + if acctStr == "" { + acctStr = "unmarshalable address" + } + + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAddr, acctStr) } } } From 62ddd3e9397b40b51d3dba311c7e78abcfd38636 Mon Sep 17 00:00:00 2001 From: Randy Grok <98407738+randygrok@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:31:22 +0100 Subject: [PATCH 21/24] feat: wire new handlers to grpc (#22333) Co-authored-by: Randy Grok <@faulttolerance.net> Co-authored-by: Julien Robert --- api/cosmos/base/grpc/v2/service.pulsar.go | 2590 ++++++++++++++++++++ api/cosmos/base/grpc/v2/service_grpc.pb.go | 167 ++ proto/cosmos/base/grpc/v2/service.proto | 39 + server/v2/api/grpc/server.go | 3 + server/v2/api/grpc/service.go | 73 + server/v2/api/grpc/service.pb.go | 1167 +++++++++ server/v2/api/grpc/service_test.go | 227 ++ server/v2/go.mod | 2 + server/v2/go.sum | 8 + 9 files changed, 4276 insertions(+) create mode 100644 api/cosmos/base/grpc/v2/service.pulsar.go create mode 100644 api/cosmos/base/grpc/v2/service_grpc.pb.go create mode 100644 proto/cosmos/base/grpc/v2/service.proto create mode 100644 server/v2/api/grpc/service.go create mode 100644 server/v2/api/grpc/service.pb.go create mode 100644 server/v2/api/grpc/service_test.go diff --git a/api/cosmos/base/grpc/v2/service.pulsar.go b/api/cosmos/base/grpc/v2/service.pulsar.go new file mode 100644 index 000000000000..3112092f1add --- /dev/null +++ b/api/cosmos/base/grpc/v2/service.pulsar.go @@ -0,0 +1,2590 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package grpcv2 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryRequest protoreflect.MessageDescriptor + fd_QueryRequest_request protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_QueryRequest = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("QueryRequest") + fd_QueryRequest_request = md_QueryRequest.Fields().ByName("request") +} + +var _ protoreflect.Message = (*fastReflection_QueryRequest)(nil) + +type fastReflection_QueryRequest QueryRequest + +func (x *QueryRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequest)(x) +} + +func (x *QueryRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryRequest_messageType fastReflection_QueryRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequest_messageType{} + +type fastReflection_QueryRequest_messageType struct{} + +func (x fastReflection_QueryRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequest)(nil) +} +func (x fastReflection_QueryRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequest) +} +func (x fastReflection_QueryRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRequest) New() protoreflect.Message { + return new(fastReflection_QueryRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Request != nil { + value := protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + if !f(fd_QueryRequest_request, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + return x.Request != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + x.Request = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + value := x.Request + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + x.Request = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + if x.Request == nil { + x.Request = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Request.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryRequest.request": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.QueryRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Request != nil { + l = options.Size(x.Request) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Request != nil { + encoded, err := options.Marshal(x.Request) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Request == nil { + x.Request = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Request); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryResponse protoreflect.MessageDescriptor + fd_QueryResponse_response protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_QueryResponse = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("QueryResponse") + fd_QueryResponse_response = md_QueryResponse.Fields().ByName("response") +} + +var _ protoreflect.Message = (*fastReflection_QueryResponse)(nil) + +type fastReflection_QueryResponse QueryResponse + +func (x *QueryResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResponse)(x) +} + +func (x *QueryResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryResponse_messageType fastReflection_QueryResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryResponse_messageType{} + +type fastReflection_QueryResponse_messageType struct{} + +func (x fastReflection_QueryResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResponse)(nil) +} +func (x fastReflection_QueryResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResponse) +} +func (x fastReflection_QueryResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryResponse) New() protoreflect.Message { + return new(fastReflection_QueryResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryResponse) Interface() protoreflect.ProtoMessage { + return (*QueryResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Response != nil { + value := protoreflect.ValueOfMessage(x.Response.ProtoReflect()) + if !f(fd_QueryResponse_response, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + return x.Response != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + x.Response = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + value := x.Response + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + x.Response = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + if x.Response == nil { + x.Response = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Response.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.QueryResponse.response": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.QueryResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.QueryResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.QueryResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Response != nil { + l = options.Size(x.Response) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Response != nil { + encoded, err := options.Marshal(x.Response) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Response == nil { + x.Response = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Response); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ListQueryHandlersRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_ListQueryHandlersRequest = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("ListQueryHandlersRequest") +} + +var _ protoreflect.Message = (*fastReflection_ListQueryHandlersRequest)(nil) + +type fastReflection_ListQueryHandlersRequest ListQueryHandlersRequest + +func (x *ListQueryHandlersRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListQueryHandlersRequest)(x) +} + +func (x *ListQueryHandlersRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ListQueryHandlersRequest_messageType fastReflection_ListQueryHandlersRequest_messageType +var _ protoreflect.MessageType = fastReflection_ListQueryHandlersRequest_messageType{} + +type fastReflection_ListQueryHandlersRequest_messageType struct{} + +func (x fastReflection_ListQueryHandlersRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListQueryHandlersRequest)(nil) +} +func (x fastReflection_ListQueryHandlersRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersRequest) +} +func (x fastReflection_ListQueryHandlersRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListQueryHandlersRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ListQueryHandlersRequest) Type() protoreflect.MessageType { + return _fastReflection_ListQueryHandlersRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListQueryHandlersRequest) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListQueryHandlersRequest) Interface() protoreflect.ProtoMessage { + return (*ListQueryHandlersRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ListQueryHandlersRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ListQueryHandlersRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ListQueryHandlersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ListQueryHandlersRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersRequest")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ListQueryHandlersRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.ListQueryHandlersRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ListQueryHandlersRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ListQueryHandlersRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ListQueryHandlersRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListQueryHandlersRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ListQueryHandlersRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ListQueryHandlersRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListQueryHandlersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListQueryHandlersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_ListQueryHandlersResponse_1_list)(nil) + +type _ListQueryHandlersResponse_1_list struct { + list *[]*Handler +} + +func (x *_ListQueryHandlersResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ListQueryHandlersResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ListQueryHandlersResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + (*x.list)[i] = concreteValue +} + +func (x *_ListQueryHandlersResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Handler) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ListQueryHandlersResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Handler) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ListQueryHandlersResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ListQueryHandlersResponse_1_list) NewElement() protoreflect.Value { + v := new(Handler) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ListQueryHandlersResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ListQueryHandlersResponse protoreflect.MessageDescriptor + fd_ListQueryHandlersResponse_handlers protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_ListQueryHandlersResponse = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("ListQueryHandlersResponse") + fd_ListQueryHandlersResponse_handlers = md_ListQueryHandlersResponse.Fields().ByName("handlers") +} + +var _ protoreflect.Message = (*fastReflection_ListQueryHandlersResponse)(nil) + +type fastReflection_ListQueryHandlersResponse ListQueryHandlersResponse + +func (x *ListQueryHandlersResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ListQueryHandlersResponse)(x) +} + +func (x *ListQueryHandlersResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ListQueryHandlersResponse_messageType fastReflection_ListQueryHandlersResponse_messageType +var _ protoreflect.MessageType = fastReflection_ListQueryHandlersResponse_messageType{} + +type fastReflection_ListQueryHandlersResponse_messageType struct{} + +func (x fastReflection_ListQueryHandlersResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ListQueryHandlersResponse)(nil) +} +func (x fastReflection_ListQueryHandlersResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersResponse) +} +func (x fastReflection_ListQueryHandlersResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ListQueryHandlersResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ListQueryHandlersResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ListQueryHandlersResponse) Type() protoreflect.MessageType { + return _fastReflection_ListQueryHandlersResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ListQueryHandlersResponse) New() protoreflect.Message { + return new(fastReflection_ListQueryHandlersResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ListQueryHandlersResponse) Interface() protoreflect.ProtoMessage { + return (*ListQueryHandlersResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ListQueryHandlersResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Handlers) != 0 { + value := protoreflect.ValueOfList(&_ListQueryHandlersResponse_1_list{list: &x.Handlers}) + if !f(fd_ListQueryHandlersResponse_handlers, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ListQueryHandlersResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + return len(x.Handlers) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + x.Handlers = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ListQueryHandlersResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + if len(x.Handlers) == 0 { + return protoreflect.ValueOfList(&_ListQueryHandlersResponse_1_list{}) + } + listValue := &_ListQueryHandlersResponse_1_list{list: &x.Handlers} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + lv := value.List() + clv := lv.(*_ListQueryHandlersResponse_1_list) + x.Handlers = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + if x.Handlers == nil { + x.Handlers = []*Handler{} + } + value := &_ListQueryHandlersResponse_1_list{list: &x.Handlers} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ListQueryHandlersResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers": + list := []*Handler{} + return protoreflect.ValueOfList(&_ListQueryHandlersResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.ListQueryHandlersResponse")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.ListQueryHandlersResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ListQueryHandlersResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.ListQueryHandlersResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ListQueryHandlersResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ListQueryHandlersResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ListQueryHandlersResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ListQueryHandlersResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ListQueryHandlersResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Handlers) > 0 { + for _, e := range x.Handlers { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ListQueryHandlersResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Handlers) > 0 { + for iNdEx := len(x.Handlers) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Handlers[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ListQueryHandlersResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListQueryHandlersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ListQueryHandlersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Handlers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Handlers = append(x.Handlers, &Handler{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Handlers[len(x.Handlers)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_Handler protoreflect.MessageDescriptor + fd_Handler_request_name protoreflect.FieldDescriptor + fd_Handler_response_name protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_grpc_v2_service_proto_init() + md_Handler = File_cosmos_base_grpc_v2_service_proto.Messages().ByName("Handler") + fd_Handler_request_name = md_Handler.Fields().ByName("request_name") + fd_Handler_response_name = md_Handler.Fields().ByName("response_name") +} + +var _ protoreflect.Message = (*fastReflection_Handler)(nil) + +type fastReflection_Handler Handler + +func (x *Handler) ProtoReflect() protoreflect.Message { + return (*fastReflection_Handler)(x) +} + +func (x *Handler) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Handler_messageType fastReflection_Handler_messageType +var _ protoreflect.MessageType = fastReflection_Handler_messageType{} + +type fastReflection_Handler_messageType struct{} + +func (x fastReflection_Handler_messageType) Zero() protoreflect.Message { + return (*fastReflection_Handler)(nil) +} +func (x fastReflection_Handler_messageType) New() protoreflect.Message { + return new(fastReflection_Handler) +} +func (x fastReflection_Handler_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Handler +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Handler) Descriptor() protoreflect.MessageDescriptor { + return md_Handler +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Handler) Type() protoreflect.MessageType { + return _fastReflection_Handler_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Handler) New() protoreflect.Message { + return new(fastReflection_Handler) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Handler) Interface() protoreflect.ProtoMessage { + return (*Handler)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Handler) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RequestName != "" { + value := protoreflect.ValueOfString(x.RequestName) + if !f(fd_Handler_request_name, value) { + return + } + } + if x.ResponseName != "" { + value := protoreflect.ValueOfString(x.ResponseName) + if !f(fd_Handler_response_name, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Handler) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + return x.RequestName != "" + case "cosmos.base.grpc.v2.Handler.response_name": + return x.ResponseName != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Handler) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + x.RequestName = "" + case "cosmos.base.grpc.v2.Handler.response_name": + x.ResponseName = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Handler) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + value := x.RequestName + return protoreflect.ValueOfString(value) + case "cosmos.base.grpc.v2.Handler.response_name": + value := x.ResponseName + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Handler) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + x.RequestName = value.Interface().(string) + case "cosmos.base.grpc.v2.Handler.response_name": + x.ResponseName = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Handler) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + panic(fmt.Errorf("field request_name of message cosmos.base.grpc.v2.Handler is not mutable")) + case "cosmos.base.grpc.v2.Handler.response_name": + panic(fmt.Errorf("field response_name of message cosmos.base.grpc.v2.Handler is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Handler) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.grpc.v2.Handler.request_name": + return protoreflect.ValueOfString("") + case "cosmos.base.grpc.v2.Handler.response_name": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.grpc.v2.Handler")) + } + panic(fmt.Errorf("message cosmos.base.grpc.v2.Handler does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Handler) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.grpc.v2.Handler", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Handler) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Handler) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Handler) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Handler) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Handler) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.RequestName) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ResponseName) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Handler) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ResponseName) > 0 { + i -= len(x.ResponseName) + copy(dAtA[i:], x.ResponseName) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ResponseName))) + i-- + dAtA[i] = 0x12 + } + if len(x.RequestName) > 0 { + i -= len(x.RequestName) + copy(dAtA[i:], x.RequestName) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RequestName))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Handler) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Handler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Handler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RequestName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.RequestName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ResponseName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ResponseName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/base/grpc/v2/service.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryRequest is the request for the Query method +type QueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *anypb.Any `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (x *QueryRequest) Reset() { + *x = QueryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequest) ProtoMessage() {} + +// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. +func (*QueryRequest) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryRequest) GetRequest() *anypb.Any { + if x != nil { + return x.Request + } + return nil +} + +// QueryResponse is the response for the Query method +type QueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response *anypb.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *QueryResponse) Reset() { + *x = QueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResponse) ProtoMessage() {} + +// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. +func (*QueryResponse) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryResponse) GetResponse() *anypb.Any { + if x != nil { + return x.Response + } + return nil +} + +// ListQueryHandlersRequest is the request for the ListQueryHandlers method +type ListQueryHandlersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListQueryHandlersRequest) Reset() { + *x = ListQueryHandlersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListQueryHandlersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueryHandlersRequest) ProtoMessage() {} + +// Deprecated: Use ListQueryHandlersRequest.ProtoReflect.Descriptor instead. +func (*ListQueryHandlersRequest) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{2} +} + +// ListQueryHandlersResponse is the response for the ListQueryHandlers method +type ListQueryHandlersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Handlers []*Handler `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"` +} + +func (x *ListQueryHandlersResponse) Reset() { + *x = ListQueryHandlersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListQueryHandlersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueryHandlersResponse) ProtoMessage() {} + +// Deprecated: Use ListQueryHandlersResponse.ProtoReflect.Descriptor instead. +func (*ListQueryHandlersResponse) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{3} +} + +func (x *ListQueryHandlersResponse) GetHandlers() []*Handler { + if x != nil { + return x.Handlers + } + return nil +} + +// Handler defines a query handler +type Handler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestName string `protobuf:"bytes,1,opt,name=request_name,json=requestName,proto3" json:"request_name,omitempty"` + ResponseName string `protobuf:"bytes,2,opt,name=response_name,json=responseName,proto3" json:"response_name,omitempty"` +} + +func (x *Handler) Reset() { + *x = Handler{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_grpc_v2_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Handler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Handler) ProtoMessage() {} + +// Deprecated: Use Handler.ProtoReflect.Descriptor instead. +func (*Handler) Descriptor() ([]byte, []int) { + return file_cosmos_base_grpc_v2_service_proto_rawDescGZIP(), []int{4} +} + +func (x *Handler) GetRequestName() string { + if x != nil { + return x.RequestName + } + return "" +} + +func (x *Handler) GetResponseName() string { + if x != nil { + return x.ResponseName + } + return "" +} + +var File_cosmos_base_grpc_v2_service_proto protoreflect.FileDescriptor + +var file_cosmos_base_grpc_v2_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x41, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, + 0x08, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x51, 0x0a, 0x07, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0xd1, 0x01, 0x0a, + 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x12, + 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x67, 0x72, 0x70, + 0x63, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0xc3, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x76, 0x32, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x47, 0xaa, + 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x47, 0x72, + 0x70, 0x63, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, + 0x61, 0x73, 0x65, 0x5c, 0x47, 0x72, 0x70, 0x63, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1f, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x47, 0x72, 0x70, 0x63, 0x5c, 0x56, + 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x47, 0x72, + 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_base_grpc_v2_service_proto_rawDescOnce sync.Once + file_cosmos_base_grpc_v2_service_proto_rawDescData = file_cosmos_base_grpc_v2_service_proto_rawDesc +) + +func file_cosmos_base_grpc_v2_service_proto_rawDescGZIP() []byte { + file_cosmos_base_grpc_v2_service_proto_rawDescOnce.Do(func() { + file_cosmos_base_grpc_v2_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_base_grpc_v2_service_proto_rawDescData) + }) + return file_cosmos_base_grpc_v2_service_proto_rawDescData +} + +var file_cosmos_base_grpc_v2_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_cosmos_base_grpc_v2_service_proto_goTypes = []interface{}{ + (*QueryRequest)(nil), // 0: cosmos.base.grpc.v2.QueryRequest + (*QueryResponse)(nil), // 1: cosmos.base.grpc.v2.QueryResponse + (*ListQueryHandlersRequest)(nil), // 2: cosmos.base.grpc.v2.ListQueryHandlersRequest + (*ListQueryHandlersResponse)(nil), // 3: cosmos.base.grpc.v2.ListQueryHandlersResponse + (*Handler)(nil), // 4: cosmos.base.grpc.v2.Handler + (*anypb.Any)(nil), // 5: google.protobuf.Any +} +var file_cosmos_base_grpc_v2_service_proto_depIdxs = []int32{ + 5, // 0: cosmos.base.grpc.v2.QueryRequest.request:type_name -> google.protobuf.Any + 5, // 1: cosmos.base.grpc.v2.QueryResponse.response:type_name -> google.protobuf.Any + 4, // 2: cosmos.base.grpc.v2.ListQueryHandlersResponse.handlers:type_name -> cosmos.base.grpc.v2.Handler + 0, // 3: cosmos.base.grpc.v2.Service.Query:input_type -> cosmos.base.grpc.v2.QueryRequest + 2, // 4: cosmos.base.grpc.v2.Service.ListQueryHandlers:input_type -> cosmos.base.grpc.v2.ListQueryHandlersRequest + 1, // 5: cosmos.base.grpc.v2.Service.Query:output_type -> cosmos.base.grpc.v2.QueryResponse + 3, // 6: cosmos.base.grpc.v2.Service.ListQueryHandlers:output_type -> cosmos.base.grpc.v2.ListQueryHandlersResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cosmos_base_grpc_v2_service_proto_init() } +func file_cosmos_base_grpc_v2_service_proto_init() { + if File_cosmos_base_grpc_v2_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_base_grpc_v2_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListQueryHandlersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListQueryHandlersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_grpc_v2_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Handler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_base_grpc_v2_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_base_grpc_v2_service_proto_goTypes, + DependencyIndexes: file_cosmos_base_grpc_v2_service_proto_depIdxs, + MessageInfos: file_cosmos_base_grpc_v2_service_proto_msgTypes, + }.Build() + File_cosmos_base_grpc_v2_service_proto = out.File + file_cosmos_base_grpc_v2_service_proto_rawDesc = nil + file_cosmos_base_grpc_v2_service_proto_goTypes = nil + file_cosmos_base_grpc_v2_service_proto_depIdxs = nil +} diff --git a/api/cosmos/base/grpc/v2/service_grpc.pb.go b/api/cosmos/base/grpc/v2/service_grpc.pb.go new file mode 100644 index 000000000000..689431d223aa --- /dev/null +++ b/api/cosmos/base/grpc/v2/service_grpc.pb.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/base/grpc/v2/service.proto + +package grpcv2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Service_Query_FullMethodName = "/cosmos.base.grpc.v2.Service/Query" + Service_ListQueryHandlers_FullMethodName = "/cosmos.base.grpc.v2.Service/ListQueryHandlers" +) + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service defines the gRPC service for query server for v2 +type ServiceClient interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) +} + +type serviceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Service_Query_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListQueryHandlersResponse) + err := c.cc.Invoke(ctx, Service_ListQueryHandlers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +// All implementations must embed UnimplementedServiceServer +// for forward compatibility. +// +// Service defines the gRPC service for query server for v2 +type ServiceServer interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(context.Context, *QueryRequest) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(context.Context, *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) + mustEmbedUnimplementedServiceServer() +} + +// UnimplementedServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedServiceServer struct{} + +func (UnimplementedServiceServer) Query(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (UnimplementedServiceServer) ListQueryHandlers(context.Context, *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListQueryHandlers not implemented") +} +func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} +func (UnimplementedServiceServer) testEmbeddedByValue() {} + +// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServer will +// result in compilation errors. +type UnsafeServiceServer interface { + mustEmbedUnimplementedServiceServer() +} + +func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + // If the following call pancis, it indicates UnimplementedServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Service_ServiceDesc, srv) +} + +func _Service_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Query(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_Query_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Query(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_ListQueryHandlers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListQueryHandlersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).ListQueryHandlers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_ListQueryHandlers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).ListQueryHandlers(ctx, req.(*ListQueryHandlersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Service_ServiceDesc is the grpc.ServiceDesc for Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.grpc.v2.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Query", + Handler: _Service_Query_Handler, + }, + { + MethodName: "ListQueryHandlers", + Handler: _Service_ListQueryHandlers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/grpc/v2/service.proto", +} diff --git a/proto/cosmos/base/grpc/v2/service.proto b/proto/cosmos/base/grpc/v2/service.proto new file mode 100644 index 000000000000..4ac86c552cc5 --- /dev/null +++ b/proto/cosmos/base/grpc/v2/service.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package cosmos.base.grpc.v2; + +import "google/protobuf/any.proto"; + +option go_package = "cosmossdk.io/server/v2/api/grpc"; + +// Service defines the gRPC service for query server for v2 +service Service { + // Query queries the server with a request, the request can be any sdk Msg. + rpc Query(QueryRequest) returns (QueryResponse) {} + + // ListQueryHandlers lists all the available query handlers. + rpc ListQueryHandlers(ListQueryHandlersRequest) returns (ListQueryHandlersResponse) {} +} + +// QueryRequest is the request for the Query method +message QueryRequest { + google.protobuf.Any request = 1; +} + +// QueryResponse is the response for the Query method +message QueryResponse { + google.protobuf.Any response = 1; +} + +// ListQueryHandlersRequest is the request for the ListQueryHandlers method +message ListQueryHandlersRequest {} + +// ListQueryHandlersResponse is the response for the ListQueryHandlers method +message ListQueryHandlersResponse { + repeated Handler handlers = 1; +} + +// Handler defines a query handler +message Handler { + string request_name = 1; + string response_name = 2; +} \ No newline at end of file diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index e163bf3183c1..12cc1e6add1a 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -74,6 +74,9 @@ func New[T transaction.Tx]( // Reflection allows external clients to see what services and methods the gRPC server exposes. gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) + // Register V2 + RegisterServiceServer(grpcSrv, &v2Service{queryHandlers, queryable}) + srv.grpcSrv = grpcSrv srv.config = serverCfg srv.logger = logger.With(log.ModuleKey, srv.Name()) diff --git a/server/v2/api/grpc/service.go b/server/v2/api/grpc/service.go new file mode 100644 index 000000000000..e373fa910469 --- /dev/null +++ b/server/v2/api/grpc/service.go @@ -0,0 +1,73 @@ +package grpc + +import ( + "context" + + "github.com/cosmos/gogoproto/proto" + gogoproto "github.com/cosmos/gogoproto/types/any" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/transaction" +) + +// v2Service implements the gRPC service interface for handling queries and listing handlers. +type v2Service struct { + queryHandlers map[string]appmodulev2.Handler + queryable interface { + Query(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error) + } +} + +// Query handles incoming query requests by unmarshaling the request, processing it, +// and returning the response in an Any protobuf message. +func (s v2Service) Query(ctx context.Context, request *QueryRequest) (*QueryResponse, error) { + if request == nil || request.Request == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + msgName := request.Request.TypeUrl + + handler, exists := s.queryHandlers[msgName] + if !exists { + return nil, status.Errorf(codes.NotFound, "handler not found for %s", msgName) + } + + protoMsg := handler.MakeMsg() + if err := proto.Unmarshal(request.Request.Value, protoMsg); err != nil { + return nil, status.Errorf(codes.InvalidArgument, "failed to unmarshal request: %v", err) + } + + queryResp, err := s.queryable.Query(ctx, 0, protoMsg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query failed: %v", err) + } + + respBytes, err := proto.Marshal(queryResp) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to marshal response: %v", err) + } + + anyResp := &gogoproto.Any{ + TypeUrl: "/" + proto.MessageName(queryResp), + Value: respBytes, + } + + return &QueryResponse{Response: anyResp}, nil +} + +func (s v2Service) ListQueryHandlers(_ context.Context, _ *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) { + var handlerDescriptors []*Handler + for handlerName := range s.queryHandlers { + msg := s.queryHandlers[handlerName].MakeMsg() + resp := s.queryHandlers[handlerName].MakeMsgResp() + + handlerDescriptors = append(handlerDescriptors, &Handler{ + RequestName: proto.MessageName(msg), + ResponseName: proto.MessageName(resp), + }) + } + + return &ListQueryHandlersResponse{Handlers: handlerDescriptors}, nil +} diff --git a/server/v2/api/grpc/service.pb.go b/server/v2/api/grpc/service.pb.go new file mode 100644 index 000000000000..64ecb79c0332 --- /dev/null +++ b/server/v2/api/grpc/service.pb.go @@ -0,0 +1,1167 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/grpc/v2/service.proto + +package grpc + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryRequest is the request for the Query method +type QueryRequest struct { + Request *any.Any `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func (m *QueryRequest) GetRequest() *any.Any { + if m != nil { + return m.Request + } + return nil +} + +// QueryResponse is the response for the Query method +type QueryResponse struct { + Response *any.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{1} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetResponse() *any.Any { + if m != nil { + return m.Response + } + return nil +} + +// ListQueryHandlersRequest is the request for the ListQueryHandlers method +type ListQueryHandlersRequest struct { +} + +func (m *ListQueryHandlersRequest) Reset() { *m = ListQueryHandlersRequest{} } +func (m *ListQueryHandlersRequest) String() string { return proto.CompactTextString(m) } +func (*ListQueryHandlersRequest) ProtoMessage() {} +func (*ListQueryHandlersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{2} +} +func (m *ListQueryHandlersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListQueryHandlersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListQueryHandlersRequest.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 *ListQueryHandlersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListQueryHandlersRequest.Merge(m, src) +} +func (m *ListQueryHandlersRequest) XXX_Size() int { + return m.Size() +} +func (m *ListQueryHandlersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListQueryHandlersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListQueryHandlersRequest proto.InternalMessageInfo + +// ListQueryHandlersResponse is the response for the ListQueryHandlers method +type ListQueryHandlersResponse struct { + Handlers []*Handler `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"` +} + +func (m *ListQueryHandlersResponse) Reset() { *m = ListQueryHandlersResponse{} } +func (m *ListQueryHandlersResponse) String() string { return proto.CompactTextString(m) } +func (*ListQueryHandlersResponse) ProtoMessage() {} +func (*ListQueryHandlersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{3} +} +func (m *ListQueryHandlersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListQueryHandlersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListQueryHandlersResponse.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 *ListQueryHandlersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListQueryHandlersResponse.Merge(m, src) +} +func (m *ListQueryHandlersResponse) XXX_Size() int { + return m.Size() +} +func (m *ListQueryHandlersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListQueryHandlersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListQueryHandlersResponse proto.InternalMessageInfo + +func (m *ListQueryHandlersResponse) GetHandlers() []*Handler { + if m != nil { + return m.Handlers + } + return nil +} + +// Handler defines a query handler +type Handler struct { + RequestName string `protobuf:"bytes,1,opt,name=request_name,json=requestName,proto3" json:"request_name,omitempty"` + ResponseName string `protobuf:"bytes,2,opt,name=response_name,json=responseName,proto3" json:"response_name,omitempty"` +} + +func (m *Handler) Reset() { *m = Handler{} } +func (m *Handler) String() string { return proto.CompactTextString(m) } +func (*Handler) ProtoMessage() {} +func (*Handler) Descriptor() ([]byte, []int) { + return fileDescriptor_d2a65dd0225af870, []int{4} +} +func (m *Handler) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Handler.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 *Handler) XXX_Merge(src proto.Message) { + xxx_messageInfo_Handler.Merge(m, src) +} +func (m *Handler) XXX_Size() int { + return m.Size() +} +func (m *Handler) XXX_DiscardUnknown() { + xxx_messageInfo_Handler.DiscardUnknown(m) +} + +var xxx_messageInfo_Handler proto.InternalMessageInfo + +func (m *Handler) GetRequestName() string { + if m != nil { + return m.RequestName + } + return "" +} + +func (m *Handler) GetResponseName() string { + if m != nil { + return m.ResponseName + } + return "" +} + +func init() { + proto.RegisterType((*QueryRequest)(nil), "cosmos.base.grpc.v2.QueryRequest") + proto.RegisterType((*QueryResponse)(nil), "cosmos.base.grpc.v2.QueryResponse") + proto.RegisterType((*ListQueryHandlersRequest)(nil), "cosmos.base.grpc.v2.ListQueryHandlersRequest") + proto.RegisterType((*ListQueryHandlersResponse)(nil), "cosmos.base.grpc.v2.ListQueryHandlersResponse") + proto.RegisterType((*Handler)(nil), "cosmos.base.grpc.v2.Handler") +} + +func init() { proto.RegisterFile("cosmos/base/grpc/v2/service.proto", fileDescriptor_d2a65dd0225af870) } + +var fileDescriptor_d2a65dd0225af870 = []byte{ + // 352 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x4f, 0xc2, 0x40, + 0x14, 0xc7, 0x7b, 0x1a, 0x05, 0x1f, 0x30, 0x78, 0x3a, 0x40, 0x63, 0x2a, 0xd4, 0x85, 0xc5, 0x57, + 0x53, 0x17, 0x5d, 0x4c, 0x70, 0x72, 0x30, 0x46, 0x6a, 0x5c, 0x5c, 0x4c, 0x81, 0x13, 0x1b, 0xa1, + 0x57, 0xef, 0x0a, 0x09, 0xdf, 0xc2, 0x8f, 0xe5, 0x88, 0x9b, 0xa3, 0x81, 0x2f, 0x62, 0x7a, 0x77, + 0x25, 0x26, 0x56, 0xe2, 0x76, 0x79, 0xf7, 0xfb, 0xbf, 0xfb, 0xdf, 0xff, 0x3d, 0x68, 0xf5, 0xb9, + 0x1c, 0x73, 0xe9, 0xf5, 0x42, 0xc9, 0xbc, 0xa1, 0x48, 0xfa, 0xde, 0xd4, 0xf7, 0x24, 0x13, 0xd3, + 0xa8, 0xcf, 0x30, 0x11, 0x3c, 0xe5, 0x74, 0x4f, 0x23, 0x98, 0x21, 0x98, 0x21, 0x38, 0xf5, 0xed, + 0xc6, 0x90, 0xf3, 0xe1, 0x88, 0x79, 0x0a, 0xe9, 0x4d, 0x9e, 0xbc, 0x30, 0x9e, 0x69, 0xde, 0xbd, + 0x80, 0x6a, 0x77, 0xc2, 0xc4, 0x2c, 0x60, 0xaf, 0x13, 0x26, 0x53, 0x8a, 0x50, 0x12, 0xfa, 0x58, + 0x27, 0x4d, 0xd2, 0xae, 0xf8, 0xfb, 0xa8, 0xc5, 0x98, 0x8b, 0xb1, 0x13, 0xcf, 0x82, 0x1c, 0x72, + 0x3b, 0x50, 0x33, 0x7a, 0x99, 0xf0, 0x58, 0x32, 0x7a, 0x02, 0x65, 0x61, 0xce, 0x6b, 0x3b, 0xac, + 0x28, 0xd7, 0x86, 0xfa, 0x75, 0x24, 0x53, 0xd5, 0xe6, 0x2a, 0x8c, 0x07, 0x23, 0x26, 0xa4, 0xb1, + 0xe3, 0xde, 0x43, 0xa3, 0xe0, 0xce, 0x3c, 0x75, 0x06, 0xe5, 0x67, 0x53, 0xab, 0x93, 0xe6, 0x66, + 0xbb, 0xe2, 0x1f, 0x60, 0xc1, 0xf7, 0xd1, 0x08, 0x83, 0x15, 0xed, 0x76, 0xa1, 0x64, 0x8a, 0xb4, + 0x05, 0x55, 0xf3, 0x97, 0xc7, 0x38, 0x1c, 0x6b, 0xcf, 0x3b, 0x41, 0xc5, 0xd4, 0x6e, 0xc2, 0x31, + 0xa3, 0x47, 0x50, 0xcb, 0xcd, 0x6a, 0x66, 0x43, 0x31, 0xd5, 0xbc, 0x98, 0x41, 0xfe, 0x07, 0x81, + 0xd2, 0x9d, 0x1e, 0x05, 0xbd, 0x85, 0x2d, 0xe5, 0x98, 0xb6, 0x0a, 0xfd, 0xfc, 0x0c, 0xdc, 0x76, + 0xd7, 0x21, 0x26, 0x21, 0x8b, 0xa6, 0xb0, 0xfb, 0x2b, 0x07, 0x7a, 0x5c, 0x28, 0xfd, 0x2b, 0x4b, + 0x1b, 0xff, 0x8b, 0xe7, 0xaf, 0x5e, 0x9e, 0xbf, 0x2f, 0x1c, 0x32, 0x5f, 0x38, 0xe4, 0x6b, 0xe1, + 0x90, 0xb7, 0xa5, 0x63, 0xcd, 0x97, 0x8e, 0xf5, 0xb9, 0x74, 0xac, 0x87, 0x43, 0xdd, 0x4a, 0x0e, + 0x5e, 0x30, 0xe2, 0x6a, 0x05, 0x99, 0xc8, 0x96, 0x31, 0x4c, 0x22, 0xb5, 0x98, 0xbd, 0x6d, 0x35, + 0xec, 0xd3, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x00, 0xa2, 0x0d, 0xb3, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ServiceClient interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) +} + +type serviceClient struct { + cc grpc1.ClientConn +} + +func NewServiceClient(cc grpc1.ClientConn) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.grpc.v2.Service/Query", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) { + out := new(ListQueryHandlersResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.grpc.v2.Service/ListQueryHandlers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +type ServiceServer interface { + // Query queries the server with a request, the request can be any sdk Msg. + Query(context.Context, *QueryRequest) (*QueryResponse, error) + // ListQueryHandlers lists all the available query handlers. + ListQueryHandlers(context.Context, *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) +} + +// UnimplementedServiceServer can be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (*UnimplementedServiceServer) Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (*UnimplementedServiceServer) ListQueryHandlers(ctx context.Context, req *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListQueryHandlers not implemented") +} + +func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { + s.RegisterService(&_Service_serviceDesc, srv) +} + +func _Service_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Query(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.grpc.v2.Service/Query", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Query(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_ListQueryHandlers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListQueryHandlersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).ListQueryHandlers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.grpc.v2.Service/ListQueryHandlers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).ListQueryHandlers(ctx, req.(*ListQueryHandlersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Service_serviceDesc = _Service_serviceDesc +var _Service_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.grpc.v2.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Query", + Handler: _Service_Query_Handler, + }, + { + MethodName: "ListQueryHandlers", + Handler: _Service_ListQueryHandlers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/grpc/v2/service.proto", +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Request != nil { + { + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Response != nil { + { + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListQueryHandlersRequest) 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 *ListQueryHandlersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListQueryHandlersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ListQueryHandlersResponse) 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 *ListQueryHandlersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListQueryHandlersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Handlers) > 0 { + for iNdEx := len(m.Handlers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Handlers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Handler) 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 *Handler) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Handler) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResponseName) > 0 { + i -= len(m.ResponseName) + copy(dAtA[i:], m.ResponseName) + i = encodeVarintService(dAtA, i, uint64(len(m.ResponseName))) + i-- + dAtA[i] = 0x12 + } + if len(m.RequestName) > 0 { + i -= len(m.RequestName) + copy(dAtA[i:], m.RequestName) + i = encodeVarintService(dAtA, i, uint64(len(m.RequestName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintService(dAtA []byte, offset int, v uint64) int { + offset -= sovService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = m.Request.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func (m *ListQueryHandlersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ListQueryHandlersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Handlers) > 0 { + for _, e := range m.Handlers { + l = e.Size() + n += 1 + l + sovService(uint64(l)) + } + } + return n +} + +func (m *Handler) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RequestName) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + l = len(m.ResponseName) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } + return n +} + +func sovService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozService(x uint64) (n int) { + return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowService + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Request == nil { + m.Request = &any.Any{} + } + if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryResponse) 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 ErrIntOverflowService + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &any.Any{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListQueryHandlersRequest) 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 ErrIntOverflowService + } + 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: ListQueryHandlersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListQueryHandlersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListQueryHandlersResponse) 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 ErrIntOverflowService + } + 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: ListQueryHandlersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListQueryHandlersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Handlers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Handlers = append(m.Handlers, &Handler{}) + if err := m.Handlers[len(m.Handlers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Handler) 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 ErrIntOverflowService + } + 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: Handler: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Handler: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + 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 ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResponseName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipService(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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrIntOverflowService + } + 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, ErrInvalidLengthService + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupService + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthService + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowService = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") +) diff --git a/server/v2/api/grpc/service_test.go b/server/v2/api/grpc/service_test.go new file mode 100644 index 000000000000..5c416f60c166 --- /dev/null +++ b/server/v2/api/grpc/service_test.go @@ -0,0 +1,227 @@ +package grpc + +import ( + "context" + "fmt" + "testing" + + "github.com/cosmos/gogoproto/proto" + gogoproto "github.com/cosmos/gogoproto/types/any" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + appmodulev2 "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/transaction" + serverv2 "cosmossdk.io/server/v2" +) + +type MockRequestMessage struct { + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MockRequestMessage) XXX_MessageName() string { + return "MockRequestMessage" +} +func (m *MockRequestMessage) Reset() {} +func (m *MockRequestMessage) String() string { return "" } +func (m *MockRequestMessage) ProtoMessage() {} +func (m *MockRequestMessage) ValidateBasic() error { + return nil +} + +type MockResponseMessage struct { + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MockResponseMessage) Reset() {} +func (m *MockResponseMessage) String() string { return "" } +func (m *MockResponseMessage) ProtoMessage() {} +func (m *MockResponseMessage) ValidateBasic() error { + return nil +} + +type mockApp[T transaction.Tx] struct { + mock.Mock + + serverv2.AppI[T] +} + +func (m *mockApp[T]) QueryHandlers() map[string]appmodulev2.Handler { + args := m.Called() + return args.Get(0).(map[string]appmodulev2.Handler) +} + +func (m *mockApp[T]) Query(ctx context.Context, height uint64, msg transaction.Msg) (transaction.Msg, error) { + args := m.Called(ctx, height, msg) + if args.Get(0) == nil { + return nil, args.Error(1) + } + return args.Get(0).(transaction.Msg), args.Error(1) +} + +func TestQuery(t *testing.T) { + tests := []struct { + name string + setupMock func(app *mockApp[transaction.Tx]) + request *QueryRequest + expectError bool + expectedError string + }{ + { + name: "successful query", + setupMock: func(app *mockApp[transaction.Tx]) { + reqMsg := &MockRequestMessage{Data: "request"} + respMsg := &MockResponseMessage{Data: "response"} + + handlers := map[string]appmodulev2.Handler{ + "/" + proto.MessageName(&MockRequestMessage{}): { + Func: func(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return respMsg, nil + }, + MakeMsg: func() transaction.Msg { + return reqMsg + }, + MakeMsgResp: func() transaction.Msg { + return respMsg + }, + }, + } + app.On("QueryHandlers").Return(handlers) + app.On("Query", mock.Anything, uint64(0), reqMsg).Return(respMsg, nil) + }, + + request: createTestRequest(t), + expectError: false, + }, + { + name: "handler not found", + setupMock: func(app *mockApp[transaction.Tx]) { + handlers := map[string]appmodulev2.Handler{} + app.On("QueryHandlers").Return(handlers) + }, + request: createTestRequest(t), + expectError: true, + expectedError: "rpc error: code = NotFound desc = handler not found for /MockRequestMessage", + }, + { + name: "query error", + setupMock: func(app *mockApp[transaction.Tx]) { + reqMsg := &MockRequestMessage{Data: "request"} + respMsg := &MockRequestMessage{Data: "response"} + + handlers := map[string]appmodulev2.Handler{ + "/" + proto.MessageName(&MockRequestMessage{}): { + Func: func(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return respMsg, nil + }, + MakeMsg: func() transaction.Msg { + return reqMsg + }, + MakeMsgResp: func() transaction.Msg { + return respMsg + }, + }, + } + app.On("QueryHandlers").Return(handlers) + app.On("Query", mock.Anything, uint64(0), reqMsg).Return(nil, assert.AnError) + }, + request: createTestRequest(t), + expectError: true, + expectedError: fmt.Sprintf("rpc error: code = Internal desc = query failed: %s", assert.AnError.Error()), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockApp := &mockApp[transaction.Tx]{} + + if tt.setupMock != nil { + tt.setupMock(mockApp) + } + + service := &v2Service{mockApp.QueryHandlers(), mockApp} + resp, err := service.Query(context.Background(), tt.request) + + if tt.expectError { + assert.Error(t, err) + if tt.expectedError != "" { + assert.Equal(t, tt.expectedError, err.Error()) + } + } else { + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.Response) + } + + mockApp.AssertExpectations(t) + }) + } +} + +func TestV2Service_ListQueryHandlers(t *testing.T) { + tests := []struct { + name string + setupMock func(app *mockApp[transaction.Tx]) + }{ + { + name: "successful list query handlers", + setupMock: func(app *mockApp[transaction.Tx]) { + reqMsg := &MockRequestMessage{Data: "request"} + respMsg := &MockResponseMessage{Data: "response"} + + handlers := map[string]appmodulev2.Handler{ + "/test.Query": { + Func: func(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + return respMsg, nil + }, + MakeMsg: func() transaction.Msg { + return reqMsg + }, + MakeMsgResp: func() transaction.Msg { + return respMsg + }, + }, + } + app.On("QueryHandlers").Return(handlers) + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockApp := &mockApp[transaction.Tx]{} + + if tt.setupMock != nil { + tt.setupMock(mockApp) + } + + service := &v2Service{mockApp.QueryHandlers(), mockApp} + resp, err := service.ListQueryHandlers(context.Background(), &ListQueryHandlersRequest{}) + + assert.NoError(t, err) + assert.NotNil(t, resp) + assert.Len(t, resp.Handlers, 1) + resp.Handlers[0].RequestName = "/MockRequestMessage" + resp.Handlers[0].ResponseName = "/MockResponseMessage" + + mockApp.AssertExpectations(t) + }) + } +} + +func createTestRequest(t *testing.T) *QueryRequest { + t.Helper() + + reqMsg := &MockRequestMessage{Data: "request"} + reqBytes, err := proto.Marshal(reqMsg) + if err != nil { + t.Fatalf("failed to marshal request: %v", err) + } + + return &QueryRequest{ + Request: &gogoproto.Any{ + TypeUrl: "/" + proto.MessageName(reqMsg), + Value: reqBytes, + }, + } +} diff --git a/server/v2/go.mod b/server/v2/go.mod index 0331cd942b46..0f59d1a71de7 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -92,8 +92,10 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect 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/tidwall/btree v1.7.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.28.0 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index 4ea1c4e1b328..0e797e011688 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -119,6 +119,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= @@ -147,7 +148,10 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= @@ -320,6 +324,8 @@ 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.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -371,6 +377,7 @@ golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4Iltr 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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -440,6 +447,7 @@ golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNq google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= From ed46a4c93a748ef56d86d405d9836c7699f7bcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Toledano?= Date: Tue, 5 Nov 2024 16:49:09 +0100 Subject: [PATCH 22/24] refactor(client/v2): offchain uses client/v2/factory (#22344) Co-authored-by: Julien Robert --- client/v2/Makefile | 2 +- client/v2/internal/buf.gen.gogo.yaml | 5 + .../{buf.gen.yaml => buf.gen.pulsar.yaml} | 0 .../offchain/msgSignArbitraryData.proto | 2 + client/v2/internal/testpb/msg.pulsar.go | 28 +- client/v2/internal/testpb/msg_grpc.pb.go | 15 +- client/v2/internal/testpb/query_grpc.pb.go | 10 +- client/v2/offchain/builder.go | 318 ------------- client/v2/offchain/cli.go | 20 +- client/v2/offchain/encode.go | 9 + client/v2/offchain/marshal.go | 43 -- client/v2/offchain/msgSignArbitraryData.pb.go | 432 ++++++++++++++++++ client/v2/offchain/sign.go | 149 +++--- client/v2/offchain/sign_test.go | 61 ++- client/v2/offchain/signature.go | 34 -- client/v2/offchain/verify.go | 53 ++- client/v2/offchain/verify_test.go | 38 +- client/v2/tx/config.go | 24 +- client/v2/tx/config_test.go | 4 +- client/v2/tx/encoder.go | 39 ++ client/v2/tx/factory.go | 48 +- client/v2/tx/factory_test.go | 50 +- client/v2/tx/tx.go | 2 +- client/v2/tx/types.go | 31 +- client/v2/tx/wrapper.go | 11 + 25 files changed, 757 insertions(+), 671 deletions(-) create mode 100644 client/v2/internal/buf.gen.gogo.yaml rename client/v2/internal/{buf.gen.yaml => buf.gen.pulsar.yaml} (100%) delete mode 100644 client/v2/offchain/builder.go delete mode 100644 client/v2/offchain/marshal.go create mode 100644 client/v2/offchain/msgSignArbitraryData.pb.go delete mode 100644 client/v2/offchain/signature.go diff --git a/client/v2/Makefile b/client/v2/Makefile index 1b4bb0cbe7f6..ec0288100be4 100644 --- a/client/v2/Makefile +++ b/client/v2/Makefile @@ -1,2 +1,2 @@ codegen: - @(cd internal; buf generate) \ No newline at end of file + @(cd internal; buf generate --template buf.gen.pulsar.yaml) \ No newline at end of file diff --git a/client/v2/internal/buf.gen.gogo.yaml b/client/v2/internal/buf.gen.gogo.yaml new file mode 100644 index 000000000000..a1df55b815d6 --- /dev/null +++ b/client/v2/internal/buf.gen.gogo.yaml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - name: gocosmos + out: .. + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any diff --git a/client/v2/internal/buf.gen.yaml b/client/v2/internal/buf.gen.pulsar.yaml similarity index 100% rename from client/v2/internal/buf.gen.yaml rename to client/v2/internal/buf.gen.pulsar.yaml diff --git a/client/v2/internal/offchain/msgSignArbitraryData.proto b/client/v2/internal/offchain/msgSignArbitraryData.proto index 0dcce3399ba4..87cff99a5db8 100644 --- a/client/v2/internal/offchain/msgSignArbitraryData.proto +++ b/client/v2/internal/offchain/msgSignArbitraryData.proto @@ -6,6 +6,8 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "amino/amino.proto"; +option go_package = "cosmossdk.io/client/v2/offchain"; + // MsgSignArbitraryData defines an arbitrary, general-purpose, off-chain message message MsgSignArbitraryData { option (amino.name) = "offchain/MsgSignArbitraryData"; diff --git a/client/v2/internal/testpb/msg.pulsar.go b/client/v2/internal/testpb/msg.pulsar.go index 29fd89007a3d..c156d4131627 100644 --- a/client/v2/internal/testpb/msg.pulsar.go +++ b/client/v2/internal/testpb/msg.pulsar.go @@ -4287,27 +4287,27 @@ var file_testpb_msg_proto_rawDesc = []byte{ 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xab, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xac, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0xca, 0xb4, 0x2d, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, - 0x30, 0x2e, 0x35, 0x30, 0x2e, 0x30, 0x12, 0x5b, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, + 0x30, 0x2e, 0x35, 0x30, 0x2e, 0x30, 0x12, 0x5c, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, - 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0xca, 0xb4, 0x2d, - 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, 0x30, 0x2e, 0x35, - 0x31, 0x2e, 0x30, 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, - 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, - 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0xca, 0xb4, 0x2d, + 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, 0x30, 0x2e, 0x35, + 0x33, 0x2e, 0x30, 0x20, 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, + 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/client/v2/internal/testpb/msg_grpc.pb.go b/client/v2/internal/testpb/msg_grpc.pb.go index ebcfba150bb9..b9ccec990607 100644 --- a/client/v2/internal/testpb/msg_grpc.pb.go +++ b/client/v2/internal/testpb/msg_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) // source: testpb/msg.proto @@ -18,11 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Msg_Send_FullMethodName = "/testpb.Msg/Send" - Msg_Clawback_FullMethodName = "/testpb.Msg/Clawback" -) - // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -42,7 +37,7 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) { out := new(MsgResponse) - err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/testpb.Msg/Send", in, out, opts...) if err != nil { return nil, err } @@ -51,7 +46,7 @@ func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallO func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { out := new(MsgClawbackResponse) - err := c.cc.Invoke(ctx, Msg_Clawback_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/testpb.Msg/Clawback", in, out, opts...) if err != nil { return nil, err } @@ -101,7 +96,7 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_Send_FullMethodName, + FullMethod: "/testpb.Msg/Send", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Send(ctx, req.(*MsgRequest)) @@ -119,7 +114,7 @@ func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_Clawback_FullMethodName, + FullMethod: "/testpb.Msg/Clawback", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Clawback(ctx, req.(*MsgClawbackRequest)) diff --git a/client/v2/internal/testpb/query_grpc.pb.go b/client/v2/internal/testpb/query_grpc.pb.go index 9f444b76c729..56d177ddc86f 100644 --- a/client/v2/internal/testpb/query_grpc.pb.go +++ b/client/v2/internal/testpb/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) // source: testpb/query.proto @@ -18,10 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Query_Echo_FullMethodName = "/testpb.Query/Echo" -) - // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -40,7 +36,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { out := new(EchoResponse) - err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/testpb.Query/Echo", in, out, opts...) if err != nil { return nil, err } @@ -86,7 +82,7 @@ func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_Echo_FullMethodName, + FullMethod: "/testpb.Query/Echo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Echo(ctx, req.(*EchoRequest)) diff --git a/client/v2/offchain/builder.go b/client/v2/offchain/builder.go deleted file mode 100644 index 55c5678cd15c..000000000000 --- a/client/v2/offchain/builder.go +++ /dev/null @@ -1,318 +0,0 @@ -package offchain - -// TODO: remove custom off-chain builder once v2 tx builder is developed. - -import ( - "errors" - "fmt" - - "github.com/cosmos/cosmos-proto/anyutil" - "github.com/cosmos/gogoproto/proto" - protov2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" - - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" - txsigning "cosmossdk.io/x/tx/signing" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" -) - -type builder struct { - cdc codec.Codec - tx *apitx.Tx -} - -func newBuilder(cdc codec.Codec) *builder { - return &builder{ - cdc: cdc, - tx: &apitx.Tx{ - Body: &apitx.TxBody{}, - AuthInfo: &apitx.AuthInfo{ - Fee: &apitx.Fee{ - Amount: nil, - GasLimit: 0, - Payer: "", - Granter: "", - }, - }, - Signatures: nil, - }, - } -} - -// GetTx returns the tx. -func (b *builder) GetTx() *apitx.Tx { - return b.tx -} - -// GetSigningTxData returns the necessary data to generate sign bytes. -func (b *builder) GetSigningTxData() (txsigning.TxData, error) { - body := b.tx.Body - authInfo := b.tx.AuthInfo - - msgs := make([]*anypb.Any, len(body.Messages)) - for i, msg := range body.Messages { - msgs[i] = &anypb.Any{ - TypeUrl: msg.TypeUrl, - Value: msg.Value, - } - } - - extOptions := make([]*anypb.Any, len(body.ExtensionOptions)) - for i, extOption := range body.ExtensionOptions { - extOptions[i] = &anypb.Any{ - TypeUrl: extOption.TypeUrl, - Value: extOption.Value, - } - } - - nonCriticalExtOptions := make([]*anypb.Any, len(body.NonCriticalExtensionOptions)) - for i, extOption := range body.NonCriticalExtensionOptions { - nonCriticalExtOptions[i] = &anypb.Any{ - TypeUrl: extOption.TypeUrl, - Value: extOption.Value, - } - } - - feeCoins := authInfo.Fee.Amount - feeAmount := make([]*basev1beta1.Coin, len(feeCoins)) - for i, coin := range feeCoins { - feeAmount[i] = &basev1beta1.Coin{ - Denom: coin.Denom, - Amount: coin.Amount, - } - } - - txSignerInfos := make([]*apitx.SignerInfo, len(authInfo.SignerInfos)) - for i, signerInfo := range authInfo.SignerInfos { - txSignerInfo := &apitx.SignerInfo{ - PublicKey: &anypb.Any{ - TypeUrl: signerInfo.PublicKey.TypeUrl, - Value: signerInfo.PublicKey.Value, - }, - Sequence: signerInfo.Sequence, - ModeInfo: signerInfo.ModeInfo, - } - txSignerInfos[i] = txSignerInfo - } - - txAuthInfo := &apitx.AuthInfo{ - SignerInfos: txSignerInfos, - Fee: &apitx.Fee{ - Amount: feeAmount, - GasLimit: authInfo.Fee.GasLimit, - Payer: authInfo.Fee.Payer, - Granter: authInfo.Fee.Granter, - }, - } - - txBody := &apitx.TxBody{ - Messages: msgs, - Memo: body.Memo, - TimeoutHeight: body.TimeoutHeight, - TimeoutTimestamp: body.TimeoutTimestamp, - ExtensionOptions: extOptions, - NonCriticalExtensionOptions: nonCriticalExtOptions, - } - authInfoBz, err := protov2.Marshal(b.tx.AuthInfo) - if err != nil { - return txsigning.TxData{}, err - } - bodyBz, err := protov2.Marshal(b.tx.Body) - if err != nil { - return txsigning.TxData{}, err - } - txData := txsigning.TxData{ - AuthInfo: txAuthInfo, - AuthInfoBytes: authInfoBz, - Body: txBody, - BodyBytes: bodyBz, - } - return txData, nil -} - -// GetPubKeys returns the pubKeys of the tx. -func (b *builder) GetPubKeys() ([]cryptotypes.PubKey, error) { // If signer already has pubkey in context, this list will have nil in its place - signerInfos := b.tx.AuthInfo.SignerInfos - pks := make([]cryptotypes.PubKey, len(signerInfos)) - - for i, si := range signerInfos { - // NOTE: it is okay to leave this nil if there is no PubKey in the SignerInfo. - // PubKey's can be left unset in SignerInfo. - if si.PublicKey == nil { - continue - } - var pk cryptotypes.PubKey - anyPk := &codectypes.Any{ - TypeUrl: si.PublicKey.TypeUrl, - Value: si.PublicKey.Value, - } - err := b.cdc.UnpackAny(anyPk, &pk) - if err != nil { - return nil, err - } - pks[i] = pk - } - - return pks, nil -} - -// GetSignatures returns the signatures of the tx. -func (b *builder) GetSignatures() ([]OffchainSignature, error) { - signerInfos := b.tx.AuthInfo.SignerInfos - sigs := b.tx.Signatures - pubKeys, err := b.GetPubKeys() - if err != nil { - return nil, err - } - n := len(signerInfos) - res := make([]OffchainSignature, n) - - for i, si := range signerInfos { - // handle nil signatures (in case of simulation) - if si.ModeInfo == nil { - res[i] = OffchainSignature{ - PubKey: pubKeys[i], - } - } else { - var err error - sigData, err := modeInfoAndSigToSignatureData(si.ModeInfo, sigs[i]) - if err != nil { - return nil, err - } - // sequence number is functionally a transaction nonce and referred to as such in the SDK - nonce := si.GetSequence() - res[i] = OffchainSignature{ - PubKey: pubKeys[i], - Data: sigData, - Sequence: nonce, - } - } - } - - return res, nil -} - -// GetSigners returns the signers of the tx. -func (b *builder) GetSigners() ([][]byte, error) { - signers, _, err := b.getSigners() - return signers, err -} - -func (b *builder) getSigners() ([][]byte, []protov2.Message, error) { - var signers [][]byte - seen := map[string]bool{} - - var msgsv2 []protov2.Message - for _, msg := range b.tx.Body.Messages { - msgv2, err := anyutil.Unpack(msg, b.cdc.InterfaceRegistry(), nil) - if err != nil { - return nil, nil, err - } - xs, err := b.cdc.InterfaceRegistry().SigningContext().GetSigners(msgv2) - if err != nil { - return nil, nil, err - } - - msgsv2 = append(msgsv2, msg) - - for _, signer := range xs { - if !seen[string(signer)] { - signers = append(signers, signer) - seen[string(signer)] = true - } - } - } - - return signers, msgsv2, nil -} - -func (b *builder) setMsgs(msgs ...proto.Message) error { - anys := make([]*anypb.Any, len(msgs)) - for i, msg := range msgs { - protoMsg, ok := msg.(protov2.Message) - if !ok { - return errors.New("message is not a proto.Message") - } - protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} - bz, err := protov2MarshalOpts.Marshal(protoMsg) - if err != nil { - return err - } - anys[i] = &anypb.Any{ - TypeUrl: codectypes.MsgTypeURL(msg), - Value: bz, - } - } - b.tx.Body.Messages = anys - return nil -} - -// SetSignatures set the signatures of the tx. -func (b *builder) SetSignatures(signatures ...OffchainSignature) error { - n := len(signatures) - signerInfos := make([]*apitx.SignerInfo, n) - rawSigs := make([][]byte, n) - var err error - for i, sig := range signatures { - var mi *apitx.ModeInfo - mi, rawSigs[i], err = b.signatureDataToModeInfoAndSig(sig.Data) - if err != nil { - return err - } - - pubKey, err := codectypes.NewAnyWithValue(sig.PubKey) - if err != nil { - return err - } - - signerInfos[i] = &apitx.SignerInfo{ - PublicKey: &anypb.Any{ - TypeUrl: pubKey.TypeUrl, - Value: pubKey.Value, - }, - ModeInfo: mi, - Sequence: sig.Sequence, - } - } - - b.tx.AuthInfo.SignerInfos = signerInfos - b.tx.Signatures = rawSigs - - return nil -} - -// signatureDataToModeInfoAndSig converts a SignatureData to a ModeInfo and raw bytes signature. -func (b *builder) signatureDataToModeInfoAndSig(data SignatureData) (*apitx.ModeInfo, []byte, error) { - if data == nil { - return nil, nil, errors.New("empty SignatureData") - } - - switch data := data.(type) { - case *SingleSignatureData: - return &apitx.ModeInfo{ - Sum: &apitx.ModeInfo_Single_{ - Single: &apitx.ModeInfo_Single{Mode: data.SignMode}, - }, - }, data.Signature, nil - default: - return nil, nil, fmt.Errorf("unexpected signature data type %T", data) - } -} - -// modeInfoAndSigToSignatureData converts a ModeInfo and raw bytes signature to a SignatureData. -func modeInfoAndSigToSignatureData(modeInfo *apitx.ModeInfo, sig []byte) (SignatureData, error) { - switch modeInfoType := modeInfo.Sum.(type) { - case *apitx.ModeInfo_Single_: - return &SingleSignatureData{ - SignMode: modeInfoType.Single.Mode, - Signature: sig, - }, nil - - default: - return nil, fmt.Errorf("unexpected ModeInfo data type %T", modeInfo) - } -} diff --git a/client/v2/offchain/cli.go b/client/v2/offchain/cli.go index fabb3f503beb..7738a6204451 100644 --- a/client/v2/offchain/cli.go +++ b/client/v2/offchain/cli.go @@ -13,10 +13,8 @@ import ( ) const ( - flagNotEmitUnpopulated = "notEmitUnpopulated" - flagIndent = "indent" - flagEncoding = "encoding" - flagFileFormat = "file-format" + flagEncoding = "encoding" + flagFileFormat = "file-format" ) // OffChain off-chain utilities. @@ -51,13 +49,12 @@ func SignFile() *cobra.Command { return err } - notEmitUnpopulated, _ := cmd.Flags().GetBool(flagNotEmitUnpopulated) - indent, _ := cmd.Flags().GetString(flagIndent) encoding, _ := cmd.Flags().GetString(flagEncoding) outputFormat, _ := cmd.Flags().GetString(v2flags.FlagOutput) outputFile, _ := cmd.Flags().GetString(flags.FlagOutputDocument) + signMode, _ := cmd.Flags().GetString(flags.FlagSignMode) - signedTx, err := Sign(clientCtx, bz, args[0], indent, encoding, outputFormat, !notEmitUnpopulated) + signedTx, err := Sign(clientCtx, bz, args[0], encoding, signMode, outputFormat) if err != nil { return err } @@ -75,28 +72,27 @@ func SignFile() *cobra.Command { }, } - cmd.Flags().String(flagIndent, " ", "Choose an indent for the tx") cmd.Flags().String(v2flags.FlagOutput, "json", "Choose an output format for the tx (json|text") - cmd.Flags().Bool(flagNotEmitUnpopulated, false, "Don't show unpopulated fields in the tx") cmd.Flags().String(flagEncoding, "no-encoding", "Choose an encoding method for the file content to be added as msg data (no-encoding|base64|hex)") cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT") + cmd.PersistentFlags().String(flags.FlagSignMode, "direct", "Choose sign mode (direct|amino-json)") return cmd } // VerifyFile verifies given file with given key. func VerifyFile() *cobra.Command { cmd := &cobra.Command{ - Use: "verify-file ", + Use: "verify-file ", Short: "Verify a file.", Long: "Verify a previously signed file with the given key.", - Args: cobra.ExactArgs(2), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } - bz, err := os.ReadFile(args[1]) + bz, err := os.ReadFile(args[0]) if err != nil { return err } diff --git a/client/v2/offchain/encode.go b/client/v2/offchain/encode.go index 6721ffc28cf2..be43316a655f 100644 --- a/client/v2/offchain/encode.go +++ b/client/v2/offchain/encode.go @@ -42,3 +42,12 @@ func getEncoder(encoder string) (encodingFunc, error) { return nil, fmt.Errorf("unknown encoder: %s", encoder) } } + +func encodeDigest(encodingFormat string, digest []byte) (string, error) { + encoder, err := getEncoder(encodingFormat) + if err != nil { + return "", err + } + + return encoder(digest) +} diff --git a/client/v2/offchain/marshal.go b/client/v2/offchain/marshal.go deleted file mode 100644 index 8f90b9830d3f..000000000000 --- a/client/v2/offchain/marshal.go +++ /dev/null @@ -1,43 +0,0 @@ -package offchain - -import ( - "fmt" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/proto" - - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" - v2flags "cosmossdk.io/client/v2/internal/flags" -) - -// marshaller marshals Messages. -type marshaller interface { - Marshal(message proto.Message) ([]byte, error) -} - -// getMarshaller returns the marshaller for the given marshaller id. -func getMarshaller(marshallerId, indent string, emitUnpopulated bool) (marshaller, error) { - switch marshallerId { - case v2flags.OutputFormatJSON: - return protojson.MarshalOptions{ - Indent: indent, - EmitUnpopulated: emitUnpopulated, - }, nil - case v2flags.OutputFormatText: - return prototext.MarshalOptions{ - Indent: indent, - EmitUnknown: emitUnpopulated, - }, nil - } - return nil, fmt.Errorf("marshaller with id '%s' not identified", marshallerId) -} - -// marshalOffChainTx marshals a Tx using given marshaller. -func marshalOffChainTx(tx *apitx.Tx, marshaller marshaller) (string, error) { - bytesTx, err := marshaller.Marshal(tx) - if err != nil { - return "", err - } - return string(bytesTx), nil -} diff --git a/client/v2/offchain/msgSignArbitraryData.pb.go b/client/v2/offchain/msgSignArbitraryData.pb.go new file mode 100644 index 000000000000..2733b9182b95 --- /dev/null +++ b/client/v2/offchain/msgSignArbitraryData.pb.go @@ -0,0 +1,432 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: offchain/msgSignArbitraryData.proto + +package offchain + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + 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 + +// MsgSignArbitraryData defines an arbitrary, general-purpose, off-chain message +type MsgSignArbitraryData struct { + // AppDomain is the application requesting off-chain message signing + AppDomain string `protobuf:"bytes,1,opt,name=app_domain,json=appDomain,proto3" json:"app_domain,omitempty"` + // Signer is the sdk.AccAddress of the message signer + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + // Data represents the raw bytes of the content that is signed (text, json, etc) + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgSignArbitraryData) Reset() { *m = MsgSignArbitraryData{} } +func (m *MsgSignArbitraryData) String() string { return proto.CompactTextString(m) } +func (*MsgSignArbitraryData) ProtoMessage() {} +func (*MsgSignArbitraryData) Descriptor() ([]byte, []int) { + return fileDescriptor_f3e1b1b538b29252, []int{0} +} +func (m *MsgSignArbitraryData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSignArbitraryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSignArbitraryData.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 *MsgSignArbitraryData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSignArbitraryData.Merge(m, src) +} +func (m *MsgSignArbitraryData) XXX_Size() int { + return m.Size() +} +func (m *MsgSignArbitraryData) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSignArbitraryData.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSignArbitraryData proto.InternalMessageInfo + +func (m *MsgSignArbitraryData) GetAppDomain() string { + if m != nil { + return m.AppDomain + } + return "" +} + +func (m *MsgSignArbitraryData) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgSignArbitraryData) GetData() string { + if m != nil { + return m.Data + } + return "" +} + +func init() { + proto.RegisterType((*MsgSignArbitraryData)(nil), "offchain.MsgSignArbitraryData") +} + +func init() { + proto.RegisterFile("offchain/msgSignArbitraryData.proto", fileDescriptor_f3e1b1b538b29252) +} + +var fileDescriptor_f3e1b1b538b29252 = []byte{ + // 267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0x4f, 0x4b, 0x4b, + 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0xcf, 0x2d, 0x4e, 0x0f, 0xce, 0x4c, 0xcf, 0x73, 0x2c, 0x4a, 0xca, + 0x2c, 0x29, 0x4a, 0x2c, 0xaa, 0x74, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0xe2, 0x80, 0x29, 0x92, 0x92, 0x4c, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x8e, 0x07, 0x8b, 0xeb, 0x43, + 0x38, 0x10, 0x45, 0x52, 0xe2, 0x10, 0x1e, 0xc8, 0x1c, 0xfd, 0x32, 0x43, 0x10, 0x05, 0x95, 0x10, + 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x21, 0xa5, 0x55, 0x8c, 0x5c, 0x22, 0xbe, + 0x58, 0xec, 0x13, 0x92, 0xe5, 0xe2, 0x4a, 0x2c, 0x28, 0x88, 0x4f, 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, + 0x93, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0xe2, 0x4c, 0x2c, 0x28, 0x70, 0x01, 0x0b, 0x08, 0x19, + 0x70, 0xb1, 0x15, 0x67, 0xa6, 0xe7, 0xa5, 0x16, 0x49, 0x30, 0x81, 0xa4, 0x9c, 0x24, 0x2e, 0x6d, + 0xd1, 0x15, 0x81, 0xba, 0xc2, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, 0x33, + 0x2f, 0x3d, 0x08, 0xaa, 0x4e, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1, 0x24, 0x51, 0x82, 0x19, 0x6c, + 0x14, 0x98, 0x6d, 0xa5, 0xdb, 0xf4, 0x7c, 0x83, 0x16, 0x54, 0x41, 0xd7, 0xf3, 0x0d, 0x5a, 0xb2, + 0xf0, 0x30, 0xc0, 0xe6, 0x26, 0x27, 0xcb, 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, 0x92, 0x87, 0x58, 0x5d, 0x9c, 0x92, 0xad, 0x97, 0x99, 0xaf, 0x9f, 0x9c, 0x93, 0x99, 0x9a, + 0x57, 0xa2, 0x5f, 0x66, 0xa4, 0x0f, 0x33, 0x2f, 0x89, 0x0d, 0xec, 0x5d, 0x63, 0x40, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x78, 0x04, 0xe8, 0x80, 0x66, 0x01, 0x00, 0x00, +} + +func (m *MsgSignArbitraryData) 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 *MsgSignArbitraryData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSignArbitraryData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintMsgSignArbitraryData(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMsgSignArbitraryData(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.AppDomain) > 0 { + i -= len(m.AppDomain) + copy(dAtA[i:], m.AppDomain) + i = encodeVarintMsgSignArbitraryData(dAtA, i, uint64(len(m.AppDomain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMsgSignArbitraryData(dAtA []byte, offset int, v uint64) int { + offset -= sovMsgSignArbitraryData(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSignArbitraryData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppDomain) + if l > 0 { + n += 1 + l + sovMsgSignArbitraryData(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMsgSignArbitraryData(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovMsgSignArbitraryData(uint64(l)) + } + return n +} + +func sovMsgSignArbitraryData(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMsgSignArbitraryData(x uint64) (n int) { + return sovMsgSignArbitraryData(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSignArbitraryData) 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 ErrIntOverflowMsgSignArbitraryData + } + 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: MsgSignArbitraryData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSignArbitraryData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppDomain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgSignArbitraryData + } + 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 ErrInvalidLengthMsgSignArbitraryData + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppDomain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgSignArbitraryData + } + 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 ErrInvalidLengthMsgSignArbitraryData + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgSignArbitraryData + } + 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 ErrInvalidLengthMsgSignArbitraryData + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgSignArbitraryData(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMsgSignArbitraryData + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMsgSignArbitraryData(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, ErrIntOverflowMsgSignArbitraryData + } + 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, ErrIntOverflowMsgSignArbitraryData + } + 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, ErrIntOverflowMsgSignArbitraryData + } + 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, ErrInvalidLengthMsgSignArbitraryData + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMsgSignArbitraryData + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMsgSignArbitraryData + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMsgSignArbitraryData = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMsgSignArbitraryData = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMsgSignArbitraryData = fmt.Errorf("proto: unexpected end of group") +) diff --git a/client/v2/offchain/sign.go b/client/v2/offchain/sign.go index b36a50c00ca0..8dfcb907c089 100644 --- a/client/v2/offchain/sign.go +++ b/client/v2/offchain/sign.go @@ -2,18 +2,15 @@ package offchain import ( "context" - - "google.golang.org/protobuf/types/known/anypb" + "fmt" apisigning "cosmossdk.io/api/cosmos/tx/signing/v1beta1" - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/client/v2/internal/account" "cosmossdk.io/client/v2/internal/offchain" - txsigning "cosmossdk.io/x/tx/signing" + clitx "cosmossdk.io/client/v2/tx" "github.com/cosmos/cosmos-sdk/client" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/version" ) @@ -24,58 +21,64 @@ const ( ExpectedAccountNumber = 0 // ExpectedSequence defines the sequence number an off-chain message must have ExpectedSequence = 0 - - signMode = apisigning.SignMode_SIGN_MODE_TEXTUAL ) -type signerData struct { - Address string - ChainID string - AccountNumber uint64 - Sequence uint64 - PubKey cryptotypes.PubKey +var enabledSignModes = []apisigning.SignMode{ + apisigning.SignMode_SIGN_MODE_DIRECT, + apisigning.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, } // Sign signs given bytes using the specified encoder and SignMode. -func Sign(ctx client.Context, rawBytes []byte, fromName, indent, encoding, output string, emitUnpopulated bool) (string, error) { - encoder, err := getEncoder(encoding) +func Sign(ctx client.Context, rawBytes []byte, fromName, encoding, signMode, output string) (string, error) { + digest, err := encodeDigest(encoding, rawBytes) if err != nil { return "", err } - digest, err := encoder(rawBytes) + keybase, err := keyring.NewAutoCLIKeyring(ctx.Keyring, ctx.AddressCodec) if err != nil { return "", err } - tx, err := sign(ctx, fromName, digest) + txConfig, err := clitx.NewTxConfig(clitx.ConfigOptions{ + AddressCodec: ctx.AddressCodec, + Cdc: ctx.Codec, + ValidatorAddressCodec: ctx.ValidatorAddressCodec, + EnabledSignModes: enabledSignModes, + }) if err != nil { return "", err } - txMarshaller, err := getMarshaller(output, indent, emitUnpopulated) + accRetriever := account.NewAccountRetriever(ctx.AddressCodec, ctx, ctx.InterfaceRegistry) + + sm, err := getSignMode(signMode) if err != nil { return "", err } + params := clitx.TxParameters{ + ChainID: ExpectedChainID, + SignMode: sm, + AccountConfig: clitx.AccountConfig{ + AccountNumber: ExpectedAccountNumber, + Sequence: ExpectedSequence, + FromName: fromName, + }, + } - return marshalOffChainTx(tx, txMarshaller) -} - -// sign signs a digest with provided key and SignMode. -func sign(ctx client.Context, fromName, digest string) (*apitx.Tx, error) { - keybase, err := keyring.NewAutoCLIKeyring(ctx.Keyring, ctx.AddressCodec) + txf, err := clitx.NewFactory(keybase, ctx.Codec, accRetriever, txConfig, ctx.AddressCodec, ctx, params) if err != nil { - return nil, err + return "", err } pubKey, err := keybase.GetPubKey(fromName) if err != nil { - return nil, err + return "", err } addr, err := ctx.AddressCodec.BytesToString(pubKey.Address()) if err != nil { - return nil, err + return "", err } msg := &offchain.MsgSignArbitraryData{ @@ -84,84 +87,38 @@ func sign(ctx client.Context, fromName, digest string) (*apitx.Tx, error) { Data: digest, } - txBuilder := newBuilder(ctx.Codec) - err = txBuilder.setMsgs(msg) - if err != nil { - return nil, err - } - - signerData := signerData{ - Address: addr, - ChainID: ExpectedChainID, - AccountNumber: ExpectedAccountNumber, - Sequence: ExpectedSequence, - PubKey: pubKey, - } - - sigData := &SingleSignatureData{ - SignMode: signMode, - Signature: nil, - } - - sig := OffchainSignature{ - PubKey: pubKey, - Data: sigData, - Sequence: ExpectedSequence, - } - - sigs := []OffchainSignature{sig} - err = txBuilder.SetSignatures(sigs...) - if err != nil { - return nil, err - } - - bytesToSign, err := getSignBytes( - context.Background(), ctx.TxConfig.SignModeHandler(), signerData, txBuilder) - if err != nil { - return nil, err - } - - signedBytes, err := keybase.Sign(fromName, bytesToSign, signMode) + signedTx, err := txf.BuildsSignedTx(context.Background(), msg) if err != nil { - return nil, err + return "", err } - sigData.Signature = signedBytes - - err = txBuilder.SetSignatures(sig) + bz, err := encode(output, signedTx, txConfig) if err != nil { - return nil, err + return "", err } - return txBuilder.GetTx(), nil + return string(bz), nil } -// getSignBytes gets the bytes to be signed for the given Tx and SignMode. -func getSignBytes(ctx context.Context, - handlerMap *txsigning.HandlerMap, - signerData signerData, - tx *builder, -) ([]byte, error) { - txData, err := tx.GetSigningTxData() - if err != nil { - return nil, err - } - - anyPk, err := codectypes.NewAnyWithValue(signerData.PubKey) - if err != nil { - return nil, err +func encode(output string, tx clitx.Tx, config clitx.TxConfig) ([]byte, error) { + switch output { + case "json": + return config.TxJSONEncoder()(tx) + case "text": + return config.TxTextEncoder()(tx) + default: + return nil, fmt.Errorf("unsupported output type: %s", output) } +} - txSignerData := txsigning.SignerData{ - ChainID: signerData.ChainID, - AccountNumber: signerData.AccountNumber, - Sequence: signerData.Sequence, - Address: signerData.Address, - PubKey: &anypb.Any{ - TypeUrl: anyPk.TypeUrl, - Value: anyPk.Value, - }, +// getSignMode returns the corresponding apisigning.SignMode based on the provided mode string. +func getSignMode(mode string) (apisigning.SignMode, error) { + switch mode { + case "direct": + return apisigning.SignMode_SIGN_MODE_DIRECT, nil + case "amino-json": + return apisigning.SignMode_SIGN_MODE_LEGACY_AMINO_JSON, nil } - return handlerMap.GetSignBytes(ctx, signMode, txSignerData, txData) + return apisigning.SignMode_SIGN_MODE_UNSPECIFIED, fmt.Errorf("unsupported sign mode: %s", mode) } diff --git a/client/v2/offchain/sign_test.go b/client/v2/offchain/sign_test.go index b47a84584d36..839872866629 100644 --- a/client/v2/offchain/sign_test.go +++ b/client/v2/offchain/sign_test.go @@ -11,41 +11,54 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" ) -func Test_sign(t *testing.T) { +func TestSign(t *testing.T) { k := keyring.NewInMemory(getCodec()) + _, err := k.NewAccount("signVerify", mnemonic, "", "m/44'/118'/0'/0/0", hd.Secp256k1) + require.NoError(t, err) ctx := client.Context{ - Keyring: k, - TxConfig: newTestConfig(t), - AddressCodec: address.NewBech32Codec("cosmos"), - } - - type args struct { - ctx client.Context - fromName string - digest string + TxConfig: newTestConfig(t), + Codec: getCodec(), + AddressCodec: address.NewBech32Codec("cosmos"), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), + Keyring: k, } tests := []struct { - name string - args args + name string + rawBytes []byte + encoding string + signMode string + wantErr bool }{ { - name: "Sign", - args: args{ - ctx: ctx, - fromName: "direct", - digest: "Hello world!", - }, + name: "sign direct", + rawBytes: []byte("hello world"), + encoding: noEncoder, + signMode: "direct", + }, + { + name: "sign amino", + rawBytes: []byte("hello world"), + encoding: noEncoder, + signMode: "amino-json", + }, + { + name: "not supported sign mode", + rawBytes: []byte("hello world"), + encoding: noEncoder, + signMode: "textual", + wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - _, err := k.NewAccount(tt.args.fromName, mnemonic, tt.name, "m/44'/118'/0'/0/0", hd.Secp256k1) - require.NoError(t, err) - - got, err := sign(tt.args.ctx, tt.args.fromName, tt.args.digest) - require.NoError(t, err) - require.NotNil(t, got) + got, err := Sign(ctx, tt.rawBytes, "signVerify", tt.encoding, tt.signMode, "json") + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.NotNil(t, got) + } }) } } diff --git a/client/v2/offchain/signature.go b/client/v2/offchain/signature.go deleted file mode 100644 index d7b9769de983..000000000000 --- a/client/v2/offchain/signature.go +++ /dev/null @@ -1,34 +0,0 @@ -package offchain - -import ( - apitxsigning "cosmossdk.io/api/cosmos/tx/signing/v1beta1" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" -) - -type SignatureData interface { - isSignatureData() -} - -func (m *SingleSignatureData) isSignatureData() {} - -type SingleSignatureData struct { - // SignMode represents the SignMode of the signature - SignMode apitxsigning.SignMode - - // Signature is the raw signature. - Signature []byte -} - -type OffchainSignature struct { - // PubKey is the public key to use for verifying the signature - PubKey cryptotypes.PubKey - - // Data is the actual data of the signature which includes SignMode's and - // the signatures themselves for either single or multi-signatures. - Data SignatureData - - // Sequence is the sequence of this account. Only populated in - // SIGN_MODE_DIRECT. - Sequence uint64 -} diff --git a/client/v2/offchain/verify.go b/client/v2/offchain/verify.go index 8b9580d63235..2c064faccc71 100644 --- a/client/v2/offchain/verify.go +++ b/client/v2/offchain/verify.go @@ -6,12 +6,9 @@ import ( "errors" "fmt" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" "google.golang.org/protobuf/types/known/anypb" - apitx "cosmossdk.io/api/cosmos/tx/v1beta1" - v2flags "cosmossdk.io/client/v2/internal/flags" + clitx "cosmossdk.io/client/v2/tx" txsigning "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/client" @@ -21,29 +18,34 @@ import ( // Verify verifies a digest after unmarshalling it. func Verify(ctx client.Context, digest []byte, fileFormat string) error { - tx, err := unmarshal(digest, fileFormat) + txConfig, err := clitx.NewTxConfig(clitx.ConfigOptions{ + AddressCodec: ctx.AddressCodec, + Cdc: ctx.Codec, + ValidatorAddressCodec: ctx.ValidatorAddressCodec, + EnabledSignModes: enabledSignModes, + }) if err != nil { return err } - return verify(ctx, tx) + dTx, err := unmarshal(fileFormat, digest, txConfig) + if err != nil { + return err + } + + return verify(ctx, dTx) } // verify verifies given Tx. -func verify(ctx client.Context, tx *apitx.Tx) error { - sigTx := builder{ - cdc: ctx.Codec, - tx: tx, - } - +func verify(ctx client.Context, dTx clitx.Tx) error { signModeHandler := ctx.TxConfig.SignModeHandler() - signers, err := sigTx.GetSigners() + signers, err := dTx.GetSigners() if err != nil { return err } - sigs, err := sigTx.GetSignatures() + sigs, err := dTx.GetSignatures() if err != nil { return err } @@ -79,7 +81,7 @@ func verify(ctx client.Context, tx *apitx.Tx) error { }, } - txData, err := sigTx.GetSigningTxData() + txData, err := dTx.GetSigningTxData() if err != nil { return err } @@ -93,18 +95,15 @@ func verify(ctx client.Context, tx *apitx.Tx) error { } // unmarshal unmarshalls a digest to a Tx using protobuf protojson. -func unmarshal(digest []byte, fileFormat string) (*apitx.Tx, error) { - var err error - tx := &apitx.Tx{} - switch fileFormat { - case v2flags.OutputFormatJSON: - err = protojson.Unmarshal(digest, tx) - case v2flags.OutputFormatText: - err = prototext.Unmarshal(digest, tx) +func unmarshal(format string, bz []byte, config clitx.TxConfig) (clitx.Tx, error) { + switch format { + case "json": + return config.TxJSONDecoder()(bz) + case "text": + return config.TxTextDecoder()(bz) default: - return nil, fmt.Errorf("unsupported file format: %s", fileFormat) + return nil, fmt.Errorf("unsupported format: %s", format) } - return tx, err } // verifySignature verifies a transaction signature contained in SignatureData abstracting over different signing modes. @@ -112,12 +111,12 @@ func verifySignature( ctx context.Context, pubKey cryptotypes.PubKey, signerData txsigning.SignerData, - signatureData SignatureData, + signatureData clitx.SignatureData, handler *txsigning.HandlerMap, txData txsigning.TxData, ) error { switch data := signatureData.(type) { - case *SingleSignatureData: + case *clitx.SingleSignatureData: signBytes, err := handler.GetSignBytes(ctx, data.SignMode, signerData, txData) if err != nil { return err diff --git a/client/v2/offchain/verify_test.go b/client/v2/offchain/verify_test.go index ecdd57e75b5b..56345504d80e 100644 --- a/client/v2/offchain/verify_test.go +++ b/client/v2/offchain/verify_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" _ "cosmossdk.io/api/cosmos/crypto/secp256k1" + clitx "cosmossdk.io/client/v2/tx" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec/address" @@ -15,9 +16,10 @@ import ( func Test_Verify(t *testing.T) { ctx := client.Context{ - TxConfig: newTestConfig(t), - Codec: getCodec(), - AddressCodec: address.NewBech32Codec("cosmos"), + TxConfig: newTestConfig(t), + Codec: getCodec(), + AddressCodec: address.NewBech32Codec("cosmos"), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), } tests := []struct { @@ -29,26 +31,26 @@ func Test_Verify(t *testing.T) { }{ { name: "verify json", - digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"appDomain\":\"simd\", \"signer\":\"cosmos1x33fy6rusfprkntvjsfregss7rvsvyy4lkwrqu\", \"data\":\"{\\n\\t\\\"name\\\": \\\"John\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 15\\n}\\n\"}]}, \"authInfo\":{\"signerInfos\":[{\"publicKey\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"A/Bfsb7grZtysreo48oB1XAXbcgHnEJyhAqzDMgbLlXw\"}, \"modeInfo\":{\"single\":{\"mode\":\"SIGN_MODE_TEXTUAL\"}}}], \"fee\":{}}, \"signatures\":[\"gRufjcmATaJ3hZSiXII3lcsLDJlHM4OhQs3O/QgAK4weQ73kmj30/gw3HwTKxGb4pnVe0iyLXrKRNeSl1O3zSQ==\"]}"), + digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"app_domain\":\"\", \"signer\":\"cosmos16877zjk85kwlap3wclpmx34e0xllg2erc7u7m4\", \"data\":\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}], \"timeout_timestamp\":\"0001-01-01T00:00:00Z\"}, \"auth_info\":{\"signer_infos\":[{\"public_key\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"Ahhu3idSSUAQXtDBvBjUlCPWH3od4rXyWgb7L4scSj4m\"}, \"mode_info\":{\"single\":{\"mode\":\"SIGN_MODE_DIRECT\"}}}], \"fee\":{}}, \"signatures\":[\"tdXsO5uNqIBFSBKEA1e3Wrcb6ejriP9HwlcBTkU7EUJzuezjg6Rvr1a+Kp6umCAN7MWoBHRT2cmqzDfg6RjaYA==\"]}"), fileFormat: "json", ctx: ctx, }, { name: "wrong signer json", - digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"appDomain\":\"simd\", \"signer\":\"cosmos1450l4uau674z55c36df0v7904rnvdk9aq8w96j\", \"data\":\"{\\n\\t\\\"name\\\": \\\"John\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 15\\n}\\n\"}]}, \"authInfo\":{\"signerInfos\":[{\"publicKey\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"A/Bfsb7grZtysreo48oB1XAXbcgHnEJyhAqzDMgbLlXw\"}, \"modeInfo\":{\"single\":{\"mode\":\"SIGN_MODE_TEXTUAL\"}}}], \"fee\":{}}, \"signatures\":[\"gRufjcmATaJ3hZSiXII3lcsLDJlHM4OhQs3O/QgAK4weQ73kmj30/gw3HwTKxGb4pnVe0iyLXrKRNeSl1O3zSQ==\"]}"), + digest: []byte("{\"body\":{\"messages\":[{\"@type\":\"/offchain.MsgSignArbitraryData\", \"app_domain\":\"\", \"signer\":\"cosmos1xv9e39mkhhyg5aneu2myj82t7029sv48qu3pgj\", \"data\":\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}], \"timeout_timestamp\":\"0001-01-01T00:00:00Z\"}, \"auth_info\":{\"signer_infos\":[{\"public_key\":{\"@type\":\"/cosmos.crypto.secp256k1.PubKey\", \"key\":\"Ahhu3idSSUAQXtDBvBjUlCPWH3od4rXyWgb7L4scSj4m\"}, \"mode_info\":{\"single\":{\"mode\":\"SIGN_MODE_DIRECT\"}}}], \"fee\":{}}, \"signatures\":[\"tdXsO5uNqIBFSBKEA1e3Wrcb6ejriP9HwlcBTkU7EUJzuezjg6Rvr1a+Kp6umCAN7MWoBHRT2cmqzDfg6RjaYA==\"]}"), fileFormat: "json", ctx: ctx, wantErr: true, }, { name: "verify text", - digest: []byte("body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\"simd\" signer:\"cosmos1x33fy6rusfprkntvjsfregss7rvsvyy4lkwrqu\" data:\"{\\n\\t\\\"name\\\": \\\"John\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 15\\n}\\n\"}}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\"\\x03\\xf0_\\xb1\\xbe\u0B5Br\\xb2\\xb7\\xa8\\xe3\\xca\\x01\\xd5p\\x17m\\xc8\\x07\\x9cBr\\x84\\n\\xb3\\x0c\\xc8\\x1b.U\\xf0\"}} mode_info:{single:{mode:SIGN_MODE_TEXTUAL}}} fee:{}} signatures:\"\\x81\\x1b\\x9f\\x8dɀM\\xa2w\\x85\\x94\\xa2\\\\\\x827\\x95\\xcb\\x0b\\x0c\\x99G3\\x83\\xa1B\\xcd\\xce\\xfd\\x08\\x00+\\x8c\\x1eC\\xbd\\xe4\\x9a=\\xf4\\xfe\\x0c7\\x1f\\x04\\xca\\xc4f\\xf8\\xa6u^\\xd2,\\x8b^\\xb2\\x915\\xe4\\xa5\\xd4\\xed\\xf3I\"\n"), + digest: []byte("body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\"\" signer:\"cosmos16877zjk85kwlap3wclpmx34e0xllg2erc7u7m4\" data:\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}} timeout_timestamp:{seconds:-62135596800}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\"\\x02\\x18n\\xde'RI@\\x10^\\xd0\\xc1\\xbc\\x18Ԕ#\\xd6\\x1fz\\x1d\\xe2\\xb5\\xf2Z\\x06\\xfb/\\x8b\\x1cJ>&\"}} mode_info:{single:{mode:SIGN_MODE_DIRECT}}} fee:{}} signatures:\"\\xb5\\xd5\\xec;\\x9b\\x8d\\xa8\\x80EH\\x12\\x84\\x03W\\xb7Z\\xb7\\x1b\\xe9\\xe8\\xeb\\x88\\xffG\\xc2W\\x01NE;\\x11Bs\\xb9\\xecヤo\\xafV\\xbe*\\x9e\\xae\\x98 \\r\\xecŨ\\x04tS\\xd9ɪ\\xcc7\\xe0\\xe9\\x18\\xda`\"\n"), fileFormat: "text", ctx: ctx, }, { name: "wrong signer text", - digest: []byte("\"body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\\\"simd\\\" signer:\\\"cosmos1450l4uau674z55c36df0v7904rnvdk9aq8w96j\\\" data:\\\"{\\\\n\\\\t\\\\\\\"name\\\\\\\": \\\\\\\"John\\\\\\\",\\\\n\\\\t\\\\\\\"surname\\\\\\\": \\\\\\\"Connor\\\\\\\",\\\\n\\\\t\\\\\\\"age\\\\\\\": 15\\\\n}\\\\n\\\"}}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\\\"\\\\x03\\\\xf0_\\\\xb1\\\\xbe\\u0B5Br\\\\xb2\\\\xb7\\\\xa8\\\\xe3\\\\xca\\\\x01\\\\xd5p\\\\x17m\\\\xc8\\\\x07\\\\x9cBr\\\\x84\\\\n\\\\xb3\\\\x0c\\\\xc8\\\\x1b.U\\\\xf0\\\"}} mode_info:{single:{mode:SIGN_MODE_TEXTUAL}}} fee:{}} signatures:\\\"\\\\x81\\\\x1b\\\\x9f\\\\x8dɀM\\\\xa2w\\\\x85\\\\x94\\\\xa2\\\\\\\\\\\\x827\\\\x95\\\\xcb\\\\x0b\\\\x0c\\\\x99G3\\\\x83\\\\xa1B\\\\xcd\\\\xce\\\\xfd\\\\x08\\\\x00+\\\\x8c\\\\x1eC\\\\xbd\\\\xe4\\\\x9a=\\\\xf4\\\\xfe\\\\x0c7\\\\x1f\\\\x04\\\\xca\\\\xc4f\\\\xf8\\\\xa6u^\\\\xd2,\\\\x8b^\\\\xb2\\\\x915\\\\xe4\\\\xa5\\\\xd4\\\\xed\\\\xf3I\\\"\\n"), + digest: []byte("body:{messages:{[/offchain.MsgSignArbitraryData]:{app_domain:\"\" signer:\"cosmos1xv9e39mkhhyg5aneu2myj82t7029sv48qu3pgj\" data:\"{\\n\\t\\\"name\\\": \\\"Sarah\\\",\\n\\t\\\"surname\\\": \\\"Connor\\\",\\n\\t\\\"age\\\": 29\\n}\\n\"}} timeout_timestamp:{seconds:-62135596800}} auth_info:{signer_infos:{public_key:{[/cosmos.crypto.secp256k1.PubKey]:{key:\"\\x02\\x18n\\xde'RI@\\x10^\\xd0\\xc1\\xbc\\x18Ԕ#\\xd6\\x1fz\\x1d\\xe2\\xb5\\xf2Z\\x06\\xfb/\\x8b\\x1cJ>&\"}} mode_info:{single:{mode:SIGN_MODE_DIRECT}}} fee:{}} signatures:\"\\xb5\\xd5\\xec;\\x9b\\x8d\\xa8\\x80EH\\x12\\x84\\x03W\\xb7Z\\xb7\\x1b\\xe9\\xe8\\xeb\\x88\\xffG\\xc2W\\x01NE;\\x11Bs\\xb9\\xecヤo\\xafV\\xbe*\\x9e\\xae\\x98 \\r\\xecŨ\\x04tS\\xd9ɪ\\xcc7\\xe0\\xe9\\x18\\xda`\"\n"), fileFormat: "text", ctx: ctx, wantErr: true, @@ -72,20 +74,28 @@ func Test_SignVerify(t *testing.T) { require.NoError(t, err) ctx := client.Context{ - TxConfig: newTestConfig(t), - Codec: getCodec(), - AddressCodec: address.NewBech32Codec("cosmos"), - Keyring: k, + TxConfig: newTestConfig(t), + Codec: getCodec(), + AddressCodec: address.NewBech32Codec("cosmos"), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), + Keyring: k, } - tx, err := sign(ctx, "signVerify", "digest") + tx, err := Sign(ctx, []byte("Hello World!"), "signVerify", "no-encoding", "direct", "json") require.NoError(t, err) - err = verify(ctx, tx) + err = Verify(ctx, []byte(tx), "json") require.NoError(t, err) } func Test_unmarshal(t *testing.T) { + txConfig, err := clitx.NewTxConfig(clitx.ConfigOptions{ + AddressCodec: address.NewBech32Codec("cosmos"), + Cdc: getCodec(), + ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), + EnabledSignModes: enabledSignModes, + }) + require.NoError(t, err) tests := []struct { name string digest []byte @@ -104,7 +114,7 @@ func Test_unmarshal(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := unmarshal(tt.digest, tt.fileFormat) + got, err := unmarshal(tt.fileFormat, tt.digest, txConfig) require.NoError(t, err) require.NotNil(t, got) }) diff --git a/client/v2/tx/config.go b/client/v2/tx/config.go index a500f7c9b009..7c12b3b21ce1 100644 --- a/client/v2/tx/config.go +++ b/client/v2/tx/config.go @@ -51,6 +51,10 @@ type TxEncodingConfig interface { TxJSONEncoder() txEncoder // TxJSONDecoder returns a decoder for JSON transaction decoding. TxJSONDecoder() txDecoder + // TxTextEncoder returns an encoder for text transaction encoding. + TxTextEncoder() txEncoder + // TxTextDecoder returns a decoder for text transaction decoding. + TxTextDecoder() txDecoder // Decoder returns the Decoder interface for decoding transaction bytes into a DecodedTx. Decoder() Decoder } @@ -79,7 +83,7 @@ type ConfigOptions struct { CustomGetSigner map[protoreflect.FullName]signing.GetSignersFunc MaxRecursionDepth int - EnablesSignModes []apitxsigning.SignMode + EnabledSignModes []apitxsigning.SignMode CustomSignModes []signing.SignModeHandler TextualCoinMetadataQueryFn textual.CoinMetadataQueryFn } @@ -98,8 +102,8 @@ func (c *ConfigOptions) validate() error { } // set default signModes if none are provided - if len(c.EnablesSignModes) == 0 { - c.EnablesSignModes = defaultEnabledSignModes + if len(c.EnabledSignModes) == 0 { + c.EnabledSignModes = defaultEnabledSignModes } return nil } @@ -168,6 +172,16 @@ func (t defaultEncodingConfig) TxJSONDecoder() txDecoder { return decodeJsonTx(t.cdc, t.decoder) } +// TxTextEncoder returns the default text transaction encoder. +func (t defaultEncodingConfig) TxTextEncoder() txEncoder { + return encodeTextTx +} + +// TxTextDecoder returns the default text transaction decoder. +func (t defaultEncodingConfig) TxTextDecoder() txDecoder { + return decodeTextTx(t.cdc, t.decoder) +} + // Decoder returns the Decoder instance associated with this encoding configuration. func (t defaultEncodingConfig) Decoder() Decoder { return t.decoder @@ -294,10 +308,10 @@ func newSigningContext(opts ConfigOptions) (*signing.Context, error) { // newHandlerMap constructs a new HandlerMap based on the provided ConfigOptions and signing context. // It initializes handlers for each enabled and custom sign mode specified in the options. func newHandlerMap(opts ConfigOptions, signingCtx *signing.Context) (*signing.HandlerMap, error) { - lenSignModes := len(opts.EnablesSignModes) + lenSignModes := len(opts.EnabledSignModes) handlers := make([]signing.SignModeHandler, lenSignModes+len(opts.CustomSignModes)) - for i, m := range opts.EnablesSignModes { + for i, m := range opts.EnabledSignModes { var err error switch m { case apitxsigning.SignMode_SIGN_MODE_DIRECT: diff --git a/client/v2/tx/config_test.go b/client/v2/tx/config_test.go index 7d1f223d1214..887756f37f6d 100644 --- a/client/v2/tx/config_test.go +++ b/client/v2/tx/config_test.go @@ -111,7 +111,7 @@ func Test_newHandlerMap(t *testing.T) { Decoder: decoder, Cdc: cdc, ValidatorAddressCodec: address.NewBech32Codec("cosmosvaloper"), - EnablesSignModes: []apitxsigning.SignMode{apitxsigning.SignMode_SIGN_MODE_DIRECT}, + EnabledSignModes: []apitxsigning.SignMode{apitxsigning.SignMode_SIGN_MODE_DIRECT}, }, }, { @@ -136,7 +136,7 @@ func Test_newHandlerMap(t *testing.T) { handlerMap, err := newHandlerMap(tt.opts, signingCtx) require.NoError(t, err) require.NotNil(t, handlerMap) - require.Equal(t, len(handlerMap.SupportedModes()), len(tt.opts.EnablesSignModes)+len(tt.opts.CustomSignModes)) + require.Equal(t, len(handlerMap.SupportedModes()), len(tt.opts.EnabledSignModes)+len(tt.opts.CustomSignModes)) }) } } diff --git a/client/v2/tx/encoder.go b/client/v2/tx/encoder.go index 2094efe6d3d5..3e917b34b4c3 100644 --- a/client/v2/tx/encoder.go +++ b/client/v2/tx/encoder.go @@ -4,6 +4,7 @@ import ( "fmt" "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/encoding/prototext" protov2 "google.golang.org/protobuf/proto" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" @@ -22,6 +23,11 @@ var ( UseProtoNames: true, UseEnumNumbers: false, } + + // textMarshalOptions + textMarshalOptions = prototext.MarshalOptions{ + Indent: "", + } ) // Decoder defines the interface for decoding transaction bytes into a DecodedTx. @@ -100,6 +106,39 @@ func encodeJsonTx(tx Tx) ([]byte, error) { return jsonMarshalOptions.Marshal(wTx.Tx) } +func encodeTextTx(tx Tx) ([]byte, error) { + wTx, ok := tx.(*wrappedTx) + if !ok { + return nil, fmt.Errorf("unexpected tx type: %T", tx) + } + return textMarshalOptions.Marshal(wTx.Tx) +} + +// decodeJsonTx decodes transaction bytes into an apitx.Tx structure using JSON format. +func decodeTextTx(cdc codec.BinaryCodec, decoder Decoder) txDecoder { + return func(txBytes []byte) (Tx, error) { + jsonTx := new(txv1beta1.Tx) + err := prototext.UnmarshalOptions{ + AllowPartial: false, + DiscardUnknown: false, + }.Unmarshal(txBytes, jsonTx) + if err != nil { + return nil, err + } + + pTxBytes, err := protoTxBytes(jsonTx) + if err != nil { + return nil, err + } + + decodedTx, err := decoder.Decode(pTxBytes) + if err != nil { + return nil, err + } + return newWrapperTx(cdc, decodedTx), nil + } +} + func protoTxBytes(tx *txv1beta1.Tx) ([]byte, error) { bodyBytes, err := marshalOption.Marshal(tx.Body) if err != nil { diff --git a/client/v2/tx/factory.go b/client/v2/tx/factory.go index 9dd0eae21a34..8007caaee4f8 100644 --- a/client/v2/tx/factory.go +++ b/client/v2/tx/factory.go @@ -124,22 +124,22 @@ func prepareTxParams(parameters TxParameters, accRetriever account.AccountRetrie return parameters, nil } - if len(parameters.address) == 0 { + if len(parameters.Address) == 0 { return parameters, errors.New("missing 'from address' field") } - if parameters.accountNumber == 0 || parameters.sequence == 0 { - num, seq, err := accRetriever.GetAccountNumberSequence(context.Background(), parameters.address) + if parameters.AccountNumber == 0 || parameters.Sequence == 0 { + num, seq, err := accRetriever.GetAccountNumberSequence(context.Background(), parameters.Address) if err != nil { return parameters, err } - if parameters.accountNumber == 0 { - parameters.accountNumber = num + if parameters.AccountNumber == 0 { + parameters.AccountNumber = num } - if parameters.sequence == 0 { - parameters.sequence = seq + if parameters.Sequence == 0 { + parameters.Sequence = seq } } @@ -328,11 +328,11 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { } var err error - if f.txParams.signMode == apitxsigning.SignMode_SIGN_MODE_UNSPECIFIED { - f.txParams.signMode = f.txConfig.SignModeHandler().DefaultMode() + if f.txParams.SignMode == apitxsigning.SignMode_SIGN_MODE_UNSPECIFIED { + f.txParams.SignMode = f.txConfig.SignModeHandler().DefaultMode() } - pubKey, err := f.keybase.GetPubKey(f.txParams.fromName) + pubKey, err := f.keybase.GetPubKey(f.txParams.FromName) if err != nil { return nil, err } @@ -343,9 +343,9 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { } signerData := signing.SignerData{ - ChainID: f.txParams.chainID, - AccountNumber: f.txParams.accountNumber, - Sequence: f.txParams.sequence, + ChainID: f.txParams.ChainID, + AccountNumber: f.txParams.AccountNumber, + Sequence: f.txParams.Sequence, PubKey: &anypb.Any{ TypeUrl: codectypes.MsgTypeURL(pubKey), Value: pubKey.Bytes(), @@ -364,13 +364,13 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { // By setting the signatures here, we ensure that the correct SignerInfos // are in place for all subsequent operations, regardless of the sign mode. sigData := SingleSignatureData{ - SignMode: f.txParams.signMode, + SignMode: f.txParams.SignMode, Signature: nil, } sig := Signature{ PubKey: pubKey, Data: &sigData, - Sequence: f.txParams.sequence, + Sequence: f.txParams.Sequence, } var prevSignatures []Signature @@ -412,7 +412,7 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { } // Sign those bytes - sigBytes, err := f.keybase.Sign(f.txParams.fromName, bytesToSign, f.txParams.signMode) + sigBytes, err := f.keybase.Sign(f.txParams.FromName, bytesToSign, f.txParams.SignMode) if err != nil { return nil, err } @@ -425,7 +425,7 @@ func (f *Factory) sign(ctx context.Context, overwriteSig bool) (Tx, error) { sig = Signature{ PubKey: pubKey, Data: &sigData, - Sequence: f.txParams.sequence, + Sequence: f.txParams.Sequence, } if overwriteSig { @@ -460,16 +460,16 @@ func (f *Factory) WithGas(gas uint64) { // WithSequence returns a copy of the Factory with an updated sequence number. func (f *Factory) WithSequence(sequence uint64) { - f.txParams.sequence = sequence + f.txParams.Sequence = sequence } // WithAccountNumber returns a copy of the Factory with an updated account number. func (f *Factory) WithAccountNumber(accnum uint64) { - f.txParams.accountNumber = accnum + f.txParams.AccountNumber = accnum } // sequence returns the sequence number. -func (f *Factory) sequence() uint64 { return f.txParams.sequence } +func (f *Factory) sequence() uint64 { return f.txParams.Sequence } // gasAdjustment returns the gas adjustment value. func (f *Factory) gasAdjustment() float64 { return f.txParams.gasAdjustment } @@ -478,7 +478,7 @@ func (f *Factory) gasAdjustment() float64 { return f.txParams.gasAdjustment } func (f *Factory) simulateAndExecute() bool { return f.txParams.simulateAndExecute } // signMode returns the sign mode. -func (f *Factory) signMode() apitxsigning.SignMode { return f.txParams.signMode } +func (f *Factory) signMode() apitxsigning.SignMode { return f.txParams.SignMode } // getSimPK gets the public key to use for building a simulation tx. // Note, we should only check for keys in the keybase if we are in simulate and execute mode, @@ -492,14 +492,14 @@ func (f *Factory) getSimPK() (cryptotypes.PubKey, error) { ) if f.txParams.simulateAndExecute && f.keybase != nil { - pk, err = f.keybase.GetPubKey(f.txParams.fromName) + pk, err = f.keybase.GetPubKey(f.txParams.FromName) if err != nil { return nil, err } } else { // When in dry-run mode, attempt to retrieve the account using the provided address. // If the account retrieval fails, the default public key is used. - acc, err := f.accountRetriever.GetAccount(context.Background(), f.txParams.address) + acc, err := f.accountRetriever.GetAccount(context.Background(), f.txParams.Address) if err != nil { // If there is an error retrieving the account, return the default public key. return pk, nil @@ -516,7 +516,7 @@ func (f *Factory) getSimPK() (cryptotypes.PubKey, error) { func (f *Factory) getSimSignatureData(pk cryptotypes.PubKey) SignatureData { multisigPubKey, ok := pk.(*multisig.LegacyAminoPubKey) if !ok { - return &SingleSignatureData{SignMode: f.txParams.signMode} + return &SingleSignatureData{SignMode: f.txParams.SignMode} } multiSignatureData := make([]SignatureData, 0, multisigPubKey.Threshold) diff --git a/client/v2/tx/factory_test.go b/client/v2/tx/factory_test.go index 39f21b38d0df..363cf9146bde 100644 --- a/client/v2/tx/factory_test.go +++ b/client/v2/tx/factory_test.go @@ -35,7 +35,7 @@ func TestFactory_prepareTxParams(t *testing.T) { name: "no error", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, }, @@ -66,9 +66,9 @@ func TestFactory_BuildUnsignedTx(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, msgs: []transaction.Msg{ @@ -81,9 +81,9 @@ func TestFactory_BuildUnsignedTx(t *testing.T) { { name: "fees and gas price provided", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, GasConfig: GasConfig{ gasPrices: []*base.DecCoin{ @@ -133,9 +133,9 @@ func TestFactory_calculateGas(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, GasConfig: GasConfig{ gasAdjustment: 1, @@ -175,9 +175,9 @@ func TestFactory_Simulate(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, GasConfig: GasConfig{ gasAdjustment: 1, @@ -219,9 +219,9 @@ func TestFactory_BuildSimTx(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, }, @@ -251,10 +251,10 @@ func TestFactory_Sign(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - fromName: "alice", - address: addr, + FromName: "alice", + Address: addr, }, }, }, @@ -299,19 +299,19 @@ func TestFactory_getSignBytesAdapter(t *testing.T) { { name: "no error", txParams: TxParameters{ - chainID: "demo", - signMode: apitxsigning.SignMode_SIGN_MODE_DIRECT, + ChainID: "demo", + SignMode: apitxsigning.SignMode_SIGN_MODE_DIRECT, AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, }, { name: "signMode not specified", txParams: TxParameters{ - chainID: "demo", + ChainID: "demo", AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, error: true, @@ -341,7 +341,7 @@ func TestFactory_getSignBytesAdapter(t *testing.T) { signerData := signing.SignerData{ Address: addr, - ChainID: f.txParams.chainID, + ChainID: f.txParams.ChainID, AccountNumber: 0, Sequence: 0, PubKey: &anypb.Any{ @@ -401,7 +401,7 @@ func TestFactory_WithFunctions(t *testing.T) { name: "with gas", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, withFunc: func(f *Factory) { @@ -415,28 +415,28 @@ func TestFactory_WithFunctions(t *testing.T) { name: "with sequence", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, withFunc: func(f *Factory) { f.WithSequence(10) }, checkFunc: func(f *Factory) bool { - return f.txParams.AccountConfig.sequence == 10 + return f.txParams.AccountConfig.Sequence == 10 }, }, { name: "with account number", txParams: TxParameters{ AccountConfig: AccountConfig{ - address: addr, + Address: addr, }, }, withFunc: func(f *Factory) { f.WithAccountNumber(123) }, checkFunc: func(f *Factory) bool { - return f.txParams.AccountConfig.accountNumber == 123 + return f.txParams.AccountConfig.AccountNumber == 123 }, }, } diff --git a/client/v2/tx/tx.go b/client/v2/tx/tx.go index ab82c813ac20..c6bb5a548f92 100644 --- a/client/v2/tx/tx.go +++ b/client/v2/tx/tx.go @@ -77,7 +77,7 @@ func newFactory(ctx client.Context, flagSet *pflag.FlagSet) (Factory, error) { AddressCodec: ctx.AddressCodec, Cdc: ctx.Codec, ValidatorAddressCodec: ctx.ValidatorAddressCodec, - EnablesSignModes: ctx.TxConfig.SignModeHandler().SupportedModes(), + EnabledSignModes: ctx.TxConfig.SignModeHandler().SupportedModes(), }) if err != nil { return Factory{}, err diff --git a/client/v2/tx/types.go b/client/v2/tx/types.go index ee60c27065b6..a50b0b996b1d 100644 --- a/client/v2/tx/types.go +++ b/client/v2/tx/types.go @@ -14,6 +14,7 @@ import ( "cosmossdk.io/client/v2/internal/coins" "cosmossdk.io/core/address" "cosmossdk.io/core/transaction" + "cosmossdk.io/x/tx/signing" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -28,9 +29,9 @@ type HasValidateBasic interface { // TxParameters defines the parameters required for constructing a transaction. type TxParameters struct { timeoutTimestamp time.Time // timeoutTimestamp indicates a timestamp after which the transaction is no longer valid. - chainID string // chainID specifies the unique identifier of the blockchain where the transaction will be processed. + ChainID string // ChainID specifies the unique identifier of the blockchain where the transaction will be processed. memo string // memo contains any arbitrary memo to be attached to the transaction. - signMode apitxsigning.SignMode // signMode determines the signing mode to be used for the transaction. + SignMode apitxsigning.SignMode // signMode determines the signing mode to be used for the transaction. AccountConfig // AccountConfig includes information about the transaction originator's account. GasConfig // GasConfig specifies the gas settings for the transaction. @@ -41,15 +42,15 @@ type TxParameters struct { // AccountConfig defines the 'account' related fields in a transaction. type AccountConfig struct { // accountNumber is the unique identifier for the account. - accountNumber uint64 + AccountNumber uint64 // sequence is the sequence number of the transaction. - sequence uint64 + Sequence uint64 // fromName is the name of the account sending the transaction. - fromName string + FromName string // fromAddress is the address of the account sending the transaction. - fromAddress string + FromAddress string // address is the byte representation of the account address. - address []byte + Address []byte } // GasConfig defines the 'gas' related fields in a transaction. @@ -141,6 +142,8 @@ type Tx interface { GetPubKeys() ([]cryptotypes.PubKey, error) // GetSignatures fetches the signatures attached to the transaction. GetSignatures() ([]Signature, error) + // GetSigningTxData returns the signing.TxData for the transaction. + GetSigningTxData() (signing.TxData, error) } // txParamsFromFlagSet extracts the transaction parameters from the provided FlagSet. @@ -192,15 +195,15 @@ func txParamsFromFlagSet(flags *pflag.FlagSet, keybase keyring2.Keyring, ac addr txParams := TxParameters{ timeoutTimestamp: timeoutTimestamp, - chainID: chainID, + ChainID: chainID, memo: memo, - signMode: getSignMode(signMode), + SignMode: getSignMode(signMode), AccountConfig: AccountConfig{ - accountNumber: accNumber, - sequence: sequence, - fromName: fromName, - fromAddress: fromAddress, - address: addr, + AccountNumber: accNumber, + Sequence: sequence, + FromName: fromName, + FromAddress: fromAddress, + Address: addr, }, GasConfig: gasConfig, FeeConfig: feeConfig, diff --git a/client/v2/tx/wrapper.go b/client/v2/tx/wrapper.go index fbcf62126bfc..5fc1ef528861 100644 --- a/client/v2/tx/wrapper.go +++ b/client/v2/tx/wrapper.go @@ -10,6 +10,7 @@ import ( "cosmossdk.io/core/transaction" "cosmossdk.io/x/tx/decode" + "cosmossdk.io/x/tx/signing" "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -96,6 +97,16 @@ func (w wrappedTx) GetSignatures() ([]Signature, error) { return signatures, nil } +func (w wrappedTx) GetSigningTxData() (signing.TxData, error) { + return signing.TxData{ + Body: w.Tx.Body, + AuthInfo: w.Tx.AuthInfo, + BodyBytes: w.TxRaw.BodyBytes, + AuthInfoBytes: w.TxRaw.AuthInfoBytes, + BodyHasUnknownNonCriticals: w.TxBodyHasUnknownNonCriticals, + }, nil +} + // decodeAny decodes a protobuf Any message into a concrete proto.Message. func (w wrappedTx) decodeAny(anyPb *anypb.Any) (proto.Message, error) { name := anyPb.GetTypeUrl() From d0d8585e8a99b238d963ad3576d98f04df299e98 Mon Sep 17 00:00:00 2001 From: Eric Mokaya <4112301+ziscky@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:13:21 +0300 Subject: [PATCH 23/24] docs: Update tendermint validators query pagination documentation (#22412) Co-authored-by: Julien Robert --- .../base/tendermint/v1beta1/query.pulsar.go | 53 ++--- client/grpc/cmtservice/query.pb.go | 195 +++++++++--------- .../base/tendermint/v1beta1/query.proto | 21 +- 3 files changed, 139 insertions(+), 130 deletions(-) diff --git a/api/cosmos/base/tendermint/v1beta1/query.pulsar.go b/api/cosmos/base/tendermint/v1beta1/query.pulsar.go index 7ba49ca70105..fc9ff0abbeea 100644 --- a/api/cosmos/base/tendermint/v1beta1/query.pulsar.go +++ b/api/cosmos/base/tendermint/v1beta1/query.pulsar.go @@ -10405,7 +10405,8 @@ type GetValidatorSetByHeightRequest struct { unknownFields protoimpl.UnknownFields Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - // pagination defines an pagination for the request. + // pagination defines an pagination for the request. offset and limit are used for pagination, next_key is not + // supported for this query. Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -10451,7 +10452,8 @@ type GetValidatorSetByHeightResponse struct { BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` - // pagination defines an pagination for the response. + // pagination defines an pagination for the response. offset and limit are used for pagination, next_key is not + // supported for this query. Pagination *v1beta1.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -10541,7 +10543,8 @@ type GetLatestValidatorSetResponse struct { BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` - // pagination defines an pagination for the response. + // pagination defines an pagination for the response. offset and limit are used for pagination, next_key is not + // supported for this query. Pagination *v1beta1.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -11364,28 +11367,28 @@ var file_cosmos_base_tendermint_v1beta1_query_proto_rawDesc = []byte{ 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x63, 0x6f, 0x6d, - 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, - 0x66, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, - 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x6f, 0x6d, 0x65, - 0x74, 0x62, 0x66, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x6d, 0x65, 0x74, - 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, - 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x11, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1b, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x70, 0x32, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x6f, 0x6d, + 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x42, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, diff --git a/client/grpc/cmtservice/query.pb.go b/client/grpc/cmtservice/query.pb.go index 37cedbed196c..5a7e58dffc55 100644 --- a/client/grpc/cmtservice/query.pb.go +++ b/client/grpc/cmtservice/query.pb.go @@ -39,7 +39,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. type GetValidatorSetByHeightRequest struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - // pagination defines an pagination for the request. + // pagination defines an pagination for the request. offset and limit are used for pagination, next_key is not + // supported for this query. Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -94,7 +95,8 @@ func (m *GetValidatorSetByHeightRequest) GetPagination() *query.PageRequest { type GetValidatorSetByHeightResponse struct { BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` - // pagination defines an pagination for the response. + // pagination defines an pagination for the response. offset and limit are used for pagination, next_key is not + // supported for this query. Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -202,7 +204,8 @@ func (m *GetLatestValidatorSetRequest) GetPagination() *query.PageRequest { type GetLatestValidatorSetResponse struct { BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` - // pagination defines an pagination for the response. + // pagination defines an pagination for the response. offset and limit are used for pagination, next_key is not + // supported for this query. Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -1196,99 +1199,99 @@ func init() { } var fileDescriptor_40c93fb3ef485c5d = []byte{ - // 1467 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4d, 0x6f, 0x1b, 0xc5, - 0x1b, 0xcf, 0xda, 0x69, 0x6c, 0x3f, 0xe9, 0xff, 0xdf, 0x64, 0x12, 0xda, 0xad, 0x49, 0xdd, 0x60, - 0x89, 0xbe, 0x92, 0xdd, 0xda, 0x69, 0xd3, 0x82, 0x4a, 0x51, 0xd2, 0x94, 0x34, 0xa5, 0x2d, 0x61, - 0x53, 0x81, 0x84, 0x90, 0x56, 0xeb, 0xdd, 0xc9, 0x66, 0x15, 0x7b, 0x67, 0xba, 0x3b, 0x36, 0x58, - 0x08, 0x09, 0x71, 0xe2, 0x88, 0xc4, 0x57, 0xe0, 0x00, 0x37, 0x0e, 0x15, 0x9c, 0xa8, 0x04, 0xa7, - 0x8a, 0x53, 0x55, 0x24, 0x54, 0xf5, 0x80, 0x50, 0x8b, 0xc4, 0xd7, 0x40, 0xf3, 0xb2, 0xeb, 0x75, - 0x5e, 0x6a, 0xa7, 0x37, 0xb8, 0x58, 0xb3, 0xcf, 0xeb, 0xef, 0xf7, 0xcc, 0x33, 0xcf, 0x8c, 0xe1, - 0x8c, 0x4b, 0xe2, 0x16, 0x89, 0xcd, 0x86, 0x13, 0x63, 0x93, 0xe1, 0xd0, 0xc3, 0x51, 0x2b, 0x08, - 0x99, 0xd9, 0xa9, 0x35, 0x30, 0x73, 0x6a, 0xe6, 0xdd, 0x36, 0x8e, 0xba, 0x06, 0x8d, 0x08, 0x23, - 0xa8, 0x22, 0x6d, 0x0d, 0x6e, 0x6b, 0xf4, 0x6c, 0x0d, 0x65, 0x5b, 0x9e, 0xf6, 0x89, 0x4f, 0x84, - 0xa9, 0xc9, 0x57, 0xd2, 0xab, 0x7c, 0xd4, 0x27, 0xc4, 0x6f, 0x62, 0x53, 0x7c, 0x35, 0xda, 0x1b, - 0xa6, 0x13, 0xaa, 0x80, 0xe5, 0x19, 0xa5, 0x72, 0x68, 0x60, 0x3a, 0x61, 0x48, 0x98, 0xc3, 0x02, - 0x12, 0xc6, 0x4a, 0xfb, 0xb2, 0x4b, 0x5a, 0x98, 0x35, 0x36, 0x98, 0x49, 0xeb, 0xd4, 0xec, 0xd4, - 0x4c, 0xd6, 0xa5, 0x38, 0x51, 0x1e, 0x4b, 0x95, 0x42, 0xba, 0x5d, 0xdd, 0x47, 0x4b, 0x70, 0x48, - 0x19, 0x51, 0xc7, 0x0f, 0x42, 0x91, 0x68, 0x37, 0xdb, 0x5d, 0x4a, 0x90, 0x8d, 0x7b, 0x54, 0xda, - 0xda, 0x92, 0xa5, 0xaa, 0xc7, 0x9e, 0x88, 0x1a, 0x4d, 0xe2, 0x6e, 0x29, 0x75, 0x25, 0x55, 0xbb, - 0x51, 0x97, 0x32, 0xc2, 0xf5, 0x34, 0x22, 0x64, 0x43, 0xe9, 0x27, 0x9d, 0x56, 0x10, 0x12, 0x53, - 0xfc, 0x4a, 0x51, 0xf5, 0x73, 0x0d, 0x2a, 0x2b, 0x98, 0xbd, 0xef, 0x34, 0x03, 0xcf, 0x61, 0x24, - 0x5a, 0xc7, 0x6c, 0xa9, 0x7b, 0x1d, 0x07, 0xfe, 0x26, 0xb3, 0xf0, 0xdd, 0x36, 0x8e, 0x19, 0x3a, - 0x0c, 0x63, 0x9b, 0x42, 0xa0, 0x6b, 0xb3, 0xda, 0xa9, 0xbc, 0xa5, 0xbe, 0xd0, 0xdb, 0x00, 0x3d, - 0x9e, 0x7a, 0x6e, 0x56, 0x3b, 0x35, 0x5e, 0x3f, 0x61, 0x64, 0xf7, 0x4f, 0x6e, 0xac, 0xe2, 0x68, - 0xac, 0x39, 0x3e, 0x56, 0x31, 0xad, 0x8c, 0x67, 0xf5, 0xb1, 0x06, 0xc7, 0xf7, 0x84, 0x10, 0x53, - 0x12, 0xc6, 0x18, 0xbd, 0x02, 0x07, 0x05, 0x51, 0xbb, 0x0f, 0xc9, 0xb8, 0x90, 0x49, 0x53, 0xb4, - 0x0a, 0xd0, 0x49, 0x42, 0xc4, 0x7a, 0x6e, 0x36, 0x7f, 0x6a, 0xbc, 0x7e, 0xda, 0x78, 0x7e, 0x3b, - 0x19, 0x69, 0x52, 0x2b, 0xe3, 0x8c, 0x56, 0xfa, 0x98, 0xe5, 0x05, 0xb3, 0x93, 0x03, 0x99, 0x49, - 0xa8, 0x7d, 0xd4, 0x36, 0x60, 0x66, 0x05, 0xb3, 0x9b, 0x0e, 0xc3, 0x71, 0x1f, 0xbf, 0xa4, 0xb4, - 0xfd, 0x25, 0xd4, 0x5e, 0xb8, 0x84, 0xbf, 0x6b, 0x70, 0x6c, 0x8f, 0x44, 0xff, 0xee, 0x02, 0xde, - 0xd7, 0xa0, 0x94, 0xa6, 0x40, 0x75, 0x28, 0x38, 0x9e, 0x17, 0xe1, 0x38, 0x16, 0xf8, 0x4b, 0x4b, - 0xfa, 0xa3, 0x7b, 0x73, 0xd3, 0x2a, 0xec, 0xa2, 0xd4, 0xac, 0xb3, 0x28, 0x08, 0x7d, 0x2b, 0x31, - 0x44, 0x73, 0x50, 0xa0, 0xed, 0x86, 0xbd, 0x85, 0xbb, 0xaa, 0x45, 0xa7, 0x0d, 0x39, 0x11, 0x8c, - 0x64, 0x58, 0x18, 0x8b, 0x61, 0xd7, 0x1a, 0xa3, 0xed, 0xc6, 0x3b, 0xb8, 0xcb, 0xeb, 0xd4, 0x21, - 0x2c, 0x08, 0x7d, 0x9b, 0x92, 0x8f, 0x71, 0x24, 0xb0, 0xe7, 0xad, 0x71, 0x29, 0x5b, 0xe3, 0x22, - 0x74, 0x16, 0x26, 0x69, 0x44, 0x28, 0x89, 0x71, 0x64, 0xd3, 0x28, 0x20, 0x51, 0xc0, 0xba, 0xfa, - 0xa8, 0xb0, 0x9b, 0x48, 0x14, 0x6b, 0x4a, 0x5e, 0xad, 0xc1, 0x91, 0x15, 0xcc, 0x96, 0x78, 0x99, - 0x87, 0x3c, 0x57, 0xd5, 0x27, 0x1a, 0xe8, 0x3b, 0x7d, 0xd4, 0x3e, 0x5e, 0x80, 0xa2, 0xdc, 0xc7, - 0xc0, 0x53, 0xfd, 0x52, 0x36, 0x92, 0x53, 0x6f, 0xc8, 0x29, 0xd2, 0xa9, 0x19, 0xc2, 0x77, 0x75, - 0xd9, 0x2a, 0x08, 0xdb, 0x55, 0x0f, 0x19, 0x70, 0x40, 0x2c, 0x55, 0x0d, 0xf4, 0xbd, 0x7c, 0x2c, - 0x69, 0x86, 0x3e, 0x80, 0x52, 0xec, 0x6d, 0xd9, 0xd2, 0x47, 0xee, 0xdf, 0xab, 0x83, 0x5a, 0x41, - 0x02, 0x9e, 0x7a, 0x72, 0x6f, 0xee, 0x90, 0xb4, 0x9c, 0x8b, 0xbd, 0xad, 0xd9, 0x73, 0xc6, 0xf9, - 0x8b, 0x56, 0x31, 0xf6, 0xb6, 0x84, 0xba, 0x7a, 0x04, 0x5e, 0x4a, 0x1b, 0x55, 0x66, 0x94, 0xd5, - 0xe0, 0x53, 0xe0, 0xf0, 0x76, 0xcd, 0x7f, 0x84, 0xf3, 0x14, 0x4c, 0xae, 0x60, 0xb6, 0xde, 0x0d, - 0x5d, 0xde, 0x99, 0x8a, 0xaf, 0x01, 0x28, 0x2b, 0x54, 0x54, 0x75, 0x28, 0xc4, 0x52, 0x24, 0x98, - 0x16, 0xad, 0xe4, 0xb3, 0x3a, 0x2d, 0xec, 0x6f, 0x13, 0x0f, 0xaf, 0x86, 0x1b, 0x24, 0x89, 0xf2, - 0xb3, 0x06, 0x53, 0x7d, 0x62, 0x15, 0xe7, 0x26, 0x4c, 0x7a, 0x78, 0xc3, 0x69, 0x37, 0x99, 0x1d, - 0x12, 0x0f, 0xdb, 0x41, 0xb8, 0x41, 0x54, 0xed, 0x66, 0x7b, 0x75, 0xa0, 0x75, 0xca, 0xab, 0xb0, - 0x2c, 0x2d, 0xd3, 0x20, 0x87, 0xbc, 0x7e, 0x01, 0xfa, 0x08, 0xa6, 0x1c, 0x4a, 0x9b, 0x81, 0x2b, - 0x0e, 0xa5, 0xdd, 0xc1, 0x51, 0xdc, 0x1b, 0xf9, 0x67, 0x07, 0x8e, 0x08, 0x69, 0x2e, 0x42, 0xa3, - 0x4c, 0x1c, 0x25, 0xaf, 0xfe, 0x94, 0x83, 0xf1, 0x8c, 0x0d, 0x42, 0x30, 0x1a, 0x3a, 0x2d, 0x2c, - 0x8f, 0xb8, 0x25, 0xd6, 0xe8, 0x28, 0x14, 0x1d, 0x4a, 0x6d, 0x21, 0xcf, 0x09, 0x79, 0xc1, 0xa1, - 0xf4, 0x36, 0x57, 0xe9, 0x50, 0x48, 0x00, 0xe5, 0xa5, 0x46, 0x7d, 0xa2, 0x63, 0x00, 0x7e, 0xc0, - 0x6c, 0x97, 0xb4, 0x5a, 0x01, 0x13, 0x27, 0xb4, 0x64, 0x95, 0xfc, 0x80, 0x5d, 0x15, 0x02, 0xae, - 0x6e, 0xb4, 0x83, 0xa6, 0x67, 0x33, 0xc7, 0x8f, 0xf5, 0x03, 0x52, 0x2d, 0x24, 0x77, 0x1c, 0x3f, - 0x16, 0xde, 0x24, 0xe5, 0x3a, 0xa6, 0xbc, 0x89, 0x42, 0x8a, 0xae, 0x25, 0xde, 0x1e, 0xa6, 0xb1, - 0x5e, 0x10, 0xd3, 0xf2, 0xc4, 0xa0, 0x52, 0xdc, 0x22, 0x5e, 0xbb, 0x89, 0x55, 0x96, 0x65, 0x4c, - 0x63, 0xb4, 0x08, 0x48, 0x5d, 0xf7, 0xbc, 0xf7, 0x92, 0x6c, 0x45, 0x31, 0xdd, 0x76, 0x69, 0xab, - 0x79, 0x6b, 0x42, 0x0a, 0xd6, 0xbd, 0xad, 0xa4, 0x7e, 0xd7, 0x61, 0x4c, 0xc6, 0xe5, 0x95, 0xa3, - 0x0e, 0xdb, 0x4c, 0x2a, 0xc7, 0xd7, 0xd9, 0xf2, 0xe4, 0xfa, 0xcb, 0x33, 0x01, 0xf9, 0xb8, 0xdd, - 0x52, 0x45, 0xe3, 0xcb, 0xea, 0x26, 0x4c, 0x2c, 0x2e, 0x5d, 0x5d, 0x7d, 0x8f, 0xcf, 0xe6, 0x64, - 0x4a, 0x21, 0x18, 0xf5, 0x1c, 0xe6, 0x88, 0x98, 0x07, 0x2d, 0xb1, 0x4e, 0xf3, 0xe4, 0x32, 0x79, - 0x7a, 0xd3, 0x2c, 0xdf, 0xf7, 0x4a, 0x98, 0x86, 0x03, 0x34, 0x22, 0x1d, 0x2c, 0xea, 0x5f, 0xb4, - 0xe4, 0x47, 0xf5, 0xcb, 0x1c, 0x4c, 0x66, 0x52, 0xa9, 0xae, 0x45, 0x30, 0xea, 0x12, 0x4f, 0xee, - 0xfc, 0xff, 0x2c, 0xb1, 0xe6, 0x28, 0x9b, 0xc4, 0x4f, 0x50, 0x36, 0x89, 0xcf, 0xad, 0x44, 0x3b, - 0xcb, 0x0d, 0x15, 0x6b, 0x9e, 0x25, 0x08, 0x3d, 0xfc, 0x89, 0xd8, 0xc6, 0xbc, 0x25, 0x3f, 0xb8, - 0x2f, 0x9f, 0xfb, 0x63, 0x02, 0x3a, 0x5f, 0x72, 0xbb, 0x8e, 0xd3, 0x6c, 0x63, 0xbd, 0x20, 0x64, - 0xf2, 0x23, 0x83, 0xbd, 0xd4, 0x87, 0x7d, 0x06, 0x4a, 0x1c, 0x43, 0x4c, 0x1d, 0x17, 0xeb, 0x20, - 0x3b, 0x20, 0x15, 0xa0, 0xd7, 0xa1, 0x24, 0x1e, 0x57, 0x36, 0xa1, 0xb1, 0x3e, 0x2e, 0xce, 0xc2, - 0x4c, 0xef, 0x6c, 0xc9, 0x17, 0x18, 0x3f, 0x5e, 0x6b, 0xdc, 0xe8, 0x5d, 0x1a, 0x5b, 0x45, 0xaa, - 0x56, 0x37, 0x46, 0x8b, 0xb9, 0x89, 0xfc, 0x8d, 0xd1, 0x62, 0x71, 0xa2, 0x54, 0x5d, 0x81, 0x82, - 0xb2, 0xe0, 0xcc, 0xf8, 0x68, 0x4a, 0xf6, 0x8f, 0xaf, 0x13, 0x0e, 0xb9, 0x1e, 0x87, 0x64, 0x47, - 0xf2, 0xbd, 0x1d, 0x79, 0x23, 0xa7, 0x6b, 0xd5, 0x3b, 0x50, 0x4c, 0x52, 0xa1, 0x65, 0xc8, 0x73, - 0x54, 0x9a, 0x68, 0xcb, 0x93, 0x83, 0xda, 0x52, 0xb9, 0x2d, 0x95, 0x1e, 0xfc, 0x71, 0x7c, 0xe4, - 0xdb, 0xbf, 0xbf, 0x3f, 0xa3, 0x59, 0xdc, 0x9d, 0x47, 0xad, 0xff, 0x02, 0x50, 0x58, 0xc7, 0x51, - 0x27, 0x70, 0x31, 0xfa, 0x4e, 0x83, 0xf1, 0xcc, 0xb4, 0x41, 0xf5, 0x41, 0x81, 0x77, 0x4e, 0xac, - 0xf2, 0xfc, 0xbe, 0x7c, 0x64, 0x63, 0x54, 0x6b, 0x5f, 0xfc, 0xf6, 0xd7, 0xd7, 0xb9, 0xb3, 0xe8, - 0xb4, 0x39, 0xe0, 0x1d, 0x9d, 0x0e, 0x3b, 0xf4, 0x8d, 0x06, 0xd0, 0x1b, 0xb0, 0xa8, 0x36, 0x44, - 0xda, 0xfe, 0x09, 0x5d, 0xae, 0xef, 0xc7, 0x45, 0x01, 0x35, 0x05, 0xd0, 0xd3, 0xe8, 0xe4, 0x20, - 0xa0, 0x6a, 0xac, 0xa3, 0x1f, 0x34, 0xf8, 0x7f, 0xff, 0xb5, 0x87, 0x2e, 0x0c, 0x91, 0x77, 0xe7, - 0x05, 0x5a, 0x5e, 0xd8, 0xaf, 0x9b, 0x82, 0x7c, 0x41, 0x40, 0x36, 0xd1, 0xdc, 0x20, 0xc8, 0xe2, - 0x62, 0x8c, 0xcd, 0xa6, 0x88, 0x81, 0xee, 0x6b, 0x30, 0xb1, 0xfd, 0x95, 0x82, 0x2e, 0x0e, 0x81, - 0x61, 0xb7, 0xb7, 0x50, 0xf9, 0xd2, 0xfe, 0x1d, 0x15, 0xfc, 0x8b, 0x02, 0x7e, 0x0d, 0x99, 0x43, - 0xc2, 0xff, 0x54, 0x9e, 0xed, 0xcf, 0xd0, 0x23, 0x2d, 0xf3, 0x14, 0xc9, 0xbe, 0x99, 0xd1, 0xe5, - 0xa1, 0x2b, 0xb9, 0xcb, 0x9b, 0xbe, 0xfc, 0xe6, 0x0b, 0x7a, 0x2b, 0x3e, 0x97, 0x05, 0x9f, 0x05, - 0x74, 0x7e, 0x10, 0x9f, 0xde, 0x73, 0x1b, 0xb3, 0x74, 0x57, 0x9e, 0x68, 0xe2, 0xbd, 0xb9, 0xdb, - 0x7f, 0x29, 0x74, 0x65, 0x08, 0x60, 0xcf, 0xf9, 0x1f, 0x58, 0x7e, 0xeb, 0x85, 0xfd, 0x15, 0xb5, - 0x2b, 0x82, 0xda, 0x25, 0xb4, 0xb0, 0x3f, 0x6a, 0xe9, 0x8e, 0xfd, 0xa8, 0x41, 0x29, 0xbd, 0x34, - 0xd0, 0xb9, 0x41, 0x70, 0xb6, 0x5f, 0x65, 0xe5, 0xda, 0x3e, 0x3c, 0x14, 0xe4, 0x6b, 0xbf, 0xee, - 0xb8, 0x82, 0x17, 0x04, 0x8b, 0xd7, 0xd0, 0x99, 0x41, 0x2c, 0x9c, 0x86, 0x1b, 0xd8, 0xe2, 0x7f, - 0xce, 0xd2, 0xad, 0x07, 0x4f, 0x2b, 0xda, 0xc3, 0xa7, 0x15, 0xed, 0xcf, 0xa7, 0x15, 0xed, 0xab, - 0x67, 0x95, 0x91, 0x87, 0xcf, 0x2a, 0x23, 0x8f, 0x9f, 0x55, 0x46, 0x3e, 0x9c, 0xf7, 0x03, 0xb6, - 0xd9, 0x6e, 0xf0, 0x7b, 0x23, 0x89, 0xd7, 0x4b, 0x67, 0xba, 0xcd, 0x00, 0x87, 0xcc, 0xf4, 0x23, - 0xea, 0x9a, 0x6e, 0x8b, 0xc5, 0x72, 0x0e, 0x37, 0xc6, 0xc4, 0x5f, 0x97, 0xf9, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0xed, 0x64, 0xd5, 0x13, 0x59, 0x11, 0x00, 0x00, + // 1468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x1b, 0xcf, 0xda, 0x69, 0x6c, 0x3f, 0xe9, 0xfb, 0x36, 0x99, 0xe4, 0x6d, 0xb7, 0x7e, 0x53, 0x37, + 0xaf, 0xa5, 0xb7, 0x9f, 0x64, 0xb7, 0x76, 0xda, 0xb4, 0xa0, 0x52, 0x94, 0x34, 0x25, 0x4d, 0x69, + 0x4b, 0xd8, 0x54, 0x20, 0x21, 0xa4, 0xd5, 0x7a, 0x77, 0xbc, 0x59, 0xc5, 0xde, 0x99, 0xee, 0x8e, + 0x0d, 0x16, 0x42, 0x42, 0x9c, 0x38, 0x22, 0xf1, 0x2f, 0x70, 0x80, 0x1b, 0x87, 0x0a, 0x4e, 0x54, + 0x82, 0x53, 0xc5, 0xa9, 0x2a, 0x12, 0xaa, 0x7a, 0x40, 0xa8, 0x45, 0xe2, 0xdf, 0x40, 0xf3, 0xb1, + 0xeb, 0x75, 0x93, 0xd4, 0x4e, 0x6f, 0x70, 0x59, 0xcd, 0x3c, 0x9f, 0xbf, 0xe7, 0x63, 0x9e, 0x99, + 0x85, 0x33, 0x2e, 0x89, 0xdb, 0x24, 0x36, 0x1b, 0x4e, 0x8c, 0x4d, 0x86, 0x43, 0x0f, 0x47, 0xed, + 0x20, 0x64, 0x66, 0xb7, 0xd6, 0xc0, 0xcc, 0xa9, 0x99, 0x77, 0x3b, 0x38, 0xea, 0x19, 0x34, 0x22, + 0x8c, 0xa0, 0x8a, 0x94, 0x35, 0xb8, 0xac, 0xd1, 0x97, 0x35, 0x94, 0x6c, 0x79, 0xda, 0x69, 0x07, + 0x21, 0x31, 0xc5, 0x57, 0xaa, 0x94, 0x2b, 0x2e, 0x69, 0x63, 0xd6, 0x68, 0x32, 0xd3, 0x8d, 0x7a, + 0x94, 0x11, 0xb3, 0x5b, 0x33, 0x69, 0x44, 0x48, 0x53, 0xf1, 0xff, 0x9b, 0xf2, 0x69, 0x9d, 0x72, + 0x26, 0xeb, 0x51, 0x1c, 0x2b, 0xe6, 0xb1, 0x94, 0x29, 0xa8, 0x9c, 0xdd, 0x68, 0x11, 0x77, 0x7b, + 0x6f, 0x76, 0x56, 0x7b, 0x20, 0x32, 0x11, 0x46, 0x1a, 0x14, 0x75, 0xfc, 0x20, 0x74, 0x58, 0x40, + 0xc2, 0xdd, 0x64, 0x77, 0xc9, 0x42, 0xd6, 0xee, 0x51, 0x29, 0x6b, 0x8b, 0x9d, 0xa9, 0x52, 0x22, + 0x59, 0xb3, 0x3e, 0xf1, 0x89, 0xa4, 0xf3, 0x95, 0xa2, 0xce, 0xf9, 0x84, 0xf8, 0x2d, 0x6c, 0x3a, + 0x34, 0x30, 0x9d, 0x30, 0x24, 0x4c, 0x78, 0x4e, 0xcd, 0x29, 0xae, 0xd8, 0x35, 0x3a, 0x4d, 0xd3, + 0x09, 0x55, 0xbe, 0xab, 0x9f, 0x6a, 0x50, 0x59, 0xc3, 0xec, 0x5d, 0xa7, 0x15, 0x78, 0x0e, 0x23, + 0xd1, 0x26, 0x66, 0x2b, 0xbd, 0xeb, 0x38, 0xf0, 0xb7, 0x98, 0x85, 0xef, 0x76, 0x70, 0xcc, 0xd0, + 0x61, 0x98, 0xd8, 0x12, 0x04, 0x5d, 0x9b, 0xd7, 0x4e, 0xe5, 0x2d, 0xb5, 0x43, 0x6f, 0x02, 0xf4, + 0x83, 0xd4, 0x73, 0xf3, 0xda, 0xa9, 0xc9, 0xfa, 0x09, 0x23, 0x5b, 0x3f, 0x59, 0x58, 0x15, 0xa0, + 0xb1, 0xe1, 0xf8, 0x58, 0xd9, 0xb4, 0x32, 0x9a, 0xd5, 0xc7, 0x1a, 0x1c, 0xdf, 0x13, 0x42, 0x4c, + 0x49, 0x18, 0x63, 0xf4, 0x3f, 0x38, 0x28, 0xca, 0x62, 0x0f, 0x20, 0x99, 0x14, 0x34, 0x29, 0x8a, + 0xd6, 0x01, 0xba, 0x89, 0x89, 0x58, 0xcf, 0xcd, 0xe7, 0x4f, 0x4d, 0xd6, 0x4f, 0x1b, 0x2f, 0x6e, + 0x27, 0x23, 0x75, 0x6a, 0x65, 0x94, 0xd1, 0xda, 0x40, 0x64, 0x79, 0x11, 0xd9, 0xc9, 0xa1, 0x91, + 0x49, 0xa8, 0x03, 0xa1, 0x35, 0x61, 0x6e, 0x0d, 0xb3, 0x9b, 0x0e, 0xc3, 0xf1, 0x40, 0x7c, 0x49, + 0x6a, 0x07, 0x53, 0xa8, 0xbd, 0x74, 0x0a, 0x7f, 0xd5, 0xe0, 0xd8, 0x1e, 0x8e, 0xfe, 0xde, 0x09, + 0xbc, 0xaf, 0x41, 0x29, 0x75, 0x81, 0xea, 0x50, 0x70, 0x3c, 0x2f, 0xc2, 0x71, 0x2c, 0xf0, 0x97, + 0x56, 0xf4, 0x47, 0xf7, 0x16, 0x66, 0x95, 0xd9, 0x65, 0xc9, 0xd9, 0x64, 0x51, 0x10, 0xfa, 0x56, + 0x22, 0x88, 0x16, 0xa0, 0x40, 0x3b, 0x0d, 0x7b, 0x1b, 0xf7, 0x54, 0x8b, 0xce, 0x1a, 0xf2, 0x34, + 0x18, 0xc9, 0x69, 0x30, 0x96, 0xc3, 0x9e, 0x35, 0x41, 0x3b, 0x8d, 0xb7, 0x70, 0x8f, 0xe7, 0xa9, + 0x4b, 0x58, 0x10, 0xfa, 0x36, 0x25, 0x1f, 0xe2, 0x48, 0x60, 0xcf, 0x5b, 0x93, 0x92, 0xb6, 0xc1, + 0x49, 0xe8, 0x2c, 0x4c, 0xd3, 0x88, 0x50, 0x12, 0xe3, 0xc8, 0xa6, 0x51, 0x40, 0xa2, 0x80, 0xf5, + 0xf4, 0x71, 0x21, 0x37, 0x95, 0x30, 0x36, 0x14, 0xbd, 0x5a, 0x83, 0x23, 0x6b, 0x98, 0xad, 0xf0, + 0x34, 0x8f, 0x78, 0xae, 0xaa, 0x4f, 0x34, 0xd0, 0x77, 0xea, 0xa8, 0x3a, 0x5e, 0x80, 0xa2, 0xac, + 0x63, 0xe0, 0xa9, 0x7e, 0x29, 0x1b, 0xc9, 0x8c, 0x32, 0xe4, 0x08, 0xe9, 0xd6, 0x0c, 0xa1, 0xbb, + 0xbe, 0x6a, 0x15, 0x84, 0xec, 0xba, 0x87, 0x0c, 0x38, 0x20, 0x96, 0x2a, 0x07, 0xfa, 0x5e, 0x3a, + 0x96, 0x14, 0x43, 0xef, 0x41, 0x29, 0xf6, 0xb6, 0x6d, 0xa9, 0x23, 0xeb, 0xf7, 0xff, 0x61, 0xad, + 0x20, 0x01, 0xcf, 0x3c, 0xb9, 0xb7, 0x70, 0x48, 0x4a, 0x2e, 0xc4, 0xde, 0xf6, 0xfc, 0x39, 0xe3, + 0xfc, 0x45, 0xab, 0x18, 0x7b, 0xdb, 0x82, 0x5d, 0x3d, 0x02, 0xff, 0x49, 0x1b, 0x55, 0x7a, 0x94, + 0xd9, 0xe0, 0x53, 0xe0, 0xf0, 0xf3, 0x9c, 0x7f, 0x48, 0xcc, 0x33, 0x30, 0xbd, 0x86, 0xd9, 0x66, + 0x2f, 0x74, 0x79, 0x67, 0xaa, 0x78, 0x0d, 0x40, 0x59, 0xa2, 0x0a, 0x55, 0x87, 0x42, 0x2c, 0x49, + 0x22, 0xd2, 0xa2, 0x95, 0x6c, 0xab, 0xb3, 0x42, 0xfe, 0x36, 0xf1, 0xf0, 0x7a, 0xd8, 0x24, 0x89, + 0x95, 0x1f, 0x35, 0x98, 0x19, 0x20, 0x2b, 0x3b, 0x37, 0x61, 0xda, 0xc3, 0x4d, 0xa7, 0xd3, 0x62, + 0x76, 0x48, 0x3c, 0x6c, 0x07, 0x61, 0x93, 0xa8, 0xdc, 0xcd, 0xf7, 0xf3, 0x40, 0xeb, 0x94, 0x67, + 0x61, 0x55, 0x4a, 0xa6, 0x46, 0x0e, 0x79, 0x83, 0x04, 0xf4, 0x01, 0xcc, 0x38, 0x94, 0xb6, 0x02, + 0x57, 0x1c, 0x4a, 0xbb, 0x8b, 0xa3, 0xb8, 0x3f, 0xf2, 0xcf, 0x0e, 0x1d, 0x11, 0x52, 0x5c, 0x98, + 0x46, 0x19, 0x3b, 0x8a, 0x5e, 0xfd, 0x21, 0x07, 0x93, 0x19, 0x19, 0x84, 0x60, 0x3c, 0x74, 0xda, + 0x58, 0x1e, 0x71, 0x4b, 0xac, 0xd1, 0x51, 0x28, 0x3a, 0x94, 0xda, 0x82, 0x9e, 0x13, 0xf4, 0x82, + 0x43, 0xe9, 0x6d, 0xce, 0xd2, 0xa1, 0x90, 0x00, 0xca, 0x4b, 0x8e, 0xda, 0xa2, 0x63, 0x00, 0x7e, + 0xc0, 0x6c, 0x97, 0xb4, 0xdb, 0x01, 0x13, 0x27, 0xb4, 0x64, 0x95, 0xfc, 0x80, 0x5d, 0x15, 0x04, + 0xce, 0x6e, 0x74, 0x82, 0x96, 0x67, 0x33, 0xc7, 0x8f, 0xf5, 0x03, 0x92, 0x2d, 0x28, 0x77, 0x1c, + 0x3f, 0x16, 0xda, 0x24, 0x8d, 0x75, 0x42, 0x69, 0x13, 0x85, 0x14, 0x5d, 0x4b, 0xb4, 0x3d, 0x4c, + 0x63, 0xbd, 0x20, 0xa6, 0xe5, 0x89, 0x61, 0xa9, 0xb8, 0x45, 0xbc, 0x4e, 0x0b, 0x2b, 0x2f, 0xab, + 0x98, 0xc6, 0x68, 0x19, 0x90, 0xba, 0xeb, 0x79, 0xef, 0x25, 0xde, 0x8a, 0x62, 0xba, 0xed, 0xd2, + 0x56, 0x8b, 0xd6, 0x94, 0x24, 0x6c, 0x7a, 0xdb, 0x49, 0xfe, 0xae, 0xc3, 0x84, 0xb4, 0xcb, 0x33, + 0x47, 0x1d, 0xb6, 0x95, 0x64, 0x8e, 0xaf, 0xb3, 0xe9, 0xc9, 0x0d, 0xa6, 0x67, 0x0a, 0xf2, 0x71, + 0xa7, 0xad, 0x92, 0xc6, 0x97, 0xd5, 0x2d, 0x98, 0x5a, 0x5e, 0xb9, 0xba, 0xfe, 0x0e, 0x9f, 0xcd, + 0xc9, 0x94, 0x42, 0x30, 0xee, 0x39, 0xcc, 0x11, 0x36, 0x0f, 0x5a, 0x62, 0x9d, 0xfa, 0xc9, 0x65, + 0xfc, 0xf4, 0xa7, 0x59, 0x7e, 0xe0, 0x95, 0x30, 0x0b, 0x07, 0x68, 0x44, 0xba, 0x58, 0xe4, 0xbf, + 0x68, 0xc9, 0x4d, 0xf5, 0xf3, 0x1c, 0x4c, 0x67, 0x5c, 0xa9, 0xae, 0x45, 0x30, 0xee, 0x12, 0x4f, + 0x56, 0xfe, 0x5f, 0x96, 0x58, 0x73, 0x94, 0x2d, 0xe2, 0x27, 0x28, 0x5b, 0xc4, 0xe7, 0x52, 0xa2, + 0x9d, 0x65, 0x41, 0xc5, 0x9a, 0x7b, 0x09, 0x42, 0x0f, 0x7f, 0x24, 0xca, 0x98, 0xb7, 0xe4, 0x86, + 0xeb, 0xf2, 0xb9, 0x3f, 0x21, 0xa0, 0xf3, 0x25, 0x97, 0xeb, 0x3a, 0xad, 0x0e, 0xd6, 0x0b, 0x82, + 0x26, 0x37, 0x19, 0xec, 0xa5, 0x01, 0xec, 0x73, 0x50, 0xe2, 0x18, 0x62, 0xea, 0xb8, 0x58, 0x07, + 0xd9, 0x01, 0x29, 0x01, 0xbd, 0x0a, 0x25, 0xf1, 0xcc, 0xb4, 0x09, 0x8d, 0xf5, 0x49, 0x71, 0x16, + 0xe6, 0xfa, 0x67, 0x4b, 0xbe, 0x45, 0xf9, 0xf1, 0xda, 0xe0, 0x42, 0x6f, 0xd3, 0xd8, 0x2a, 0x52, + 0xb5, 0xba, 0x31, 0x5e, 0xcc, 0x4d, 0xe5, 0x6f, 0x8c, 0x17, 0x8b, 0x53, 0xa5, 0xea, 0x1a, 0x14, + 0x94, 0x04, 0x8f, 0x8c, 0x8f, 0xa6, 0xa4, 0x7e, 0x7c, 0x9d, 0xc4, 0x90, 0xeb, 0xc7, 0x90, 0x54, + 0x24, 0xdf, 0xaf, 0xc8, 0x6b, 0x39, 0x5d, 0xab, 0xde, 0x81, 0x62, 0xe2, 0x0a, 0xad, 0x42, 0x9e, + 0xa3, 0xd2, 0x44, 0x5b, 0x9e, 0x1c, 0xd6, 0x96, 0x4a, 0x6d, 0xa5, 0xf4, 0xe0, 0xb7, 0xe3, 0x63, + 0x5f, 0xff, 0xf9, 0xed, 0x19, 0xcd, 0xe2, 0xea, 0xdc, 0x6a, 0xfd, 0x27, 0x80, 0xc2, 0x26, 0x8e, + 0xba, 0x81, 0x8b, 0xd1, 0x37, 0x1a, 0x4c, 0x66, 0xa6, 0x0d, 0xaa, 0x0f, 0x33, 0xbc, 0x73, 0x62, + 0x95, 0x17, 0xf7, 0xa5, 0x23, 0x1b, 0xa3, 0x5a, 0xfb, 0xec, 0x97, 0x3f, 0xbe, 0xcc, 0x9d, 0x45, + 0xa7, 0xcd, 0x21, 0x8f, 0xe8, 0x74, 0xd8, 0xa1, 0xaf, 0x34, 0x80, 0xfe, 0x80, 0x45, 0xb5, 0x11, + 0xdc, 0x0e, 0x4e, 0xe8, 0x72, 0x7d, 0x3f, 0x2a, 0x0a, 0xa8, 0x29, 0x80, 0x9e, 0x46, 0x27, 0x87, + 0x01, 0x55, 0x63, 0x1d, 0x7d, 0xa7, 0xc1, 0xbf, 0x07, 0xaf, 0x3d, 0x74, 0x61, 0x04, 0xbf, 0x3b, + 0x2f, 0xd0, 0xf2, 0xd2, 0x7e, 0xd5, 0x14, 0xe4, 0x0b, 0x02, 0xb2, 0x89, 0x16, 0x86, 0x41, 0x16, + 0x17, 0x63, 0x6c, 0xb6, 0x84, 0x0d, 0x74, 0x5f, 0x83, 0xa9, 0xe7, 0x5f, 0x29, 0xe8, 0xe2, 0x08, + 0x18, 0x76, 0x7b, 0x0b, 0x95, 0x2f, 0xed, 0x5f, 0x51, 0xc1, 0xbf, 0x28, 0xe0, 0xd7, 0x90, 0x39, + 0x22, 0xfc, 0x8f, 0xe5, 0xd9, 0xfe, 0x04, 0x3d, 0xd2, 0x32, 0x4f, 0x91, 0xec, 0x9b, 0x19, 0x5d, + 0x1e, 0x39, 0x93, 0xbb, 0xbc, 0xe9, 0xcb, 0xaf, 0xbf, 0xa4, 0xb6, 0x8a, 0xe7, 0xb2, 0x88, 0x67, + 0x09, 0x9d, 0x1f, 0x16, 0x4f, 0xff, 0xb9, 0x8d, 0x59, 0x5a, 0x95, 0x27, 0x9a, 0x78, 0x6f, 0xee, + 0xf6, 0x2f, 0x85, 0xae, 0x8c, 0x00, 0xec, 0x05, 0xff, 0x81, 0xe5, 0x37, 0x5e, 0x5a, 0x5f, 0x85, + 0x76, 0x45, 0x84, 0x76, 0x09, 0x2d, 0xed, 0x2f, 0xb4, 0xb4, 0x62, 0xdf, 0x6b, 0x50, 0x4a, 0x2f, + 0x0d, 0x74, 0x6e, 0x18, 0x9c, 0xe7, 0xaf, 0xb2, 0x72, 0x6d, 0x1f, 0x1a, 0x0a, 0xf2, 0xb5, 0x9f, + 0x77, 0x5c, 0xc1, 0x4b, 0x22, 0x8a, 0x57, 0xd0, 0x99, 0x61, 0x51, 0x38, 0x0d, 0x37, 0xb0, 0xc5, + 0x7f, 0xce, 0xca, 0xad, 0x07, 0x4f, 0x2b, 0xda, 0xc3, 0xa7, 0x15, 0xed, 0xf7, 0xa7, 0x15, 0xed, + 0x8b, 0x67, 0x95, 0xb1, 0x87, 0xcf, 0x2a, 0x63, 0x8f, 0x9f, 0x55, 0xc6, 0xde, 0x5f, 0xf4, 0x03, + 0xb6, 0xd5, 0x69, 0xf0, 0x7b, 0x23, 0xb1, 0xd7, 0x77, 0x67, 0xba, 0xad, 0x00, 0x87, 0xcc, 0xf4, + 0x23, 0xea, 0x9a, 0x6e, 0x9b, 0xc5, 0x72, 0x0e, 0x37, 0x26, 0xc4, 0xaf, 0xcb, 0xe2, 0x5f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x65, 0x10, 0xfa, 0x9e, 0x59, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto index 9e17e952118c..70c6588985d3 100644 --- a/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -1,17 +1,17 @@ syntax = "proto3"; package cosmos.base.tendermint.v1beta1; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; +import "amino/amino.proto"; +import "cometbft/crypto/v1/proof.proto"; import "cometbft/p2p/v1/types.proto"; +import "cometbft/types/v1/block.proto"; import "cometbft/types/v1/types.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos/base/tendermint/v1beta1/types.proto"; import "cosmos_proto/cosmos.proto"; -import "cometbft/types/v1/block.proto"; -import "cometbft/crypto/v1/proof.proto"; -import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"; @@ -59,7 +59,8 @@ service Service { // GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. message GetValidatorSetByHeightRequest { int64 height = 1; - // pagination defines an pagination for the request. + // pagination defines an pagination for the request. offset and limit are used for pagination, next_key is not + // supported for this query. cosmos.base.query.v1beta1.PageRequest pagination = 2; } @@ -67,7 +68,8 @@ message GetValidatorSetByHeightRequest { message GetValidatorSetByHeightResponse { int64 block_height = 1; repeated Validator validators = 2; - // pagination defines an pagination for the response. + // pagination defines an pagination for the response. offset and limit are used for pagination, next_key is not + // supported for this query. cosmos.base.query.v1beta1.PageResponse pagination = 3; } @@ -81,7 +83,8 @@ message GetLatestValidatorSetRequest { message GetLatestValidatorSetResponse { int64 block_height = 1; repeated Validator validators = 2; - // pagination defines an pagination for the response. + // pagination defines an pagination for the response. offset and limit are used for pagination, next_key is not + // supported for this query. cosmos.base.query.v1beta1.PageResponse pagination = 3; } From 9611c5a0e6e3a9274a66aaed8858a5062a25f8f6 Mon Sep 17 00:00:00 2001 From: Matt Kocubinski Date: Wed, 6 Nov 2024 03:35:05 -0600 Subject: [PATCH 24/24] build(deps): upgrade to iavl@v1.3.1 (#22436) --- client/v2/go.mod | 2 +- client/v2/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- runtime/v2/go.mod | 2 +- runtime/v2/go.sum | 4 ++-- server/v2/cometbft/go.mod | 2 +- server/v2/cometbft/go.sum | 4 ++-- server/v2/go.mod | 2 +- server/v2/go.sum | 4 ++-- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- simapp/v2/go.mod | 2 +- simapp/v2/go.sum | 4 ++-- store/go.mod | 4 +++- store/go.sum | 13 +++++++++++-- store/iavl/store.go | 4 ++++ store/v2/go.mod | 2 +- store/v2/go.sum | 6 ++++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- x/accounts/defaults/base/go.mod | 2 +- x/accounts/defaults/base/go.sum | 4 ++-- x/accounts/defaults/lockup/go.mod | 2 +- x/accounts/defaults/lockup/go.sum | 4 ++-- x/accounts/defaults/multisig/go.mod | 2 +- x/accounts/defaults/multisig/go.sum | 4 ++-- x/accounts/go.mod | 2 +- x/accounts/go.sum | 4 ++-- x/authz/go.mod | 2 +- x/authz/go.sum | 4 ++-- x/bank/go.mod | 2 +- x/bank/go.sum | 4 ++-- x/circuit/go.mod | 2 +- x/circuit/go.sum | 4 ++-- x/consensus/go.mod | 2 +- x/consensus/go.sum | 4 ++-- x/distribution/go.mod | 2 +- x/distribution/go.sum | 4 ++-- x/epochs/go.mod | 2 +- x/epochs/go.sum | 4 ++-- x/evidence/go.mod | 2 +- x/evidence/go.sum | 4 ++-- x/feegrant/go.mod | 2 +- x/feegrant/go.sum | 4 ++-- x/gov/go.mod | 2 +- x/gov/go.sum | 4 ++-- x/group/go.mod | 2 +- x/group/go.sum | 4 ++-- x/mint/go.mod | 2 +- x/mint/go.sum | 4 ++-- x/nft/go.mod | 2 +- x/nft/go.sum | 4 ++-- x/params/go.mod | 2 +- x/params/go.sum | 4 ++-- x/protocolpool/go.mod | 2 +- x/protocolpool/go.sum | 4 ++-- x/slashing/go.mod | 2 +- x/slashing/go.sum | 4 ++-- x/staking/go.mod | 2 +- x/staking/go.sum | 4 ++-- x/upgrade/go.mod | 2 +- x/upgrade/go.sum | 4 ++-- 63 files changed, 110 insertions(+), 93 deletions(-) diff --git a/client/v2/go.mod b/client/v2/go.mod index b1b709154c1d..9c345727bc0f 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -57,7 +57,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index a8bd0b7d3a18..0dbbeb62061b 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -127,8 +127,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/go.mod b/go.mod index 1fa88112b32c..a1a179bba8cb 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.15.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect diff --git a/go.sum b/go.sum index dcf09e6b2575..7d058a39e228 100644 --- a/go.sum +++ b/go.sum @@ -114,8 +114,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/runtime/v2/go.mod b/runtime/v2/go.mod index 78ad2b0fe974..034d5c1016ca 100644 --- a/runtime/v2/go.mod +++ b/runtime/v2/go.mod @@ -41,7 +41,7 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/dot v1.6.2 // indirect diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index c56de5b9d391..8318709549d4 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -50,8 +50,8 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+R github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index ccc8de2d3e16..8733ab572235 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -73,7 +73,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index e381294209fc..d197f5e08cc7 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -121,8 +121,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/server/v2/go.mod b/server/v2/go.mod index 0f59d1a71de7..528f1d26c839 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -53,7 +53,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/dot v1.6.2 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index 0e797e011688..4a10f529cb02 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -66,8 +66,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= diff --git a/simapp/go.mod b/simapp/go.mod index bb3eb06a565e..83cb00c876aa 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -89,7 +89,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.5 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 0a415935f1f8..2100a33af3f3 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -327,8 +327,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index ef88fcec0440..94231d3b3553 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -97,7 +97,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.5 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 4d66c383748f..176723cff856 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -329,8 +329,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/store/go.mod b/store/go.mod index 897a23b96003..3d6562d83b06 100644 --- a/store/go.mod +++ b/store/go.mod @@ -12,7 +12,7 @@ require ( github.com/cometbft/cometbft/api v1.0.0-rc.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogoproto v1.7.0 - github.com/cosmos/iavl v1.0.0-beta.1.0.20240813194616-eb5078efcf9e + github.com/cosmos/iavl v1.3.1 github.com/cosmos/ics23/go v0.11.0 github.com/hashicorp/go-hclog v1.6.3 github.com/hashicorp/go-metrics v0.5.3 @@ -33,6 +33,8 @@ require ( github.com/fatih/color v1.18.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-uuid v1.0.1 // indirect diff --git a/store/go.sum b/store/go.sum index 7311339fbed4..ed8c46700387 100644 --- a/store/go.sum +++ b/store/go.sum @@ -35,8 +35,8 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+R github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.0.0-beta.1.0.20240813194616-eb5078efcf9e h1:LEii0v/FxtXa/F7mRn+tijZ0zaXBPn2ZkKwb6Qm4rqE= -github.com/cosmos/iavl v1.0.0-beta.1.0.20240813194616-eb5078efcf9e/go.mod h1:3ywr0wDnWeD7MUH6qu50wZ5bxuKH3LBrGG4/lZX8lVY= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -51,6 +51,8 @@ github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/ 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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +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/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-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -61,6 +63,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -140,18 +144,22 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= +github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d h1:htwtWgtQo8YS6JFWWi2DNgY0RwSGJ1ruMoxY6CUUclk= @@ -298,6 +306,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/store/iavl/store.go b/store/iavl/store.go index 42f8fed7c910..ab04b73c47b7 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -51,6 +51,10 @@ func LoadStore(db corestore.KVStoreWithBatch, logger types.Logger, key types.Sto // provided DB. An error is returned if the version fails to load, or if called with a positive // version on an empty tree. func LoadStoreWithInitialVersion(db corestore.KVStoreWithBatch, logger types.Logger, key types.StoreKey, id types.CommitID, initialVersion uint64, cacheSize int, disableFastNode bool, metrics metrics.StoreMetrics) (types.CommitKVStore, error) { + // store/v1 and app/v1 flows never require an initial version of 0 + if initialVersion == 0 { + initialVersion = 1 + } tree := iavl.NewMutableTree(db, cacheSize, disableFastNode, logger, iavl.InitialVersionOption(initialVersion), iavl.AsyncPruningOption(true)) isUpgradeable, err := tree.IsUpgradeable() diff --git a/store/v2/go.mod b/store/v2/go.mod index 79fe623e278e..60bd123414a1 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -10,7 +10,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogoproto v1.7.0 - github.com/cosmos/iavl v1.0.0-beta.1.0.20240813194616-eb5078efcf9e + github.com/cosmos/iavl v1.3.1 github.com/cosmos/ics23/go v0.11.0 github.com/google/btree v1.1.2 github.com/hashicorp/go-metrics v0.5.3 diff --git a/store/v2/go.sum b/store/v2/go.sum index 9e18be21fa29..b38596983898 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -44,8 +44,8 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+R github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.0.0-beta.1.0.20240813194616-eb5078efcf9e h1:LEii0v/FxtXa/F7mRn+tijZ0zaXBPn2ZkKwb6Qm4rqE= -github.com/cosmos/iavl v1.0.0-beta.1.0.20240813194616-eb5078efcf9e/go.mod h1:3ywr0wDnWeD7MUH6qu50wZ5bxuKH3LBrGG4/lZX8lVY= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -76,6 +76,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/tests/go.mod b/tests/go.mod index 5ad97cc1d0bc..13651b36201e 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -96,7 +96,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/tests/go.sum b/tests/go.sum index e26179dd6cda..8aeebe04da0a 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -325,8 +325,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/x/accounts/defaults/base/go.mod b/x/accounts/defaults/base/go.mod index 8c48af24a5bf..d9e178768084 100644 --- a/x/accounts/defaults/base/go.mod +++ b/x/accounts/defaults/base/go.mod @@ -52,7 +52,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/accounts/defaults/base/go.sum b/x/accounts/defaults/base/go.sum index cd9371822af4..ebee6b4c5637 100644 --- a/x/accounts/defaults/base/go.sum +++ b/x/accounts/defaults/base/go.sum @@ -117,8 +117,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index d261f5672a0b..a66cad7b987b 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -46,7 +46,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index c6ace37c13b6..3468212e7763 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -97,8 +97,8 @@ github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiK github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/accounts/defaults/multisig/go.mod b/x/accounts/defaults/multisig/go.mod index f7d8659b157b..b1d04c75bb04 100644 --- a/x/accounts/defaults/multisig/go.mod +++ b/x/accounts/defaults/multisig/go.mod @@ -51,7 +51,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/accounts/defaults/multisig/go.sum b/x/accounts/defaults/multisig/go.sum index cd9371822af4..ebee6b4c5637 100644 --- a/x/accounts/defaults/multisig/go.sum +++ b/x/accounts/defaults/multisig/go.sum @@ -117,8 +117,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/accounts/go.mod b/x/accounts/go.mod index 16e2c6ef3c1d..90b22d1a9936 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -57,7 +57,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/accounts/go.sum b/x/accounts/go.sum index cd9371822af4..ebee6b4c5637 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -117,8 +117,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/authz/go.mod b/x/authz/go.mod index 1e34eb17d8be..6766c08f6232 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -53,7 +53,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/authz/go.sum b/x/authz/go.sum index cd9371822af4..ebee6b4c5637 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -117,8 +117,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/bank/go.mod b/x/bank/go.mod index 984ef646b580..d71c9f9469fb 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -53,7 +53,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index cd9371822af4..ebee6b4c5637 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -117,8 +117,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 54a731e78ffe..e7ecf287f592 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -53,7 +53,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 8fceb55731a7..6762762486f0 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -119,8 +119,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/consensus/go.mod b/x/consensus/go.mod index d12915607923..a8d9e94b6add 100644 --- a/x/consensus/go.mod +++ b/x/consensus/go.mod @@ -53,7 +53,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/consensus/go.sum b/x/consensus/go.sum index 8fceb55731a7..6762762486f0 100644 --- a/x/consensus/go.sum +++ b/x/consensus/go.sum @@ -119,8 +119,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 7ee993aae9f4..51af70f6ddf8 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -56,7 +56,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index cd9371822af4..ebee6b4c5637 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -117,8 +117,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index 284e7f2deab2..5ef8a6fd51a9 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -53,7 +53,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index 8fceb55731a7..6762762486f0 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -119,8 +119,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 4de7e8a97cf8..77ed2c0bc2db 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -56,7 +56,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 8fceb55731a7..6762762486f0 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -119,8 +119,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 959204ea7189..8411fcb51ca0 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -64,7 +64,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index efdf24e13ba5..323b785436e7 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -125,8 +125,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/gov/go.mod b/x/gov/go.mod index 1de77256af1e..47293086d33e 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -60,7 +60,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index 4e6d843a385a..d4c99229b97e 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -123,8 +123,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/group/go.mod b/x/group/go.mod index 5c0a41a54ada..0609f36bc48d 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -66,7 +66,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index 827315f69da4..e6f8f5f509c5 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -125,8 +125,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/mint/go.mod b/x/mint/go.mod index 5780be9ba0aa..4e889b161269 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -53,7 +53,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index 8fceb55731a7..6762762486f0 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -119,8 +119,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/nft/go.mod b/x/nft/go.mod index a07aafaacf3a..59a7c70fd2ba 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -54,7 +54,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 8fceb55731a7..6762762486f0 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -119,8 +119,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/params/go.mod b/x/params/go.mod index c4d16f371bda..7bab88afb076 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -53,7 +53,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index 4c27f0ad454a..6bbecb386bcb 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -109,8 +109,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index ce68008aadb4..e8f560c165c6 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -55,7 +55,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index 8fceb55731a7..6762762486f0 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -119,8 +119,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/slashing/go.mod b/x/slashing/go.mod index b08e4a964bac..692a437020e1 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -57,7 +57,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index 58ca35c37a24..afb8b70d2632 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -121,8 +121,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/staking/go.mod b/x/staking/go.mod index fac99dfe7a4b..617d68a71211 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -51,7 +51,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index cd9371822af4..ebee6b4c5637 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -117,8 +117,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 6f2aedce1541..7fec5b70ba21 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -71,7 +71,7 @@ require ( github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.3.0 // indirect + github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 829d69c67197..9514798d28a6 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -327,8 +327,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= -github.com/cosmos/iavl v1.3.0/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= +github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= +github.com/cosmos/iavl v1.3.1/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM=