Skip to content
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

Support only a transparent address as a refund target #3646

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

yito88
Copy link
Member

@yito88 yito88 commented Aug 14, 2024

Describe your changes

Closes #3620

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes

@yito88
Copy link
Member Author

yito88 commented Aug 14, 2024

hmm, wasm compilation error happened again on my Mac

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 38.66667% with 46 lines in your changes missing coverage. Please review.

Project coverage is 61.20%. Comparing base (80268fa) to head (21d49a5).
Report is 17 commits behind head on main.

Files Patch % Lines
crates/sdk/src/tx.rs 0.00% 30 Missing ⚠️
crates/ibc/src/context/nft_transfer.rs 41.66% 7 Missing ⚠️
crates/ibc/src/context/token_transfer.rs 66.66% 4 Missing ⚠️
crates/ibc/src/msg.rs 50.00% 3 Missing ⚠️
crates/ibc/src/lib.rs 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3646      +/-   ##
==========================================
+ Coverage   61.18%   61.20%   +0.01%     
==========================================
  Files         312      312              
  Lines      101384   101356      -28     
==========================================
- Hits        62033    62031       -2     
+ Misses      39351    39325      -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yito88 yito88 force-pushed the yuji/ibc-refund-transparent branch from bbcfc57 to db26e06 Compare August 16, 2024 11:31
@yito88 yito88 requested review from sug0 and grarco August 16, 2024 14:39
let mut wallet = context.wallet_mut().await;
if let Some(addr) = wallet.find_address(IBC_REFUND_TARGET_ALIAS) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's better to generate a new disposable address every time, otherwise we might establish some linkage between the shielded ibc operations and this transparent refund address

Copy link
Member Author

@yito88 yito88 Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a default one. A user can prepare an address and set it with --refund-target.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yes, it's better to generate a new one for useability

@@ -28,6 +28,7 @@ where
C: IbcCommonContext,
{
inner: Rc<RefCell<C>>,
is_shielded: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have this new field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the sender in the IBC packet is replaced with the refund address. The context doesn't know whether the sender is the actual sender or the refund target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework shielded action refund
2 participants