From b5c3cbe4b7131950fbf05c3de36f990d31db44fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:36:54 +0200 Subject: [PATCH 1/5] apply code changes from pr #1031 --- modules/apps/29-fee/fee_test.go | 10 ++- modules/apps/29-fee/ibc_module.go | 15 +++- modules/apps/29-fee/ibc_module_test.go | 18 +++++ modules/apps/29-fee/keeper/escrow_test.go | 79 +++++++++++-------- modules/apps/29-fee/keeper/keeper.go | 13 +++ modules/apps/29-fee/keeper/keeper_test.go | 18 ++++- modules/apps/29-fee/keeper/msg_server.go | 8 ++ modules/apps/29-fee/keeper/msg_server_test.go | 21 ++++- modules/apps/29-fee/types/errors.go | 1 + modules/apps/29-fee/types/keys.go | 6 ++ 10 files changed, 150 insertions(+), 39 deletions(-) diff --git a/modules/apps/29-fee/fee_test.go b/modules/apps/29-fee/fee_test.go index 9369fc16743..d2445adef22 100644 --- a/modules/apps/29-fee/fee_test.go +++ b/modules/apps/29-fee/fee_test.go @@ -21,7 +21,7 @@ type FeeTestSuite struct { chainB *ibctesting.TestChain chainC *ibctesting.TestChain - path *ibctesting.Path + path *ibctesting.Path pathAToC *ibctesting.Path } @@ -63,3 +63,11 @@ func (suite *FeeTestSuite) CreateMockPacket() channeltypes.Packet { 0, ) } + +// helper function +func lockFeeModule(chain *ibctesting.TestChain) { + ctx := chain.GetContext() + storeKey := chain.GetSimApp().GetKey(types.ModuleName) + store := ctx.KVStore(storeKey) + store.Set(types.KeyLocked(), []byte{1}) +} diff --git a/modules/apps/29-fee/ibc_module.go b/modules/apps/29-fee/ibc_module.go index e4dab034b04..042c649e7a0 100644 --- a/modules/apps/29-fee/ibc_module.go +++ b/modules/apps/29-fee/ibc_module.go @@ -231,6 +231,16 @@ func (im IBCModule) OnAcknowledgementPacket( return sdkerrors.Wrapf(err, "cannot unmarshal ICS-29 incentivized packet acknowledgement: %v", ack) } + if im.keeper.IsLocked(ctx) { + // if the fee keeper is locked then fee logic should be skipped + // this may occur in the presence of a severe bug which leads invalid state + // the fee keeper will be unlocked after manual intervention + // the acknowledgement has been unmarshalled into an ics29 acknowledgement + // since the counterparty is still sending incentivized acknowledgements + // for fee enabled channels + return im.app.OnAcknowledgementPacket(ctx, packet, ack.Result, relayer) + } + packetID := channeltypes.NewPacketId(packet.SourceChannel, packet.SourcePort, packet.Sequence) feesInEscrow, found := im.keeper.GetFeesInEscrow(ctx, packetID) if found { @@ -251,7 +261,10 @@ func (im IBCModule) OnTimeoutPacket( packet channeltypes.Packet, relayer sdk.AccAddress, ) error { - if !im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) { + // if the fee keeper is locked then fee logic should be skipped + // this may occur in the presence of a severe bug which leads invalid state + // the fee keeper will be unlocked after manual intervention + if !im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) || im.keeper.IsLocked(ctx) { return im.app.OnTimeoutPacket(ctx, packet, relayer) } diff --git a/modules/apps/29-fee/ibc_module_test.go b/modules/apps/29-fee/ibc_module_test.go index fb2bd8ecf01..17f1ded2983 100644 --- a/modules/apps/29-fee/ibc_module_test.go +++ b/modules/apps/29-fee/ibc_module_test.go @@ -611,6 +611,15 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { }, true, }, + { + "success: fee module is disabled, skip fee logic", + func() { + lockFeeModule(suite.chainA) + + expectedBalance = originalBalance + }, + true, + }, { "fail on distribute receive fee (blocked address)", func() { @@ -724,6 +733,15 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { }, false, }, + { + "fee module is disabled, skip fee logic", + func() { + lockFeeModule(suite.chainA) + + expectedBalance = originalBalance + }, + false, + }, { "no op if identified packet fee doesn't exist", func() { diff --git a/modules/apps/29-fee/keeper/escrow_test.go b/modules/apps/29-fee/keeper/escrow_test.go index 2f6b2fe62b1..51752c393c5 100644 --- a/modules/apps/29-fee/keeper/escrow_test.go +++ b/modules/apps/29-fee/keeper/escrow_test.go @@ -125,27 +125,62 @@ func (suite *KeeperTestSuite) TestDistributeFee() { reverseRelayer sdk.AccAddress forwardRelayer string refundAcc sdk.AccAddress + refundAccBal sdk.Coin + fee types.Fee + packetID channeltypes.PacketId ) validSeq := uint64(1) testCases := []struct { - name string - malleate func() - expPass bool + name string + malleate func() + expResult func() }{ { - "success", func() {}, true, + "success", func() {}, func() { + // check if the reverse relayer is paid + hasBalance := suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), reverseRelayer, fee.AckFee[0].Add(fee.AckFee[0])) + suite.Require().True(hasBalance) + + // check if the forward relayer is paid + forward, err := sdk.AccAddressFromBech32(forwardRelayer) + suite.Require().NoError(err) + hasBalance = suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), forward, fee.RecvFee[0].Add(fee.RecvFee[0])) + suite.Require().True(hasBalance) + + // check if the refund acc has been refunded the timeoutFee + expectedRefundAccBal := refundAccBal.Add(fee.TimeoutFee[0].Add(fee.TimeoutFee[0])) + hasBalance = suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), refundAcc, expectedRefundAccBal) + suite.Require().True(hasBalance) + + // check the module acc wallet is now empty + hasBalance = suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(0)}) + suite.Require().True(hasBalance) + }, }, { "invalid forward address", func() { forwardRelayer = "invalid address" - }, false, + }, + func() { + // check if the refund acc has been refunded the timeoutFee & onRecvFee + expectedRefundAccBal := refundAccBal.Add(fee.TimeoutFee[0]).Add(fee.RecvFee[0]).Add(fee.TimeoutFee[0]).Add(fee.RecvFee[0]) + hasBalance := suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), refundAcc, expectedRefundAccBal) + suite.Require().True(hasBalance) + + }, }, { "invalid forward address: blocked address", func() { forwardRelayer = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress().String() - }, false, + }, + func() { + // check if the refund acc has been refunded the timeoutFee & onRecvFee + expectedRefundAccBal := refundAccBal.Add(fee.TimeoutFee[0]).Add(fee.RecvFee[0]).Add(fee.TimeoutFee[0]).Add(fee.RecvFee[0]) + hasBalance := suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), refundAcc, expectedRefundAccBal) + suite.Require().True(hasBalance) + }, }, } @@ -161,8 +196,8 @@ func (suite *KeeperTestSuite) TestDistributeFee() { reverseRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) forwardRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() - packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, validSeq) - fee := types.Fee{ + packetID = channeltypes.NewPacketId(suite.path.EndpointA.ChannelID, suite.path.EndpointA.ChannelConfig.PortID, validSeq) + fee = types.Fee{ RecvFee: defaultReceiveFee, AckFee: defaultAckFee, TimeoutFee: defaultTimeoutFee, @@ -180,35 +215,11 @@ func (suite *KeeperTestSuite) TestDistributeFee() { tc.malleate() // refundAcc balance after escrow - refundAccBal := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + refundAccBal = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) suite.chainA.GetSimApp().IBCFeeKeeper.DistributePacketFees(suite.chainA.GetContext(), forwardRelayer, reverseRelayer, []types.PacketFee{packetFee, packetFee}) - if tc.expPass { - // check if the reverse relayer is paid - hasBalance := suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), reverseRelayer, fee.AckFee[0].Add(fee.AckFee[0])) - suite.Require().True(hasBalance) - - // check if the forward relayer is paid - forward, err := sdk.AccAddressFromBech32(forwardRelayer) - suite.Require().NoError(err) - hasBalance = suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), forward, fee.RecvFee[0].Add(fee.RecvFee[0])) - suite.Require().True(hasBalance) - - // check if the refund acc has been refunded the timeoutFee - expectedRefundAccBal := refundAccBal.Add(fee.TimeoutFee[0].Add(fee.TimeoutFee[0])) - hasBalance = suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), refundAcc, expectedRefundAccBal) - suite.Require().True(hasBalance) - - // check the module acc wallet is now empty - hasBalance = suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(0)}) - suite.Require().True(hasBalance) - } else { - // check if the refund acc has been refunded the timeoutFee & onRecvFee - expectedRefundAccBal := refundAccBal.Add(fee.TimeoutFee[0]).Add(fee.RecvFee[0]).Add(fee.TimeoutFee[0]).Add(fee.RecvFee[0]) - hasBalance := suite.chainA.GetSimApp().BankKeeper.HasBalance(suite.chainA.GetContext(), refundAcc, expectedRefundAccBal) - suite.Require().True(hasBalance) - } + tc.expResult() }) } } diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index c0c43dbecc6..6777ab97b3b 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -85,6 +85,19 @@ func (k Keeper) EscrowAccountHasBalance(ctx sdk.Context, coins sdk.Coins) bool { return true } +// lockFeeModule sets a flag to determine if fee handling logic should run for the given channel +// identified by channel and port identifiers. +func (k Keeper) lockFeeModule(ctx sdk.Context) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyLocked(), []byte{1}) +} + +// IsLocked indicates if the fee module is locked +func (k Keeper) IsLocked(ctx sdk.Context) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.KeyLocked()) +} + // SetFeeEnabled sets a flag to determine if fee handling logic should run for the given channel // identified by channel and port identifiers. func (k Keeper) SetFeeEnabled(ctx sdk.Context, portID, channelID string) { diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go index 1f29a8872d5..4b5d5030e20 100644 --- a/modules/apps/29-fee/keeper/keeper_test.go +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -67,6 +67,14 @@ func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } +// helper function +func lockFeeModule(chain *ibctesting.TestChain) { + ctx := chain.GetContext() + storeKey := chain.GetSimApp().GetKey(types.ModuleName) + store := ctx.KVStore(storeKey) + store.Set(types.KeyLocked(), []byte{1}) +} + func (suite *KeeperTestSuite) TestEscrowAccountHasBalance() { fee := types.Fee{ AckFee: defaultAckFee, @@ -85,7 +93,6 @@ func (suite *KeeperTestSuite) TestEscrowAccountHasBalance() { // increase ack fee fee.AckFee = fee.AckFee.Add(defaultAckFee...) suite.Require().False(suite.chainA.GetSimApp().IBCFeeKeeper.EscrowAccountHasBalance(suite.chainA.GetContext(), fee.Total())) - } func (suite *KeeperTestSuite) TestFeesInEscrow() { @@ -111,6 +118,15 @@ func (suite *KeeperTestSuite) TestFeesInEscrow() { suite.Require().False(hasFeesInEscrow) } +func (suite *KeeperTestSuite) TestIsLocked() { + ctx := suite.chainA.GetContext() + suite.Require().False(suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(ctx)) + + lockFeeModule(suite.chainA) + + suite.Require().True(suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(ctx)) +} + func (suite *KeeperTestSuite) TestDisableAllChannels() { suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), "port1", "channel1") suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), "port2", "channel2") diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index fdac1d27874..c8ffb853799 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -31,6 +31,10 @@ func (k Keeper) RegisterCounterpartyAddress(goCtx context.Context, msg *types.Ms func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) (*types.MsgPayPacketFeeResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + if k.IsLocked(ctx) { + return nil, types.ErrFeeModuleLocked + } + // get the next sequence sequence, found := k.GetNextSequenceSend(ctx, msg.SourcePortId, msg.SourceChannelId) if !found { @@ -57,6 +61,10 @@ func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) func (k Keeper) PayPacketFeeAsync(goCtx context.Context, msg *types.MsgPayPacketFeeAsync) (*types.MsgPayPacketFeeAsyncResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + if k.IsLocked(ctx) { + return nil, types.ErrFeeModuleLocked + } + if err := k.EscrowPacketFee(ctx, msg.PacketId, msg.PacketFee); err != nil { return nil, err } diff --git a/modules/apps/29-fee/keeper/msg_server_test.go b/modules/apps/29-fee/keeper/msg_server_test.go index 26ce387b60e..8e52bb10790 100644 --- a/modules/apps/29-fee/keeper/msg_server_test.go +++ b/modules/apps/29-fee/keeper/msg_server_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" ibctesting "github.com/cosmos/ibc-go/v3/testing" @@ -62,6 +64,13 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { true, func() {}, }, + { + "fee module is locked", + false, + func() { + lockFeeModule(suite.chainA) + }, + }, } for _, tc := range testCases { @@ -78,7 +87,8 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { msg := types.NewMsgPayPacketFee(fee, suite.path.EndpointA.ChannelConfig.PortID, channelID, refundAcc.String(), []string{}) tc.malleate() - _, err := suite.chainA.SendMsgs(msg) + + _, err := suite.chainA.GetSimApp().IBCFeeKeeper.PayPacketFee(sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // message committed @@ -99,6 +109,13 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { true, func() {}, }, + { + "fee module is locked", + false, + func() { + lockFeeModule(suite.chainA) + }, + }, } for _, tc := range testCases { @@ -125,7 +142,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { tc.malleate() msg := types.NewMsgPayPacketFeeAsync(packetID, packetFee) - _, err := suite.chainA.SendMsgs(msg) + _, err := suite.chainA.GetSimApp().IBCFeeKeeper.PayPacketFeeAsync(sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // message committed diff --git a/modules/apps/29-fee/types/errors.go b/modules/apps/29-fee/types/errors.go index 75fdd436c91..1e35c92e2b1 100644 --- a/modules/apps/29-fee/types/errors.go +++ b/modules/apps/29-fee/types/errors.go @@ -15,4 +15,5 @@ var ( ErrForwardRelayerAddressNotFound = sdkerrors.Register(ModuleName, 8, "forward relayer address not found") ErrFeeNotEnabled = sdkerrors.Register(ModuleName, 9, "fee module is not enabled for this channel. If this error occurs after channel setup, fee module may not be enabled") ErrRelayerNotFoundForAsyncAck = sdkerrors.Register(ModuleName, 10, "relayer address must be stored for async WriteAcknowledgement") + ErrFeeModuleLocked = sdkerrors.Register(ModuleName, 11, "the fee module is currently locked") ) diff --git a/modules/apps/29-fee/types/keys.go b/modules/apps/29-fee/types/keys.go index f2dd3458e20..c2b60ea69db 100644 --- a/modules/apps/29-fee/types/keys.go +++ b/modules/apps/29-fee/types/keys.go @@ -38,6 +38,12 @@ const ( ForwardRelayerPrefix = "forwardRelayer" ) +// KeyLocked returns the key used to lock and unlock the fee module. This key is used +// in the presence of a severe bug. +func KeyLocked() []byte { + return []byte("locked") +} + // KeyFeeEnabled returns the key that stores a flag to determine if fee logic should // be enabled for the given port and channel identifiers. func KeyFeeEnabled(portID, channelID string) []byte { From 49588fa6471d33c6f3f01d1091012be51add2295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:41:00 +0200 Subject: [PATCH 2/5] update comments --- modules/apps/29-fee/ibc_module.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/apps/29-fee/ibc_module.go b/modules/apps/29-fee/ibc_module.go index 042c649e7a0..f74cfa324d3 100644 --- a/modules/apps/29-fee/ibc_module.go +++ b/modules/apps/29-fee/ibc_module.go @@ -233,7 +233,7 @@ func (im IBCModule) OnAcknowledgementPacket( if im.keeper.IsLocked(ctx) { // if the fee keeper is locked then fee logic should be skipped - // this may occur in the presence of a severe bug which leads invalid state + // this may occur in the presence of a severe bug which leads to invalid state // the fee keeper will be unlocked after manual intervention // the acknowledgement has been unmarshalled into an ics29 acknowledgement // since the counterparty is still sending incentivized acknowledgements @@ -262,7 +262,7 @@ func (im IBCModule) OnTimeoutPacket( relayer sdk.AccAddress, ) error { // if the fee keeper is locked then fee logic should be skipped - // this may occur in the presence of a severe bug which leads invalid state + // this may occur in the presence of a severe bug which leads to invalid state // the fee keeper will be unlocked after manual intervention if !im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) || im.keeper.IsLocked(ctx) { return im.app.OnTimeoutPacket(ctx, packet, relayer) From d0bb2411b671843001dc70dd6ad35665ccac331a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 11 Apr 2022 15:49:59 +0200 Subject: [PATCH 3/5] chore: update fee module is locked error string --- modules/apps/29-fee/types/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/29-fee/types/errors.go b/modules/apps/29-fee/types/errors.go index 1e35c92e2b1..812db0a43a4 100644 --- a/modules/apps/29-fee/types/errors.go +++ b/modules/apps/29-fee/types/errors.go @@ -15,5 +15,5 @@ var ( ErrForwardRelayerAddressNotFound = sdkerrors.Register(ModuleName, 8, "forward relayer address not found") ErrFeeNotEnabled = sdkerrors.Register(ModuleName, 9, "fee module is not enabled for this channel. If this error occurs after channel setup, fee module may not be enabled") ErrRelayerNotFoundForAsyncAck = sdkerrors.Register(ModuleName, 10, "relayer address must be stored for async WriteAcknowledgement") - ErrFeeModuleLocked = sdkerrors.Register(ModuleName, 11, "the fee module is currently locked") + ErrFeeModuleLocked = sdkerrors.Register(ModuleName, 11, "the fee module is currently locked, a severe bug has been detected") ) From f6e7a8e2625e957fff7709a32bc952f259b7f927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 11 Apr 2022 15:51:13 +0200 Subject: [PATCH 4/5] update godoc to reference ADR 004 --- modules/apps/29-fee/keeper/keeper.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index 6777ab97b3b..2ebec6aaf42 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -87,12 +87,14 @@ func (k Keeper) EscrowAccountHasBalance(ctx sdk.Context, coins sdk.Coins) bool { // lockFeeModule sets a flag to determine if fee handling logic should run for the given channel // identified by channel and port identifiers. +// Please see ADR 004 for more information. func (k Keeper) lockFeeModule(ctx sdk.Context) { store := ctx.KVStore(k.storeKey) store.Set(types.KeyLocked(), []byte{1}) } // IsLocked indicates if the fee module is locked +// Please see ADR 004 for more information. func (k Keeper) IsLocked(ctx sdk.Context) bool { store := ctx.KVStore(k.storeKey) return store.Has(types.KeyLocked()) From b85f81485efb4ac21b40e57b1c8c4a42cbd35dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 11 Apr 2022 15:52:46 +0200 Subject: [PATCH 5/5] add more references to ADR 004 --- modules/apps/29-fee/ibc_module.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/apps/29-fee/ibc_module.go b/modules/apps/29-fee/ibc_module.go index 4b66b419ef7..9d026a9f032 100644 --- a/modules/apps/29-fee/ibc_module.go +++ b/modules/apps/29-fee/ibc_module.go @@ -238,6 +238,8 @@ func (im IBCModule) OnAcknowledgementPacket( // the acknowledgement has been unmarshalled into an ics29 acknowledgement // since the counterparty is still sending incentivized acknowledgements // for fee enabled channels + // + // Please see ADR 004 for more information. return im.app.OnAcknowledgementPacket(ctx, packet, ack.Result, relayer) } @@ -264,6 +266,8 @@ func (im IBCModule) OnTimeoutPacket( // if the fee keeper is locked then fee logic should be skipped // this may occur in the presence of a severe bug which leads to invalid state // the fee keeper will be unlocked after manual intervention + // + // Please see ADR 004 for more information. if !im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) || im.keeper.IsLocked(ctx) { return im.app.OnTimeoutPacket(ctx, packet, relayer) }