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 v2 #716

Merged
merged 28 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ace0f16
upgrades interchaintest to ibc8 first commit
faddat Jul 24, 2023
ebc28a5
initial tidy
faddat Jul 24, 2023
1b0bf83
use math lib and use store from 50
faddat Jul 24, 2023
190cc6d
update packages
faddat Jul 25, 2023
1bd743d
remove beginblockevents section in chain_node.go
faddat Jul 25, 2023
2e5b0ef
bump go
faddat Jul 25, 2023
85d52bd
Merge remote-tracking branch 'origin/main' into faddat/ibc8
faddat Aug 3, 2023
2196665
Merge remote-tracking branch 'origin/main' into faddat/ibc8
faddat Aug 21, 2023
43a831f
upgrade workflows
catShaark Aug 21, 2023
d69e2ec
update lint.yml
faddat Aug 22, 2023
bed003c
Merge remote-tracking branch 'origin/main' into faddat/sdk-50-v2
faddat Aug 23, 2023
4e86fbe
Merge remote-tracking branch 'origin/main' into faddat/sdk-50-v2
faddat Aug 23, 2023
92d5857
update ibc to use upstream repo
faddat Aug 24, 2023
339d5ae
add finalizeBlockTx
catShaark Aug 26, 2023
52eb9fe
update hermes config
charleenfei Aug 30, 2023
79bbe45
update default hermes version
charleenfei Aug 31, 2023
c9539fd
rm unneeded param
charleenfei Aug 31, 2023
33aa10d
remove wasm
boojamya Aug 30, 2023
c819b0c
remove polkadot
boojamya Aug 30, 2023
8518e52
remove hyperspace
boojamya Aug 30, 2023
eea91cb
update go mod + tidy
boojamya Aug 31, 2023
dd103da
update sdk boundary test
boojamya Aug 31, 2023
18fdf1b
relayer image for sdk boundary test
boojamya Aug 31, 2023
512b60a
Merge branch 'main' into faddat/sdk-50-v2
faddat Sep 1, 2023
9536aa6
bump module to `v8`
boojamya Sep 1, 2023
86b2183
boundary test run in parallel
boojamya Sep 1, 2023
5b748bc
fix: bump hermes UidGid
boojamya Sep 1, 2023
c2dc240
Merge branch 'main' into faddat/sdk-50-v2
boojamya Sep 5, 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
12 changes: 6 additions & 6 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'

- name: checkout interchaintest
uses: actions/checkout@v3
Expand All @@ -35,10 +35,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'
cache: false

- name: checkout interchaintest
Expand All @@ -57,10 +57,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'
cache: false

- name: checkout interchaintest
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: v1.54
misko9 marked this conversation as resolved.
Show resolved Hide resolved
only-new-issues: true
args: --timeout=5m
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.19
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'

- name: checkout interchaintest
uses: actions/checkout@v3
Expand Down
25 changes: 13 additions & 12 deletions chain/cosmos/08-wasm-types/client_state.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
Expand All @@ -21,11 +22,11 @@ func (c ClientState) Validate() error {
return nil
}

func (c ClientState) Status(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec) exported.Status {
func (c ClientState) Status(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec) exported.Status {
return exported.Active
}

func (c ClientState) ExportMetadata(store sdk.KVStore) []exported.GenesisMetadata {
func (c ClientState) ExportMetadata(store storetypes.KVStore) []exported.GenesisMetadata {
return []exported.GenesisMetadata{}
}

Expand All @@ -35,20 +36,20 @@ func (c ClientState) ZeroCustomFields() exported.ClientState {

func (c ClientState) GetTimestampAtHeight(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
) (uint64, error) {
return 0, nil
}

func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store sdk.KVStore, state exported.ConsensusState) error {
func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store storetypes.KVStore, state exported.ConsensusState) error {
return nil
}

func (c ClientState) VerifyMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
Expand All @@ -62,7 +63,7 @@ func (c ClientState) VerifyMembership(

func (c ClientState) VerifyNonMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
Expand All @@ -77,34 +78,34 @@ func (c ClientState) VerifyNonMembership(
// It must handle each type of ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState, and UpdateStateOnMisbehaviour
// will assume that the content of the ClientMessage has been verified and can be trusted. An error should be returned
// if the ClientMessage fails to verify.
func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) error {
func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) error {
return nil
}

func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, msg exported.ClientMessage) bool {
func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, msg exported.ClientMessage) bool {
return true
}

// UpdateStateOnMisbehaviour should perform appropriate state changes on a client state given that misbehaviour has been detected and verified
func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) {
func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) {

}

func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) []exported.Height {
func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height {
return []exported.Height{c.LatestHeight}
}

func (c ClientState) CheckSubstituteAndUpdateState(
ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore,
substituteClientStore sdk.KVStore, substituteClient exported.ClientState,
substituteClientStore storetypes.KVStore, substituteClient exported.ClientState,
) error {
return nil
}

func (c ClientState) VerifyUpgradeAndUpdateState(
ctx sdk.Context,
cdc codec.BinaryCodec,
store sdk.KVStore,
store storetypes.KVStore,
newClient exported.ClientState,
newConsState exported.ConsensusState,
proofUpgradeClient,
Expand Down
40 changes: 0 additions & 40 deletions chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,46 +417,6 @@ func (tn *ChainNode) FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx,
}
txs = append(txs, newTx)
}
if len(blockRes.BeginBlockEvents) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should BeginBlockEvents/EndBlockEvents be replaced with FinalizeBlockEvents instead of just removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd need to defer to @catShaark on this. I am not sure, but thanks for the review and bringing this up!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @misko9, I just add the code u request.

beginBlockTx := blockdb.Tx{
Data: []byte(`{"data":"begin_block","note":"this is a transaction artificially created for debugging purposes"}`),
}
beginBlockTx.Events = make([]blockdb.Event, len(blockRes.BeginBlockEvents))
for i, e := range blockRes.BeginBlockEvents {
attrs := make([]blockdb.EventAttribute, len(e.Attributes))
for j, attr := range e.Attributes {
attrs[j] = blockdb.EventAttribute{
Key: string(attr.Key),
Value: string(attr.Value),
}
}
beginBlockTx.Events[i] = blockdb.Event{
Type: e.Type,
Attributes: attrs,
}
}
txs = append(txs, beginBlockTx)
}
if len(blockRes.EndBlockEvents) > 0 {
endBlockTx := blockdb.Tx{
Data: []byte(`{"data":"end_block","note":"this is a transaction artificially created for debugging purposes"}`),
}
endBlockTx.Events = make([]blockdb.Event, len(blockRes.EndBlockEvents))
for i, e := range blockRes.EndBlockEvents {
attrs := make([]blockdb.EventAttribute, len(e.Attributes))
for j, attr := range e.Attributes {
attrs[j] = blockdb.EventAttribute{
Key: string(attr.Key),
Value: string(attr.Value),
}
}
endBlockTx.Events[i] = blockdb.Event{
Type: e.Type,
Attributes: attrs,
}
}
txs = append(txs, endBlockTx)
}

return txs, nil
}
Expand Down
5 changes: 1 addition & 4 deletions chain/cosmos/codec.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cosmos

import (
"cosmossdk.io/x/upgrade"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -19,8 +20,6 @@ import (
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
"github.com/cosmos/ibc-go/modules/capability"

transfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
Expand All @@ -41,8 +40,6 @@ func DefaultEncoding() testutil.TestEncodingConfig {
gov.NewAppModuleBasic(
[]govclient.ProposalHandler{
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
},
),
params.AppModuleBasic{},
Expand Down
6 changes: 4 additions & 2 deletions chain/cosmos/cosmos_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"sync"

"cosmossdk.io/math"
sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
Expand Down Expand Up @@ -822,12 +823,12 @@ func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGene
chainCfg := c.Config()

genesisAmount := types.Coin{
Amount: types.NewInt(10_000_000_000_000),
Amount: sdkmath.NewInt(10_000_000_000_000),
Denom: chainCfg.Denom,
}

genesisSelfDelegation := types.Coin{
Amount: types.NewInt(5_000_000_000_000),
Amount: sdkmath.NewInt(5_000_000_000_000),
Denom: chainCfg.Denom,
}

Expand Down Expand Up @@ -936,6 +937,7 @@ func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGene
}

for _, wallet := range additionalGenesisWallets {

if err := validator0.AddGenesisAccount(ctx, wallet.Address, []types.Coin{{Denom: wallet.Denom, Amount: wallet.Amount}}); err != nil {
return err
}
Expand Down
Loading