-
Notifications
You must be signed in to change notification settings - Fork 955
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
Refine IBC parts for masp ibc replay protection #3422
Refine IBC parts for masp ibc replay protection #3422
Conversation
…ncodings are consistent.
…ts no longer used.
…f the success acknowledgement.
439e5a9
to
fb0ed6f
Compare
fb0ed6f
to
0c999bd
Compare
14fe5d5
to
05c584a
Compare
4de6577
to
0a5d480
Compare
// message cannot be found, then ignore this message. Though this check | ||
// is done in the IBC VP, the test is repeated here to avoid making | ||
// assumptions about how the IBC VP interprets the given message. | ||
if self |
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.
Could we keep this check or have something with similar effect so that we avoid making assumptions about the execution of the IBC VP? See also #3409 (comment) .
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.
Overall could the assumptions that the MASP VP makes about the execution of the IBC VP be reduced? See a more precise description of the potentially problematic assumptions here #3409 (comment) .
&packet.chan_id_on_a, | ||
packet.seq_on_a, | ||
); | ||
if !keys_changed.contains(&ack_key) { |
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.
Putting aside assumptions about the behaviour/judgement of the IBC VP, is there a chance that an IBC packet that has been previously acknowledged in a previous state change could be replayed here successfully and be used to fool the MASP VP into, say, reshielding funds from the packet?
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.
it is possible if IBC VP isn't triggered. I'll revert this.
// Mirror how the IBC token is derived in | ||
// gen_ibc_shielded_transfer in the non-refund case | ||
let ibc_denom = self.query_ibc_denom( |
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.
Discussion here: #3409 (comment) . Would the above comment about "mirror"ing still be correct with this change?
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 changed it to check the packet receipt
a51f3eb
to
a942176
Compare
IBC E2E tests |
crates/sdk/src/rpc.rs
Outdated
if let Address::Internal(InternalAddress::IbcToken(ibc_token_hash)) = | ||
token | ||
{ | ||
extract_base_token(context, ibc_token_hash.clone(), None).await |
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.
There is no guarantee that the base token of the source chain is the same as that of the destination(this) chain.
We should use zero denomination for all IbcToken
s.
Tested NFT transfers between local Namada and Stargaze testnet.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3422 +/- ##
==========================================
- Coverage 53.92% 53.74% -0.19%
==========================================
Files 317 318 +1
Lines 107575 107887 +312
==========================================
- Hits 58011 57980 -31
- Misses 49564 49907 +343 ☔ View full report in Codecov by Sentry. |
merged with #3444 |
Describe your changes
Indicate on which release or other PRs this topic is based on
#3409
Diff: 76fab4c...5c3b3ab
Checklist before merging to
draft