-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(x/auth): app wiring setup #12019
Conversation
@@ -44,8 +43,6 @@ type App struct { | |||
beginBlockers []func(sdk.Context, abci.RequestBeginBlock) | |||
endBlockers []func(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate | |||
baseAppOptions []BaseAppOption | |||
|
|||
msgServiceRegistrar grpc.Server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer needed and not provided by x/auth
k := keeper.NewAccountKeeper(cdc, key, subspace, types.ProtoBaseAccount, maccPerms, config.Bech32Prefix) | ||
m := NewAppModule(cdc, k, simulation.RandomGenesisAccounts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
types.ProtoBaseAccount
and simulation.RandomGenesisAccounts
are used here always instead of having configuration parameters. I propose that we handle this configuration in a separate PR. See #12055
@@ -231,7 +233,7 @@ func NewSimApp( | |||
runtimeApp := appBuilder.Build(logger, db, traceStore, baseAppOptions...) | |||
|
|||
keys := sdk.NewKVStoreKeys( | |||
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit of an issue here surfaced in tests.
authTypes.Store = "acc"
(not "auth"
), but runtime.ProvideKVStoreKey makes the assumption that storeKey = moduleName
("auth"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... this could be an issue when migrating existing stores. One option is to give the module the name acc in the app config. In general I think the existing practice of hard coding these names is wrong, but we need to cope with how things are currently done too... we'll need to think about this a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two options I can think of:
- Let modules give a store key name, not a huge fan of this
- Let users specify an alternate store key name for a module in the runtime config
Sort of leaning towards 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I favor (2) as well (key overrides)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation of (2) pushed for review in 90759ac
|
||
// module_store_keys is an optional list of overrides for the module store keys | ||
// used in keeper construction. | ||
repeated ModuleStoreKey module_store_keys = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeated ModuleStoreKey module_store_keys = 6; | |
repeated ModuleStoreKey override_store_keys = 6; |
string module_name = 1; | ||
|
||
// the store key to use instead of the module name. | ||
string store_key = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string store_key = 2; | |
string kv_store_key = 2; |
|
||
// ModuleStoreKey may be supplied to override the default module store key, which | ||
// is the module name. | ||
message ModuleStoreKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message ModuleStoreKey { | |
message StoreKeyConfig { |
@@ -397,7 +397,6 @@ func NewSimApp( | |||
app.ModuleManager.RegisterInvariants(&app.CrisisKeeper) | |||
app.ModuleManager.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) | |||
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) | |||
app.ModuleManager.RegisterServices(app.configurator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already called once in runtime/app so removing this call.
* only implement kv store key overrides.
* configurator in runtime/app and create getter fn for tests * refactor test usages of configurator fetching
Codecov Report
@@ Coverage Diff @@
## main #12019 +/- ##
==========================================
+ Coverage 66.06% 66.09% +0.03%
==========================================
Files 671 671
Lines 70924 70936 +12
==========================================
+ Hits 46856 46887 +31
+ Misses 21411 21391 -20
- Partials 2657 2658 +1
|
Description
Ref #11899
After #11924 (this is based on the branch for that PR so the diff will get smaller after that's merged)
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change