-
Notifications
You must be signed in to change notification settings - Fork 960
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
Make the sender set MASP transaction to IBC memo #3444
Conversation
…ncodings are consistent.
…ts no longer used.
…f the success acknowledgement.
crates/apps_lib/src/cli.rs
Outdated
@@ -6498,7 +6526,7 @@ pub mod args { | |||
"The channel ID via which the token is received." | |||
))) | |||
.arg(REFUND.def().help(wrap!( | |||
"Generate the shielded transfer for refunding." | |||
"Generate the shielding transfer for refunding." |
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.
This is used to generate both the refunding tx and the actual shielding transfer on the destination chain, correct? If that's the case maybe we can change the message here
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.
Thanks, Hermes used the argument. Now build_ibc_transfer
generates the masp tx for the refunding.
Users don't have to generate it with this command anymore.
I'll remove this argument.
crates/sdk/src/args.rs
Outdated
@@ -2662,6 +2662,6 @@ pub struct GenIbcShieldedTransfer<C: NamadaTypes = SdkTypes> { | |||
pub port_id: PortId, | |||
/// Channel ID via which the token is received | |||
pub channel_id: ChannelId, | |||
/// Generate the shielded transfer for refunding | |||
/// Generate the shielding transfer for refunding |
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.
Same here as in the client
crates/sdk/src/masp.rs
Outdated
let mut masp_txs = Vec::new(); | ||
for cmt in &tx.header.batch { | ||
let tx_data = tx.data(cmt).ok_or_else(|| { | ||
Error::Other("Missing expected masp transaction".to_string()) |
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.
Error::Other("Missing expected masp transaction".to_string()) | |
Error::Other("Missing transaction data".to_string()) |
crates/sdk/src/masp.rs
Outdated
Ok(masp_txs) | ||
} else { | ||
Err(Error::Other( | ||
"IBC meesage doesn't have masp transaction".to_string(), |
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.
"IBC meesage doesn't have masp transaction".to_string(), | |
"IBC message doesn't have masp transaction".to_string(), |
@@ -27,6 +27,7 @@ pub enum Action { | |||
Gov(GovAction), | |||
Pgf(PgfAction), | |||
Masp(MaspAction), | |||
IbcShielding, |
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.
I was thinking that instead of IbcShielding
perhaps we could just expand the MaspAction
to be an enum like:
enum MaspAction {
TxSection(Hash),
InnerTxCmt(Hash)
}
The first case is the one we already have and its hash is the hash of the tx's Masp
section. The second case is an alternative to IbcShielding
and its hash is that of the TxCommitments
(i.e. the inner tx hash). The ibc transaction could write the second variant when the tx is an incoming one. In the SDK then, we can look at the specific inner txs of the batch that contain a masp ibc tx and extract only their memos without looking at all of them.
This is a minor suggestion, feel free to ignore it
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.
Thanks, it looks better. However, the change for setting Hash into the action caused wasm compilation error on arm mac. Let's leave it as it is.
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.
Minor comments but looks good to me, thanks!
Actually, I believe there's an issue, my bad for not spotting it earlier. In the sdk we use The issue is that we don't know if that specific inner tx was successful: if it wasn't, the client (or indexer) extracts information from a wrong source and spoils the internal state of the We need a way to tell, in the events we emit, which transactions of the batch are actually valid and filter only these ones in |
Opened #3488 to track this separately |
Describe your changes
closes #3438
WARNING: don't merge this PR for now becausetx_ibc.wasm
failed to be compiled on my Apple silicon machine.We could workaround this error.
Indicate on which release or other PRs this topic is based on
#3422
Diff: 5c3b3ab...ca79554
Checklist before merging to
draft