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

chore: upgrade to polkadot v1.11.0 #666

Merged
merged 47 commits into from
Sep 13, 2024
Merged

chore: upgrade to polkadot v1.11.0 #666

merged 47 commits into from
Sep 13, 2024

Conversation

Roznovjak
Copy link
Collaborator

@Roznovjak Roznovjak commented Aug 12, 2024

NOTES:
All changes can be found here:

Breaking changes:

Notable changes

  • System Callbacks: The system pallet gets five new config items - all of which can be safely set to () as default.

    • SingleBlockMigrations: replaces the Executive now for configuring migrations.
    • MultiBlockMigrator: the pallet-migrations would be set here, if deployed.
    • PreInherents: a hook that runs before any inherent.
    • PostInherents: a hook to run between inherents and poll/MBM logic.
    • PostTransactions: a hook to run after all transactions but before on_idle.
  • Add the ability for MessageQueue to process enqueued messages on idle

  • Rate limiting for RPC server which can be utilized by the CLI --rpc-rate-limit

  • Adds pallet-parameters that allows to have parameters for pallet configs that dynamically change at runtime

  • pallet-migrations is introduced that can be configured in the System of a runtime to act as multi-block migrator.

  • Add claim_assets extrinsic to pallet-xcm

  • The construct_runtime macro now generates a test to assert that all GenesisConfigs of all pallets can be build within the runtime.

  • XCM fee payment API: A runtime API was added for estimating the fees required for XCM execution and delivery.

    • fn query_acceptable_payment_assets(xcm_version: Version) -> Result<Vec, Error>;
    • fn query_xcm_weight(message: VersionedXcm) -> Result<Weight, Error>;
    • fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result<u128, Error>;
    • fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result<VersionedAssets, Error>;
  • pallet-xcm's extrinsics teleport_assets and reserve_transfer_assets have been marked as deprecated. Please change their usage to the limited_teleport_assets and limited_reserve_transfer_assets, respectively; or use the generic/flexible transfer_assets extrinsic.

  • pallet-xcm's extrinsics execute and send have been marked as deprecated. Please change their usage to the new execute_blob and send_blob. There's a new utility in PolkadotJS Apps for encoding XCMs you can use: https://polkadot.js.org/apps/#/utilities/xcm

  • Migrations: prevent accidentally using inner unversioned migration instead of VersionedMigration

  • Adds optional HRMP notification handlers to the xcm-executor. These handlers are 3 new config types on the xcm-executor Config trait:

    • HrmpNewChannelOpenRequestHandler
    • HrmpChannelAcceptedHandler
    • HrmpChannelClosingHandler
  • The runtime now can provide a number of predefined presets of RuntimeGenesisConfig struct. This presets are intended to be used in different deployments, e.g.: local, staging, etc, and should be included into the corresponding chain-specs.
Having GenesisConfig presets in runtime allows to fully decouple node from runtime types (the problem is described in #1984).

    • The GenesisBuilder API was adjusted to enable this functionality,
    • (Breaking change) Old create_default_config method was removed, build_config was renamed to build_state. As a consequence a node won't be able to interact with genesis config for older runtimes. The cleanup was made for sake of API simplicity.
  • New call hrmp.establish_channel_with_system to allow parachains to establish a channel with a system parachain

  • (Breaking change) For all authority nodes, the node binary now enforces the presence of a network key, instead of auto-generating when it is absent.

  • pallet-xcm has a new extrinsic transfer_assets_using_type_and_then for transferring assets from local chain to destination chain using an explicit XCM transfer types for transferring the assets and the fees:

    • TransferType::LocalReserve: transfer assets to sovereign account of destination
chain and forward a notification XCM to dest to mint and deposit reserve-based
assets to beneficiary.
    • TransferType::DestinationReserve: burn local assets and forward a notification to
dest chain to withdraw the reserve assets from this chain's sovereign account and
deposit them to beneficiary.
    • TransferType::RemoteReserve(reserve): burn local assets, forward XCM to reserve
chain to move reserves from this chain's SA to dest chain's SA, and forward another
XCM to dest to mint and deposit reserve-based assets to beneficiary. Typically
the remote reserve is Asset Hub.
    • TransferType::Teleport: burn local assets and forward XCM to dest chain to
mint/teleport assets and deposit them to beneficiary.
By default, an asset's reserve is its origin chain. But sometimes we may want to explicitly use another chain as reserve (as long as allowed by runtime IsReserve filter).
This is very helpful for transferring assets with multiple configured reserves (such as Asset Hub ForeignAssets), when the transfer strictly depends on the used reserve location.
      E.g. For transferring a bridged Foreign Assets between local parachains, Asset Hub or the parachain that bridged the asset over must be used as the reserve location. Same when transferring bridged assets back across the bridge, the local bridging parachain must be used as the explicit reserve location.
      The new method takes a custom_xcm_on_dest parameter allowing the caller to specify what should happen to the transferred assets once they reach the dest chain. The custom_xcm_on_dest parameter should contains the instructions to execute on dest as a final step. Usually as simple as:
 Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }]),
 but could be something more exotic like sending the assets even further.
  • Remove XCM SafeCallFilter for chains using Weights::v3

    • SafeCallFilter was removed from Rococo and Westend relay and system chains as they all now use Weights::v3 which already accounts for call PoV size.
This effectively removes artificial limitations on what users can XCM::Transact on these chains (blockspace limitations are still upheld).

@Roznovjak Roznovjak self-assigned this Aug 12, 2024
Copy link

github-actions bot commented Aug 12, 2024

Crate versions that have been updated:

  • runtime-integration-tests: v1.0.2 -> v1.0.3
  • basilisk: v14.0.0 -> v15.0.0
  • pallet-asset-registry: v2.3.3 -> v2.3.4
  • pallet-marketplace: v5.0.18 -> v5.0.19
  • pallet-xyk-liquidity-mining: v1.1.11 -> v1.1.12
  • pallet-xyk-liquidity-mining-benchmarking: v1.0.17 -> v1.0.18
  • primitives: v6.6.2 -> v6.6.3
  • basilisk-runtime: v118.0.0 -> v119.0.0

Runtime version has been increased.

@Roznovjak Roznovjak marked this pull request as ready for review August 29, 2024 11:11
Cargo.toml Show resolved Hide resolved
primitives/Cargo.toml Outdated Show resolved Hide resolved
runtime/basilisk/src/apis.rs Show resolved Hide resolved
runtime/basilisk/src/assets.rs Show resolved Hide resolved
@@ -322,6 +325,7 @@ impl pallet_message_queue::Config for Runtime {
type HeapSize = MessageQueueHeapSize;
type MaxStale = MessageQueueMaxStale;
type ServiceWeight = MessageQueueServiceWeight;
type IdleMaxServiceWeight = ();
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like an important field we should configure?! So the max service weight we want to use on idle.

Copy link
Member

Choose a reason for hiding this comment

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

default is none

Copy link
Member

Choose a reason for hiding this comment

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

but mby we could configure it to ServiceWeight so that we are able to process messages on idle as well

//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any reason that sometimes we use DEV as chain, but sometimes we use None like here runtime/basilisk/src/weights/pallet_whitelist.rs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason is that some pallets can't be benchmarked with the old benchmarking command (there is a bug, the command line parameter --heap-pages is broken) so some pallets are benchmarked with new benchmarking tool. But this new tool uses a different chain spec and doesn't work with all pallets. As a result, we need to use 2 different benchmarking tools.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually no. It looks like a different chain spec is used. But it should not be a problem.

@mrq1911
Copy link
Member

mrq1911 commented Sep 12, 2024

damn, i was using that... ty for letting me know @Roznovjak

@mrq1911
Copy link
Member

mrq1911 commented Sep 12, 2024

  • (Breaking change) For all authority nodes, the node binary now enforces the presence of a network key, instead of auto-generating when it is absent.

important breking change that will affect collators

));
});
Rococo::execute_with(|| {
assert_ok!(rococo_runtime::XcmPallet::reserve_transfer_assets(
assert_ok!(rococo_runtime::XcmPallet::limited_reserve_transfer_assets(
Copy link
Member

Choose a reason for hiding this comment

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

reserve_transfer_asset was removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

deprecated, so I changed the test to get rid of the warning.

runtime/basilisk/src/apis.rs Show resolved Hide resolved
@@ -18,30 +18,28 @@

Copy link
Member

Choose a reason for hiding this comment

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

do we really still need this pallet?

@@ -322,6 +325,7 @@ impl pallet_message_queue::Config for Runtime {
type HeapSize = MessageQueueHeapSize;
type MaxStale = MessageQueueMaxStale;
type ServiceWeight = MessageQueueServiceWeight;
type IdleMaxServiceWeight = ();
Copy link
Member

Choose a reason for hiding this comment

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

default is none

@@ -322,6 +325,7 @@ impl pallet_message_queue::Config for Runtime {
type HeapSize = MessageQueueHeapSize;
type MaxStale = MessageQueueMaxStale;
type ServiceWeight = MessageQueueServiceWeight;
type IdleMaxServiceWeight = ();
Copy link
Member

Choose a reason for hiding this comment

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

but mby we could configure it to ServiceWeight so that we are able to process messages on idle as well

Copy link
Member

Choose a reason for hiding this comment

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

delete?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would keep it. Let's hope that the issue with heap-pages will be fixed in the next release and we can use it again. There is also a standalone tool for benchmarking, omni-bencher, which can also be used to benchmark all pallets, but it uses default (empty) chain spec and doesn't work with all our pallets.

@mrq1911 mrq1911 merged commit d6f885a into master Sep 13, 2024
7 checks passed
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.

3 participants