-
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 Chain upgrade from sdk45 to sdk47 ## 2. Implementation details Changes made in this PR are mostly on adding few new modules into play and upgrading versions of old dependencies : 1. Wasm bumped from v31 to v45 2. IBC from v4 to v7 3. Wasmvm from 1.2 to 1.5 4. IBC was light client added 5. Cosmos sdk from v45 to v47.12 6. Async ICQ from v4 to v7 7. Tendermint to cometbft 8. and so on... ## 3. How to test/use Testing can be done by running : 1. Compile v1.0.0 or download from tagged versions as `quasarnodedv1` 2. Change directory to `demos/upgrade-handler/v2.0.0` 3. Run upgrade_test.sh. Upgrade test will run the old binary with relayer setup and some IBC connections to Osmosis chain. And then it will perform some pre upgrade transactions and then post the upgrade proposal. Once the desired block height is reached then the setup will automatically stop the old chain and start with new binary. New binary once started, it will be tested using the post_upgrade actions on chain. ## 4. Future Work (optional) 1. Update interchaintest e2e in sdk 50 upgrade 2. Cleanup makefiles 3. Cleanup protos 4. Cleanup unused modules. --------- Co-authored-by: akure <[email protected]> Co-authored-by: Ajaz Ahmed Ansari <[email protected]> Co-authored-by: Ajaz Ahmed <[email protected]>
- Loading branch information
1 parent
3548515
commit 662bd74
Showing
292 changed files
with
6,249 additions
and
3,961 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package ante | ||
|
||
import ( | ||
errorsmod "cosmossdk.io/errors" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
"github.com/cosmos/cosmos-sdk/x/auth/ante" | ||
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" | ||
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" | ||
) | ||
|
||
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC | ||
// channel keeper. | ||
type HandlerOptions struct { | ||
ante.HandlerOptions | ||
Codec codec.BinaryCodec | ||
IBCkeeper *ibckeeper.Keeper | ||
} | ||
|
||
func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { | ||
if opts.AccountKeeper == nil { | ||
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") | ||
} | ||
if opts.BankKeeper == nil { | ||
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") | ||
} | ||
if opts.SignModeHandler == nil { | ||
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for AnteHandler") | ||
} | ||
if opts.IBCkeeper == nil { | ||
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for AnteHandler") | ||
} | ||
|
||
sigGasConsumer := opts.SigGasConsumer | ||
if sigGasConsumer == nil { | ||
sigGasConsumer = ante.DefaultSigVerificationGasConsumer | ||
} | ||
|
||
anteDecorators := []sdk.AnteDecorator{ | ||
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first | ||
ante.NewExtensionOptionsDecorator(opts.ExtensionOptionChecker), | ||
ante.NewValidateBasicDecorator(), | ||
ante.NewTxTimeoutHeightDecorator(), | ||
ante.NewValidateMemoDecorator(opts.AccountKeeper), | ||
ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper), | ||
ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker), | ||
ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators | ||
ante.NewValidateSigCountDecorator(opts.AccountKeeper), | ||
ante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer), | ||
ante.NewSigVerificationDecorator(opts.AccountKeeper, opts.SignModeHandler), | ||
ante.NewIncrementSequenceDecorator(opts.AccountKeeper), | ||
ibcante.NewRedundantRelayDecorator(opts.IBCkeeper), | ||
} | ||
|
||
return sdk.ChainAnteDecorators(anteDecorators...), nil | ||
} |
Oops, something went wrong.