-
Notifications
You must be signed in to change notification settings - Fork 610
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
docs: msg types for fee middleware #1572
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
96f3c49
fix broken link
charleenfei 250e45f
Merge branch 'main' of github.com:cosmos/ibc-go
charleenfei bf3b96b
Merge branch 'main' of github.com:cosmos/ibc-go
charleenfei ed4a153
fix: rm AllowUpdateAfter... check (#1118)
charleenfei 8018627
Merge branch 'main' of github.com:cosmos/ibc-go
charleenfei 08e71e7
Merge branch 'main' of github.com:cosmos/ibc-go
charleenfei 05f50c4
Merge branch 'main' of github.com:cosmos/ibc-go
charleenfei a06b2f3
updated docs
charleenfei 169ead2
Merge branch 'main' of github.com:cosmos/ibc-go
charleenfei 8a2c986
Merge branch 'main' into charly/docs_fee_middleware
charleenfei 21ac60f
update re: comments
charleenfei 5aa657b
Merge branch 'main' into charly/docs_fee_middleware
seantking a834ad5
final nits
seantking c4412fe
nits: adding inline comments
seantking File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!-- | ||
order: 3 | ||
--> | ||
|
||
# Escrowing fees | ||
|
||
The fee middleware module exposes two different ways to pay fees for relaying IBC packets: | ||
|
||
1. `MsgPayPacketFee`, which enables the escrowing of fees for a packet at the next sequence send and should be combined into one `MultiMsgTx` with the message that will be paid for. | ||
|
||
Note that the `Relayers` field has been set up to allow for an optional whitelist of relayers permitted to receive this fee, however, this feature has not yet been enabled at this time. | ||
|
||
``` | ||
type MsgPayPacketFee struct{ | ||
Fee Fee | ||
SourcePortId string | ||
SourceChannelId string | ||
Signer string | ||
Relayers []string | ||
} | ||
``` | ||
|
||
The `Fee` message contained in this synchronous fee payment method configures different fees which will be paid out for `MsgRecvPacket`, `MsgAcknowledgement`, and `MsgTimeout`/`MsgTimeoutOnClose`. | ||
|
||
``` | ||
type Fee struct { | ||
RecvFee types.Coins | ||
AckFee types.Coins | ||
TimeoutFee types.Coin` | ||
} | ||
``` | ||
|
||
2. `MsgPayPacketFeeAsync`, which enables the asynchronous escrowing of fees for a specified packet: | ||
|
||
``` | ||
type MsgPayPacketFeeAsync struct { | ||
PacketId channeltypes.PacketId | ||
PacketFee PacketFee | ||
} | ||
``` | ||
|
||
where the `PacketFee` also specifies the `Fee` to be paid as well as the refund address for fees which are not paid out | ||
``` | ||
type PacketFee struct { | ||
Fee Fee | ||
RefundAddress string | ||
Relayers []]string | ||
} | ||
``` | ||
|
||
Please see our [wiki](https://github.com/cosmos/ibc-go/wiki/Fee-enabled-fungible-token-transfers) for example flows on how to use these messages to incentivise a token transfer channel. | ||
|
||
# Paying out the escrowed fees | ||
|
||
In the case of a successful transaction, `RecvFee` will be paid out to the designated counterparty payee address which has been registered on the receiver chain and sent back with the `MsgAcknowledgement`, `AckFee` will be paid out to the relayer address which has submitted the `MsgAcknowledgement` on the sending chain (or the registered payee in case one has been registered for the relayer address), and `TimeoutFee` will be reimbursed to the account which escrowed the fee. In cases of timeout transactions, `RecvFee` and `AckFee` will be reimbursed. | ||
|
||
Please note that fee payments are built on the assumption that sender chains are the source of incentives — the chain that sends the packets is the same chain where fee payments will occur -- please see the [relayer operator section](../ics29-fee/fee-distribution.md) to understand the flow for registering payee and counterparty payee (fee receiving) addresses. | ||
|
||
# A locked fee middleware module | ||
crodriguezvega marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The fee middleware module can become locked if the situation arises that the escrow account for the fees does not have sufficient funds to pay out the fees which have been escrowed for each packet. This situation indicates a severe bug. In this case, the fee module will be locked until manual intervention fixes the issue. | ||
|
||
A locked fee module will simply skip fee logic and continue on to the underlying packet flow. A channel with a locked fee module will temporarily function as a fee disabled channel, and the locking of a fee module will not affect the continued flow of packets over the channel. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add this new page to the
children
array! I think you'll need to merge main first