From da929211d6f78014e3b40de3dc01e0ffcf0104cb Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 5 Jan 2022 23:32:10 +0100 Subject: [PATCH 1/7] feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + docs/core/upgrade.md | 84 +++++++++++++++--------------- simapp/app.go | 3 ++ types/errors/errors.go | 6 +-- types/module/module.go | 90 ++++++++++++++++++++++++--------- types/module/module_int_test.go | 57 +++++++++++++++++++++ 6 files changed, 174 insertions(+), 67 deletions(-) create mode 100644 types/module/module_int_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index ee19e9cc49d..c9268586916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10507](https://github.com/cosmos/cosmos-sdk/pull/10507) Add middleware for tx priority. * [\#10311](https://github.com/cosmos/cosmos-sdk/pull/10311) Adds cli to use tips transactions. It adds an `--aux` flag to all CLI tx commands to generate the aux signer data (with optional tip), and a new `tx aux-to-fee` subcommand to let the fee payer gather aux signer data and broadcast the tx * [\#10430](https://github.com/cosmos/cosmos-sdk/pull/10430) ADR-040: Add store/v2 `MultiStore` implementation +* [\#10614](https://github.com/cosmos/cosmos-sdk/pull/10614) Support in-place migration ordering ### API Breaking Changes diff --git a/docs/core/upgrade.md b/docs/core/upgrade.md index 2a3844161b8..2782785e75c 100644 --- a/docs/core/upgrade.md +++ b/docs/core/upgrade.md @@ -22,27 +22,13 @@ This document provides steps to use the In-Place Store Migrations upgrade method Each module gets assigned a consensus version by the module developer. The consensus version serves as the breaking change version of the module. The Cosmos SDK keeps track of all module consensus versions in the x/upgrade `VersionMap` store. During an upgrade, the difference between the old `VersionMap` stored in state and the new `VersionMap` is calculated by the Cosmos SDK. For each identified difference, the module-specific migrations are run and the respective consensus version of each upgraded module is incremented. -## Genesis State - -When starting a new chain, the consensus version of each module must be saved to state during the application's genesis. To save the consensus version, add the following line to the `InitChainer` method in `app.go`: - -```diff -func (app *MyApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - ... -+ app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - ... -} -``` - -This information is used by the Cosmos SDK to detect when modules with newer versions are introduced to the app. - ### Consensus Version The consensus version is defined on each app module by the module developer and serves as the breaking change version of the module. The consensus version informs the Cosmos SDK on which modules need to be upgraded. For example, if the bank module was version 2 and an upgrade introduces bank module 3, the Cosmos SDK upgrades the bank module and runs the "version 2 to 3" migration script. ### Version Map -The version map is a mapping of module names to consensus versions. The map is persisted to x/upgrade's state for use during in-place migrations. When migrations finish, the updated version map is persisted to state. +The version map is a mapping of module names to consensus versions. The map is persisted to x/upgrade's state for use during in-place migrations. When migrations finish, the updated version map is persisted in the state. ## Upgrade Handlers @@ -60,24 +46,29 @@ Inside these functions, you must perform any upgrade logic to include in the pro ## Running Migrations -Migrations are run inside of an `UpgradeHandler` using `app.mm.RunMigrations(ctx, cfg, vm)`. The `UpgradeHandler` functions describe the functionality to occur during an upgrade. The `RunMigration` function loops through the `VersionMap` argument and runs the migration scripts for all versions that are less than the versions of the new binary app module. After the migrations are finished, a new `VersionMap` is returned to persist the upgraded module versions to state. +Migrations are run inside of an `UpgradeHandler` using `app.mm.RunMigrations(ctx, cfg, vm)`. The `UpgradeHandler` functions describe the functionality to occur during an upgrade. The `RunMigration` function loops through the `VersionMap` argument and runs the migration scripts for all versions that are less than the versions of the new binary app module. After the migrations are finished, a new `VersionMap` is returned to persist the upgraded module versions to state. ```go cfg := module.NewConfigurator(...) -app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { +app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // ... - // do upgrade logic + // additional upgrade logic // ... - // RunMigrations returns the VersionMap - // with the updated module ConsensusVersions - return app.mm.RunMigrations(ctx, vm) + // returns a VersionMap with the updated module ConsensusVersions + return app.mm.RunMigrations(ctx, fromVM) }) ``` To learn more about configuring migration scripts for your modules, see the [Module Upgrade Guide](../building-modules/upgrade.md). +### Order Of Migrations + +By default, all migrations are run in module name alphabetical ascending order, except `x/auth` which is run last. The reason is state dependencies between x/auth and other modules (you can read more in [issue #10606](https://github.com/cosmos/cosmos-sdk/issues/10606)). + +If you want to change the order of migration then you should call `app.mm.SetOrderMigrations(module1, module2, ...)` in your app.go file. The function will panic if you forget to include a module in the argument list. + ## Adding New Modules During Upgrades You can introduce entirely new modules to the application during an upgrade. New modules are recognized because they have not yet been registered in `x/upgrade`'s `VersionMap` store. In this case, `RunMigrations` calls the `InitGenesis` function from the corresponding module to set up its initial state. @@ -105,7 +96,35 @@ if upgradeInfo.Name == "my-plan" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo. } ``` -## Overwriting Genesis Functions +## Genesis State + +When starting a new chain, the consensus version of each module MUST be saved to state during the application's genesis. To save the consensus version, add the following line to the `InitChainer` method in `app.go`: + +```diff +func (app *MyApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { + ... ++ app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + ... +} +``` + +This information is used by the Cosmos SDK to detect when modules with newer versions are introduced to the app. + +For a new module `foo`, `InitGenesis` is called by `RunMigration` only when `foo` is registered in the module manager but it's not set in the `fromVM`. Therefore, if you want to skip `InitGenesis` when a new module is added to the app, then you should set its module version in `fromVM` to the module consensus version: + +```go +app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // ... + + // Set foo's version to the latest ConsensusVersion in the VersionMap. + // This will skip running InitGenesis on Foo + fromVM[foo.ModuleName] = foo.AppModule{}.ConsensusVersion() + + return app.mm.RunMigrations(ctx, fromVM) +}) +``` + +### Overwriting Genesis Functions The Cosmos SDK offers modules that the application developer can import in their app. These modules often have an `InitGenesis` function already defined. @@ -118,32 +137,17 @@ You MUST manually set the consensus version in the version map passed to the `Up ```go import foo "github.com/my/module/foo" -app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { +app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { // Register the consensus version in the version map // to avoid the SDK from triggering the default // InitGenesis function. - vm["foo"] = foo.AppModule{}.ConsensusVersion() + fromVM["foo"] = foo.AppModule{}.ConsensusVersion() // Run custom InitGenesis for foo app.mm["foo"].InitGenesis(ctx, app.appCodec, myCustomGenesisState) - return app.mm.RunMigrations(ctx, cfg, vm) -}) -``` - -If you do not have a custom genesis function and want to skip the module's default genesis function, you can simply register the module with the version map in the `UpgradeHandler` as shown in the example: - -```go -import foo "github.com/my/module/foo" - -app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - - // Set foo's version to the latest ConsensusVersion in the VersionMap. - // This will skip running InitGenesis on Foo - vm["foo"] = foo.AppModule{}.ConsensusVersion() - - return app.mm.RunMigrations(ctx, cfg, vm) + return app.mm.RunMigrations(ctx, cfg, fromVM) }) ``` diff --git a/simapp/app.go b/simapp/app.go index af060d7b529..edc6a6333ee 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -389,6 +389,9 @@ func NewSimApp( group.ModuleName, ) + // Uncomment if you want to set a custom migration order here. + // app.mm.SetOrderMigrations(custom order) + app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.legacyRouter, app.QueryRouter(), encodingConfig.Amino) app.configurator = module.NewConfigurator(app.appCodec, app.msgSvcRouter, app.GRPCQueryRouter()) diff --git a/types/errors/errors.go b/types/errors/errors.go index 2aa53c1deb5..8f98a191099 100644 --- a/types/errors/errors.go +++ b/types/errors/errors.go @@ -160,10 +160,10 @@ var ( // Examples: not DB domain error, file writing etc... ErrIO = Register(RootCodespace, 39, "Internal IO error") + // ErrAppConfig defines an error occurred if min-gas-prices field in BaseConfig is empty. + ErrAppConfig = Register(RootCodespace, 40, "error in app.toml") + // ErrPanic is only set when we recover from a panic, so we know to // redact potentially sensitive system info ErrPanic = errorsmod.ErrPanic - - // ErrAppConfig defines an error occurred if min-gas-prices field in BaseConfig is empty. - ErrAppConfig = Register(RootCodespace, 40, "error in app.toml") ) diff --git a/types/module/module.go b/types/module/module.go index 2c4754d5c9a..4128d781adf 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -230,6 +230,7 @@ type Manager struct { OrderExportGenesis []string OrderBeginBlockers []string OrderEndBlockers []string + OrderMigrations []string } // NewManager creates a new Manager object @@ -253,28 +254,35 @@ func NewManager(modules ...AppModule) *Manager { // SetOrderInitGenesis sets the order of init genesis calls func (m *Manager) SetOrderInitGenesis(moduleNames ...string) { - m.checkForgottenModules("SetOrderInitGenesis", moduleNames) + m.assertNoForgottenModules("SetOrderInitGenesis", moduleNames) m.OrderInitGenesis = moduleNames } // SetOrderExportGenesis sets the order of export genesis calls func (m *Manager) SetOrderExportGenesis(moduleNames ...string) { - m.checkForgottenModules("SetOrderExportGenesis", moduleNames) + m.assertNoForgottenModules("SetOrderExportGenesis", moduleNames) m.OrderExportGenesis = moduleNames } // SetOrderBeginBlockers sets the order of set begin-blocker calls func (m *Manager) SetOrderBeginBlockers(moduleNames ...string) { - m.checkForgottenModules("SetOrderBeginBlockers", moduleNames) + m.assertNoForgottenModules("SetOrderBeginBlockers", moduleNames) m.OrderBeginBlockers = moduleNames } // SetOrderEndBlockers sets the order of set end-blocker calls func (m *Manager) SetOrderEndBlockers(moduleNames ...string) { - m.checkForgottenModules("SetOrderEndBlockers", moduleNames) + m.assertNoForgottenModules("SetOrderEndBlockers", moduleNames) m.OrderEndBlockers = moduleNames } +// SetOrderMigrations sets the order of migrations to be run. If not set +// then migrations will be run with an order defined in `DefaultMigrationsOrder`. +func (m *Manager) SetOrderMigrations(moduleNames ...string) { + m.assertNoForgottenModules("SetOrderMigrations", moduleNames) + m.OrderMigrations = moduleNames +} + // RegisterInvariants registers all module invariants func (m *Manager) RegisterInvariants(ir sdk.InvariantRegistry) { for _, module := range m.Modules { @@ -345,24 +353,29 @@ func (m *Manager) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) map[string return genesisData } -// checkForgottenModules checks that we didn't forget any modules in the +// assertNoForgottenModules checks that we didn't forget any modules in the // SetOrder* functions. -func (m *Manager) checkForgottenModules(setOrderFnName string, moduleNames []string) { - setOrderMap := map[string]struct{}{} +func (m *Manager) assertNoForgottenModules(setOrderFnName string, moduleNames []string) { + ms := make(map[string]bool) for _, m := range moduleNames { - setOrderMap[m] = struct{}{} + ms[m] = true } - - if len(setOrderMap) != len(m.Modules) { - panic(fmt.Sprintf("got %d modules in the module manager, but %d modules in %s", len(m.Modules), len(setOrderMap), setOrderFnName)) + var missing []string + for m := range m.Modules { + if !ms[m] { + missing = append(missing, m) + } + } + if len(missing) != 0 { + panic(fmt.Sprintf( + "%s: all modules must be defined when setting SetOrderMigrations, missing: %v", setOrderFnName, missing)) } } // MigrationHandler is the migration function that each module registers. type MigrationHandler func(sdk.Context) error -// VersionMap is a map of moduleName -> version, where version denotes the -// version from which we should perform the migration for each module. +// VersionMap is a map of moduleName -> version type VersionMap map[string]uint64 // RunMigrations performs in-place store migrations for all modules. This @@ -389,6 +402,9 @@ type VersionMap map[string]uint64 // `InitGenesis` on that module. // - return the `updatedVM` to be persisted in the x/upgrade's store. // +// Migrations are run in an order defined by `Manager.OrderMigrations` or (if not set) defined by +// `DefaultMigrationsOrder` function. +// // As an app developer, if you wish to skip running InitGenesis for your new // module "foo", you need to manually pass a `fromVM` argument to this function // foo's module version set to its latest ConsensusVersion. That way, the diff @@ -415,19 +431,13 @@ func (m Manager) RunMigrations(ctx sdk.Context, cfg Configurator, fromVM Version if !ok { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "expected %T, got %T", configurator{}, cfg) } - - updatedVM := make(VersionMap) - // for deterministic iteration order - // (as some migrations depend on other modules - // and the order of executing migrations matters) - // TODO: make the order user-configurable? - sortedModNames := make([]string, 0, len(m.Modules)) - for key := range m.Modules { - sortedModNames = append(sortedModNames, key) + var modules = m.OrderMigrations + if modules == nil { + modules = DefaultMigrationsOrder(m.ModuleNames()) } - sort.Strings(sortedModNames) - for _, moduleName := range sortedModNames { + updatedVM := VersionMap{} + for _, moduleName := range modules { module := m.Modules[moduleName] fromVersion, exists := fromVM[moduleName] toVersion := module.ConsensusVersion() @@ -514,3 +524,35 @@ func (m *Manager) GetVersionMap() VersionMap { return vermap } + +// ModuleNames returns list of all module names, without any particular order. +func (m *Manager) ModuleNames() []string { + ms := make([]string, len(m.Modules)) + i := 0 + for m := range m.Modules { + ms[i] = m + i++ + } + return ms +} + +// DefaultMigrationsOrder returns a default migrations order: ascending alphabetical by module name, +// except x/auth which will run last, see: +// https://github.com/cosmos/cosmos-sdk/issues/10591 +func DefaultMigrationsOrder(modules []string) []string { + const authName = "auth" + out := make([]string, 0, len(modules)) + hasAuth := false + for _, m := range modules { + if m == authName { + hasAuth = true + } else { + out = append(out, m) + } + } + sort.Strings(out) + if hasAuth { + out = append(out, authName) + } + return out +} diff --git a/types/module/module_int_test.go b/types/module/module_int_test.go new file mode 100644 index 00000000000..3301a9926d6 --- /dev/null +++ b/types/module/module_int_test.go @@ -0,0 +1,57 @@ +package module + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/suite" +) + +func TestModuleIntSuite(t *testing.T) { + suite.Run(t, new(TestSuite)) +} + +type TestSuite struct { + suite.Suite +} + +func (s TestSuite) TestAssertNoForgottenModules() { + m := Manager{ + Modules: map[string]AppModule{"a": nil, "b": nil}, + } + tcs := []struct { + name string + positive bool + modules []string + }{ + {"same modules", true, []string{"a", "b"}}, + {"more modules", true, []string{"a", "b", "c"}}, + } + + for _, tc := range tcs { + if tc.positive { + m.assertNoForgottenModules("x", tc.modules) + } else { + s.Panics(func() { m.assertNoForgottenModules("x", tc.modules) }) + } + } +} + +func (s TestSuite) TestModuleNames() { + m := Manager{ + Modules: map[string]AppModule{"a": nil, "b": nil}, + } + ms := m.ModuleNames() + sort.Strings(ms) + s.Require().Equal([]string{"a", "b"}, ms) +} + +func (s TestSuite) TestDefaultMigrationsOrder() { + require := s.Require() + require.Equal( + []string{"auth2", "d", "z", "auth"}, + DefaultMigrationsOrder([]string{"d", "auth", "auth2", "z"}), "alphabetical, but auth should be last") + require.Equal( + []string{"auth2", "d", "z"}, + DefaultMigrationsOrder([]string{"d", "auth2", "z"}), "alphabetical") +} From ce70bd8c7f52389be5540522842a209faa194e89 Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:37:35 +0530 Subject: [PATCH 2/7] chore: fix group events proto (#10892) ## Description Closes: #XXXX --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- proto/cosmos/group/v1beta1/events.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/proto/cosmos/group/v1beta1/events.proto b/proto/cosmos/group/v1beta1/events.proto index 9b59e4744cf..18289d4559d 100644 --- a/proto/cosmos/group/v1beta1/events.proto +++ b/proto/cosmos/group/v1beta1/events.proto @@ -25,7 +25,6 @@ message EventCreateGroupPolicy { // address is the account address of the group policy. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - ; } // EventUpdateGroupPolicy is an event emitted when a group policy is updated. @@ -33,7 +32,6 @@ message EventUpdateGroupPolicy { // address is the account address of the group policy. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - ; } // EventCreateProposal is an event emitted when a proposal is created. From a7c09a3278613a2c383968e73ee36150245cbdc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:21:47 +0100 Subject: [PATCH 3/7] build(deps): Bump technote-space/get-diff-action from 5 to 6.0.1 (#10889) Bumps [technote-space/get-diff-action](https://github.com/technote-space/get-diff-action) from 5 to 6.0.1. - [Release notes](https://github.com/technote-space/get-diff-action/releases) - [Changelog](https://github.com/technote-space/get-diff-action/blob/main/.releasegarc) - [Commits](https://github.com/technote-space/get-diff-action/compare/v5...v6.0.1) --- updated-dependencies: - dependency-name: technote-space/get-diff-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marko --- .github/workflows/atlas.yml | 6 +++--- .github/workflows/lint.yml | 2 +- .github/workflows/proto.yml | 4 ++-- .github/workflows/sims.yml | 8 ++++---- .github/workflows/test.yml | 14 +++++++------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/atlas.yml b/.github/workflows/atlas.yml index 861ef811007..bbb96aa424c 100644 --- a/.github/workflows/atlas.yml +++ b/.github/workflows/atlas.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e8a1fc0b347..e108e2e0df8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-go@v2.1.5 with: go-version: 1.17 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 4ec3b07b2ae..1ddbf009764 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -10,7 +10,7 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@master - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | **/**.proto @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | **/**.proto diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index e2be5134ee5..d69d53fa671 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -46,7 +46,7 @@ jobs: go-version: 1.17 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | **/**.go @@ -72,7 +72,7 @@ jobs: go-version: 1.17 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: SUFFIX_FILTER: | **/**.go @@ -100,7 +100,7 @@ jobs: go-version: 1.17 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: SUFFIX_FILTER: | **/**.go @@ -128,7 +128,7 @@ jobs: go-version: 1.17 - name: Display go version run: go version - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: SUFFIX_FILTER: | **/**.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3a54fb9616..c31f91ef825 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-go@v2.1.5 with: go-version: 1.17 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | @@ -54,7 +54,7 @@ jobs: - uses: actions/setup-go@v2.1.5 with: go-version: 1.17 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | @@ -108,7 +108,7 @@ jobs: - uses: actions/setup-go@v2.1.5 with: go-version: 1.17 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | **/**.go @@ -132,7 +132,7 @@ jobs: needs: tests steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | **/**.go @@ -190,7 +190,7 @@ jobs: - uses: actions/setup-go@v2.1.5 with: go-version: 1.17 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | **/**.go @@ -214,7 +214,7 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v2 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | @@ -234,7 +234,7 @@ jobs: - uses: actions/setup-go@v2.1.5 with: go-version: 1.17 - - uses: technote-space/get-diff-action@v5 + - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: PATTERNS: | From b5477dfee9e0785fe651fc603ca53f72a34d9bfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:02:42 +0100 Subject: [PATCH 4/7] build(deps): Bump amannn/action-semantic-pull-request (#10888) Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 3.5.0 to 3.6.0. - [Release notes](https://github.com/amannn/action-semantic-pull-request/releases) - [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/master/CHANGELOG.md) - [Commits](https://github.com/amannn/action-semantic-pull-request/compare/v3.5.0...v3.6.0) --- updated-dependencies: - dependency-name: amannn/action-semantic-pull-request dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 599b3622034..330cd199559 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -11,6 +11,6 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v3.5.0 + - uses: amannn/action-semantic-pull-request@v3.6.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 60a0935d608073057c42317aaca8a0f1ea9ffd9f Mon Sep 17 00:00:00 2001 From: Sai Kumar <17549398+gsk967@users.noreply.github.com> Date: Thu, 6 Jan 2022 18:45:22 +0530 Subject: [PATCH 5/7] fix(cli): reset the app data (#10882) ## Description This pull request will contain the fix for reset the app data Closes: #10881 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- server/tm_cmds.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 5398113a6cc..89638087811 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -130,7 +130,7 @@ func UnsafeResetAllCmd() *cobra.Command { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config - tcmd.ResetAll(cfg.DBDir(), cfg.P2P.AddrBookFile(), cfg.PrivValidator.Key, cfg.PrivValidator.State, serverCtx.Logger) + tcmd.ResetAll(cfg.DBDir(), cfg.P2P.AddrBookFile(), cfg.PrivValidator.KeyFile(), cfg.PrivValidator.StateFile(), serverCtx.Logger) return nil }, } From aaa61e35298109cb8214b8e06538be7b25a5620b Mon Sep 17 00:00:00 2001 From: likhita-809 <78951027+likhita-809@users.noreply.github.com> Date: Thu, 6 Jan 2022 21:59:46 +0530 Subject: [PATCH 6/7] feat: Add timestamp to group, group policy and member (#10883) ## Description Closes: #10668 There is currently no timestamp in GroupInfo, GroupAccountInfo, or Member. Add created_at for groups and group policies. Add added_at for members. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- proto/cosmos/group/v1beta1/types.proto | 9 + x/group/go.sum | 11 - x/group/keeper/keeper_test.go | 43 ++- x/group/keeper/msg_server.go | 3 + x/group/types.go | 13 +- x/group/types.pb.go | 357 ++++++++++++++++++------- 6 files changed, 311 insertions(+), 125 deletions(-) diff --git a/proto/cosmos/group/v1beta1/types.proto b/proto/cosmos/group/v1beta1/types.proto index a6a17b84eb3..e6a33568d64 100644 --- a/proto/cosmos/group/v1beta1/types.proto +++ b/proto/cosmos/group/v1beta1/types.proto @@ -22,6 +22,9 @@ message Member { // metadata is any arbitrary metadata to attached to the member. bytes metadata = 3; + + // added_at is a timestamp specifying when a member was added. + google.protobuf.Timestamp added_at = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // Members defines a repeated slice of Member objects. @@ -86,6 +89,9 @@ message GroupInfo { // total_weight is the sum of the group members' weights. string total_weight = 5; + + // created_at is a timestamp specifying when a group was created. + google.protobuf.Timestamp created_at = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // GroupMember represents the relationship between a group and a member. @@ -121,6 +127,9 @@ message GroupPolicyInfo { // decision_policy specifies the group policy's decision policy. google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "DecisionPolicy"]; + + // created_at is a timestamp specifying when a group policy was created. + google.protobuf.Timestamp created_at = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // Proposal defines a group proposal. Any member of a group can submit a proposal diff --git a/x/group/go.sum b/x/group/go.sum index bc6d4cb6786..302d22780a2 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -313,7 +313,6 @@ github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFM github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= @@ -526,8 +525,6 @@ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9 github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 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= @@ -636,7 +633,6 @@ github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBt github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= @@ -730,7 +726,6 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= github.com/jhump/protoreflect v1.10.1 h1:iH+UZfsbRE6vpyZH7asAjTPWJf7RJbpZ9j/N3lDlKs0= -github.com/jhump/protoreflect v1.10.1/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -955,7 +950,6 @@ github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.2.3/go.mod h1:bhIX678Nx8inLM9PbpvK1yv6oGtoP8BfaIeMzgBNKvc= github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= -github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nishanths/predeclared v0.2.1/go.mod h1:HvkGJcA3naj4lOwnFXFDkFxVtSqQMB9sbB1usJ+xjQE= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -1138,7 +1132,6 @@ github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0K github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= @@ -1638,7 +1631,6 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211113001501-0c823b97ae02/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= @@ -1728,7 +1720,6 @@ golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1737,7 +1728,6 @@ golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200630154851-b2d8b0336632/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200706234117-b22de6825cf7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1921,7 +1911,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index 86a58056073..4d6b6bc52c5 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -93,10 +93,12 @@ func (s *TestSuite) TestCreateGroup() { Address: addr5.String(), Weight: "1", Metadata: nil, + AddedAt: s.blockTime, }, { Address: addr6.String(), Weight: "2", Metadata: nil, + AddedAt: s.blockTime, }} expGroups := []*group.GroupInfo{ @@ -106,6 +108,7 @@ func (s *TestSuite) TestCreateGroup() { Admin: addr1.String(), TotalWeight: "3", Metadata: nil, + CreatedAt: s.blockTime, }, { GroupId: 2, @@ -113,6 +116,7 @@ func (s *TestSuite) TestCreateGroup() { Admin: addr1.String(), TotalWeight: "3", Metadata: nil, + CreatedAt: s.blockTime, }, } @@ -205,6 +209,7 @@ func (s *TestSuite) TestCreateGroup() { s.Assert().Equal(members[i].Metadata, loadedMembers[i].Member.Metadata) s.Assert().Equal(members[i].Address, loadedMembers[i].Member.Address) s.Assert().Equal(members[i].Weight, loadedMembers[i].Member.Weight) + s.Assert().Equal(members[i].AddedAt, loadedMembers[i].Member.AddedAt) s.Assert().Equal(id, loadedMembers[i].GroupId) } @@ -219,6 +224,7 @@ func (s *TestSuite) TestCreateGroup() { s.Assert().Equal(spec.expGroups[i].TotalWeight, loadedGroups[i].TotalWeight) s.Assert().Equal(spec.expGroups[i].GroupId, loadedGroups[i].GroupId) s.Assert().Equal(spec.expGroups[i].Version, loadedGroups[i].Version) + s.Assert().Equal(spec.expGroups[i].CreatedAt, loadedGroups[i].CreatedAt) } }) } @@ -236,6 +242,7 @@ func (s *TestSuite) TestUpdateGroupAdmin() { Address: addr1.String(), Weight: "1", Metadata: nil, + AddedAt: s.blockTime, }} oldAdmin := addr2.String() newAdmin := addr3.String() @@ -263,6 +270,7 @@ func (s *TestSuite) TestUpdateGroupAdmin() { Metadata: nil, TotalWeight: "1", Version: 2, + CreatedAt: s.blockTime, }, }, "with wrong admin": { @@ -278,6 +286,7 @@ func (s *TestSuite) TestUpdateGroupAdmin() { Metadata: nil, TotalWeight: "1", Version: 1, + CreatedAt: s.blockTime, }, }, "with unknown groupID": { @@ -293,6 +302,7 @@ func (s *TestSuite) TestUpdateGroupAdmin() { Metadata: nil, TotalWeight: "1", Version: 1, + CreatedAt: s.blockTime, }, }, } @@ -339,6 +349,7 @@ func (s *TestSuite) TestUpdateGroupMetadata() { Metadata: []byte{1, 2, 3}, TotalWeight: "3", Version: 2, + CreatedAt: s.blockTime, }, }, "with wrong admin": { @@ -354,6 +365,7 @@ func (s *TestSuite) TestUpdateGroupMetadata() { Metadata: nil, TotalWeight: "1", Version: 1, + CreatedAt: s.blockTime, }, }, "with unknown groupid": { @@ -369,6 +381,7 @@ func (s *TestSuite) TestUpdateGroupMetadata() { Metadata: nil, TotalWeight: "1", Version: 1, + CreatedAt: s.blockTime, }, }, } @@ -438,6 +451,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "3", Version: 2, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { @@ -474,6 +488,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "2", Version: 2, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { @@ -501,6 +516,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "1", Version: 2, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { @@ -535,6 +551,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "1", Version: 2, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, @@ -561,6 +578,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "0", Version: 2, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{}, }, @@ -581,6 +599,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "1", Version: 1, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, @@ -608,6 +627,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "1", Version: 1, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, @@ -634,6 +654,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Metadata: nil, TotalWeight: "1", Version: 1, + CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, @@ -817,6 +838,7 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { Metadata: nil, Version: 2, DecisionPolicy: nil, + CreatedAt: s.blockTime, }, expErr: true, }, @@ -833,6 +855,7 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { Metadata: nil, Version: 2, DecisionPolicy: nil, + CreatedAt: s.blockTime, }, expErr: true, }, @@ -849,6 +872,7 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { Metadata: nil, Version: 2, DecisionPolicy: nil, + CreatedAt: s.blockTime, }, expErr: false, }, @@ -927,6 +951,7 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { Metadata: []byte("hello"), Version: 2, DecisionPolicy: nil, + CreatedAt: s.blockTime, }, expErr: false, }, @@ -1000,6 +1025,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { Metadata: nil, Version: 2, DecisionPolicy: nil, + CreatedAt: s.blockTime, }, expErr: false, }, @@ -1066,11 +1092,12 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { s.Require().NoError(err) expectAcc := &group.GroupPolicyInfo{ - Address: res.Address, - Admin: admin.String(), - Metadata: nil, - GroupId: myGroupID, - Version: uint64(1), + Address: res.Address, + Admin: admin.String(), + Metadata: nil, + GroupId: myGroupID, + Version: uint64(1), + CreatedAt: s.blockTime, } err = expectAcc.SetDecisionPolicy(policies[i]) s.Require().NoError(err) @@ -1093,6 +1120,7 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { s.Assert().Equal(policyAccs[i].Admin, expectAccs[i].Admin) s.Assert().Equal(policyAccs[i].Metadata, expectAccs[i].Metadata) s.Assert().Equal(policyAccs[i].Version, expectAccs[i].Version) + s.Assert().Equal(policyAccs[i].CreatedAt, expectAccs[i].CreatedAt) s.Assert().Equal(policyAccs[i].GetDecisionPolicy(), expectAccs[i].GetDecisionPolicy()) } @@ -1111,6 +1139,7 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { s.Assert().Equal(policyAccs[i].Admin, expectAccs[i].Admin) s.Assert().Equal(policyAccs[i].Metadata, expectAccs[i].Metadata) s.Assert().Equal(policyAccs[i].Version, expectAccs[i].Version) + s.Assert().Equal(policyAccs[i].CreatedAt, expectAccs[i].CreatedAt) s.Assert().Equal(policyAccs[i].GetDecisionPolicy(), expectAccs[i].GetDecisionPolicy()) } } @@ -1349,8 +1378,8 @@ func (s *TestSuite) TestVote() { addr4 := addrs[3] addr5 := addrs[4] members := []group.Member{ - {Address: addr4.String(), Weight: "1"}, - {Address: addr3.String(), Weight: "2"}, + {Address: addr4.String(), Weight: "1", AddedAt: s.blockTime}, + {Address: addr3.String(), Weight: "2", AddedAt: s.blockTime}, } groupRes, err := s.keeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ Admin: addr1.String(), diff --git a/x/group/keeper/msg_server.go b/x/group/keeper/msg_server.go index 1bac956e835..745dbb271b6 100644 --- a/x/group/keeper/msg_server.go +++ b/x/group/keeper/msg_server.go @@ -65,6 +65,7 @@ func (k Keeper) CreateGroup(goCtx context.Context, req *group.MsgCreateGroup) (* Metadata: metadata, Version: 1, TotalWeight: totalWeight.String(), + CreatedAt: ctx.BlockTime(), } groupID, err := k.groupTable.Create(ctx.KVStore(k.key), groupInfo) if err != nil { @@ -80,6 +81,7 @@ func (k Keeper) CreateGroup(goCtx context.Context, req *group.MsgCreateGroup) (* Address: m.Address, Weight: m.Weight, Metadata: m.Metadata, + AddedAt: ctx.BlockTime(), }, }) if err != nil { @@ -291,6 +293,7 @@ func (k Keeper) CreateGroupPolicy(goCtx context.Context, req *group.MsgCreateGro metadata, 1, policy, + ctx.BlockTime(), ) if err != nil { return nil, err diff --git a/x/group/types.go b/x/group/types.go index 25553db6e94..7c28e3ec175 100644 --- a/x/group/types.go +++ b/x/group/types.go @@ -122,13 +122,14 @@ var _ orm.Validateable = GroupPolicyInfo{} // NewGroupPolicyInfo creates a new GroupPolicyInfo instance func NewGroupPolicyInfo(address sdk.AccAddress, group uint64, admin sdk.AccAddress, metadata []byte, - version uint64, decisionPolicy DecisionPolicy) (GroupPolicyInfo, error) { + version uint64, decisionPolicy DecisionPolicy, createdAt time.Time) (GroupPolicyInfo, error) { p := GroupPolicyInfo{ - Address: address.String(), - GroupId: group, - Admin: admin.String(), - Metadata: metadata, - Version: version, + Address: address.String(), + GroupId: group, + Admin: admin.String(), + Metadata: metadata, + Version: version, + CreatedAt: createdAt, } err := p.SetDecisionPolicy(decisionPolicy) diff --git a/x/group/types.pb.go b/x/group/types.pb.go index cd28b96506e..39ded0a0578 100644 --- a/x/group/types.pb.go +++ b/x/group/types.pb.go @@ -188,6 +188,8 @@ type Member struct { Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` // metadata is any arbitrary metadata to attached to the member. Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // added_at is a timestamp specifying when a member was added. + AddedAt time.Time `protobuf:"bytes,4,opt,name=added_at,json=addedAt,proto3,stdtime" json:"added_at"` } func (m *Member) Reset() { *m = Member{} } @@ -244,6 +246,13 @@ func (m *Member) GetMetadata() []byte { return nil } +func (m *Member) GetAddedAt() time.Time { + if m != nil { + return m.AddedAt + } + return time.Time{} +} + // Members defines a repeated slice of Member objects. type Members struct { // members is the list of members. @@ -361,6 +370,8 @@ type GroupInfo struct { Version uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` // total_weight is the sum of the group members' weights. TotalWeight string `protobuf:"bytes,5,opt,name=total_weight,json=totalWeight,proto3" json:"total_weight,omitempty"` + // created_at is a timestamp specifying when a group was created. + CreatedAt time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"` } func (m *GroupInfo) Reset() { *m = GroupInfo{} } @@ -431,6 +442,13 @@ func (m *GroupInfo) GetTotalWeight() string { return "" } +func (m *GroupInfo) GetCreatedAt() time.Time { + if m != nil { + return m.CreatedAt + } + return time.Time{} +} + // GroupMember represents the relationship between a group and a member. type GroupMember struct { // group_id is the unique ID of the group. @@ -501,6 +519,8 @@ type GroupPolicyInfo struct { Version uint64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` // decision_policy specifies the group policy's decision policy. DecisionPolicy *types.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` + // created_at is a timestamp specifying when a group policy was created. + CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"` } func (m *GroupPolicyInfo) Reset() { *m = GroupPolicyInfo{} } @@ -753,87 +773,90 @@ func init() { func init() { proto.RegisterFile("cosmos/group/v1beta1/types.proto", fileDescriptor_e091dfce5c49c8b6) } var fileDescriptor_e091dfce5c49c8b6 = []byte{ - // 1278 bytes of a gzipped FileD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fb, 0x8c, 0x4e, 0x54, 0xc1, 0x12, 0x1d, 0xe5, 0xf1, - 0x8c, 0x8d, 0xb6, 0x20, 0x39, 0xf4, 0xfb, 0x7e, 0x71, 0x85, 0x9d, 0xd6, 0x73, 0xe7, 0x5f, 0x63, - 0x88, 0xca, 0x23, 0x09, 0x52, 0x5c, 0x55, 0xb4, 0x03, 0x48, 0x37, 0xea, 0x46, 0x47, 0xef, 0x76, - 0x5a, 0xfa, 0xa1, 0xaa, 0x34, 0xf7, 0x9b, 0xea, 0x5e, 0x21, 0x56, 0x5a, 0x9f, 0x4c, 0xe5, 0x37, - 0xa2, 0xcc, 0x1c, 0xdb, 0x74, 0x4f, 0xcc, 0x81, 0x63, 0xa3, 0x1d, 0x28, 0x08, 0x8a, 0xde, 0x69, - 0xdc, 0x68, 0x1a, 0x86, 0xba, 0x57, 0x90, 0x4a, 0x1b, 0x93, 0xa9, 0x7c, 0x7e, 0x96, 0xa0, 0x47, - 0xb3, 0x84, 0xde, 0x81, 0x15, 0x41, 0x51, 0x0e, 0xda, 0xba, 0xba, 0x57, 0x88, 0x97, 0x8a, 0x93, - 0xa9, 0xbc, 0x36, 0x8b, 0x57, 0x06, 0xc4, 0xc7, 0x36, 0xda, 0x86, 0xbc, 0x00, 0xd7, 0x1b, 0x6d, - 0x2d, 0x8c, 0x9e, 0x98, 0x57, 0x4e, 0xbd, 0x47, 0x3c, 0x8a, 0xed, 0x52, 0xf2, 0xce, 0xfd, 0x72, - 0xac, 0xf2, 0xbb, 0x04, 0x29, 0xa1, 0xc3, 0x0e, 0x20, 0x4d, 0xd5, 0x3b, 0x07, 0xc6, 0xa2, 0x96, - 0x38, 0x36, 0x6a, 0xe9, 0x83, 0x67, 0x28, 0xfb, 0xcd, 0x56, 0xfd, 0xa0, 0x79, 0x93, 0x35, 0x75, - 0x71, 0x32, 0x95, 0xd7, 0x67, 0x29, 0x1d, 0xf7, 0x96, 0xe3, 0x9a, 0x03, 0xe7, 0x3b, 0x6c, 0xa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e, 0x0c, 0x00, 0x00, + // 1321 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4d, 0x6f, 0xdb, 0xc6, + 0x16, 0x15, 0x25, 0x59, 0x1f, 0x57, 0xb6, 0x2c, 0x0c, 0xfc, 0x12, 0x59, 0x4e, 0x64, 0x46, 0x79, + 0x0f, 0x30, 0xde, 0x83, 0xa5, 0x67, 0xf7, 0x63, 0x11, 0x34, 0x69, 0x29, 0x9a, 0x4e, 0x55, 0x38, + 0x92, 0x4b, 0x4a, 0x6e, 0x9b, 0x45, 0x05, 0x8a, 0x9c, 0xc8, 0x6c, 0x25, 0x8e, 0x40, 0x8e, 0xdc, + 0xa8, 0xbf, 0x20, 0xd5, 0x2a, 0xcb, 0x76, 0x21, 0x20, 0x40, 0x17, 0x5d, 0x17, 0xc8, 0x8f, 0x08, + 0xba, 0x0a, 0xba, 0x2a, 0xba, 0x68, 0x8b, 0x64, 0x93, 0x75, 0xd1, 0x1f, 0x50, 0x70, 0x66, 0x18, + 0x87, 0x89, 0xa2, 0xc4, 0x41, 0x57, 0xe6, 0xcc, 0x9c, 0x73, 0xe7, 0x9e, 0x7b, 0xae, 0x67, 0x46, + 0x20, 0x5b, 0xc4, 0x1f, 0x12, 0xbf, 0xd6, 0xf7, 0xc8, 0x78, 0x54, 0x3b, 0xd9, 0xe9, 0x61, 0x6a, + 0xee, 0xd4, 0xe8, 0x64, 0x84, 0xfd, 0xea, 0xc8, 0x23, 0x94, 0xa0, 0x35, 0x8e, 0xa8, 0x32, 0x44, + 0x55, 0x20, 0x4a, 0x6b, 0x7d, 0xd2, 0x27, 0x0c, 0x50, 0x0b, 0xbe, 0x38, 0xb6, 0x54, 0xee, 0x13, + 0xd2, 0x1f, 0xe0, 0x1a, 0x1b, 0xf5, 0xc6, 0xb7, 0x6a, 0xf6, 0xd8, 0x33, 0xa9, 0x43, 0x5c, 0xb1, + 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97, 0x63, 0x0f, 0x1f, 0x97, 0x63, 0xbf, 0x3c, 0x2e, 0xc7, 0x6e, 0xfe, + 0xbb, 0xef, 0xd0, 0xe3, 0x71, 0xaf, 0x6a, 0x91, 0xa1, 0xf8, 0xa9, 0x20, 0xfe, 0x6c, 0xfb, 0xf6, + 0x97, 0xb5, 0xdb, 0xfc, 0x37, 0x4d, 0x2f, 0xc5, 0x04, 0xbd, 0xf5, 0x77, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xa5, 0xd8, 0x7b, 0xb8, 0xea, 0x0c, 0x00, 0x00, } func (this *GroupPolicyInfo) Equal(that interface{}) bool { @@ -873,6 +896,9 @@ func (this *GroupPolicyInfo) Equal(that interface{}) bool { if !this.DecisionPolicy.Equal(that1.DecisionPolicy) { return false } + if !this.CreatedAt.Equal(that1.CreatedAt) { + return false + } return true } func (m *Member) Marshal() (dAtA []byte, err error) { @@ -895,6 +921,14 @@ func (m *Member) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.AddedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.AddedAt):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintTypes(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x22 if len(m.Metadata) > 0 { i -= len(m.Metadata) copy(dAtA[i:], m.Metadata) @@ -976,12 +1010,12 @@ func (m *ThresholdDecisionPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) - if err1 != nil { - return 0, err1 + n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Timeout):]) + if err2 != nil { + return 0, err2 } - i -= n1 - i = encodeVarintTypes(dAtA, i, uint64(n1)) + i -= n2 + i = encodeVarintTypes(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x12 if len(m.Threshold) > 0 { @@ -1014,6 +1048,14 @@ func (m *GroupInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintTypes(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x32 if len(m.TotalWeight) > 0 { i -= len(m.TotalWeight) copy(dAtA[i:], m.TotalWeight) @@ -1108,6 +1150,14 @@ func (m *GroupPolicyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintTypes(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x3a if m.DecisionPolicy != nil { { size, err := m.DecisionPolicy.MarshalToSizedBuffer(dAtA[:i]) @@ -1193,12 +1243,12 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x60 } - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timeout):]) - if err4 != nil { - return 0, err4 + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timeout, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timeout):]) + if err7 != nil { + return 0, err7 } - i -= n4 - i = encodeVarintTypes(dAtA, i, uint64(n4)) + i -= n7 + i = encodeVarintTypes(dAtA, i, uint64(n7)) i-- dAtA[i] = 0x5a { @@ -1231,12 +1281,12 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x30 } - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmittedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmittedAt):]) - if err6 != nil { - return 0, err6 + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmittedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmittedAt):]) + if err9 != nil { + return 0, err9 } - i -= n6 - i = encodeVarintTypes(dAtA, i, uint64(n6)) + i -= n9 + i = encodeVarintTypes(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x2a if len(m.Proposers) > 0 { @@ -1341,12 +1391,12 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmittedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmittedAt):]) - if err7 != nil { - return 0, err7 + n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.SubmittedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.SubmittedAt):]) + if err10 != nil { + return 0, err10 } - i -= n7 - i = encodeVarintTypes(dAtA, i, uint64(n7)) + i -= n10 + i = encodeVarintTypes(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x2a if len(m.Metadata) > 0 { @@ -1405,6 +1455,8 @@ func (m *Member) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.AddedAt) + n += 1 + l + sovTypes(uint64(l)) return n } @@ -1462,6 +1514,8 @@ func (m *GroupInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) + n += 1 + l + sovTypes(uint64(l)) return n } @@ -1509,6 +1563,8 @@ func (m *GroupPolicyInfo) Size() (n int) { l = m.DecisionPolicy.Size() n += 1 + l + sovTypes(uint64(l)) } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) + n += 1 + l + sovTypes(uint64(l)) return n } @@ -1748,6 +1804,39 @@ func (m *Member) Unmarshal(dAtA []byte) error { m.Metadata = []byte{} } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.AddedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -2133,6 +2222,39 @@ func (m *GroupInfo) Unmarshal(dAtA []byte) error { } m.TotalWeight = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -2460,6 +2582,39 @@ func (m *GroupPolicyInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) From fbcca265b071f2e06d0bbce688c47e5f71ff3755 Mon Sep 17 00:00:00 2001 From: Marko Date: Thu, 6 Jan 2022 18:03:09 +0100 Subject: [PATCH 7/7] chore: remove duplicate abci metrics (#10884) ## Description tendermint add metrics to ABCI level. (https://github.com/tendermint/tendermint/pull/7342). This deduplicates the metrics. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- baseapp/abci.go | 8 -------- docs/core/telemetry.md | 8 -------- 2 files changed, 16 deletions(-) diff --git a/baseapp/abci.go b/baseapp/abci.go index 6954bb7e017..9f9a80b91fc 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -8,7 +8,6 @@ import ( "sort" "strings" "syscall" - "time" "github.com/gogo/protobuf/proto" abci "github.com/tendermint/tendermint/abci/types" @@ -18,7 +17,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx" @@ -137,7 +135,6 @@ func (app *BaseApp) FilterPeerByID(info string) abci.ResponseQuery { // BeginBlock implements the ABCI application interface. func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) { - defer telemetry.MeasureSince(time.Now(), "abci", "begin_block") if app.cms.TracingEnabled() { app.cms.SetTracingContext(sdk.TraceContext( @@ -204,7 +201,6 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg // EndBlock implements the ABCI interface. func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock) { - defer telemetry.MeasureSince(time.Now(), "abci", "end_block") if app.deliverState.ms.TracingEnabled() { app.deliverState.ms = app.deliverState.ms.SetTracingContext(nil).(sdk.CacheMultiStore) @@ -236,7 +232,6 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc // will contain releveant error information. Regardless of tx execution outcome, // the ResponseCheckTx will contain relevant gas execution context. func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { - defer telemetry.MeasureSince(time.Now(), "abci", "check_tx") var mode runTxMode @@ -271,7 +266,6 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { // Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant // gas execution context. func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { - defer telemetry.MeasureSince(time.Now(), "abci", "deliver_tx") var abciRes abci.ResponseDeliverTx defer func() { @@ -306,7 +300,6 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx // against that height and gracefully halt if it matches the latest committed // height. func (app *BaseApp) Commit() (res abci.ResponseCommit) { - defer telemetry.MeasureSince(time.Now(), "abci", "commit") header := app.deliverState.ctx.BlockHeader() retainHeight := app.GetBlockRetentionHeight(header.Height) @@ -410,7 +403,6 @@ func (app *BaseApp) snapshot(height int64) { // Query implements the ABCI interface. It delegates to CommitMultiStore if it // implements Queryable. func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) { - defer telemetry.MeasureSince(time.Now(), "abci", "query") // Add panic recovery for all queries. // ref: https://github.com/cosmos/cosmos-sdk/pull/8039 diff --git a/docs/core/telemetry.md b/docs/core/telemetry.md index 11c31413748..d34ad51ec1d 100644 --- a/docs/core/telemetry.md +++ b/docs/core/telemetry.md @@ -117,14 +117,6 @@ The following examples expose too much cardinality and may not even prove to be | `tx_msg_ibc_recv_packet` | Total number of IBC packets received | packet | counter | | `tx_msg_ibc_acknowledge_packet` | Total number of IBC packets acknowledged | acknowledgement | counter | | `ibc_timeout_packet` | Total number of IBC timeout packets | timeout | counter | -| `abci_check_tx` | Duration of ABCI `CheckTx` | ms | summary | -| `abci_deliver_tx` | Duration of ABCI `DeliverTx` | ms | summary | -| `abci_commit` | Duration of ABCI `Commit` | ms | summary | -| `abci_query` | Duration of ABCI `Query` | ms | summary | -| `abci_begin_block` | Duration of ABCI `BeginBlock` | ms | summary | -| `abci_end_block` | Duration of ABCI `EndBlock` | ms | summary | -| `begin_blocker` | Duration of `BeginBlock` for a given module | ms | summary | -| `end_blocker` | Duration of `EndBlock` for a given module | ms | summary | | `store_iavl_get` | Duration of an IAVL `Store#Get` call | ms | summary | | `store_iavl_set` | Duration of an IAVL `Store#Set` call | ms | summary | | `store_iavl_has` | Duration of an IAVL `Store#Has` call | ms | summary |