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

ibc-go v5: cosmos-sdk 46 #1653

Merged
merged 88 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
800d530
begin changes needed for "real 46"
faddat Jul 5, 2022
0f64e06
46 updates
faddat Jul 5, 2022
8867120
46 updates
faddat Jul 5, 2022
30f7946
Delete .gitpod.yml
faddat Jul 5, 2022
0c77eab
46 updates
faddat Jul 5, 2022
1e79e0b
46 updates
faddat Jul 5, 2022
185adee
Update genesis_test.go
faddat Jul 5, 2022
11d96cb
update tests
faddat Jul 5, 2022
bdf7cc3
Merge branch 'real-46-branch' of https://github.com/notional-labs/ibc…
faddat Jul 5, 2022
ab06157
bring back the client client
faddat Jul 5, 2022
6704daf
fumpt
faddat Jul 5, 2022
42c1eac
genesis with val set
vuong177 Jul 5, 2022
78689e1
fix TestRandomizedGenState
nghuyenthevinh2000 Jul 5, 2022
32fa306
Merge branch 'main' into real-46-branch
faddat Jul 5, 2022
e300204
Merge branch 'main' into real-46-branch
faddat Jul 7, 2022
8e4f87e
use cosmos-sdk v0.46.0-rc2
faddat Jul 7, 2022
4b579fa
Merge branch 'main' into real-46-branch
faddat Jul 9, 2022
93cd207
Revert "Merge branch 'main' into real-46-branch"
faddat Jul 14, 2022
11e336c
Merge remote-tracking branch 'upstream/main' into real-46-branch
faddat Jul 16, 2022
b0b34cf
goimports
faddat Jul 16, 2022
ee64d56
fumpt
faddat Jul 16, 2022
06b8deb
Update testing/simapp/app.go
faddat Jul 19, 2022
8c2c541
Merge branch 'main' into real-46-branch
faddat Jul 19, 2022
df546ed
Update testing/simapp/simd/cmd/genaccounts.go
faddat Jul 19, 2022
eff83e2
make format
faddat Jul 19, 2022
626480f
tidy
faddat Jul 19, 2022
496a7f3
change import path
faddat Jul 19, 2022
d6ee5c9
remove gitpod artifact
faddat Jul 19, 2022
1f290e0
sdk.Int -> math.Int
faddat Jul 19, 2022
cf0997e
group sdk and tendermint imports
faddat Jul 19, 2022
869043d
Organize Governance Proposal Handlers
faddat Jul 19, 2022
802b1bc
Remove Extra line in msgs_test.go
faddat Jul 19, 2022
232cbb6
use test.yml from main branch
faddat Jul 19, 2022
1281e74
fix fee module ibc middleware
faddat Jul 19, 2022
8769f22
remove sdk_test.go and use Carlos' branch's antehandler
faddat Jul 20, 2022
2caf65f
various fixes
faddat Jul 20, 2022
8dc9b01
fix assignment to addr
faddat Jul 20, 2022
9f95dd5
revert change in misbehaviour_handle.go
vuong177 Jul 20, 2022
0c3b31f
Merge branch 'main' into real-46-branch
faddat Jul 20, 2022
6a063fe
e2e go.mod
faddat Jul 20, 2022
21cf683
e2e v4 module path
faddat Jul 20, 2022
55b166b
Merge branch 'main' into real-46-branch
faddat Jul 20, 2022
4bd8fdb
Merge branch 'main' into real-46-branch
faddat Jul 21, 2022
859eae7
Merge branch 'main' into real-46-branch
faddat Jul 21, 2022
374e043
fix import paths
faddat Jul 21, 2022
33be3d6
Merge branch 'main' into real-46-branch
faddat Jul 21, 2022
9441c40
Merge branch 'main' into real-46-branch
faddat Jul 22, 2022
d0ae698
goimports and gofumpt
faddat Jul 22, 2022
eb12e81
Merge branch 'main' into real-46-branch
faddat Jul 22, 2022
8afece8
Merge branch 'main' into real-46-branch
faddat Jul 26, 2022
4951539
Merge branch 'main' into real-46-branch
faddat Jul 26, 2022
2233d7b
46 final release
faddat Jul 26, 2022
a2d6e01
fix makefile
faddat Jul 26, 2022
e09af23
update proto file to v5
vuong177 Jul 26, 2022
0eb3fc0
Merge remote-tracking branch 'upstream/main' into real-46-branch
faddat Jul 27, 2022
771e422
Merge remote-tracking branch 'upstream/main' into real-46-branch
faddat Jul 27, 2022
0a11156
temp gitpod for protos
faddat Jul 27, 2022
8f3943d
work on protos
faddat Jul 27, 2022
92061fc
Merge remote-tracking branch 'upstream/main' into real-46-branch
faddat Jul 27, 2022
a6e2ce3
tidy
faddat Jul 27, 2022
272b708
Delete .gitpod.yml
faddat Jul 27, 2022
6f2e6df
Merge branch 'main' into real-46-branch
faddat Jul 28, 2022
cf43ee0
Merge remote-tracking branch 'upstream/main' into real-46-branch
faddat Jul 28, 2022
527d656
finish merge
faddat Jul 28, 2022
cbebf62
Merge branch 'main' into real-46-branch
faddat Jul 28, 2022
89e53d2
apply review suggestions, fix imports
colin-axner Jul 28, 2022
76ee58d
remove incorrect e2e import path
colin-axner Jul 28, 2022
2201809
fix incorrect import moving
colin-axner Jul 28, 2022
c4ca865
Merge pull request #75 from cosmos/colin/review-suggestions
faddat Jul 28, 2022
040aca9
Merge branch 'main' into real-46-branch
faddat Jul 28, 2022
acff013
refactor acknowledgement construction for SDK 0.46
crodriguezvega Jul 28, 2022
ad9241a
Merge branch 'main' into real-46-branch
catShaark Jul 28, 2022
e31ec28
Merge pull request #76 from crodriguezvega/carlos/refactor-acknowledg…
faddat Jul 28, 2022
db99001
46 upgrade
faddat Jul 28, 2022
148c020
fix ics27 changes, import fixes
colin-axner Jul 28, 2022
9bc1af7
Merge branch 'main' into real-46-branch
faddat Jul 28, 2022
d0b020b
Merge pull request #77 from cosmos/colin/self-review
faddat Jul 28, 2022
993ce8b
re add ibcclient proposal route
catShaark Jul 28, 2022
f300949
Merge branch 'main' into real-46-branch
catShaark Jul 28, 2022
d36576c
Merge branch 'main' into real-46-branch
catShaark Jul 29, 2022
053141f
fix for make proto-all
crodriguezvega Jul 30, 2022
7728fa1
Merge branch 'main' into real-46-branch
faddat Jul 30, 2022
70ee541
Merge pull request #79 from crodriguezvega/carlos/proto-fix
faddat Jul 30, 2022
d48007f
now both commands work, together!
faddat Jul 30, 2022
08f60a0
tidy
faddat Jul 30, 2022
171a81e
update swagger docs
faddat Aug 1, 2022
d11a462
appease codeql
faddat Aug 1, 2022
9af421e
update CONFIO_URL
faddat Aug 1, 2022
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
Prev Previous commit
Next Next commit
various fixes
  • Loading branch information
faddat committed Jul 20, 2022
commit 2caf65f1c2353f5f0282cceaf29fafa42ca02a82
10 changes: 5 additions & 5 deletions modules/apps/29-fee/types/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ func (f Fee) Total() sdk.Coins {
}

// Validate asserts that each Fee is valid and all three Fees are not empty or zero
func (fee Fee) Validate() error {
func (f Fee) Validate() error {
var errFees []string
if !fee.AckFee.IsValid() {
if !f.AckFee.IsValid() {
errFees = append(errFees, "ack fee invalid")
}
if !fee.RecvFee.IsValid() {
if !f.RecvFee.IsValid() {
errFees = append(errFees, "recv fee invalid")
}
if !fee.TimeoutFee.IsValid() {
if !f.TimeoutFee.IsValid() {
errFees = append(errFees, "timeout fee invalid")
}

Expand All @@ -84,7 +84,7 @@ func (fee Fee) Validate() error {
}

// if all three fee's are zero or empty return an error
if fee.AckFee.IsZero() && fee.RecvFee.IsZero() && fee.TimeoutFee.IsZero() {
if f.AckFee.IsZero() && f.RecvFee.IsZero() && f.TimeoutFee.IsZero() {
return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "all fees are zero")
}

Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/types/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func extractPathAndBaseFromFullDenom(fullDenomItems []string) (string, string) {
var path []string
var baseDenom []string
length := len(fullDenomItems)
for i := 0; i < length; i = i + 2 {
for i := 0; i < length; i += 2 {
if i < length-1 && length > 2 && fullDenomItems[i] == PortID {
path = append(path, fullDenomItems[i], fullDenomItems[i+1])
} else {
Expand Down
9 changes: 4 additions & 5 deletions modules/core/02-client/legacy/v100/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
host "github.com/cosmos/ibc-go/v5/modules/core/24-host"
"github.com/cosmos/ibc-go/v5/modules/core/exported"
Expand Down Expand Up @@ -46,7 +45,7 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar
}

for _, clientID := range clients {
clientType, _, err := types.ParseClientIdentifier(clientID)
clientType, _, err := clienttypes.ParseClientIdentifier(clientID)
if err != nil {
return err
}
Expand Down Expand Up @@ -91,7 +90,7 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar

tmClientState, ok := clientState.(*ibctmtypes.ClientState)
if !ok {
return sdkerrors.Wrap(types.ErrInvalidClient, "client state is not tendermint even though client id contains 07-tendermint")
return sdkerrors.Wrap(clienttypes.ErrInvalidClient, "client state is not tendermint even though client id contains 07-tendermint")
}

// add iteration keys so pruning will be successful
Expand Down Expand Up @@ -143,7 +142,7 @@ func pruneSolomachineConsensusStates(clientStore sdk.KVStore) {
}

// collect consensus states to be pruned
heights = append(heights, types.MustParseHeight(keySplit[1]))
heights = append(heights, clienttypes.MustParseHeight(keySplit[1]))
}

// delete all consensus states
Expand All @@ -167,7 +166,7 @@ func addConsensusMetadata(ctx sdk.Context, clientStore sdk.KVStore, cdc codec.Bi
continue
}

heights = append(heights, types.MustParseHeight(keySplit[1]))
heights = append(heights, clienttypes.MustParseHeight(keySplit[1]))
}

for _, height := range heights {
Expand Down
4 changes: 2 additions & 2 deletions modules/core/04-channel/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const (
EventTypeTimeoutPacket = "timeout_packet"
EventTypeTimeoutPacketOnClose = "timeout_on_close_packet"

// NOTE: DEPRECATED in favor of AttributeKeyDataHex
// Deprecated: in favor of AttributeKeyDataHex
AttributeKeyData = "packet_data"
// NOTE: DEPRECATED in favor of AttributeKeyAckHex
// Deprecated: in favor of AttributeKeyAckHex
AttributeKeyAck = "packet_ack"

AttributeKeyDataHex = "packet_data_hex"
Expand Down
16 changes: 8 additions & 8 deletions modules/core/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,39 @@ func (ad AnteDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
return ctx, err
}
if response.Result == channeltypes.NOOP {
redundancies += 1
redundancies++
}
packetMsgs += 1
packetMsgs++

case *channeltypes.MsgAcknowledgement:
response, err := ad.k.Acknowledgement(sdk.WrapSDKContext(ctx), msg)
if err != nil {
return ctx, err
}
if response.Result == channeltypes.NOOP {
redundancies += 1
redundancies++
}
packetMsgs += 1
packetMsgs++

case *channeltypes.MsgTimeout:
response, err := ad.k.Timeout(sdk.WrapSDKContext(ctx), msg)
if err != nil {
return ctx, err
}
if response.Result == channeltypes.NOOP {
redundancies += 1
redundancies++
}
packetMsgs += 1
packetMsgs++

case *channeltypes.MsgTimeoutOnClose:
response, err := ad.k.TimeoutOnClose(sdk.WrapSDKContext(ctx), msg)
if err != nil {
return ctx, err
}
if response.Result == channeltypes.NOOP {
redundancies += 1
redundancies++
}
packetMsgs += 1
packetMsgs++

case *clienttypes.MsgUpdateClient:
_, err := ad.k.UpdateClient(sdk.WrapSDKContext(ctx), msg)
Expand Down
11 changes: 5 additions & 6 deletions modules/light-clients/07-tendermint/types/misbehaviour_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ func (cs ClientState) CheckMisbehaviourAndUpdateState(
if bytes.Equal(blockID1.Hash, blockID2.Hash) {
return nil, sdkerrors.Wrap(clienttypes.ErrInvalidMisbehaviour, "headers block hashes are equal")
}
} else {
// Header1 is at greater height than Header2, therefore Header1 time must be less than or equal to
// Header2 time in order to be valid misbehaviour (violation of monotonic time).
if tmMisbehaviour.Header1.SignedHeader.Header.Time.After(tmMisbehaviour.Header2.SignedHeader.Header.Time) {
return nil, sdkerrors.Wrap(clienttypes.ErrInvalidMisbehaviour, "headers are not at same height and are monotonically increasing")
}
}
// Header1 is at greater height than Header2, therefore Header1 time must be less than or equal to
// Header2 time in order to be valid misbehaviour (violation of monotonic time).
if tmMisbehaviour.Header1.SignedHeader.Header.Time.After(tmMisbehaviour.Header2.SignedHeader.Header.Time) {
return nil, sdkerrors.Wrap(clienttypes.ErrInvalidMisbehaviour, "headers are not at same height and are monotonically increasing")
}

// Regardless of the type of misbehaviour, ensure that both headers are valid and would have been accepted by light-client
Expand Down
3 changes: 1 addition & 2 deletions testing/simapp/simd/cmd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/server"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -41,7 +40,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx := client.GetClientContextFromCmd(cmd)
depCdc := clientCtx.Codec
cdc := depCdc.(codec.Codec)
cdc := depCdc

serverCtx := server.GetServerContextFromCmd(cmd)
config := serverCtx.Config
Expand Down
2 changes: 1 addition & 1 deletion testing/simapp/simd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func calculateIP(ip string, i int) (string, error) {
}

func writeFile(name string, dir string, contents []byte) error {
writePath := filepath.Join(dir)
writePath := filepath.Dir(dir)
file := filepath.Join(writePath, name)

err := tmos.EnsureDir(writePath, 0o755)
Expand Down
4 changes: 2 additions & 2 deletions testing/values.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This file contains the variables, constants, and default values
used in the testing package and commonly defined in tests.
This file contains the variables, constants, and default values
used in the testing package and commonly defined in tests.
*/
package ibctesting

Expand Down