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

Quasar chain uprgade #607

Merged
merged 25 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f562399
SDK47 changes - in progress.
akure Oct 19, 2023
bb97213
SDK47 changes - in progress.
akure Oct 19, 2023
a4bea9b
SDK 47 changes - in progress.
akure Oct 19, 2023
89dcb51
sdk47 changes in progress
akure Nov 1, 2023
34fa3cd
fix: `collect-gentx` cmd (#533)
ajansari95 Nov 2, 2023
50b36fb
SDK 47 - fixed baseapp chain-id
akure Nov 2, 2023
01e719c
SDK 47 - crisis and consensus store key
akure Nov 2, 2023
5bb0efd
SDK 47 - adding upgrade handler
akure Nov 8, 2023
1b7e0c9
WIP : sdk 45 to sdk 47 upgrade and code restructuring.
arhamchordia May 29, 2024
30bdc6b
WIP: Added all the remaining module to normal keeper and removed PFM.
arhamchordia May 30, 2024
3877549
WIP: Moving begin, end and init blocker. Some work on upgrade handler…
arhamchordia Jun 3, 2024
907edfd
WIP: First round of upgrade code testing.
arhamchordia Jun 3, 2024
4b5e1a2
WIP: Working chain upgrade code with minor testing.
arhamchordia Jun 4, 2024
7283e9e
WIP: IBC testing failing due to module upgrade testing.
arhamchordia Jun 28, 2024
d7a975a
WIP : Testing setup for upgrade IBC testing.
arhamchordia Jun 28, 2024
0f35f64
Upgrade code complete. WIP : Tests and utils fixes.
arhamchordia Jul 4, 2024
05561de
Merge branch 'main' into feature/update-sdk47
arhamchordia Jul 4, 2024
a8d0887
Fixed all unit tests, testutil and lint.
arhamchordia Jul 9, 2024
6047ac2
Fixing workflows.
arhamchordia Jul 9, 2024
6a9582e
Merge branch 'main' into feature/update-sdk47
arhamchordia Jul 10, 2024
e491911
Merge branch 'main' into feature/update-sdk47
arhamchordia Jul 15, 2024
0ee381f
Fixing imports and lint issues.
arhamchordia Jul 15, 2024
1732674
Addressing PR comments.
arhamchordia Jul 15, 2024
af7a94d
Addressing PR comments from Stefano.
arhamchordia Jul 15, 2024
4ed0b31
Resolving conflicts.
arhamchordia Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: 1.20.7
go-version: 1.21
arhamchordia marked this conversation as resolved.
Show resolved Hide resolved
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: env.GIT_DIFF
uses: actions/setup-go@v4
with:
go-version: 1.20.7
go-version: 1.21
- name: Display go version
if: env.GIT_DIFF
run: go version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
if: env.GIT_DIFF
uses: actions/setup-go@v3
with:
go-version: 1.20.7
go-version: 1.21
- name: Display go version
if: env.GIT_DIFF
run: go version
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,20 @@ go.sum: go.mod
###############################################################################

proto-all: proto-format proto-gen

BUF_VERSION=1.26.1
BUILDER_VERSION=0.13.5
proto-gen:
@echo "Generating Protobuf files"
@sh ./scripts/protocgen.sh

proto-gen-1:
magiodev marked this conversation as resolved.
Show resolved Hide resolved
@echo "🤖 Generating code from protobuf..."
@echo "PWD is $(PWD)"

@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
ghcr.io/cosmos/proto-builder:$(BUILDER_VERSION) sh ./scripts/protocgen.sh
@echo "✅ Completed code generation!"

proto-doc:
@echo "Generating Protoc docs"
@sh ./scripts/generate-docs.sh
Expand Down
57 changes: 57 additions & 0 deletions ante/ante.go
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
}
Loading
Loading