-
Notifications
You must be signed in to change notification settings - Fork 8
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
F/rewards distribution send #96
base: f/btc-lc-feature
Are you sure you want to change the base?
Conversation
contracts/babylon/src/contract.rs
Outdated
// Route to babylon over IBC | ||
let channel = IBC_CHANNEL.load(deps.storage)?; |
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.
Hmm I guess IBC_CHANNEL
is the channel that this contract involves, but not necessarily a channel for IBC transfer. Probably we need to confirm this in some e2e test.
Maybe as a part of the integration, one needs to establish an IBC channel for interchain transfer, and the contract side needs to remember this channel ID in the config, for facilitating the reward mechanism.
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.
Yes, this was my suspicion as well. Implemented it this way for simplicity. Perhaps we can configure a single channel to do / support both, custom messages and ICS20 transfers?
Will write an e2e test and confirm this in any case.
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.
Was finally able to e2e test this.
Using a single channel doesn't work, as CosmWasm's IbcMsg::Transfer
requires an established channel against the ibctransfer
module, not the contract address under wasm
.
I think this is a design decision that makes sense, as in general you don't want to establish a channel for every contract that needs / wants to use ICS20 transfers.
Update: Ref.: https://github.com/CosmWasm/cosmwasm/blob/4da538debc73065f9aa8f489895cb54393db0f7c/packages/std/src/ibc.rs#L26-L54
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.
Using a single channel doesn't work, as CosmWasm's IbcMsg::Transfer requires an established channel against the ibctransfer module, not the contract address under wasm.
Yes that's right, even though we can wire up a IBC transfer packet in the contract side, babylon side's zone concerige won't recognise it.
If we really, really want to let zone concerige handle IBC tansfer, then zone concierge has to invoke IBC transfer module (in particular this code snippet) to handle the IBC transfer packets. But I'm not sure if it's worth it
So I'd recommend we consider consolidating IBC channels as future work, and for now start with having 2 IBC channels. This also creates a clean separation between channels' functionalities following IBC channels' best practices
961ca90
to
da5dbc2
Compare
934aabc
to
5a3698e
Compare
da5dbc2
to
54e733f
Compare
da78c91
to
e528d44
Compare
…n op slashing msg
7ee2ced
to
19531cd
Compare
This reverts commit 878776c.
9455a91
to
cb8e897
Compare
#97 follow-up. Sends the rewards along with the distribution table to Babylon using ICS-20 with a json payload in the Memo field.