From 58ec4ccf2f019465f8385140115c202c669260eb Mon Sep 17 00:00:00 2001 From: rustdev Date: Fri, 26 Apr 2024 11:07:50 +0100 Subject: [PATCH 1/9] add a upgrade handler for new feature cosmos eth ibc fee priority --- app/upgrades/v6_5_5/constants.go | 20 +++++++++++++++++++ app/upgrades/v6_5_5/upgrade.go | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 app/upgrades/v6_5_5/constants.go create mode 100644 app/upgrades/v6_5_5/upgrade.go diff --git a/app/upgrades/v6_5_5/constants.go b/app/upgrades/v6_5_5/constants.go new file mode 100644 index 000000000..20afe8641 --- /dev/null +++ b/app/upgrades/v6_5_5/constants.go @@ -0,0 +1,20 @@ +package v6_5_5 + +import ( + store "github.com/cosmos/cosmos-sdk/store/types" + "github.com/notional-labs/composable/v6/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrade name for the composable upgrade. + UpgradeName = "v6_5_4" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{}, + Deleted: []string{}, + }, +} diff --git a/app/upgrades/v6_5_5/upgrade.go b/app/upgrades/v6_5_5/upgrade.go new file mode 100644 index 000000000..5b260d881 --- /dev/null +++ b/app/upgrades/v6_5_5/upgrade.go @@ -0,0 +1,34 @@ +package v6_5_5 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/notional-labs/composable/v6/app/keepers" + + "github.com/notional-labs/composable/v6/app/upgrades" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + _ upgrades.BaseAppParamManager, + _ codec.Codec, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + // BrokenProposals := [3]uint64{2, 6, 11} + // // gov module store + // store := ctx.KVStore(keepers.GetKVStoreKey()["gov"]) + + // for _, proposalID := range BrokenProposals { + // bz := store.Get(types.ProposalKey(proposalID)) + // if bz != nil { + // store.Delete(types.ProposalKey(proposalID)) + // } + // } + return mm.RunMigrations(ctx, configurator, vm) + } +} From 14e56e7a57b03e94fa7ae5c385be9d73c451c6b7 Mon Sep 17 00:00:00 2001 From: rustdev Date: Sun, 28 Apr 2024 16:13:30 +0100 Subject: [PATCH 2/9] remove usage of new coin with empty denom bz it triggers incorrect denom --- custom/ibc-transfer/keeper/keeper.go | 7 +++++-- custom/ibc-transfer/keeper/msg_server.go | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/custom/ibc-transfer/keeper/keeper.go b/custom/ibc-transfer/keeper/keeper.go index 87f7c162e..54c1ab6dc 100644 --- a/custom/ibc-transfer/keeper/keeper.go +++ b/custom/ibc-transfer/keeper/keeper.go @@ -58,8 +58,9 @@ func NewKeeper( // If the transfer amount is greater than the minimum fee, it will charge the minimum fee and the percentage fee. func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + charge_coin := msg.Token + extra_charge := false params := k.IbcTransfermiddleware.GetParams(ctx) - charge_coin := sdk.NewCoin("", sdk.ZeroInt()) if params.ChannelFees != nil && len(params.ChannelFees) > 0 { channelFee := findChannelParams(params.ChannelFees, msg.SourceChannel) if channelFee != nil { @@ -125,16 +126,18 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. return &types.MsgTransferResponse{}, nil } msg.Token.Amount = newAmount + extra_charge = true } } ret, err := k.Keeper.Transfer(goCtx, msg) - if err == nil && ret != nil && !charge_coin.IsZero() { + if err == nil && ret != nil && extra_charge { k.IbcTransfermiddleware.SetSequenceFee(ctx, ret.Sequence, charge_coin) } return ret, err } func GetPriority(jsonString string) *string { + return nil var data map[string]interface{} if err := json.Unmarshal([]byte(jsonString), &data); err != nil { return nil diff --git a/custom/ibc-transfer/keeper/msg_server.go b/custom/ibc-transfer/keeper/msg_server.go index 2bff42a1d..c3e3115ea 100644 --- a/custom/ibc-transfer/keeper/msg_server.go +++ b/custom/ibc-transfer/keeper/msg_server.go @@ -31,9 +31,11 @@ func NewMsgServerImpl(ibcKeeper Keeper, bankKeeper custombankkeeper.Keeper) type // If the transfer amount is less than the minimum fee, it will charge the full transfer amount. // If the transfer amount is greater than the minimum fee, it will charge the minimum fee and the percentage fee. func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { + // return k.msgServer.Transfer(goCtx, msg) ctx := sdk.UnwrapSDKContext(goCtx) + charge_coin := msg.Token + extra_charge := false params := k.Keeper.IbcTransfermiddleware.GetParams(ctx) - charge_coin := sdk.NewCoin("", sdk.ZeroInt()) if params.ChannelFees != nil && len(params.ChannelFees) > 0 { channelFee := findChannelParams(params.ChannelFees, msg.SourceChannel) if channelFee != nil { @@ -99,10 +101,11 @@ func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*typ return &types.MsgTransferResponse{}, nil } msg.Token.Amount = newAmount + extra_charge = true } } ret, err := k.msgServer.Transfer(goCtx, msg) - if err == nil && ret != nil && !charge_coin.IsZero() { + if err == nil && ret != nil && extra_charge { k.IbcTransfermiddleware.SetSequenceFee(ctx, ret.Sequence, charge_coin) } return ret, err From d57b0c0c1e3ed1fdef37fd4a3c3a2650c6be9123 Mon Sep 17 00:00:00 2001 From: rustdev Date: Sun, 28 Apr 2024 16:17:44 +0100 Subject: [PATCH 3/9] Revert "remove usage of new coin with empty denom bz it triggers incorrect denom" This reverts commit 14e56e7a57b03e94fa7ae5c385be9d73c451c6b7. --- custom/ibc-transfer/keeper/keeper.go | 7 ++----- custom/ibc-transfer/keeper/msg_server.go | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/custom/ibc-transfer/keeper/keeper.go b/custom/ibc-transfer/keeper/keeper.go index 54c1ab6dc..87f7c162e 100644 --- a/custom/ibc-transfer/keeper/keeper.go +++ b/custom/ibc-transfer/keeper/keeper.go @@ -58,9 +58,8 @@ func NewKeeper( // If the transfer amount is greater than the minimum fee, it will charge the minimum fee and the percentage fee. func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - charge_coin := msg.Token - extra_charge := false params := k.IbcTransfermiddleware.GetParams(ctx) + charge_coin := sdk.NewCoin("", sdk.ZeroInt()) if params.ChannelFees != nil && len(params.ChannelFees) > 0 { channelFee := findChannelParams(params.ChannelFees, msg.SourceChannel) if channelFee != nil { @@ -126,18 +125,16 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. return &types.MsgTransferResponse{}, nil } msg.Token.Amount = newAmount - extra_charge = true } } ret, err := k.Keeper.Transfer(goCtx, msg) - if err == nil && ret != nil && extra_charge { + if err == nil && ret != nil && !charge_coin.IsZero() { k.IbcTransfermiddleware.SetSequenceFee(ctx, ret.Sequence, charge_coin) } return ret, err } func GetPriority(jsonString string) *string { - return nil var data map[string]interface{} if err := json.Unmarshal([]byte(jsonString), &data); err != nil { return nil diff --git a/custom/ibc-transfer/keeper/msg_server.go b/custom/ibc-transfer/keeper/msg_server.go index c3e3115ea..2bff42a1d 100644 --- a/custom/ibc-transfer/keeper/msg_server.go +++ b/custom/ibc-transfer/keeper/msg_server.go @@ -31,11 +31,9 @@ func NewMsgServerImpl(ibcKeeper Keeper, bankKeeper custombankkeeper.Keeper) type // If the transfer amount is less than the minimum fee, it will charge the full transfer amount. // If the transfer amount is greater than the minimum fee, it will charge the minimum fee and the percentage fee. func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { - // return k.msgServer.Transfer(goCtx, msg) ctx := sdk.UnwrapSDKContext(goCtx) - charge_coin := msg.Token - extra_charge := false params := k.Keeper.IbcTransfermiddleware.GetParams(ctx) + charge_coin := sdk.NewCoin("", sdk.ZeroInt()) if params.ChannelFees != nil && len(params.ChannelFees) > 0 { channelFee := findChannelParams(params.ChannelFees, msg.SourceChannel) if channelFee != nil { @@ -101,11 +99,10 @@ func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*typ return &types.MsgTransferResponse{}, nil } msg.Token.Amount = newAmount - extra_charge = true } } ret, err := k.msgServer.Transfer(goCtx, msg) - if err == nil && ret != nil && extra_charge { + if err == nil && ret != nil && !charge_coin.IsZero() { k.IbcTransfermiddleware.SetSequenceFee(ctx, ret.Sequence, charge_coin) } return ret, err From 1937cbde02c4f8c511dcfd6e60fbe85cef7f81e6 Mon Sep 17 00:00:00 2001 From: rustdev Date: Sun, 28 Apr 2024 16:18:40 +0100 Subject: [PATCH 4/9] use correct denom instead of empty. --- custom/ibc-transfer/keeper/keeper.go | 2 +- custom/ibc-transfer/keeper/msg_server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom/ibc-transfer/keeper/keeper.go b/custom/ibc-transfer/keeper/keeper.go index 87f7c162e..469c2eab1 100644 --- a/custom/ibc-transfer/keeper/keeper.go +++ b/custom/ibc-transfer/keeper/keeper.go @@ -59,7 +59,7 @@ func NewKeeper( func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) params := k.IbcTransfermiddleware.GetParams(ctx) - charge_coin := sdk.NewCoin("", sdk.ZeroInt()) + charge_coin := sdk.NewCoin(msg.Token.Denom, sdk.ZeroInt()) if params.ChannelFees != nil && len(params.ChannelFees) > 0 { channelFee := findChannelParams(params.ChannelFees, msg.SourceChannel) if channelFee != nil { diff --git a/custom/ibc-transfer/keeper/msg_server.go b/custom/ibc-transfer/keeper/msg_server.go index 2bff42a1d..7adb3a0a6 100644 --- a/custom/ibc-transfer/keeper/msg_server.go +++ b/custom/ibc-transfer/keeper/msg_server.go @@ -33,7 +33,7 @@ func NewMsgServerImpl(ibcKeeper Keeper, bankKeeper custombankkeeper.Keeper) type func (k msgServer) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) params := k.Keeper.IbcTransfermiddleware.GetParams(ctx) - charge_coin := sdk.NewCoin("", sdk.ZeroInt()) + charge_coin := sdk.NewCoin(msg.Token.Denom, sdk.ZeroInt()) if params.ChannelFees != nil && len(params.ChannelFees) > 0 { channelFee := findChannelParams(params.ChannelFees, msg.SourceChannel) if channelFee != nil { From 8271fef24ab17d4642a2402d0a5966882893c59f Mon Sep 17 00:00:00 2001 From: rustdev Date: Sun, 28 Apr 2024 21:56:44 +0100 Subject: [PATCH 5/9] extend AddAllowedIbcToken tx to add the priority of gas for ibc bridge --- .../ibctransfermiddleware/v1beta1/tx.proto | 2 + x/ibctransfermiddleware/client/cli/tx.go | 18 +- x/ibctransfermiddleware/keeper/msg_server.go | 7 +- x/ibctransfermiddleware/types/msg.go | 10 +- x/ibctransfermiddleware/types/tx.pb.go | 169 ++++++++++++------ 5 files changed, 144 insertions(+), 62 deletions(-) diff --git a/proto/composable/ibctransfermiddleware/v1beta1/tx.proto b/proto/composable/ibctransfermiddleware/v1beta1/tx.proto index 91cd2c351..62747d981 100644 --- a/proto/composable/ibctransfermiddleware/v1beta1/tx.proto +++ b/proto/composable/ibctransfermiddleware/v1beta1/tx.proto @@ -107,6 +107,8 @@ message MsgAddAllowedIbcToken { cosmos.base.v1beta1.Coin min_fee = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; int64 percentage = 4; + + repeated TxPriorityFee tx_priority_fee = 5; } message MsgAddAllowedIbcTokenResponse {} diff --git a/x/ibctransfermiddleware/client/cli/tx.go b/x/ibctransfermiddleware/client/cli/tx.go index c8b86a01e..2db622d66 100644 --- a/x/ibctransfermiddleware/client/cli/tx.go +++ b/x/ibctransfermiddleware/client/cli/tx.go @@ -77,10 +77,10 @@ func AddIBCFeeConfig() *cobra.Command { func AddAllowedIbcToken() *cobra.Command { cmd := &cobra.Command{ - Use: "add-allowed-ibc-token [channel] [percentage] [coin]", + Use: "add-allowed-ibc-token [channel] [percentage] [coin] [Amountlow] [Amountmedium] [Amounthigh] ... [Amountxxx]", Short: "add allowed ibc token", - Args: cobra.MatchAll(cobra.ExactArgs(3), cobra.OnlyValidArgs), - Example: fmt.Sprintf("%s tx ibctransfermiddleware add-allowed-ibc-token [channel] [percentage] [coin] (percentage '5' means 1/5 of amount will be taken as fee) ", version.AppName), + Args: cobra.MatchAll(cobra.RangeArgs(3, 10), cobra.OnlyValidArgs), + Example: fmt.Sprintf("%s tx ibctransfermiddleware add-allowed-ibc-token [channel] [percentage] [coin] .. [1000low] [10000medium] [100000high] ... [1000000xxx] (percentage '5' means 1/5 of amount will be taken as fee) ", version.AppName), RunE: func(cmd *cobra.Command, args []string) error { channel := args[0] percentage := args[1] @@ -88,6 +88,17 @@ func AddAllowedIbcToken() *cobra.Command { if err != nil { return err } + length := len(args) + cc := []*types.TxPriorityFee{} + for i := 3; i < length; i++ { + priority, err := sdk.ParseCoinNormalized(args[i]) + if err != nil { + return err + } + priority_str := priority.Denom + priority.Denom = coin.Denom + cc = append(cc, &types.TxPriorityFee{Priority: priority_str, PriorityFee: priority}) + } clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -106,6 +117,7 @@ func AddAllowedIbcToken() *cobra.Command { channel, coin, percentageInt, + cc, ) if err := msg.ValidateBasic(); err != nil { diff --git a/x/ibctransfermiddleware/keeper/msg_server.go b/x/ibctransfermiddleware/keeper/msg_server.go index dbe7b0f76..e9f38ddc5 100644 --- a/x/ibctransfermiddleware/keeper/msg_server.go +++ b/x/ibctransfermiddleware/keeper/msg_server.go @@ -105,11 +105,12 @@ func (ms msgServer) AddAllowedIbcToken(goCtx context.Context, req *types.MsgAddA if coin != nil { coin.MinFee = req.MinFee coin.Percentage = req.Percentage + coin.TxPriorityFee = req.TxPriorityFee } else { - coin := &types.CoinItem{ - MinFee: req.MinFee, - Percentage: req.Percentage, + MinFee: req.MinFee, + Percentage: req.Percentage, + TxPriorityFee: req.TxPriorityFee, } channelFee.AllowedTokens = append(channelFee.AllowedTokens, coin) } diff --git a/x/ibctransfermiddleware/types/msg.go b/x/ibctransfermiddleware/types/msg.go index 7634ad065..ccd9431df 100644 --- a/x/ibctransfermiddleware/types/msg.go +++ b/x/ibctransfermiddleware/types/msg.go @@ -101,12 +101,14 @@ func NewMsgAddAllowedIbcToken( channelID string, minFee sdk.Coin, percentage int64, + txPriorityFee []*TxPriorityFee, ) *MsgAddAllowedIbcToken { return &MsgAddAllowedIbcToken{ - Authority: authority, - ChannelID: channelID, - MinFee: minFee, - Percentage: percentage, + Authority: authority, + ChannelID: channelID, + MinFee: minFee, + Percentage: percentage, + TxPriorityFee: txPriorityFee, } } diff --git a/x/ibctransfermiddleware/types/tx.pb.go b/x/ibctransfermiddleware/types/tx.pb.go index d12a72ed3..df5e22149 100644 --- a/x/ibctransfermiddleware/types/tx.pb.go +++ b/x/ibctransfermiddleware/types/tx.pb.go @@ -335,10 +335,11 @@ var xxx_messageInfo_MsgRemoveIBCFeeConfigResponse proto.InternalMessageInfo type MsgAddAllowedIbcToken struct { // authority is the address that controls the module (defaults to x/gov unless // overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` - ChannelID string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` - MinFee types.Coin `protobuf:"bytes,3,opt,name=min_fee,json=minFee,proto3" json:"min_fee"` - Percentage int64 `protobuf:"varint,4,opt,name=percentage,proto3" json:"percentage,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` + ChannelID string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + MinFee types.Coin `protobuf:"bytes,3,opt,name=min_fee,json=minFee,proto3" json:"min_fee"` + Percentage int64 `protobuf:"varint,4,opt,name=percentage,proto3" json:"percentage,omitempty"` + TxPriorityFee []*TxPriorityFee `protobuf:"bytes,5,rep,name=tx_priority_fee,json=txPriorityFee,proto3" json:"tx_priority_fee,omitempty"` } func (m *MsgAddAllowedIbcToken) Reset() { *m = MsgAddAllowedIbcToken{} } @@ -402,6 +403,13 @@ func (m *MsgAddAllowedIbcToken) GetPercentage() int64 { return 0 } +func (m *MsgAddAllowedIbcToken) GetTxPriorityFee() []*TxPriorityFee { + if m != nil { + return m.TxPriorityFee + } + return nil +} + type MsgAddAllowedIbcTokenResponse struct { } @@ -554,54 +562,57 @@ func init() { } var fileDescriptor_bf5c053de6965bca = []byte{ - // 752 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0x8e, 0x5b, 0x5a, 0x94, 0xab, 0x04, 0xd4, 0xb4, 0x90, 0x46, 0xd4, 0x89, 0x3c, 0x45, 0x95, - 0x48, 0x48, 0x40, 0x54, 0xaa, 0x40, 0x55, 0x7e, 0x50, 0x94, 0x4a, 0x91, 0x50, 0x5a, 0x16, 0x96, - 0xe8, 0x62, 0xbf, 0xb8, 0x16, 0xb9, 0x3b, 0xcb, 0x77, 0xfd, 0x91, 0x0d, 0x31, 0x21, 0x26, 0x16, - 0xd6, 0xae, 0x30, 0x76, 0x60, 0xe2, 0x2f, 0xe8, 0x58, 0xb1, 0xc0, 0x14, 0xa1, 0x74, 0xe8, 0xc6, - 0xd0, 0x1d, 0x09, 0xc5, 0xe7, 0x38, 0x6d, 0xe2, 0x48, 0x4d, 0x3b, 0xd0, 0x25, 0xb6, 0xdf, 0xbb, - 0xf7, 0xf9, 0x7b, 0xdf, 0xcb, 0xfb, 0x12, 0x94, 0x35, 0x18, 0x71, 0x18, 0xc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, 0x1f, 0x06, 0x88, 0xbf, 0xbc, 0x22, 0xc0, 0x39, 0x82, 0x21, 0x36, 0xb0, 0x3a, 0x6e, 0xf7, - 0x03, 0x00, 0x63, 0x12, 0x1c, 0xbd, 0x89, 0xde, 0x77, 0x30, 0x7c, 0x0d, 0x0b, 0x97, 0xd0, 0x60, - 0x90, 0xe6, 0xfa, 0xd5, 0x31, 0x7a, 0x4c, 0xe3, 0x53, 0xef, 0xba, 0x9e, 0x54, 0x58, 0x3e, 0xec, - 0x68, 0xca, 0x51, 0x47, 0x53, 0x7e, 0x77, 0x34, 0xe5, 0xd3, 0xb1, 0x16, 0x39, 0x3a, 0xd6, 0x22, - 0xbf, 0x8e, 0xb5, 0xc8, 0x9b, 0xc5, 0x51, 0xbf, 0xd6, 0xa2, 0xe5, 0x00, 0xaf, 0x4f, 0x7b, 0xff, - 0x4d, 0x1e, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x96, 0xfe, 0x14, 0xbd, 0x09, 0x00, 0x00, + // 789 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xbf, 0x6f, 0xda, 0x5a, + 0x14, 0xc6, 0xe1, 0x91, 0x27, 0x2e, 0x7a, 0x2f, 0x2f, 0x7e, 0xc9, 0x7b, 0x04, 0x35, 0x06, 0x79, + 0x42, 0x91, 0x0a, 0x85, 0x56, 0x8d, 0x14, 0xb5, 0x8a, 0xf8, 0xd1, 0x54, 0x44, 0x42, 0x8a, 0x1c, + 0xba, 0x74, 0x41, 0xc6, 0x3e, 0x38, 0x56, 0xf1, 0xbd, 0x96, 0xef, 0x4d, 0x02, 0x5b, 0xd5, 0xa9, + 0xea, 0xd4, 0xa5, 0x6b, 0xd6, 0x76, 0xcc, 0xd0, 0xa9, 0x7f, 0x41, 0xc6, 0xa8, 0x4b, 0x3b, 0xa1, + 0x8a, 0x0c, 0xd9, 0x3a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 0x68, 0x9d, 0xaf, 0x9a, 0xc0, 0xc6, 0x06, 0xdd, + 0xe7, 0xbf, 0x2c, 0xa2, 0x70, 0x95, 0x1a, 0xe2, 0x47, 0x01, 0xad, 0x06, 0x2f, 0xe1, 0xe2, 0xec, + 0xc6, 0x4c, 0x5b, 0xe4, 0x89, 0xdd, 0x1b, 0x60, 0x4c, 0x59, 0x8e, 0xe2, 0x07, 0x01, 0x2d, 0x8d, + 0x6f, 0xc6, 0x27, 0x73, 0xe1, 0x8f, 0x55, 0x27, 0xca, 0xb7, 0xa9, 0xf6, 0x79, 0x9d, 0x08, 0x48, + 0x0c, 0x58, 0x44, 0xdb, 0x73, 0x81, 0x4f, 0x02, 0x24, 0x9e, 0xdf, 0x12, 0xe0, 0x1a, 0xc1, 0x80, + 0x3d, 0xb3, 0x3d, 0x6f, 0xf7, 0x63, 0x00, 0x73, 0x12, 0x9c, 0x3e, 0x89, 0xee, 0x7f, 0x30, 0x78, + 0x0c, 0x8b, 0x37, 0xd0, 0x60, 0x9c, 0xe6, 0xee, 0xed, 0x31, 0x06, 0x4c, 0x13, 0x91, 0xd7, 0xfd, + 0xa5, 0x57, 0xdc, 0x3c, 0xeb, 0x49, 0xc2, 0x79, 0x4f, 0x12, 0x7e, 0xf4, 0x24, 0xe1, 0xfd, 0x85, + 0x14, 0x3a, 0xbf, 0x90, 0x42, 0xdf, 0x2f, 0xa4, 0xd0, 0xcb, 0xf5, 0x69, 0x9f, 0x03, 0xac, 0x63, + 0x03, 0x6d, 0x2c, 0xba, 0x1f, 0x3f, 0x0f, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x24, 0x32, 0x1d, + 0x8f, 0x1e, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1043,6 +1054,20 @@ func (m *MsgAddAllowedIbcToken) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.TxPriorityFee) > 0 { + for iNdEx := len(m.TxPriorityFee) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TxPriorityFee[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if m.Percentage != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Percentage)) i-- @@ -1278,6 +1303,12 @@ func (m *MsgAddAllowedIbcToken) Size() (n int) { if m.Percentage != 0 { n += 1 + sovTx(uint64(m.Percentage)) } + if len(m.TxPriorityFee) > 0 { + for _, e := range m.TxPriorityFee { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -2015,6 +2046,40 @@ func (m *MsgAddAllowedIbcToken) Unmarshal(dAtA []byte) error { break } } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxPriorityFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxPriorityFee = append(m.TxPriorityFee, &TxPriorityFee{}) + if err := m.TxPriorityFee[len(m.TxPriorityFee)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From 40d6175d534ef73310f3b97526710094246267ad Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 29 Apr 2024 13:02:58 +0100 Subject: [PATCH 6/9] remove unused code --- x/transfermiddleware/ibc_middleware.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/transfermiddleware/ibc_middleware.go b/x/transfermiddleware/ibc_middleware.go index 00695d747..a03ada9af 100644 --- a/x/transfermiddleware/ibc_middleware.go +++ b/x/transfermiddleware/ibc_middleware.go @@ -137,7 +137,6 @@ func (im IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Pac fee_address, err := sdk.AccAddressFromBech32(сhannelFeeAddress) if err != nil { return nil - // return errors.Wrapf(err, "failed to decode receiver address: %s", сhannelFeeAddress) } refund_err := im.keeper.RefundChannelCosmosFee(ctx, fee_address, sdk.AccAddress(data.Sender), []sdk.Coin{fee}) From 7b08a4c6e2d54517dca67cfb5aabb02a15289461 Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 29 Apr 2024 13:45:59 +0100 Subject: [PATCH 7/9] remove unused code. --- app/upgrades/v6_5_5/upgrade.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/upgrades/v6_5_5/upgrade.go b/app/upgrades/v6_5_5/upgrade.go index 5b260d881..2226d99ef 100644 --- a/app/upgrades/v6_5_5/upgrade.go +++ b/app/upgrades/v6_5_5/upgrade.go @@ -19,16 +19,6 @@ func CreateUpgradeHandler( keepers *keepers.AppKeepers, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - // BrokenProposals := [3]uint64{2, 6, 11} - // // gov module store - // store := ctx.KVStore(keepers.GetKVStoreKey()["gov"]) - - // for _, proposalID := range BrokenProposals { - // bz := store.Get(types.ProposalKey(proposalID)) - // if bz != nil { - // store.Delete(types.ProposalKey(proposalID)) - // } - // } return mm.RunMigrations(ctx, configurator, vm) } } From f800b2ceb2e2ce3471bd70170f363fe40dde193f Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 29 Apr 2024 13:57:58 +0100 Subject: [PATCH 8/9] rename to UpgradeName to "v6_5_5" --- app/upgrades/v6_5_5/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v6_5_5/constants.go b/app/upgrades/v6_5_5/constants.go index 20afe8641..1c066a692 100644 --- a/app/upgrades/v6_5_5/constants.go +++ b/app/upgrades/v6_5_5/constants.go @@ -7,7 +7,7 @@ import ( const ( // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v6_5_4" + UpgradeName = "v6_5_5" ) var Upgrade = upgrades.Upgrade{ From be273faab427ebef541e2338627eade97361b6b5 Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 29 Apr 2024 14:00:39 +0100 Subject: [PATCH 9/9] fmt fix --- x/ibctransfermiddleware/keeper/keeper.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/ibctransfermiddleware/keeper/keeper.go b/x/ibctransfermiddleware/keeper/keeper.go index 2877a81fc..597cf30a4 100644 --- a/x/ibctransfermiddleware/keeper/keeper.go +++ b/x/ibctransfermiddleware/keeper/keeper.go @@ -76,6 +76,7 @@ func (k Keeper) GetSequenceFee(ctx sdk.Context, sequence uint64) (coin sdk.Coin, fee := types.MustUnmarshalCoin(k.cdc, value) return fee, true } + func (k Keeper) SetSequenceFee(ctx sdk.Context, sequence uint64, coin sdk.Coin) { store := ctx.KVStore(k.storeKey) store.Set(types.GetSequenceKey(sequence), types.MustMarshalCoin(k.cdc, &coin))