Open
Conversation
e4238b9 to
edae216
Compare
edae216 to
d0c9936
Compare
This was referenced Jan 23, 2023
pr0n00gler
reviewed
Jan 24, 2023
docs/neutron/feerefunder/overview.md
Outdated
| * `ack_fee` - amount of coins to refund relayer for submittting ack message for a particular IBC packet (i.e. `500untrn`); | ||
| * `timeout_fee` - amount of coins to refund relayer for submitting timeout message for a particular IBC packet (i.e. `500untrn`); | ||
| * `recv_fee` - currently is used for compatibility with ICS-29 interface only and **must be set to zero** (i.e. `0untrn`), because Neutron's fee module can't refund relayers for submission of `Recv` IBC packets due to compatibility with target chains. | ||
| * `payer` - optional address of the contract which will pay for the fees. Please note that payer must give allowance to the contract to spend fees. |
Collaborator
There was a problem hiding this comment.
optional address of the contract
looks a bit weird
docs/neutron/feerefunder/state.md
Outdated
| The FeeRefunder module stores one [FeeInfo](https://github.com/neutron-org/neutron/blob/a9e8ba5ebb9230bec97a4f2826d75a4e0e6130d9/proto/feerefunder/genesis.proto#L18) per [`channel_id`, `port_id` and `sequence`](https://github.com/neutron-org/neutron/blob/a9e8ba5ebb9230bec97a4f2826d75a4e0e6130d9/x/feerefunder/types/keys.go#L28). | ||
| `FeeInfo` contains all the necessary info to store data about fees to properly refund relayers and return fees to the original caller of IBC messages: | ||
| * `payer` - stores an address of the smart-contract which issues `Transfer` or `SubmitTx` message; | ||
| * `payer` - stores an address of the smart-contract (or fee payer) which issues `Transfer` or `SubmitTx` message; |
Collaborator
There was a problem hiding this comment.
Looks a bit weird now, cause fee payer doesn't issue Transfer or SubmitTx messages
docs/neutron/feerefunder/overview.md
Outdated
|
|
||
| 2. The fee payer can grant an allowance to a contract address, which allows the contract to use tokens from this address for the fees. Optionally, a limit, expire date, and period can be set, please refer to the [feegrant module's documentation in the Cosmos SDK](https://docs.cosmos.network/v0.46/modules/feegrant/) for more information. | ||
|
|
||
| 3. When an interchain transaction is requested by a contract, the feerefunder module checks the allowance in general by using the feegrant module's GetAllowance function. |
NeverHappened
suggested changes
Jan 25, 2023
docs/neutron/feerefunder/state.md
Outdated
| The FeeRefunder module stores one [FeeInfo](https://github.com/neutron-org/neutron/blob/a9e8ba5ebb9230bec97a4f2826d75a4e0e6130d9/proto/feerefunder/genesis.proto#L18) per [`channel_id`, `port_id` and `sequence`](https://github.com/neutron-org/neutron/blob/a9e8ba5ebb9230bec97a4f2826d75a4e0e6130d9/x/feerefunder/types/keys.go#L28). | ||
| `FeeInfo` contains all the necessary info to store data about fees to properly refund relayers and return fees to the original caller of IBC messages: | ||
| * `payer` - stores an address of the smart-contract which issues `Transfer` or `SubmitTx` message; | ||
| * `payer` - stores an address of the smart-contract (or fee payer) which will be refunded after the IBC packet is processed; |
Contributor
There was a problem hiding this comment.
maybe stores the fee payer address (smart contract or other fee payer) which will be refunded after the IBC packet is processed?
sotnikov-s
reviewed
Jan 26, 2023
| timeout_fee: | ||
| - denom: "untrn" | ||
| amount: "500" | ||
| payer: neutron10h9stc5v6ntgeygf5xf945njqq5h32r54rf7kf |
Contributor
docs/neutron/feerefunder/overview.md
Outdated
| * `ack_fee` - amount of coins to refund relayer for submittting ack message for a particular IBC packet (i.e. `500untrn`); | ||
| * `timeout_fee` - amount of coins to refund relayer for submitting timeout message for a particular IBC packet (i.e. `500untrn`); | ||
| * `recv_fee` - currently is used for compatibility with ICS-29 interface only and **must be set to zero** (i.e. `0untrn`), because Neutron's fee module can't refund relayers for submission of `Recv` IBC packets due to compatibility with target chains. | ||
| * `payer` - optional address which will pay for the fees. Please note that payer must give allowance to the contract to spend fees. |
Contributor
There was a problem hiding this comment.
to have a link to the relative feegrant doc page will be very handy here. or a link to the Details on Fee Payer section
docs/neutron/feerefunder/overview.md
Outdated
| > **Note:** the fees can be specified only in native Cosmos-SDK coins. CW-20 coins are not supported! | ||
|
|
||
| When a smart-contract issues `Transfer` or `SubmitTx` message, the fee Module deduct the whole specified fee amount (`ack_fee + timeout_fee + recv_fee`) and locks that amount in the module's escrow address. When a relayer submits `Ack` message for a particular packet, the module sends the specified amount of `ack_fee` to the relayer from the escrow address and return the specified `timeout_fee` to the contract which issued the original `Transfer` or `SubmitTx` message. In case when relayer submits `Timeout` message, things go the other way around: the relayer is refunded with `timeout_fee` and the contract gets `ack_fee` back. | ||
| When a smart-contract issues `Transfer` or `SubmitTx` message, the fee Module deduct the whole specified fee amount (`ack_fee + timeout_fee + recv_fee`) from contract address or from payer address (if it is defined and there is allowance from payer to contract address) and locks that amount in the module's escrow address. When a relayer submits `Ack` message for a particular packet, the module sends the specified amount of `ack_fee` to the relayer from the escrow address and return the specified `timeout_fee` to the contract (or fee payer) which issued the original `Transfer` or `SubmitTx` message. In case when relayer submits `Timeout` message, things go the other way around: the relayer is refunded with `timeout_fee` and the contract gets `ack_fee` back. |
Contributor
There was a problem hiding this comment.
please correct:
message, the fee Module (1) deduct (2) the whole:
- the FeeRefunder Module
- deducts
the relayer is refunded with
timeout_feeand the contract (1) getsack_feeback
- and the contract (or fee payer)
sotnikov-s
approved these changes
Jan 26, 2023
NeverHappened
approved these changes
Jan 27, 2023
pr0n00gler
approved these changes
Jan 29, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

related stuff: