Files
pezkuwi-subxt/cumulus/parachains
PG Herveou 6b7be115fd Contracts: Add XCM traits to interface with contracts (#2086)
We are introducing a new set of `XcmController` traits (final name yet
to be determined).
These traits are implemented by `pallet-xcm` and allows other pallets,
such as `pallet_contracts`, to rely on these traits instead of tight
coupling them to `pallet-xcm`.

Using only the existing Xcm traits would mean duplicating the logic from
`pallet-xcm` in these other pallets, which we aim to avoid. Our
objective is to ensure that when these APIs are called from
`pallet-contracts`, they produce the exact same outcomes as if called
directly from `pallet-xcm`.

The other benefits is that we can also expose return values to
`pallet-contracts` instead of just calling `pallet-xcm` dispatchable and
getting a `DispatchResult` back.

See traits integration in this PR
https://github.com/paritytech/polkadot-sdk/pull/1248, where the traits
are used as follow to define and implement `pallet-contracts` Config.
```rs
// Contracts config:
pub trait Config: frame_system::Config {
  // ...

  /// A type that exposes XCM APIs, allowing contracts to interact with other parachains, and
  /// execute XCM programs.
  type Xcm: xcm_executor::traits::Controller<
	  OriginFor<Self>,
	  <Self as frame_system::Config>::RuntimeCall,
	  BlockNumberFor<Self>,
  >;
}

// implementation
impl pallet_contracts::Config for Runtime {
        // ...

	type Xcm = pallet_xcm::Pallet<Self>;
}
```

---------

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: command-bot <>
2023-11-10 17:38:24 +02:00
..

Parachains

This directory is the home of Parity-developed parachain runtimes. This directory is runtime focused, and does not include builds of parachain nodes.

The general internal structure is:

  • chain-specs: Chain specs for the runtimes contained in its sibling dir runtimes.
  • common: Common configurations, impls, etc. used by several parachain runtimes.
  • integration-tests: Integration tests to test parachain interactions via XCM.
  • pallets: FRAME pallets that are specific to parachains.
  • runtimes: The entry point for parachain runtimes.

System Parachains

The runtimes directory includes many, but is not limited to, system parachains. Likewise, not all system parachains are in this repo.

Releases

The project maintainers generally try to release a set of parachain runtimes for each Polkadot Relay Chain runtime release.