-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 1. Overview This PR upgrades the Quasar chain from Cosmos SDK version 0.47 to version 0.50.x. This includes updating dependencies, modifying import paths, and adjusting the codebase to align with the changes and improvements introduced in the newer SDK version. ## 2. Implementation details Ref for the cosmos-sdk upgrade - https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/UPGRADING.md](https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/UPGRADING.md ## 3. How to test/use TODO. ## 4. Checklist <!-- Checklist for PR author(s). --> - [ ] Does the Readme need to be updated? YES ## 5. Limitations (optional) The upgrade may introduce breaking changes requiring dependent services or module modifications. Extensive testing is needed to ensure compatibility with existing data and user workflows. ## 6. Future Work (optional) <!-- Describe follow up work, if any. --> --------- Co-authored-by: akure <[email protected]> Co-authored-by: Ajaz Ahmed Ansari <[email protected]> Co-authored-by: Ajaz Ahmed <[email protected]> Co-authored-by: Ajaz Ahmed Ansari <[email protected]>
- Loading branch information
1 parent
40cd118
commit e568865
Showing
187 changed files
with
9,448 additions
and
29,115 deletions.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Upgrading Quasar to v3 | ||
|
||
This guide provides instructions for upgrading to specific versions of Quasar. | ||
|
||
## [v3.x](https://github.com/quasar-finance/quasar/releases/tag/v3.0.0) | ||
|
||
### `Binary Name Change` | ||
- This version contains binary name change from `quasarnoded` to `quasard` which requires changes in Cosmovisor settings. | ||
|
||
### `Feemarket Module Addition and Relayer Config Changes` | ||
|
||
- It contains Feemarket module addition with min gas fee. | ||
This needs changes on relayer `gas-prices` to be set equal to params set in feemarket module. | ||
|
||
- Feemarket brings in variable gas depending on past few block usage which in turn will affect the `gas-adjustment` parameter as well. | ||
It should ideally be set to 2 or above. | ||
|
||
### Packages | ||
|
||
New modules added : | ||
- PFM v8 | ||
- Ibc-hooks v8 | ||
- Rate-limiting v8 | ||
- Feemarket v1 | ||
|
||
Updates : | ||
- Wasmd v0.45 to v0.51 | ||
- Wasmvm from v1 to v2 | ||
- Cosmos-SDK from v47.12 to v50.9 | ||
- Ibc-go v7 to ibc-go v8 | ||
- Contains updates of Async ICQ, wasm light clients and capability module. | ||
|
||
Upgrade removes old unused modules : | ||
- `qVesting` | ||
- `qOracle` | ||
- `qTransfer` | ||
|
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package ante | ||
|
||
import ( | ||
errorsmod "cosmossdk.io/errors" | ||
quasarerrors "github.com/quasar-finance/quasar/types/errors" | ||
|
||
"github.com/cosmos/cosmos-sdk/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" | ||
) | ||
|
||
var expeditedPropDecoratorEnabled = true | ||
|
||
// SetExpeditedProposalsEnabled toggles the expedited proposals decorator on/off. | ||
// Should only be used in testing - this is to allow simtests to pass. | ||
func SetExpeditedProposalsEnabled(val bool) { | ||
expeditedPropDecoratorEnabled = val | ||
} | ||
|
||
var expeditedPropsWhitelist = map[string]struct{}{ | ||
"/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": {}, | ||
"/cosmos.upgrade.v1beta1.MsgCancelUpgrade": {}, | ||
} | ||
|
||
// Check if the proposal is whitelisted for expedited voting. | ||
type GovExpeditedProposalsDecorator struct { | ||
cdc codec.BinaryCodec | ||
} | ||
|
||
func NewGovExpeditedProposalsDecorator(cdc codec.BinaryCodec) GovExpeditedProposalsDecorator { | ||
return GovExpeditedProposalsDecorator{ | ||
cdc: cdc, | ||
} | ||
} | ||
|
||
// AnteHandle checks if the proposal is whitelisted for expedited voting. | ||
// Only proposals submitted using "quasard tx gov submit-proposal" can be expedited. | ||
// Legacy proposals submitted using "quasard tx gov submit-legacy-proposal" cannot be marked as expedited. | ||
func (g GovExpeditedProposalsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { | ||
if expeditedPropDecoratorEnabled { | ||
for _, msg := range tx.GetMsgs() { | ||
prop, ok := msg.(*govv1.MsgSubmitProposal) | ||
if !ok { | ||
continue | ||
} | ||
if prop.Expedited { | ||
if err := g.validateExpeditedGovProp(prop); err != nil { | ||
return ctx, err | ||
} | ||
} | ||
} | ||
} | ||
return next(ctx, tx, simulate) | ||
} | ||
|
||
func (g GovExpeditedProposalsDecorator) isWhitelisted(msgType string) bool { | ||
_, ok := expeditedPropsWhitelist[msgType] | ||
return ok | ||
} | ||
|
||
func (g GovExpeditedProposalsDecorator) validateExpeditedGovProp(prop *govv1.MsgSubmitProposal) error { | ||
msgs := prop.GetMessages() | ||
if len(msgs) == 0 { | ||
return quasarerrors.ErrInvalidExpeditedProposal | ||
} | ||
for _, message := range msgs { | ||
// in case of legacy content submitted using govv1.MsgSubmitProposal | ||
if sdkMsg, isLegacy := message.GetCachedValue().(*govv1.MsgExecLegacyContent); isLegacy { | ||
if !g.isWhitelisted(sdkMsg.Content.TypeUrl) { | ||
return errorsmod.Wrapf(quasarerrors.ErrInvalidExpeditedProposal, "invalid Msg type: %s", sdkMsg.Content.TypeUrl) | ||
} | ||
continue | ||
} | ||
if !g.isWhitelisted(message.TypeUrl) { | ||
return errorsmod.Wrapf(quasarerrors.ErrInvalidExpeditedProposal, "invalid Msg type: %s", message.TypeUrl) | ||
} | ||
} | ||
return nil | ||
} |
Oops, something went wrong.