- Jun 05, 2024
-
-
Oliver Tale-Yazdi authored
Inherited workspace dependencies cannot be renamed by the crate using them (see [1](https://github.com/rust-lang/cargo/issues/12546), [2](https://stackoverflow.com/questions/76792343/can-inherited-dependencies-in-rust-be-aliased-in-the-cargo-toml-file)). Since we want to use inherited workspace dependencies everywhere, we first need to unify all aliases that we use for a dependency throughout the workspace. The umbrella crate is currently excluded from this procedure, since it should be able to export the crates by their original name without much hassle. For example: one crate may alias `parity-scale-codec` to `codec`, while another crate does not alias it at all. After this change, all crates have to use `codec` as name. The problematic combinations were: - conflicting aliases: most crates aliases as `A` but some use `B`. - missing alias: most of the crates alias a dep but some dont. - superfluous alias: most crates dont alias a dep but some do. The script that i used first determines whether most crates opted to alias a dependency or not. From that info it decides whether to use an alias or not. If it decided to use an alias, the most common one is used everywhere. To reproduce, i used [this](https://github.com/ggwpez/substrate-scripts/blob/master/uniform-crate-alias.py) python script in combination with [this](https://github.com/ggwpez/zepter/blob/38ad10585fe98a5a86c1d2369738bc763a77057b/renames.json) error output from Zepter. --------- Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by:
Bastian Köcher <git@kchr.de>
-
- Jun 03, 2024
-
-
Ankan authored
## Runtime Apis Introduces the following runtime apis to facilitate dapps and wallets in integrating with the `DelegateStake` functionalities of the pools (related: https://github.com/paritytech/polkadot-sdk/pull/3905). These apis are meant to support pool and member migration, as well as lazy application of pending slashes of pool members. ```rust fn pool_pending_slash(pool_id: PoolId) -> Balance; fn member_pending_slash(member: AccountId) -> Balance; fn pool_needs_delegate_migration(pool_id: PoolId) -> bool; fn member_needs_delegate_migration(member: AccountId) -> bool; ``` ## Refactors - Introduces newtypes for `Agent`, `Delegator`, `Pool` and `[Pool]Member`. And refactors `StakeAdapter` and `DelegationInterface` to accept the above types. This will help make these apis typesafe against using wrong account type. - Fixing `DelegationInterface` apis to return optional (instead of default value if key does not exist). - Rename struct `Agent` that wraps `AgentLedger` to `AgentOuterLedger` which is clearer (naming wise) and different from the newtype `Agent`. - Cleaning up new Pool events (related to `Delegation` feature of pool). --------- Signed-off-by:
Matteo Muraca <mmuraca247@gmail.com> Signed-off-by:
Alexandru Gheorghe <alexandru.gheorghe@parity.io> Signed-off-by:
Andrei Sandu <andrei-mihail@parity.io> Signed-off-by:
Adrian Catangiu <adrian@parity.io> Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by:
divdeploy <chenguangxue@outlook.com> Signed-off-by:
dependabot[bot] <support@github.com> Signed-off-by:
hongkuang <liurenhong@outlook.com> Co-authored-by:
Bastian Köcher <git@kchr.de> Co-authored-by:
gemini132 <164285545+gemini132@users.noreply.github.com> Co-authored-by:
Matteo Muraca <56828990+muraca@users.noreply.github.com> Co-authored-by:
Liam Aharon <liam.aharon@hotmail.com> Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by:
Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com> Co-authored-by:
Alessandro Siniscalchi <asiniscalchi@gmail.com> Co-authored-by:
Andrei Sandu <54316454+sandreim@users.noreply.github.com> Co-authored-by:
Ross Bulat <ross@parity.io> Co-authored-by:
Serban Iorga <serban@parity.io> Co-authored-by:
s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com> Co-authored-by:
Sam Johnson <sam@durosoft.com> Co-authored-by:
Adrian Catangiu <adrian@parity.io> Co-authored-by:
Javier Viola <363911+pepoviola@users.noreply.github.com> Co-authored-by:
Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
Dastan <88332432+dastansam@users.noreply.github.com> Co-authored-by:
Clara van Staden <claravanstaden64@gmail.com> Co-authored-by:
Ron <yrong1997@gmail.com> Co-authored-by:
Vincent Geddes <vincent@snowfork.com> Co-authored-by:
Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by:
Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Co-authored-by:
Dino Pačandi <3002868+Dinonard@users.noreply.github.com> Co-authored-by:
Andrei Eres <eresav@me.com> Co-authored-by:
Alin Dima <alin@parity.io> Co-authored-by:
Andrei Sandu <andrei-mihail@parity.io> Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by:
Bastian Köcher <info@kchr.de> Co-authored-by:
Branislav Kontur <bkontur@gmail.com> Co-authored-by:
Sebastian Kunert <skunert49@gmail.com> Co-authored-by:
gupnik <nikhilgupta.iitk@gmail.com> Co-authored-by:
Vladimir Istyufeev <vladimir@parity.io> Co-authored-by:
Lulu <morgan@parity.io> Co-authored-by:
Juan Girini <juangirini@gmail.com> Co-authored-by:
Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by:
Dónal Murray <donal.murray@parity.io> Co-authored-by:
Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by:
Kutsal Kaan Bilgin <kutsalbilgin@gmail.com> Co-authored-by:
Ermal Kaleci <ermalkaleci@gmail.com> Co-authored-by:
ordian <write@reusable.software> Co-authored-by:
divdeploy <166095818+divdeploy@users.noreply.github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by:
Sergej Sakac <73715684+Szegoo@users.noreply.github.com> Co-authored-by:
Squirrel <gilescope@gmail.com> Co-authored-by:
HongKuang <166261675+HongKuang@users.noreply.github.com> Co-authored-by:
Tsvetomir Dimitrov <tsvetomir@parity.io> Co-authored-by:
Egor_P <egor@parity.io> Co-authored-by:
Aaro Altonen <48052676+altonen@users.noreply.github.com> Co-authored-by:
Dmitry Markin <dmitry@markin.tech> Co-authored-by:
Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by:
Léa Narzis <78718413+lean-apple@users.noreply.github.com> Co-authored-by:
Gonçalo Pestana <g6pestana@gmail.com> Co-authored-by:
georgepisaltu <52418509+georgepisaltu@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by:
PG Herveou <pgherveou@gmail.com> Co-authored-by:
jimwfs <wqq1479787@163.com> Co-authored-by:
jimwfs <169986508+jimwfs@users.noreply.github.com> Co-authored-by:
polka.dom <polkadotdom@gmail.com>
-
- May 31, 2024
-
-
Francisco Aguirre authored
Depends on https://github.com/paritytech/polkadot-sdk/pull/4621. Implemented the [`XcmPaymentApi`](https://github.com/paritytech/polkadot-sdk/pull/3607) and [`DryRunApi`](https://github.com/paritytech/polkadot-sdk/pull/3872) on all system parachains. More scenarios can be tested on both rococo and westend if all system parachains implement this APIs. The objective is for all XCM-enabled runtimes to implement them. After demonstrating fee estimation in a UI on the testnets, come the fellowship runtimes. Step towards https://github.com/paritytech/polkadot-sdk/issues/690.
-
- May 29, 2024
-
-
Francisco Aguirre authored
Follow-up to the new `XcmDryRunApi` runtime API introduced in https://github.com/paritytech/polkadot-sdk/pull/3872. Taking an extrinsic means the frontend has to sign first to dry-run and once again to submit. This is bad UX which is solved by taking an `origin` and a `call`. This also has the benefit of being able to dry-run as any account, since it needs no signature. This is a breaking change since I changed `dry_run_extrinsic` to `dry_run_call`, however, this API is still only on testnets. The crates are bumped accordingly. As a part of this PR, I changed the name of the API from `XcmDryRunApi` to just `DryRunApi`, since it can be used for general dry-running :) Step towards https://github.com/paritytech/polkadot-sdk/issues/690. Example of calling the API with PAPI, not the best code, just testing :) ```ts // We just build a call, the arguments make it look very big though. const call = localApi.tx.XcmPallet.transfer_assets({ dest: XcmVersionedLocation.V4({ parents: 0, interior: XcmV4Junctions.X1(XcmV4Junction.Parachain(1000)) }), beneficiary: XcmVersionedLocation.V4({ parents: 0, interior: XcmV4Junctions.X1(XcmV4Junction.AccountId32({ network: undefined, id: Binary.fromBytes(encodeAccount(account.address)) })) }), weight_limit: XcmV3WeightLimit.Unlimited(), assets: XcmVersionedAssets.V4([{ id: { parents: 0, interior: XcmV4Junctions.Here() }, fun: XcmV3MultiassetFungibility.Fungible(1_000_000_000_000n) } ]), fee_asset_item: 0, }); // We call the API passing in a signed origin const result = await localApi.apis.XcmDryRunApi.dry_run_call( WestendRuntimeOriginCaller.system(DispatchRawOrigin.Signed(account.address)), call.decodedCall ); if (result.success && result.value.execution_result.success) { // We find the forwarded XCM we want. The first one going to AssetHub in this case. const xcmsToAssetHub = result.value.forwarded_xcms.find(([location, _]) => ( location.type === "V4" && location.value.parents === 0 && location.value.interior.type === "X1" && location.value.interior.value.type === "Parachain" && location.value.interior.value.value === 1000 ))!; // We can even find the delivery fees for that forwarded XCM. const deliveryFeesQuery = await localApi.apis.XcmPaymentApi.query_delivery_fees(xcmsToAssetHub[0], xcmsToAssetHub[1][0]); if (deliveryFeesQuery.success) { const amount = deliveryFeesQuery.value.type === "V4" && deliveryFeesQuery.value.value[0].fun.type === "Fungible" && deliveryFeesQuery.value.value[0].fun.value.valueOf() || 0n; // We store them in state somewhere. setDeliveryFees(formatAmount(BigInt(amount))); } } ``` --------- Co-authored-by:
Bastian Köcher <git@kchr.de>
-
- May 22, 2024
-
-
Ankan authored
Third and final PR in the set, closes https://github.com/paritytech/polkadot-sdk/issues/454. Original PR: https://github.com/paritytech/polkadot-sdk/pull/2680 ## Precursors: - https://github.com/paritytech/polkadot-sdk/pull/3889. - https://github.com/paritytech/polkadot-sdk/pull/3904. ## Follow up issues/improvements - https://github.com/paritytech/polkadot-sdk/issues/4404 Overall changes are documented here (lot more visual
): https://hackmd.io/@ak0n/454-np-governance ## Summary of various roles 🤯 ### Pallet Staking **Nominator**: An account that directly stakes on `pallet-staking` and nominates a set of validators. **Stakers**: Common term for nominators and validators. Virtual Stakers: Same as stakers, but they are keyless accounts and their locks are managed by a pallet external to `pallet-staking`. ### Pallet Delegated Staking **Agent**: An account that receives delegation from other accounts (delegators) and stakes on their behalf. They are also Virtual Stakers in `pallet-staking` where `pallet-delegated-staking` manages its locks. **Delegator**: An account that delegates some funds to an agent. ### Pallet Nomination Pools **Pool account**: Keyless account of a pool where funds are pooled. Members pledge their funds towards the pools. These are going to become `Agent` accounts in `pallet-delegated-staking`. **Pool Members**: They are individual members of the pool who contributed funds to it. They are also `Delegator` in `pallet-delegated-staking`. ## Changes ### Multiple Stake strategies **TransferStake**: The current nomination pool logic can be considered a staking strategy where delegators transfer funds to pool and stake. In this scenario, funds are locked in pool account, and users lose the control of their funds. **DelegateStake**: With this PR, we introduce a new staking strategy where individual delegators delegate fund to pool. `Delegate` implies funds are locked in delegator account itself. Important thing to note is, pool does not have funds of its own, but it has authorization from its members to use these funds for staking. We extract out all the interaction of pool with staking interface into a new trait `StakeStrategy`. This is the logic that varies between the above two staking strategies. We use the trait `StakeStrategy` to implement above two strategies: `TransferStake` and `DelegateStake`. ### NominationPool Consumes an implementation of `StakeStrategy` instead of `StakingInterface`. I have renamed it from `Staking` to `StakeAdapter` to clarify the difference from the earlier used trait. To enable delegation based staking in pool, Nomination pool can be configured as: ``` type StakeAdapter = pallet_nomination_pools::adapter::DelegateStake<Self, DelegatedStaking>; ``` Note that with the following configuration, the changes in the PR are no-op. ``` type StakeAdapter = pallet_nomination_pools::adapter::TransferStake<Self, Staking>; ``` ## Deployment roadmap Plan to enable this only in Westend. In production runtimes, we can keep pool to use `TransferStake` which will be no functional change. Once we have a full audit, we can enable this in Kusama followed by Polkadot. ## TODO - [x] Runtime level (Westend) migration for existing nomination pools. - [x] Permissionless call/ pallet::tasks for claiming delegator funds. - [x] Add/update benches. - [x] Migration tests. - [x] Storage flag to mark `DelegateStake` migration and integrity checks to not allow `TransferStake` for migrated runtimes. --------- Signed-off-by:Matteo Muraca <mmuraca247@gmail.com> Signed-off-by:
Alexandru Gheorghe <alexandru.gheorghe@parity.io> Signed-off-by:
Andrei Sandu <andrei-mihail@parity.io> Signed-off-by:
Adrian Catangiu <adrian@parity.io> Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by:
divdeploy <chenguangxue@outlook.com> Signed-off-by:
dependabot[bot] <support@github.com> Signed-off-by:
hongkuang <liurenhong@outlook.com> Co-authored-by:
Bastian Köcher <git@kchr.de> Co-authored-by:
gemini132 <164285545+gemini132@users.noreply.github.com> Co-authored-by:
Matteo Muraca <56828990+muraca@users.noreply.github.com> Co-authored-by:
Liam Aharon <liam.aharon@hotmail.com> Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by:
Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com> Co-authored-by:
Alessandro Siniscalchi <asiniscalchi@gmail.com> Co-authored-by:
Andrei Sandu <54316454+sandreim@users.noreply.github.com> Co-authored-by:
Ross Bulat <ross@parity.io> Co-authored-by:
Serban Iorga <serban@parity.io> Co-authored-by:
s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com> Co-authored-by:
Sam Johnson <sam@durosoft.com> Co-authored-by:
Adrian Catangiu <adrian@parity.io> Co-authored-by:
Javier Viola <363911+pepoviola@users.noreply.github.com> Co-authored-by:
Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
Dastan <88332432+dastansam@users.noreply.github.com> Co-authored-by:
Clara van Staden <claravanstaden64@gmail.com> Co-authored-by:
Ron <yrong1997@gmail.com> Co-authored-by:
Vincent Geddes <vincent@snowfork.com> Co-authored-by:
Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by:
Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Co-authored-by:
Dino Pačandi <3002868+Dinonard@users.noreply.github.com> Co-authored-by:
Andrei Eres <eresav@me.com> Co-authored-by:
Alin Dima <alin@parity.io> Co-authored-by:
Andrei Sandu <andrei-mihail@parity.io> Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by:
Bastian Köcher <info@kchr.de> Co-authored-by:
Branislav Kontur <bkontur@gmail.com> Co-authored-by:
Sebastian Kunert <skunert49@gmail.com> Co-authored-by:
gupnik <nikhilgupta.iitk@gmail.com> Co-authored-by:
Vladimir Istyufeev <vladimir@parity.io> Co-authored-by:
Lulu <morgan@parity.io> Co-authored-by:
Juan Girini <juangirini@gmail.com> Co-authored-by:
Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by:
Dónal Murray <donal.murray@parity.io> Co-authored-by:
Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by:
Kutsal Kaan Bilgin <kutsalbilgin@gmail.com> Co-authored-by:
Ermal Kaleci <ermalkaleci@gmail.com> Co-authored-by:
ordian <write@reusable.software> Co-authored-by:
divdeploy <166095818+divdeploy@users.noreply.github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by:
Sergej Sakac <73715684+Szegoo@users.noreply.github.com> Co-authored-by:
Squirrel <gilescope@gmail.com> Co-authored-by:
HongKuang <166261675+HongKuang@users.noreply.github.com> Co-authored-by:
Tsvetomir Dimitrov <tsvetomir@parity.io> Co-authored-by:
Egor_P <egor@parity.io> Co-authored-by:
Aaro Altonen <48052676+altonen@users.noreply.github.com> Co-authored-by:
Dmitry Markin <dmitry@markin.tech> Co-authored-by:
Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by:
Léa Narzis <78718413+lean-apple@users.noreply.github.com> Co-authored-by:
Gonçalo Pestana <g6pestana@gmail.com> Co-authored-by:
georgepisaltu <52418509+georgepisaltu@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by:
PG Herveou <pgherveou@gmail.com> Co-authored-by:
jimwfs <wqq1479787@163.com> Co-authored-by:
jimwfs <169986508+jimwfs@users.noreply.github.com> Co-authored-by:
polka.dom <polkadotdom@gmail.com>
-
Bastian Köcher authored
This implements the `CheckMetadataHash` extension as described in [RFC78](https://polkadot-fellows.github.io/RFCs/approved/0078-merkleized-metadata.html). Besides the signed extension, the `substrate-wasm-builder` is extended to support generating the metadata-hash. Closes: https://github.com/paritytech/polkadot-sdk/issues/291 --------- Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by:
joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by:
Liam Aharon <liam.aharon@hotmail.com> Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com>
-
Egor_P authored
This PR backports version bumps and reorganisation of the prdoc files from the `1.12.0` release branch back to `master`
-
- May 21, 2024
-
-
Branislav Kontur authored
Co-authored-by:
Svyatoslav Nikolsky <svyatonik@gmail.com>
-
- May 15, 2024
-
-
Alexandru Gheorghe authored
This bump of versions: https://github.com/paritytech/polkadot-sdk/pull/4409/files#diff-13ee4b2252c9e516a0547f2891aa2105c3ca71c6d7a1e682c69be97998dfc87eR11936 reintroduced a dependency to proc-macro-crate 2.0.0 which is suffering from: https://github.com/bkchr/proc-macro-crate/pull/42 this, so bump parity-scale-codec to a newer version to eliminate the bad proc-macro-crate 2.0.0 dependency. --------- Signed-off-by:
Alexandru Gheorghe <alexandru.gheorghe@parity.io> Co-authored-by: command-bot <>
-
drewstone authored
Link was dead --------- Co-authored-by:
Bastian Köcher <git@kchr.de>
-
- May 13, 2024
-
-
Serban Iorga authored
Extracting the logic for generating and verifying ancestry proofs from this PR: https://github.com/paritytech/polkadot-sdk/pull/1903 with small adjustments @Lederstrumpf I added you as a co-author to each commit. Please let me know if you want me to also associate an e-mail address with your name
-
- May 08, 2024
-
-
Dino Pačandi authored
Adds an additional extrinsic call to the `pallet-balances` to _burn_ tokens. Depending on the `keep_alive` flag, the call might or might not reap the account. Required modification of the _fungible's_ `Mutate` trait, `burn_from` function to allow the `Preservation` argument. **TODO** - [x] run benchmarks & update weights - [x] make sure prdoc is required & properly formatted Related issue: https://github.com/paritytech/polkadot-sdk/issues/3943 --------- Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <>
-
Francisco Aguirre authored
# Context Estimating fees for XCM execution and sending has been an area with bad UX. The addition of the [XcmPaymentApi](https://github.com/paritytech/polkadot-sdk/pull/3607) exposed the necessary components to be able to estimate XCM fees correctly, however, that was not the full story. The `XcmPaymentApi` works for estimating fees only if you know the specific XCM you want to execute or send. This is necessary but most UIs want to estimate the fees for extrinsics, they don't necessarily know the XCM program that's executed by them. # Main addition A new runtime API is introduced, the `XcmDryRunApi`, that given an extrinsic, or an XCM program, returns its effects: - Execution result - Local XCM (in the case of an extrinsic) - Forwarded XCMs - List of events This API can be used on its own for dry-running purposes, for double-checking or testing, but it mainly shines when used in conjunction with the `XcmPaymentApi`. UIs can use these two APIs to estimate transfers. # How it works New tests are added to exemplify how to incorporate both APIs. There's a mock test just to make sure everything works under `xcm-fee-payment-runtime-api`. There's a real-world test using Westend and AssetHubWestend under `cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/xcm_fee_estimation.rs`. Added both a test for a simple teleport between chains and a reserve transfer asset between two parachains going through a reserve. The steps to follow: - Use `XcmDryRunApi::dry_run_extrinsic` to get local XCM program and forwarded messages - For each forwarded message - Use `XcmPaymentApi::query_delivery_fee` LOCALLY to get the delivery fees - Use `XcmPaymentApi::query_xcm_weight` ON THE DESTINATION to get the remote execution weight - (optional) Use `XcmPaymentApi::query_acceptable_payment_assets` ON THE DESTINATION to know on which assets the execution fees can be paid - Use `XcmPaymentApi::query_weight_to_asset_fee` ON THE DESTINATION to convert weight to the actual remote execution fees - Use `XcmDryRunApi::dry_run_xcm` ON THE DESTINATION to know if a new message will be forwarded, if so, continue # Dear reviewer The changes in this PR are grouped as follows, and in order of importance: - Addition of new runtime API - Definition, mock and simple tests: polkadot/xcm/xcm-fee-payment-runtime-api/* - Implemented on Westend, Asset Hub Westend and Penpal, will implement on every runtime in a following PR - Addition of a new config item to the XCM executor for recording xcms about to be executed - Definition: polkadot/xcm/xcm-executor/* - Implementation: polkadot/xcm/pallet-xcm/* - had to update all runtime xcm_config.rs files with `type XcmRecorder = XcmPallet;` - Addition of a new trait for inspecting the messages in queues - Definition: polkadot/xcm/xcm-builder/src/routing.rs - Implemented it on all routers: - ChildParachainRouter: polkadot/runtime/common/src/xcm_sender.rs - ParentAsUmp: cumulus/primitives/utility/src/lib.rs (piggybacked on implementation in cumulus/pallets/parachain-system/src/lib.rs) - XcmpQueue: cumulus/pallets/xcmp-queue/src/lib.rs - Bridge: bridges/modules/xcm-bridge-hub-router/src/lib.rs - More complicated and useful tests: - cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/xcm_fee_estimation.rs ## Next steps With this PR, Westend, AssetHubWestend, Rococo and AssetHubRococo have the new API. UIs can test on these runtimes to create better experiences around cross-chain operations. Next: - Add XcmDryRunApi to all system parachains - Integrate xcm fee estimation in all emulated tests - Get this on the fellowship runtimes --------- Co-authored-by:
Adrian Catangiu <adrian@parity.io>
-
- May 07, 2024
-
-
Branislav Kontur authored
Closes: https://github.com/paritytech/polkadot-sdk/issues/4003 (please see for the problem description) ## TODO - [x] add more tests covering `WrapVersion` corner cases (e.g. para has lower version, ...) - [x] regenerate benchmarks `runtime_parachains::hrmp` (fix for Rococo is here: https://github.com/paritytech/polkadot-sdk/pull/4332) ## Questions / possible improvements - [ ] A `WrapVersion` implementation for `pallet_xcm` initiates version discovery with [note_unknown_version](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L2527C5-L2527C25), there is possibility to avoid this overhead in this HRMP case to create new `WrapVersion` adapter for `pallet_xcm` which would not use `note_unknown_version`. Is it worth to do it or not? - [ ] There's a possibility to decouple XCM functionality from the HRMP pallet, allowing any relay chain to generate its own notifications. This approach wouldn't restrict notifications solely to the XCM. However, it's uncertain whether it's worthwhile or desirable to do so? It means making HRMP pallet more generic. E.g. hiding HRMP notifications behind some trait: ``` trait HrmpNotifications { fn on_channel_open_request( sender: ParaId, proposed_max_capacity: u32, proposed_max_message_size: u32) -> primitives::DownwardMessage; fn on_channel_accepted(recipient: ParaId) -> primitives::DownwardMessage; fn on_channel_closing(initiator: ParaId, sender: ParaId, recipient: ParaId) -> primitives::DownwardMessage; } ``` and then we could have whatever adapter, `impl HrmpNotifications for VersionedXcmHrmpNotifications {...}`, ``` impl parachains_hrmp::Config for Runtime { .. type HrmpNotifications = VersionedXcmHrmpNotifications; .. } ``` --------- Co-authored-by: command-bot <> Co-authored-by:
Bastian Köcher <git@kchr.de>
-
- May 02, 2024
-
-
Branislav Kontur authored
This PR: - changes `xcm::v4` to `xcm::prelude` imports for coretime stuff - changes `query_acceptable_payment_assets` / `query_weight_to_asset_fee` implementations to be more resilient to the XCM version change - adds `xcm_fee_payment_runtime_api::XcmPaymentApi` to the AssetHubRococo/Westend exposing a native token as acceptable payment asset Continuation of: https://github.com/paritytech/polkadot-sdk/pull/3607 Closes: https://github.com/paritytech/polkadot-sdk/issues/4297 ## Possible follow-ups - [ ] add all sufficient assets (`Assets`, `ForeignAssets`) as acceptable payment assets ?
-
Egor_P authored
This PR backports version bumps and reorganization of the `prdocs` from `1.11.0` release branch back to master
-
- May 01, 2024
-
-
Branislav Kontur authored
HRMP - set `DefaultChannelSizeAndCapacityWithSystem` with dynamic values according to the `ActiveConfig` (#4332) ## Summary This PR enhances the capability to set `DefaultChannelSizeAndCapacityWithSystem` for HRMP. Currently, all testnets (Rococo, Westend) have a hard-coded value set as 'half of the maximum' determined by the live `ActiveConfig`. While this approach appears satisfactory, potential issues could arise if the live `ActiveConfig` are adjusted below these hard-coded values, necessitating a new runtime release with updated values. Additionally, hard-coded values have consequences, such as Rococo's benchmarks not functioning: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6082656. ## Solution The proposed solution here is to utilize `ActiveConfigHrmpChannelSizeAndCapacityRatio`, which reads the current `ActiveConfig` and calculates `DefaultChannelSizeAndCapacityWithSystem`, for example, "half of the maximum" based on live data. This way, whenever `ActiveConfig` is modified, `ActiveConfigHrmpChannelSizeAndCapacityRatio` automatically returns adjusted values with the appropriate ratio. Thus, manual adjustments and new runtime releases become unnecessary. Relates to a comment/discussion: https://github.com/paritytech/polkadot-sdk/pull/3721/files#r1541001420 Relates to a comment/discussion: https://github.com/paritytech/polkadot-sdk/pull/3721/files#r1549291588 --------- Co-authored-by: command-bot <>
-
- Apr 30, 2024
-
-
Serban Iorga authored
Related to https://github.com/paritytech/polkadot-sdk/pull/1903 For #1903 we will need to add a Fisherman struct. This PR: - defines a basic version of `Fisherman` and moves into it the logic that we have now for reporting double voting equivocations - splits the logic for generating the key ownership proofs into a more generic separate method - renames `EquivocationProof` to `DoubleVotingProof` since later we will introduce a new type of equivocation The PR doesn't contain any functional changes
-
- Apr 28, 2024
-
-
Ankan authored
closes https://github.com/paritytech/polkadot-sdk/issues/426. related to https://github.com/paritytech/polkadot-sdk/pull/1189. Would help offchain programs to query if there are unclaimed pages of rewards for a given era. The logic could look like below ```js // loop as long as all era pages are claimed. while (api.call.stakingApi.pendingRewards(era, validator_stash)) { api.tx.staking.payout_stakers(validator_stash, era) } ```
-
- Apr 26, 2024
-
-
Tsvetomir Dimitrov authored
Closes https://github.com/paritytech/polkadot-sdk/issues/1966, https://github.com/paritytech/polkadot-sdk/issues/1963 and https://github.com/paritytech/polkadot-sdk/issues/1962. Disabling strategy specification [here](https://github.com/paritytech/polkadot-sdk/pull/2955). (Updated 13/02/2024) Implements: * validator disabling for a whole era instead of just a session * no more than 1/3 of the validators in the active set are disabled Removes: * `DisableStrategy` enum - now each validator committing an offence is disabled. * New era is not forced if too many validators are disabled. Before this PR not all offenders were disabled. A decision was made based on [`enum DisableStrategy`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/primitives/staking/src/offence.rs#L54). Some offenders were disabled for a whole era, some just for a session, some were not disabled at all. This PR changes the disabling behaviour. Now a validator committing an offense is disabled immediately till the end of the current era. Some implementation notes: * `OffendingValidators` in pallet session keeps all offenders (this is not changed). However its type is changed from `Vec<(u32, bool)>` to `Vec<u32>`. The reason is simple - each offender is getting disabled so the bool doesn't make sense anymore. * When a validator is disabled it is first added to `OffendingValidators` and then to `DisabledValidators`. This is done in [`add_offending_validator`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/frame/staking/src/slashing.rs#L325) from staking pallet. * In [`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe9829/substrate/frame/session/src/lib.rs#L623) the `end_session` also calls [`end_era`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/frame/staking/src/pallet/impls.rs#L490) when an era ends. In this case `OffendingValidators` are cleared **(1)**. * Then in [`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe9829/substrate/frame/session/src/lib.rs#L623) `DisabledValidators` are cleared **(2)** * And finally (still in `rotate_session`) a call to [`start_session`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316 /substrate/frame/staking/src/pallet/impls.rs#L430) repopulates the disabled validators **(3)**. * The reason for this complication is that session pallet knows nothing abut eras. To overcome this on each new session the disabled list is repopulated (points 2 and 3). Staking pallet knows when a new era starts so with point 1 it ensures that the offenders list is cleared. --------- Co-authored-by:
ordian <noreply@reusable.software> Co-authored-by:
ordian <write@reusable.software> Co-authored-by:
Maciej <maciej.zyszkiewicz@parity.io> Co-authored-by:
Gonçalo Pestana <g6pestana@gmail.com> Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by:
Ankan <10196091+Ank4n@users.noreply.github.com>
-
- Apr 24, 2024
-
-
Francisco Aguirre authored
Revert "pallet-xcm: Deprecate `execute` and `send` in favor of `execute_blob` and `send_blob` (#3749)" This reverts commit feee773d . --------- Co-authored-by:
Adrian Catangiu <adrian@parity.io> Co-authored-by:
Javier Bullrich <javier@bullrich.dev>
-
- Apr 23, 2024
-
-
Bastian Köcher authored
This should be configured on the runtime level and not somewhere inside the pallet. --------- Co-authored-by:
Adrian Catangiu <adrian@parity.io> Co-authored-by:
Branislav Kontur <bkontur@gmail.com>
-
- Apr 22, 2024
-
-
Bastian Köcher authored
Basically combines all the recommended calls into one `build_using_defaults()` call or `init_with_defaults()` when there are some custom changes required.
-
Liam Aharon authored
Co-authored-by:
Bastian Köcher <git@kchr.de>
-
- Apr 16, 2024
-
-
Muharem Ismailov authored
Introduce types to define 1:1 balance conversion for different relative asset ids/locations of native asset. Examples: native asset on Asset Hub presented as `VersionedLocatableAsset` type in the context of Relay Chain is ``` { `location`: (0, Parachain(1000)), `asset_id`: (1, Here), } ``` and it's balance should be converted 1:1 by implementations of `ConversionToAssetBalance` trait. --------- Co-authored-by:
Branislav Kontur <bkontur@gmail.com>
-
- Apr 12, 2024
-
-
Vedhavyas Singareddi authored
This PR introduces `BlockHashProvider` into `pallet_mmr::Config` This type is used to get `block_hash` for a given `block_number` rather than directly using `frame_system::Pallet::block_hash` The `DefaultBlockHashProvider` uses `frame_system::Pallet::block_hash` to get the `block_hash` Closes: #4062
-
Andrei Sandu authored
Fixes https://github.com/paritytech/polkadot-sdk/issues/3576 Required by elastic scaling collators. Deprecates old API: `candidate_pending_availability`. TODO: - [x] PRDoc --------- Signed-off-by:
Andrei Sandu <andrei-mihail@parity.io>
-
Xiliang Chen authored
Implements https://github.com/polkadot-fellows/RFCs/issues/82 Allow any parachain to have bidirectional channel with any system parachains Looking for initial feedbacks before continue finish it TODOs: - [x] docs - [x] benchmarks - [x] tests --------- Co-authored-by:
joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by:
Adrian Catangiu <adrian@parity.io>
-
- Apr 10, 2024
-
-
Matteo Muraca authored
Part of #3326 @Kianenigma @ggwpez polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp --------- Signed-off-by:
Matteo Muraca <mmuraca247@gmail.com> Co-authored-by:
ordian <write@reusable.software>
-
Egor_P authored
This PR backports `spec_version`, `node_version` bumps and reordering of the prdocs from the 1.10.0 release branch
-
- Apr 09, 2024
-
-
Adrian Catangiu authored
We are exploring [allowing this for Kusama](https://github.com/polkadot-fellows/runtimes/pull/261) as well, disallowing on test chains seems unnecessarily limiting.
-
Ankan authored
closes https://github.com/paritytech/polkadot-sdk/issues/3894 Allows Nomination Pool configuration to be set by a custom origin instead of root. In runtimes, we would set this to be `StakingAdmin`, same as for pallet-staking. --------- Co-authored-by:
Liam Aharon <liam.aharon@hotmail.com>
-
- Apr 05, 2024
-
-
Andrei Sandu authored
Signed-off-by:
Andrei Sandu <andrei-mihail@parity.io>
-
- Apr 04, 2024
-
-
Michal Kucharczyk authored
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). **Summary of changes:** - The `GenesisBuilder` API was adjusted to enable this functionality (and provide better naming - #150): ```rust fn preset_names() -> Vec<PresetId>; fn get_preset(id: Option<PresetId>) -> Option<serde_json::Value>; //`None` means default fn build_state(value: serde_json::Value); pub struct PresetId(Vec<u8>); ``` - **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. Also IMO maintaining compatibility with old API is not so crucial. - Reference implementation was provided for `substrate-test-runtime` and `rococo` runtimes. For rococo new [`genesis_configs_presets`](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b/polkadot/runtime/rococo/src/genesis_config_presets.rs#L530) module was added and is used in `GenesisBuilder` [_presets-related_](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b/polkadot/runtime/rococo/src/lib.rs#L2462-L2485) methods. - The `chain-spec-builder` util was also improved and allows to ([_doc_](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b/substrate/bin/utils/chain-spec-builder/src/lib.rs#L19)): - list presets provided by given runtime (`list-presets`), - display preset or default config provided by the runtime (`display-preset`), - build chain-spec using named preset (`create ... named-preset`), - The `ChainSpecBuilder` is extended with [`with_genesis_config_preset_name`](https://github.com/paritytech/polkadot-sdk/blob/3b41d66b/substrate/client/chain-spec/src/chain_spec.rs#L447) method which allows to build chain-spec using named preset provided by the runtime. Sample usage on the node side [here](https://github.com/paritytech/polkadot-sdk/blob/2caffaae /polkadot/node/service/src/chain_spec.rs#L404). Implementation of #1984. fixes: #150 part of: #25 --------- Co-authored-by:
Sebastian Kunert <skunert49@gmail.com> Co-authored-by:
Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
-
Liam Aharon authored
Part of https://github.com/paritytech/polkadot-sdk/issues/226 Related https://github.com/paritytech/polkadot-sdk/issues/1833 - Deprecate `CurrencyAdapter` and introduce `FungibleAdapter` - Deprecate `ToStakingPot` and replace usage with `ResolveTo` - Required creating a new `StakingPotAccountId` struct that implements `TypedGet` for the staking pot account ID - Update parachain common utils `DealWithFees`, `ToAuthor` and `AssetsToBlockAuthor` implementations to use `fungible` - Update runtime XCM Weight Traders to use `ResolveTo` instead of `ToStakingPot` - Update runtime Transaction Payment pallets to use `FungibleAdapter` instead of `CurrencyAdapter` - [x] Blocked by https://github.com/paritytech/polkadot-sdk/pull/1296, needs the `Unbalanced::decrease_balance` fix
-
- Apr 02, 2024
-
-
Serban Iorga authored
Working towards migrating the `parity-bridges-common` repo inside `polkadot-sdk`. This PR upgrades some dependencies in order to align them with the versions used in `parity-bridges-common` Related to https://github.com/paritytech/parity-bridges-common/issues/2538
-
Adrian Catangiu authored
Fix "double-weights" for extrinsics, use only the ones benchmarked in the runtime. Deprecate extrinsics that don't specify WeightLimit, remove their usage across the repo. --------- Signed-off-by:
Adrian Catangiu <adrian@parity.io> Co-authored-by: command-bot <>
-
- Apr 01, 2024
-
-
s0me0ne-unkn0wn authored
Rejoice! Rejoice! The story is nearly over. This PR removes stale migrations, auxiliary structures, and package dependencies, thus making Rococo and Westend totally free from any `im-online`-related stuff. `im-online` still stays a part of the Substrate node and its runtime: https://github.com/paritytech/polkadot-sdk/blob/0d932484/substrate/bin/node/runtime/src/lib.rs#L2276-L2277 I'm not sure if it makes sense to remove it from there considering that we're not removing `im-online` from FRAME. Please share your opinion.
-
Alexandru Gheorghe authored
Runtime release 1.2 includes bumping of the ParachainHost APIs up to v10, so let's move all the released APIs out of vstaging folder, this PR does not include any logic changes only renaming of the modules and some moving around. Signed-off-by:
Alexandru Gheorghe <alexandru.gheorghe@parity.io>
-
- Mar 29, 2024
-
-
s0me0ne-unkn0wn authored
Removes transient code introduced to clean up offchain database after `im-online` pallet removal. Should be merged after #2290 has been enacted.
-