-
Notifications
You must be signed in to change notification settings - Fork 124
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
[CORE-824] Implement keeper methods for LimitParams
and DenomCapacity
#877
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,8 @@ import ( | |
feetiersmodule "github.com/dydxprotocol/v4-chain/protocol/x/feetiers" | ||
feetiersmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/keeper" | ||
feetiersmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/feetiers/types" | ||
ibcratelimitmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/keeper" | ||
ibcratelimitmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/ibcratelimit/types" | ||
perpetualsmodule "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals" | ||
perpetualsmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/keeper" | ||
perpetualsmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" | ||
|
@@ -152,6 +154,7 @@ import ( | |
rewardsmodule "github.com/dydxprotocol/v4-chain/protocol/x/rewards" | ||
rewardsmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/rewards/keeper" | ||
rewardsmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/rewards/types" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: remove extra line |
||
sendingmodule "github.com/dydxprotocol/v4-chain/protocol/x/sending" | ||
sendingmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/sending/keeper" | ||
sendingmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/sending/types" | ||
|
@@ -237,6 +240,7 @@ type App struct { | |
IBCKeeper *ibckeeper.Keeper | ||
EvidenceKeeper evidencekeeper.Keeper | ||
TransferKeeper ibctransferkeeper.Keeper | ||
IBCRateLimitKeeper ibcratelimitmodulekeeper.Keeper | ||
FeeGrantKeeper feegrantkeeper.Keeper | ||
ConsensusParamsKeeper consensusparamkeeper.Keeper | ||
|
||
|
@@ -343,6 +347,7 @@ func New( | |
distrtypes.StoreKey, slashingtypes.StoreKey, | ||
govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, | ||
ibcexported.StoreKey, ibctransfertypes.StoreKey, | ||
ibcratelimitmoduletypes.StoreKey, | ||
evidencetypes.StoreKey, | ||
capabilitytypes.StoreKey, | ||
pricesmoduletypes.StoreKey, | ||
|
@@ -533,6 +538,18 @@ func New( | |
transferModule := transfer.NewAppModule(app.TransferKeeper) | ||
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) | ||
|
||
app.IBCRateLimitKeeper = *ibcratelimitmodulekeeper.NewKeeper( | ||
appCodec, | ||
keys[ibcratelimitmoduletypes.StoreKey], | ||
// set the governance and delaymsg module accounts as the authority for conducting upgrades | ||
[]string{ | ||
lib.GovModuleAddress.String(), | ||
delaymsgmoduletypes.ModuleAddress.String(), | ||
}, | ||
) | ||
|
||
// TODO(CORE-834): Add IBCRatelimitKeeper to the IBC transfer stack. | ||
|
||
// Create static IBC router, add transfer route, then set and seal it | ||
ibcRouter := ibcporttypes.NewRouter() | ||
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule) | ||
|
@@ -972,6 +989,7 @@ func New( | |
stakingtypes.ModuleName, | ||
ibcexported.ModuleName, | ||
ibctransfertypes.ModuleName, | ||
ibcratelimitmoduletypes.ModuleName, | ||
authtypes.ModuleName, | ||
banktypes.ModuleName, | ||
govtypes.ModuleName, | ||
|
@@ -1014,6 +1032,7 @@ func New( | |
upgradetypes.ModuleName, | ||
ibcexported.ModuleName, | ||
ibctransfertypes.ModuleName, | ||
ibcratelimitmoduletypes.ModuleName, | ||
consensusparamtypes.ModuleName, | ||
pricesmoduletypes.ModuleName, | ||
assetsmoduletypes.ModuleName, | ||
|
@@ -1052,6 +1071,7 @@ func New( | |
paramstypes.ModuleName, | ||
upgradetypes.ModuleName, | ||
ibctransfertypes.ModuleName, | ||
ibcratelimitmoduletypes.ModuleName, | ||
feegrant.ModuleName, | ||
consensusparamtypes.ModuleName, | ||
pricesmoduletypes.ModuleName, | ||
|
@@ -1087,6 +1107,7 @@ func New( | |
paramstypes.ModuleName, | ||
upgradetypes.ModuleName, | ||
ibctransfertypes.ModuleName, | ||
ibcratelimitmoduletypes.ModuleName, | ||
feegrant.ModuleName, | ||
consensusparamtypes.ModuleName, | ||
pricesmoduletypes.ModuleName, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The review of the new context from the shell scripts indicates that the non-nullable change to the
limiters
field in theLimitParams
message will have significant implications across the Go codebase. The following files and areas are particularly affected:MsgSetLimitParams
struct intx.pb.go
still referencesLimitParams
as a pointer.keeper.go
andkeeper_test.go
contain logic and tests for setting and gettingLimitParams
.params.go
includes aValidate
method forLimitParams
.genesis.pb.go
sets up initialLimitParams
in the genesis state.query.pb.go
involves listingLimitParams
, which may affect marshaling and unmarshaling.Given these findings, it is crucial to ensure that all parts of the codebase that interact with
LimitParams
and itslimiters
field are updated to handle the non-pointer slice correctly.MsgSetLimitParams
intx.pb.go
to reflect the non-pointer nature ofLimitParams
.keeper.go
andkeeper_test.go
for compatibility with the non-nullablelimiters
field.Validate
method inparams.go
for any adjustments needed due to the change.genesis.pb.go
correctly handles the updatedLimitParams
.query.pb.go
to ensure they work with the non-nullablelimiters
field.Analysis chain
The change to make the
limiters
field non-nullable is a significant alteration to the data structure. This will affect the generated Go code, potentially impacting initialization and usage patterns. Ensure that all parts of the codebase that interact withLimitParams
and itslimiters
field are updated to handle the non-pointer slice correctly.