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

XCM: Deny barrier checks for nested XCMs with specific instructions to be executed on the local chain #7200

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bkontur
Copy link
Contributor

@bkontur bkontur commented Jan 16, 2025

Resolves (partially): #7148
Depends on: #7169

Description

For context and additional information, please refer to Problem 2 - Barrier vs nested XCM validation.

TODO

  • Evaluate PoC:
    • Keep it as it is and be explicit:
      1. Name the Deny barriers for the top level.
      2. Name the Deny barrier for nested with DenyInstructionsWithXcmFor.
    • Alternatively, hard-code those three instructions in DenyThenTry, so we wouldn’t need DenyInstructionsWithXcm. However, this approach wouldn’t be as general.
    • Another possibility is to check DenyInstructionsWithXcm::Inner for the actual message, so we don’t need duplication for top-level and nested (not sure, maybe be explicit is good thing) - see Problem2 - example. Instead of this:
    DenyThenTry<
                 (
                                // Deny for top level XCM program 
                                DenyReserveTransferToRelayChain,
                                // Dedicated barrier for nested XCM programs
                                DenyInstructionsWithXcmFor<
                                                 // Repeat all Deny filters here 
                                                 DenyReserveTransferToRelayChain,
                                 >
                 ),
    
    we could just use:
    DenyThenTry<
                 (
                                // Dedicated barrier for XCM programs
                                DenyInstructionsWithXcmFor<
                                                 // Add all `Deny` filters here 
                                                 DenyReserveTransferToRelayChain,
                                                 ...
                                 >
                 ),
    
  • Consider better name DenyInstructionsWithXcmFor
  • Clean-up and docs
  • Set for the runtimes where we use DenyThenTry, but at first we need to merge xcm: fix for DenyThenTry Barrier #7169 or rebase this branch on the top of yrong:fix-for-deny-then-try
  • Schedule sec.audit

@bkontur bkontur added T6-XCM This PR/Issue is related to XCM. C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. labels Jan 16, 2025
@bkontur bkontur force-pushed the bko-deny-nested-xcm-barrier branch from 2c6325f to 9c80770 Compare January 22, 2025 09:31
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12905211993
Failed job name: fmt

@bkontur bkontur added the C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. label Jan 22, 2025
@bkontur bkontur assigned bkontur and unassigned bkontur Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. T6-XCM This PR/Issue is related to XCM.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

[XCM] Investigate better support for filtering XCM programs with Barrier
1 participant