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

Block outgoing MANTA transfers on the XCM instruction level #1223

Merged
merged 9 commits into from
Jul 20, 2023

Conversation

ghzlatarev
Copy link
Contributor

@ghzlatarev ghzlatarev commented Jul 17, 2023

Description

  • Someone could've tried to bypass xTokens outgoing transfers filter by sending a TransferReserveAsset instruction with a top level paid XCM message.
  • In order to prevent that we modify the AllowTopLevelPaidExecutionFrom and AllowTopLevelPaidExecutionDescendOriginFirst barriers to check for the TransferReserveAsset instruction after the BuyExecution and return error if it is present in the message
  • Added a test case for to showcase this barrier
  • We still need the xTokens outgoing transfers filter because that covers a different code path

Before we can approve this PR for merge, please make sure that all the following items have been checked off:

  • Connected to an issue with discussion and accepted design using zenhub "Connect issue" button below
  • Added one label out of the L- group to this PR
  • Added one or more labels from the A- and C- groups to this PR
  • Explicitly labelled A-calamari and/or A-manta if your changes are meant for/impact either of these (CI depends on it)
  • Re-reviewed Files changed in the Github PR explorer.

Situational Notes:

  • If adding functionality, write unit tests!
  • If importing a new pallet, choose a proper module index for it, and allow it in BaseFilter. Ensure every extrinsic works from front-end. If there's corresponding tool, ensure both work for each other.
  • If needed, update our Javascript/Typescript APIs. These APIs are officially used by exchanges or community developers.
  • If modifying existing runtime storage items, make sure to implement storage migrations for the runtime and test them with try-runtime. This includes migrations inherited from upstream changes, and you can search the diffs for modifications of #[pallet::storage] items to check for any.

Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
@ghzlatarev ghzlatarev self-assigned this Jul 17, 2023
@ghzlatarev ghzlatarev added C-enhancement Category: An issue proposing an enhancement or a PR with one A-manta Area: Issues and PRs related to the Manta Runtime A-calamari Area: Issues and PRs related to the Calamari Runtime A-xcm Area: Issues and PRs related to Cross-Consensus Messaging (XCM) L-changed Log: Issues and PRs related to changes labels Jul 17, 2023
@github-actions
Copy link

github-actions bot commented Jul 17, 2023

⚠️ Congestion test: 1-day congestion cost (calamari-runtime) is NOT above the target daily congestion cost

@github-actions
Copy link

github-actions bot commented Jul 17, 2023

✅ Congestion test: 1-day congestion cost (manta-runtime) is above the target daily congestion cost

Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
@ghzlatarev ghzlatarev changed the title Add more instructions to AllowUnpaidExecutionFrom Block outgoing MANTA transfers on the XCM instruction level Jul 18, 2023
@ghzlatarev ghzlatarev marked this pull request as ready for review July 18, 2023 05:21
ghzlatarev and others added 2 commits July 18, 2023 09:06
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
@ghzlatarev ghzlatarev requested a review from Dengjianping July 19, 2023 03:25
@ghzlatarev ghzlatarev requested a review from Dengjianping July 19, 2023 10:31
@ghzlatarev ghzlatarev merged commit e82ca14 into manta Jul 20, 2023
@ghzlatarev ghzlatarev deleted the ghzlatarev/xcm-barrier-update branch July 20, 2023 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-calamari Area: Issues and PRs related to the Calamari Runtime A-manta Area: Issues and PRs related to the Manta Runtime A-xcm Area: Issues and PRs related to Cross-Consensus Messaging (XCM) C-enhancement Category: An issue proposing an enhancement or a PR with one L-changed Log: Issues and PRs related to changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants