Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate x/crisis use app wiring #12270

Merged

Conversation

JeancarloBarrios
Copy link
Contributor

@JeancarloBarrios JeancarloBarrios commented Jun 15, 2022

Description

App Wiring for Crisis

Implements: 1/3 of #12194


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 in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • 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 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)

@JeancarloBarrios JeancarloBarrios changed the title Jeancarlo barrios/migrate crisis use app wiring feat: migrate x/crisis use app wiring Jun 15, 2022
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"

Check notice

Code scanning

Sensitive package import

Certain system packages contain functions which may be a possible source of non-determinism
@JeancarloBarrios
Copy link
Contributor Author

JeancarloBarrios commented Jun 16, 2022

The error log for a single test is as follow

suite.go:73: test panicked: kv store with key <nil> has not been registered in stores
        goroutine 11 [running]:
        runtime/debug.Stack()
        	/opt/homebrew/Cellar/go/1.18.3/libexec/src/runtime/debug/stack.go:24 +0x68
        github.com/stretchr/testify/suite.failOnPanic(0x1400062cd00)
        	/Users/jc/go/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:73 +0x40
        panic({0x105ed8280, 0x1400041e720})
        	/opt/homebrew/Cellar/go/1.18.3/libexec/src/runtime/panic.go:838 +0x204
        github.com/cosmos/cosmos-sdk/store/cachemulti.Store.GetKVStore({{0x1061f5bb0, 0x14000c17f40}, 0x14000825b30, 0x14000bf01b0, {0x0, 0x0}, 0x0, 0x14000bf0270}, {0x1061d6fe8, 0x0})
        	/Users/jc/Development/cosmos/cosmos-sdk/store/cachemulti/store.go:192 +0xdc
        github.com/cosmos/cosmos-sdk/types.Context.KVStore({{0x1061eb1d0, 0x1400005a120}, {0x1061f6e18, 0x1400061d580}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, ...}, ...}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/types/context.go:261 +0x64
        github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper.AddPubkey({{_, _}, {_, _}, {_, _}, {_, _}}, {{0x1061eb1d0, 0x1400005a120}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/slashing/keeper/keeper.go:49 +0xd0
        github.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper.AfterValidatorCreated({{_, _}, {_, _}, {_, _}, {_, _}}, {{0x1061eb1d0, 0x1400005a120}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/slashing/keeper/hooks.go:41 +0xf8
        github.com/cosmos/cosmos-sdk/x/slashing/keeper.Hooks.AfterValidatorCreated(...)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/slashing/keeper/hooks.go:74
        github.com/cosmos/cosmos-sdk/x/staking/types.MultiStakingHooks.AfterValidatorCreated({_, _, _}, {{0x1061eb1d0, 0x1400005a120}, {0x1061f6e18, 0x1400061d580}, {{0x0, 0x0}, {0x0, ...}, ...}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/staking/types/hooks.go:18 +0xac
        github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper.AfterValidatorCreated(...)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/staking/keeper/hooks.go:14
        github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper.InitGenesis({{0x1061d6fe8, 0x14000be2790}, {0x12ea92858, 0x14000ba3090}, {0x12ea94198, 0x1400087b810}, {0x12ea941d8, 0x14000019c88}, {0x1061f5b48, 0x1400000e8e8}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/staking/keeper/genesis.go:40 +0x1440
        github.com/cosmos/cosmos-sdk/x/staking.AppModule.InitGenesis({{{_, _}}, _, {_, _}, {_, _}}, {{0x1061eb1d0, 0x1400005a120}, {0x1061f6e18, ...}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/staking/module.go:159 +0xf0
        github.com/cosmos/cosmos-sdk/types/module.(*Manager).InitGenesis(_, {{0x1061eb1d0, 0x1400005a120}, {0x1061f6e18, 0x1400061d580}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, ...}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/types/module/module.go:314 +0x340
        github.com/cosmos/cosmos-sdk/runtime.(*App).InitChainer(_, {{0x1061eb1d0, 0x1400005a120}, {0x1061f6e18, 0x1400061d580}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, ...}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/runtime/app.go:125 +0x10c
        github.com/cosmos/cosmos-sdk/simapp.(*SimApp).InitChainer(_, {{0x1061eb1d0, 0x1400005a120}, {0x1061f6e18, 0x1400061d580}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, ...}, ...}, ...)
        	/Users/jc/Development/cosmos/cosmos-sdk/simapp/app.go:372 +0x198
        github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).InitChain(0x1400014d880, {{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x10701e420, {0x107084f88, 0x0, 0x0}, ...})
        	/Users/jc/Development/cosmos/cosmos-sdk/baseapp/abci.go:69 +0x300
        github.com/cosmos/cosmos-sdk/simapp.SetupWithGenesisValSet(0x1400062cd00, 0x5?, {0x14000bd9308, 0x1, 0x1}, {0x14000848180, 0x1, 0x1})
        	/Users/jc/Development/cosmos/cosmos-sdk/simapp/test_helpers.go:142 +0x1b4
        github.com/cosmos/cosmos-sdk/simapp.Setup(0x1400062cd00, 0x0?)
        	/Users/jc/Development/cosmos/cosmos-sdk/simapp/test_helpers.go:122 +0x32c
        github.com/cosmos/cosmos-sdk/x/upgrade/keeper_test.(*KeeperTestSuite).SetupTest(0x140002c7340)
        	/Users/jc/Development/cosmos/cosmos-sdk/x/upgrade/keeper/keeper_test.go:31 +0x38
        github.com/stretchr/testify/suite.Run.func1(0x1400062cd00)
        	/Users/jc/go/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:158 +0x164
        testing.tRunner(0x1400062cd00, 0x140005c83f0)
        	/opt/homebrew/Cellar/go/1.18.3/libexec/src/testing/testing.go:1439 +0x110
        created by testing.(*T).Run
        	/opt/homebrew/Cellar/go/1.18.3/libexec/src/testing/testing.go:1486 +0x300
--- FAIL: TestKeeperTestSuite (0.01s)
    --- FAIL: TestKeeperTestSuite/TestSoftwareUpgrade (0.01s)

x/crisis/module.go Outdated Show resolved Hide resolved
simapp/app.go Outdated Show resolved Hide resolved
@julienrbrt julienrbrt changed the base branch from main to epic/app-wiring June 29, 2022 13:42
@JeancarloBarrios JeancarloBarrios added the A:automerge Automatically merge PR once all prerequisites pass. label Jun 29, 2022
@julienrbrt julienrbrt removed the A:automerge Automatically merge PR once all prerequisites pass. label Jun 29, 2022
@julienrbrt julienrbrt force-pushed the JeancarloBarrios/migrate_crisis_use_app_wiring branch from 61c2f5a to 1d4f9fe Compare June 29, 2022 14:13
@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #12270 (61c2f5a) into epic/app-wiring (1194321) will decrease coverage by 0.03%.
The diff coverage is 45.94%.

❗ Current head 61c2f5a differs from pull request most recent head d81378e. Consider uploading reports for the commit d81378e to get more accurate results

Impacted file tree graph

@@                 Coverage Diff                 @@
##           epic/app-wiring   #12270      +/-   ##
===================================================
- Coverage            65.67%   65.63%   -0.04%     
===================================================
  Files                  676      676              
  Lines                71429    71434       +5     
===================================================
- Hits                 46911    46889      -22     
- Misses               21878    21906      +28     
+ Partials              2640     2639       -1     
Impacted Files Coverage Δ
simapp/simd/cmd/root.go 69.42% <0.00%> (-1.77%) ⬇️
x/auth/client/testutil/suite.go 93.59% <0.00%> (-0.01%) ⬇️
simapp/test_helpers.go 16.17% <16.66%> (-0.29%) ⬇️
x/auth/client/cli/query.go 1.73% <50.00%> (ø)
x/crisis/keeper/keeper.go 81.81% <71.42%> (ø)
simapp/app.go 75.00% <100.00%> (-1.12%) ⬇️
testutil/network/network.go 57.04% <100.00%> (+0.37%) ⬆️
x/distribution/simulation/operations.go 80.74% <0.00%> (-9.63%) ⬇️
crypto/keys/internal/ecdsa/privkey.go 83.01% <0.00%> (+1.88%) ⬆️

@julienrbrt julienrbrt merged commit 2c8fef0 into epic/app-wiring Jun 29, 2022
@julienrbrt julienrbrt deleted the JeancarloBarrios/migrate_crisis_use_app_wiring branch June 29, 2022 14:41
@github-actions github-actions bot removed the C:x/auth label Jun 29, 2022
@julienrbrt julienrbrt restored the JeancarloBarrios/migrate_crisis_use_app_wiring branch June 29, 2022 15:49
@julienrbrt julienrbrt deleted the JeancarloBarrios/migrate_crisis_use_app_wiring branch June 29, 2022 16:09
@julienrbrt julienrbrt mentioned this pull request Jun 29, 2022
19 tasks
@julienrbrt julienrbrt restored the JeancarloBarrios/migrate_crisis_use_app_wiring branch June 29, 2022 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate x/crisis to use app wiring
4 participants