Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Oct 7, 2025

Describe your changes

Adds support for an optional masp frontend providers sustainability fees. This fee is supported as both a transparent and a shielded transfer (with the exception of incoming shielding IBC packets). To support it the followings have been changed:

Shielding and (IBC) unshielding

The sdk has been extended to allow specifying the entry for this fee. This is an optional target and a percentage which will be applied to all inputs. The sdk adjusts the input amounts to account for this extra fee.

There's one limitation for the IBC unshielding case. If the transaction ultimately fails (rejected by the target chain or timed out) we refund the amount of the unshielding to a disposable address. The frontend fees are not part of this amount and do not get refunded: to support this we'd need to temporarily escrow those tokens to an internal address and finalize the fee payment only once the target chain has confirmed the transaction to be successful (this would require some protocol support and should probably be done in conjunction with #4726). On top of this, the unshielding refunds are done to a disposable transparent address from which the user might want to reshield the tokens: this would incur in another frontend fee event leading to multiple fees applied to the same overall action.

Incoming IBC shielding packets

The optional target and percentage of the fee can be passed to the gen_ibc_shielding_transfer function. Since IBC is limited to a single token, the asset is automatically inferred to be the same of the transfer and fees are not supported when shielding nfts. The fee amount itself will be encoded as an additional shielded output of the MASP bundle so that we can avoid the need for protocol-breaking changes.

Osmosis swaps

Osmosis swaps are ultimately collapsed to the above ibc cases and so the same rules apply. In case the swap was fully shielded the frontend provider should refrain from charging a fee since this should count as a fully shielded transaction.

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
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

This is an automatic backport of pull request #4790 done by [Mergify](https://mergify.com).

@mergify mergify bot added the conflicts label Oct 7, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Oct 7, 2025

Cherry-pick of 2418cf5 has failed:

On branch mergify/bp/maint-201.0/pr-4790
Your branch is ahead of 'origin/maint-201.0' by 7 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 2418cf553.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   crates/apps_lib/src/cli.rs
	modified:   crates/sdk/src/args.rs
	modified:   crates/sdk/src/lib.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   crates/sdk/src/tx.rs

Cherry-pick of ce7150d has failed:

On branch mergify/bp/maint-201.0/pr-4790
Your branch is ahead of 'origin/maint-201.0' by 10 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit ce7150d93.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   crates/apps_lib/src/cli.rs
	modified:   crates/sdk/src/args.rs
	modified:   crates/sdk/src/lib.rs
	modified:   crates/tests/src/e2e/ibc_tests.rs
	modified:   crates/tests/src/integration/masp.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   crates/sdk/src/tx.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify
Copy link
Contributor Author

mergify bot commented Oct 7, 2025

🧪 CI Insights

Here's what we observed from your CI run for a7b976b.

🟢 All jobs passed!

But CI Insights is watching 👀

@tzemanovic tzemanovic force-pushed the mergify/bp/maint-201.0/pr-4790 branch from 9c5d777 to a7b976b Compare October 8, 2025 09:37
@tzemanovic tzemanovic added merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass and removed conflicts labels Oct 8, 2025
@mergify mergify bot added the queued label Oct 8, 2025
mergify bot added a commit that referenced this pull request Oct 8, 2025
@mergify mergify bot merged commit d1ab01b into maint-201.0 Oct 8, 2025
11 of 12 checks passed
@mergify mergify bot deleted the mergify/bp/maint-201.0/pr-4790 branch October 8, 2025 09:39
@mergify mergify bot removed the queued label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants