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

sdk 50 #3808

Closed
wants to merge 71 commits into from
Closed

sdk 50 #3808

Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
5475dfb
sdk 50 first go
faddat Jun 9, 2023
429d933
add go workspace
faddat Jun 9, 2023
7b82e42
make proto-gen, cleanup
faddat Jun 9, 2023
0ea95e9
additiona cleanup of imports
faddat Jun 9, 2023
8a22326
updates...
faddat Jun 9, 2023
5da60cb
handle expedited proposal bools
faddat Jun 10, 2023
4580f76
restructure modules
faddat Jun 10, 2023
731dc38
pre revert commit
faddat Jun 10, 2023
5f9b832
Revert "restructure modules"
faddat Jun 10, 2023
d9ddc54
correctly migrate modules
faddat Jun 10, 2023
2f76d3f
migrate parameter store
faddat Jun 10, 2023
8ca6678
fix calls to NewContext
faddat Jun 10, 2023
428c09e
tidy and enable thelper
faddat Jun 10, 2023
fc0e782
use thelper and disable depguard
faddat Jun 10, 2023
1bae599
use latest golangci-lint in ci
faddat Jun 10, 2023
635a62e
upgrade to go 1.20 and newer protobuf builder to reduce v50 changeset
faddat Jun 10, 2023
ac1c6a6
Merge remote-tracking branch 'fork/go1.20' into sdk-50
faddat Jun 10, 2023
3b34fe1
Merge remote-tracking branch 'fork/use-thelper' into sdk-50
faddat Jun 10, 2023
d90ce0b
more cleanup, 5% of tests pass
faddat Jun 10, 2023
e128eba
add go work
faddat Jun 10, 2023
2598fd1
bumps
faddat Jun 10, 2023
20b10e9
bump go in an additional place
faddat Jun 10, 2023
2464581
Merge branch 'go1.20' of https://github.com/faddat/ibc-go into go1.20
faddat Jun 10, 2023
a798db8
set up rootmultistore in the new way and address WrongArgCount lints
faddat Jun 10, 2023
02a7a70
app.go and queries
faddat Jun 10, 2023
b782566
chain.go
faddat Jun 10, 2023
3bbb027
query command in root.go
faddat Jun 10, 2023
bf859e0
context should go first
faddat Jun 10, 2023
66eda5d
Merge branch 'main' into sdk-50
faddat Jun 10, 2023
7ffb56c
additional cleanup, mainly changing method signatures
faddat Jun 11, 2023
e332c3c
Merge branch 'sdk-50' of https://github.com/notional-labs/ibc-go into…
faddat Jun 11, 2023
c234b90
update message signatures and use sdk main branch
faddat Jun 11, 2023
aaaf012
Merge branch 'main' into go1.20
faddat Jun 12, 2023
7308c14
transfer authorization changes
faddat Jun 12, 2023
8279fdd
move go.work.example back
faddat Jun 12, 2023
34f9eb3
bump go version
crodriguezvega Jun 12, 2023
7a0392d
Merge branch 'main' into go1.20
faddat Jun 12, 2023
dd3b04b
use single quotes for the go version
faddat Jun 12, 2023
63c2b18
use sdk 50
sontrinh16 Jun 12, 2023
c8e6213
Merge branch 'main' into go1.20
colin-axner Jun 12, 2023
3d8369a
Merge branch 'main' into go1.20
faddat Jun 12, 2023
71a01df
Revert "use single quotes for the go version"
faddat Jun 12, 2023
c17de1f
use single quotes for real
faddat Jun 12, 2023
77825f9
Merge branch 'go1.20' into sdk-50
faddat Jun 12, 2023
509c18b
tidy
faddat Jun 12, 2023
1e3b686
fix
sontrinh16 Jun 13, 2023
527955c
Merge branch 'sdk-50' of https://github.com/notional-labs/ibc-go into…
sontrinh16 Jun 13, 2023
ed4c730
chore: adding exception to linter config for revive if-return (#3830)
damiannolan Jun 13, 2023
98da595
build(deps): Bump docker/build-push-action from 4.1.0 to 4.1.1 (#3834)
dependabot[bot] Jun 13, 2023
9ee95c9
build(deps): Bump docker/metadata-action from 4.5.0 to 4.6.0 (#3833)
dependabot[bot] Jun 13, 2023
c8017c9
Merge remote-tracking branch 'origin/main' into sdk-50
faddat Jun 13, 2023
0d1fecd
update .gitignore
faddat Jun 13, 2023
447963c
tidies again
faddat Jun 14, 2023
e70280a
fixing
sontrinh16 Jun 14, 2023
6d2dc6a
Merge branch 'sdk-50' of https://github.com/notional-labs/ibc-go into…
sontrinh16 Jun 14, 2023
97a402e
register modulebasicmanager in app.go
faddat Jun 15, 2023
749db69
add module register in app.go
sontrinh16 Jun 15, 2023
fd5367d
Merge branch 'sdk-50' of https://github.com/notional-labs/ibc-go into…
sontrinh16 Jun 15, 2023
55d10b3
fix the upgrade module's return
faddat Jun 15, 2023
df0d6fe
all errors now checked
faddat Jun 15, 2023
f0eaa04
update FinalizeBlock height input
sontrinh16 Jun 15, 2023
5e59727
revert changes to the capability module path
faddat Jun 16, 2023
6e16d62
add circuit breaker
faddat Jun 16, 2023
30e82a8
Begin to use modulebasicmanager
faddat Jun 16, 2023
9fd734d
rename Marshaler to Codec
faddat Jun 16, 2023
f28d925
account for modulebasicmanager
faddat Jun 16, 2023
14bf431
fix setup()
faddat Jun 16, 2023
8ea5264
fix import cycle
faddat Jun 16, 2023
7323ad1
use appcodec for setuptestingapp
faddat Jun 16, 2023
cf9f253
add missing IBCKeeper initialize and remove unused module from module…
sontrinh16 Jun 17, 2023
3d58b82
update SetupWithGenesisValSet func
sontrinh16 Jun 17, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@2c0bd771b40637d97bf205cbccdd294a32112176
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
push: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-test-workflow-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ jobs:
- name: Extract metadata (tags, labels) for Docker
if: ${{ inputs.build-and-push-docker-image }}
id: meta
uses: docker/metadata-action@2c0bd771b40637d97bf205cbccdd294a32112176
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
if: ${{ inputs.build-and-push-docker-image }}
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.52.0
version: v1.53.1
args: --timeout 5m
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@2c0bd771b40637d97bf205cbccdd294a32112176
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
with:
images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
push: true
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ dependency-graph.png
*.history

# Go
go.work
go.work.sum
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
linters:
disable-all: true
enable:
- depguard
- dogsled
- exportloopref
- errcheck
Expand All @@ -20,6 +19,7 @@ linters:
- misspell
- nakedret
- staticcheck
- thelper
- stylecheck
- revive
- typecheck
Expand Down Expand Up @@ -60,3 +60,7 @@ linters-settings:
allow-leading-space: true
require-explanation: false
require-specific: false
revive:
rules:
- name: if-return
disabled: true
2 changes: 2 additions & 0 deletions cmd/build_test_matrix/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ type FeeMiddlewareTestSuite struct {}
}

func assertGithubActionTestMatricesEqual(t *testing.T, expected, actual GithubActionTestMatrix) {
t.Helper()
// sort by both suite and test as the order of the end result does not matter as
// all tests will be run.
sort.SliceStable(expected.Include, func(i, j int) bool {
Expand Down Expand Up @@ -183,6 +184,7 @@ func helper() {}
}

func createFileWithTestSuiteAndTests(t *testing.T, suiteName, fn1Name, fn2Name, dir, filename string) {
t.Helper()
goFileContents := goTestFileContents(suiteName, fn1Name, fn2Name)
err := os.WriteFile(path.Join(dir, filename), []byte(goFileContents), os.FileMode(0o777))
assert.NoError(t, err)
Expand Down
16 changes: 8 additions & 8 deletions docs/migrations/v4-to-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The `AnteDecorator` was actually renamed twice, but in [this PR](https://github.

### Core

The `key` parameter of the `NewKeeper` function in `modules/core/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`):
The `key` parameter of the `NewKeeper` function in `modules/core/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`):

```diff
func NewKeeper(
Expand All @@ -60,7 +60,7 @@ The `RegisterRESTRoutes` function in `modules/core` has been removed.

### ICS03 - Connection

The `key` parameter of the `NewKeeper` function in `modules/core/03-connection/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`):
The `key` parameter of the `NewKeeper` function in `modules/core/03-connection/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`):

```diff
func NewKeeper(
Expand All @@ -85,7 +85,7 @@ The function `NewPacketId` in `modules/core/04-channel/types` has been renamed t
) PacketId
```

The `key` parameter of the `NewKeeper` function in `modules/core/04-channel/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`):
The `key` parameter of the `NewKeeper` function in `modules/core/04-channel/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`):

```diff
func NewKeeper(
Expand All @@ -101,7 +101,7 @@ func NewKeeper(

### ICS20 - Transfer

The `key` parameter of the `NewKeeper` function in `modules/apps/transfer/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`):
The `key` parameter of the `NewKeeper` function in `modules/apps/transfer/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`):

```diff
func NewKeeper(
Expand Down Expand Up @@ -137,7 +137,7 @@ The `key` and `msgRouter` parameters of the `NewKeeper` functions in
- `modules/apps/27-interchain-accounts/controller/keeper`
- and `modules/apps/27-interchain-accounts/host/keeper`

have changed type. The `key` parameter is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`), and the `msgRouter` parameter is now of type `*icatypes.MessageRouter` (where `icatypes` is an import alias for `"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types"`):
have changed type. The `key` parameter is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`), and the `msgRouter` parameter is now of type `*icatypes.MessageRouter` (where `icatypes` is an import alias for `"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types"`):

```diff
// NewKeeper creates a new interchain accounts controller Keeper instance
Expand Down Expand Up @@ -283,7 +283,7 @@ See [ADR-03](../architecture/adr-003-ics27-acknowledgement.md/#next-major-versio

### ICS29 - Fee Middleware

The `key` parameter of the `NewKeeper` function in `modules/apps/29-fee` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`):
The `key` parameter of the `NewKeeper` function in `modules/apps/29-fee` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`):

```diff
func NewKeeper(
Expand Down Expand Up @@ -337,7 +337,7 @@ type StakingKeeper interface {
}
```

- The return type of the function `LastCommitID` has changed to `storetypes.CommitID` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`).
- The return type of the function `LastCommitID` has changed to `storetypes.CommitID` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`).

See the following `git diff` for more details:

Expand Down Expand Up @@ -420,7 +420,7 @@ The `RegisterRESTRoutes` function in `testing/mock` has been removed.

### ICS02 - Client

The `key` parameter of the `NewKeeper` function in `modules/core/02-client/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"github.com/cosmos/cosmos-sdk/store/types"`):
The `key` parameter of the `NewKeeper` function in `modules/core/02-client/keeper` is now of type `storetypes.StoreKey` (where `storetypes` is an import alias for `"cosmossdk.io/store/types"`):

```diff
func NewKeeper(
Expand Down
4 changes: 2 additions & 2 deletions docs/migrations/v5-to-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ package v6

import (
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
storetypes "cosmossdk.io/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
upgradetypes "cosmossdk.io/x/upgrade/types"

v6 "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/controller/migrations/v6"
)
Expand Down
6 changes: 3 additions & 3 deletions e2e/tests/core/02-client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
tmprotoversion "github.com/cometbft/cometbft/proto/tendermint/version"
tmtypes "github.com/cometbft/cometbft/types"
tmversion "github.com/cometbft/cometbft/version"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
test "github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/stretchr/testify/suite"

"github.com/cosmos/cosmos-sdk/client/grpc/ccmtservice"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"

govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
Expand Down Expand Up @@ -204,7 +204,7 @@ func (s *ClientTestSuite) TestClient_Update_Misbehaviour() {
})

t.Run("create validator set", func(t *testing.T) {
var validators []*tmservice.Validator
var validators []*ccmtservice.Validator

t.Run("fetch block header at latest client state height", func(t *testing.T) {
header, err = s.GetBlockHeaderByHeight(ctx, chainB, latestHeight.GetRevisionHeight())
Expand Down Expand Up @@ -367,7 +367,7 @@ func createMaliciousTMHeader(chainID string, blockHeight int64, trustedHeight cl
blockID := ibctesting.MakeBlockID(hhash, 3, tmhash.Sum([]byte(invalidHashValue)))
voteSet := tmtypes.NewVoteSet(chainID, blockHeight, 1, tmproto.PrecommitType, tmValSet)

commit, err := tmtypes.MakeCommit(blockID, blockHeight, 1, voteSet, signers, timestamp)
commit, err := test.MakeCommit(blockID, blockHeight, 1, voteSet, signers, timestamp)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/upgrades/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"time"

sdkmath "cosmossdk.io/math"
upgradetypes "cosmossdk.io/x/upgrade/types"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/gogoproto/proto"
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
interchaintest "github.com/strangelove-ventures/interchaintest/v7"
Expand Down
2 changes: 1 addition & 1 deletion e2e/testsuite/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/hex"
"fmt"

upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/codec"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -14,7 +15,6 @@ import (
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
grouptypes "github.com/cosmos/cosmos-sdk/x/group"
proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"

icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"
Expand Down
16 changes: 8 additions & 8 deletions e2e/testsuite/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"time"

"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/client/grpc/ccmtservice"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/authz"
Expand Down Expand Up @@ -49,7 +49,7 @@ type GRPCClients struct {
AuthQueryClient authtypes.QueryClient
AuthZQueryClient authz.QueryClient

ConsensusServiceClient tmservice.ServiceClient
ConsensusServiceClient ccmtservice.ServiceClient
}

// InitGRPCClients establishes GRPC clients with the given chain.
Expand Down Expand Up @@ -85,7 +85,7 @@ func (s *E2ETestSuite) InitGRPCClients(chain *cosmos.CosmosChain) {
ParamsQueryClient: paramsproposaltypes.NewQueryClient(grpcConn),
AuthQueryClient: authtypes.NewQueryClient(grpcConn),
AuthZQueryClient: authz.NewQueryClient(grpcConn),
ConsensusServiceClient: tmservice.NewServiceClient(grpcConn),
ConsensusServiceClient: ccmtservice.NewServiceClient(grpcConn),
}
}

Expand Down Expand Up @@ -267,8 +267,8 @@ func (s *E2ETestSuite) QueryProposalV1(ctx context.Context, chain ibc.Chain, pro

// GetBlockHeaderByHeight fetches the block header at a given height.
func (s *E2ETestSuite) GetBlockHeaderByHeight(ctx context.Context, chain ibc.Chain, height uint64) (Header, error) {
tmService := s.GetChainGRCPClients(chain).ConsensusServiceClient
res, err := tmService.GetBlockByHeight(ctx, &tmservice.GetBlockByHeightRequest{
cmtservice := s.GetChainGRCPClients(chain).ConsensusServiceClient
res, err := cmtservice.GetBlockByHeight(ctx, &ccmtservice.GetBlockByHeightRequest{
Height: int64(height),
})
if err != nil {
Expand All @@ -286,9 +286,9 @@ func (s *E2ETestSuite) GetBlockHeaderByHeight(ctx context.Context, chain ibc.Cha

// GetValidatorSetByHeight returns the validators of the given chain at the specified height. The returned validators
// are sorted by address.
func (s *E2ETestSuite) GetValidatorSetByHeight(ctx context.Context, chain ibc.Chain, height uint64) ([]*tmservice.Validator, error) {
tmService := s.GetChainGRCPClients(chain).ConsensusServiceClient
res, err := tmService.GetValidatorSetByHeight(ctx, &tmservice.GetValidatorSetByHeightRequest{
func (s *E2ETestSuite) GetValidatorSetByHeight(ctx context.Context, chain ibc.Chain, height uint64) ([]*ccmtservice.Validator, error) {
cmtservice := s.GetChainGRCPClients(chain).ConsensusServiceClient
res, err := cmtservice.GetValidatorSetByHeight(ctx, &ccmtservice.GetValidatorSetByHeightRequest{
Height: int64(height),
})
if err != nil {
Expand Down
Loading