- Apr 25, 2024
-
-
Oliver Tale-Yazdi authored
Changes: - Add new error variant `ProcessMessageError::StackLimitReached` and treat XCM error `ExceedsStackLimit` as such. --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Branislav Kontur <[email protected]>
-
- Apr 10, 2024
-
-
PG Herveou authored
Current benchmarking macro returns a closure with the captured benchmarked code. This can cause issues when the benchmarked code has complex lifetime requirements. This PR updates the existing macro by injecting the recording parameter and invoking the start / stop method around the benchmarked block instead of returning a closure One other added benefit is that you can write this kind of code now as well: ```rust let v; #[block] { v = func.call(); } dbg!(v); // or assert something on v ``` [Weights compare link](https://weights.tasty.limo/compare?unit=weight&ignore_errors=true&threshold=10&method=asymptotic&repo=polkadot-sdk&old=pg/fix-weights&new=pg/bench_update&path_pattern=substrate/frame/**/src/weights.rs,polkadot/runtime/*/src/weights/**/*.rs,polkadot/bridges/modules/*/src/weights.rs,cumulus/**/weights/*.rs,cumulus/**/weights/xcm/*.rs,cumulus/**/src/weights.rs) --------- Co-authored-by: command-bot <> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@pari...>
-
- Mar 27, 2024
-
-
Ermal Kaleci authored
This will make it possible to use remaining weight on idle for processing enqueued messages. More context here https://github.com/paritytech/polkadot-sdk/issues/3709 --------- Co-authored-by: Adrian Catangiu <[email protected]>
-
- Mar 26, 2024
-
-
Dcompoze authored
**Update:** Pushed additional changes based on the review comments. **This pull request fixes various spelling mistakes in this repository.** Most of the changes are contained in the first **3** commits: - `Fix spelling mistakes in comments and docs` - `Fix spelling mistakes in test names` - `Fix spelling mistakes in error messages, panic messages, logs and tracing` Other source code spelling mistakes are separated into individual commits for easier reviewing: - `Fix the spelling of 'authority'` - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'` - `Fix the spelling of 'prev_enqueud_messages'` - `Fix the spelling of 'endpoint'` - `Fix the spelling of 'children'` - `Fix the spelling of 'PenpalSiblingSovereignAccount'` - `Fix the spelling of 'PenpalSudoAccount'` - `Fix the spelling of 'insufficient'` - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'` - `Fix the spelling of 'subtracted'` - `Fix the spelling of 'CandidatePendingAvailability'` - `Fix the spelling of 'exclusive'` - `Fix the spelling of 'until'` - `Fix the spelling of 'discriminator'` - `Fix the spelling of 'nonexistent'` - `Fix the spelling of 'subsystem'` - `Fix the spelling of 'indices'` - `Fix the spelling of 'committed'` - `Fix the spelling of 'topology'` - `Fix the spelling of 'response'` - `Fix the spelling of 'beneficiary'` - `Fix the spelling of 'formatted'` - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'` - `Fix the spelling of 'succeeded'` - `Fix the spelling of 'reopened'` - `Fix the spelling of 'proposer'` - `Fix the spelling of 'InstantiationNonce'` - `Fix the spelling of 'depositor'` - `Fix the spelling of 'expiration'` - `Fix the spelling of 'phantom'` - `Fix the spelling of 'AggregatedKeyValue'` - `Fix the spelling of 'randomness'` - `Fix the spelling of 'defendant'` - `Fix the spelling of 'AquaticMammal'` - `Fix the spelling of 'transactions'` - `Fix the spelling of 'PassingTracingSubscriber'` - `Fix the spelling of 'TxSignaturePayload'` - `Fix the spelling of 'versioning'` - `Fix the spelling of 'descendant'` - `Fix the spelling of 'overridden'` - `Fix the spelling of 'network'` Let me know if this structure is adequate. **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`, `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it as it is. ~~**Note:** In some places the term `Receival` is used to refer to message reception, IMO `Reception` is the correct word here, but I left it as it is.~~ ~~**Note:** In some places the term `Overlayed` is used instead of the more acceptable version `Overlaid` but I also left it as it is.~~ ~~**Note:** In some places the term `Applyable` is used instead of the correct version `Applicable` but I also left it as it is.~~ **Note:** Some usage of British vs American english e.g. `judgement` vs `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc. are both present in different places, but I suppose that's understandable given the number of contributors. ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it triggers errors in CI when I make changes to it, so I left it as it is.~~
-
- Mar 15, 2024
-
-
gupnik authored
Step in https://github.com/paritytech/polkadot-sdk/issues/171 This PR removes `as [disambiguation_path]` syntax from `derive_impl` usage across the polkadot-sdk as introduced in https://github.com/paritytech/polkadot-sdk/pull/3505
-
- Mar 13, 2024
-
-
georgepisaltu authored
Revert "FRAME: Create `TransactionExtension` as a replacement for `SignedExtension` (#2280)" (#3665) This PR reverts #2280 which introduced `TransactionExtension` to replace `SignedExtension`. As a result of the discussion [here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700), the changes will be reverted for now with plans to reintroduce the concept in the future. --------- Signed-off-by: georgepisaltu <[email protected]>
-
- Mar 05, 2024
-
-
Oliver Tale-Yazdi authored
Changes: - `QueueFootprint` gets a new field; `ready_pages` that contains the non-overweight and not yet processed pages. - `XCMP` queue pallet is change to use the `ready_pages` instead of `pages` to calculate the channel suspension thresholds. This should give the XCMP queue pallet a more correct view of when to suspend channels. --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-
- Mar 04, 2024
-
-
Gavin Wood authored
Closes #2160 First part of [Extrinsic Horizon](https://github.com/paritytech/polkadot-sdk/issues/2415) Introduces a new trait `TransactionExtension` to replace `SignedExtension`. Introduce the idea of transactions which obey the runtime's extensions and have according Extension data (né Extra data) yet do not have hard-coded signatures. Deprecate the terminology of "Unsigned" when used for transactions/extrinsics owing to there now being "proper" unsigned transactions which obey the extension framework and "old-style" unsigned which do not. Instead we have __*General*__ for the former and __*Bare*__ for the latter. (Ultimately, the latter will be phased out as a type of transaction, and Bare will only be used for Inherents.) Types of extrinsic are now therefore: - Bare (no hardcoded signature, no Extra data; used to be known as "Unsigned") - Bare transactions (deprecated): Gossiped, validated with `ValidateUnsigned` (deprecated) and the `_bare_compat` bits of `TransactionExtension` (deprecated). - Inherents: Not gossiped, validated with `ProvideInherent`. - Extended (Extra data): Gossiped, validated via `TransactionExtension`. - Signed transactions (with a hardcoded signature). - General transactions (without a hardcoded signature). `TransactionExtension` differs from `SignedExtension` because: - A signature on the underlying transaction may validly not be present. - It may alter the origin during validation. - `pre_dispatch` is renamed to `prepare` and need not contain the checks present in `validate`. - `validate` and `prepare` is passed an `Origin` rather than a `AccountId`. - `validate` may pass arbitrary information into `prepare` via a new user-specifiable type `Val`. - `AdditionalSigned`/`additional_signed` is renamed to `Implicit`/`implicit`. It is encoded *for the entire transaction* and passed in to each extension as a new argument to `validate`. This facilitates the ability of extensions to acts as underlying crypto. There is a new `DispatchTransaction` trait which contains only default function impls and is impl'ed for any `TransactionExtension` impler. It provides several utility functions which reduce some of the tedium from using `TransactionExtension` (indeed, none of its regular functions should now need to be called directly). Three transaction version discriminator ("versions") are now permissible: - 0b000000100: Bare (used to be called "Unsigned"): contains Signature or Extra (extension data). After bare transactions are no longer supported, this will strictly identify an Inherents only. - 0b100000100: Old-school "Signed" Transaction: contains Signature and Extra (extension data). - 0b010000100: New-school "General" Transaction: contains Extra (extension data), but no Signature. For the New-school General Transaction, it becomes trivial for authors to publish extensions to the mechanism for authorizing an Origin, e.g. through new kinds of key-signing schemes, ZK proofs, pallet state, mutations over pre-authenticated origins or any combination of the above. ## Code Migration ### NOW: Getting it to build Wrap your `SignedExtension`s in `AsTransactionExtension`. This should be accompanied by renaming your aggregate type in line with the new terminology. E.g. Before: ```rust /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( /* snip */ MySpecialSignedExtension, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>; ``` After: ```rust /// The extension to the basic transaction logic. pub type TxExtension = ( /* snip */ AsTransactionExtension<MySpecialSignedExtension>, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>; ``` You'll also need to alter any transaction building logic to add a `.into()` to make the conversion happen. E.g. Before: ```rust fn construct_extrinsic( /* snip */ ) -> UncheckedExtrinsic { let extra: SignedExtra = ( /* snip */ MySpecialSignedExtension::new(/* snip */), ); let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); UncheckedExtrinsic::new_signed( /* snip */ Signature::Sr25519(signature), extra, ) } ``` After: ```rust fn construct_extrinsic( /* snip */ ) -> UncheckedExtrinsic { let tx_ext: TxExtension = ( /* snip */ MySpecialSignedExtension::new(/* snip */).into(), ); let payload = SignedPayload::new(call.clone(), tx_ext.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); UncheckedExtrinsic::new_signed( /* snip */ Signature::Sr25519(signature), tx_ext, ) } ``` ### SOON: Migrating to `TransactionExtension` Most `SignedExtension`s can be trivially converted to become a `TransactionExtension`. There are a few things to know. - Instead of a single trait like `SignedExtension`, you should now implement two traits individually: `TransactionExtensionBase` and `TransactionExtension`. - Weights are now a thing and must be provided via the new function `fn weight`. #### `TransactionExtensionBase` This trait takes care of anything which is not dependent on types specific to your runtime, most notably `Call`. - `AdditionalSigned`/`additional_signed` is renamed to `Implicit`/`implicit`. - Weight must be returned by implementing the `weight` function. If your extension is associated with a pallet, you'll probably want to do this via the pallet's existing benchmarking infrastructure. #### `TransactionExtension` Generally: - `pre_dispatch` is now `prepare` and you *should not reexecute the `validate` functionality in there*! - You don't get an account ID any more; you get an origin instead. If you need to presume an account ID, then you can use the trait function `AsSystemOriginSigner::as_system_origin_signer`. - You get an additional ticket, similar to `Pre`, called `Val`. This defines data which is passed from `validate` into `prepare`. This is important since you should not be duplicating logic from `validate` to `prepare`, you need a way of passing your working from the former into the latter. This is it. - This trait takes two type parameters: `Call` and `Context`. `Call` is the runtime call type which used to be an associated type; you can just move it to become a type parameter for your trait impl. `Context` is not currently used and you can safely implement over it as an unbounded type. - There's no `AccountId` associated type any more. Just remove it. Regarding `validate`: - You get three new parameters in `validate`; all can be ignored when migrating from `SignedExtension`. - `validate` returns a tuple on success; the second item in the tuple is the new ticket type `Self::Val` which gets passed in to `prepare`. If you use any information extracted during `validate` (off-chain and on-chain, non-mutating) in `prepare` (on-chain, mutating) then you can pass it through with this. For the tuple's last item, just return the `origin` argument. Regarding `prepare`: - This is renamed from `pre_dispatch`, but there is one change: - FUNCTIONALITY TO VALIDATE THE TRANSACTION NEED NOT BE DUPLICATED FROM `validate`!! - (This is different to `SignedExtension` which was required to run the same checks in `pre_dispatch` as in `validate`.) Regarding `post_dispatch`: - Since there are no unsigned transactions handled by `TransactionExtension`, `Pre` is always defined, so the first parameter is `Self::Pre` rather than `Option<Self::Pre>`. If you make use of `SignedExtension::validate_unsigned` or `SignedExtension::pre_dispatch_unsigned`, then: - Just use the regular versions of these functions instead. - Have your logic execute in the case that the `origin` is `None`. - Ensure your transaction creation logic creates a General Transaction rather than a Bare Transaction; this means having to include all `TransactionExtension`s' data. - `ValidateUnsigned` can still be used (for now) if you need to be able to construct transactions which contain none of the extension data, however these will be phased out in stage 2 of the Transactions Horizon, so you should consider moving to an extension-centric design. ## TODO - [x] Introduce `CheckSignature` impl of `TransactionExtension` to ensure it's possible to have crypto be done wholly in a `TransactionExtension`. - [x] Deprecate `SignedExtension` and move all uses in codebase to `TransactionExtension`. - [x] `ChargeTransactionPayment` - [x] `DummyExtension` - [x] `ChargeAssetTxPayment` (asset-tx-payment) - [x] `ChargeAssetTxPayment` (asset-conversion-tx-payment) - [x] `CheckWeight` - [x] `CheckTxVersion` - [x] `CheckSpecVersion` - [x] `CheckNonce` - [x] `CheckNonZeroSender` - [x] `CheckMortality` - [x] `CheckGenesis` - [x] `CheckOnlySudoAccount` - [x] `WatchDummy` - [x] `PrevalidateAttests` - [x] `GenericSignedExtension` - [x] `SignedExtension` (chain-polkadot-bulletin) - [x] `RefundSignedExtensionAdapter` - [x] Implement `fn weight` across the board. - [ ] Go through all pre-existing extensions which assume an account signer and explicitly handle the possibility of another kind of origin. - [x] `CheckNonce` should probably succeed in the case of a non-account origin. - [x] `CheckNonZeroSender` should succeed in the case of a non-account origin. - [x] `ChargeTransactionPayment` and family should fail in the case of a non-account origin. - [ ] - [x] Fix any broken tests. --------- Signed-off-by: georgepisaltu <[email protected]> Signed-off-by: Alexandru Vasile <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Oliver Tale-Yazdi <[email protected]> Signed-off-by: Alexandru Gheorghe <[email protected]> Signed-off-by: Andrei Sandu <[email protected]> Co-authored-by: Nikhil Gupta <[email protected]> Co-authored-by: georgepisaltu <[email protected]> Co-authored-by: Chevdor <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Maciej <[email protected]> Co-authored-by: Javier Viola <[email protected]> Co-authored-by: Marcin S. <[email protected]> Co-authored-by: Tsvetomir Dimitrov <[email protected]> Co-authored-by: Javier Bullrich <[email protected]> Co-authored-by: Koute <[email protected]> Co-authored-by: Adrian Catangiu <[email protected]> Co-authored-by: Vladimir Istyufeev <[email protected]> Co-authored-by: Ross Bulat <[email protected]> Co-authored-by: Gonçalo Pestana <[email protected]> Co-authored-by: Liam Aharon <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]> Co-authored-by: André Silva <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: s0me0ne-unkn0wn <[email protected]> Co-authored-by: ordian <[email protected]> Co-authored-by: Sebastian Kunert <[email protected]> Co-authored-by: Aaro Altonen <[email protected]> Co-authored-by: Dmitry Markin <[email protected]> Co-authored-by: Alexandru Vasile <[email protected]> Co-authored-by: Alexander Samusev <[email protected]> Co-authored-by: Julian Eager <[email protected]> Co-authored-by: Michal Kucharczyk <[email protected]> Co-authored-by: Davide Galassi <[email protected]> Co-authored-by: Dónal Murray <[email protected]> Co-authored-by: yjh <[email protected]> Co-authored-by: Tom Mi <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Will | Paradox | ParaNodes.io <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Joshy Orndorff <[email protected]> Co-authored-by: Joshy Orndorff <[email protected]> Co-authored-by: PG Herveou <[email protected]> Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Juan Girini <[email protected]> Co-authored-by: bader y <[email protected]> Co-authored-by: James Wilson <[email protected]> Co-authored-by: joe petrowski <[email protected]> Co-authored-by: asynchronous rob <[email protected]> Co-authored-by: Parth <[email protected]> Co-authored-by: Andrew Jones <[email protected]> Co-authored-by: Jonathan Udd <[email protected]> Co-authored-by: Serban Iorga <[email protected]> Co-authored-by: Egor_P <[email protected]> Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: Evgeny Snitko <[email protected]> Co-authored-by: Just van Stam <[email protected]> Co-authored-by: Francisco Aguirre <[email protected]> Co-authored-by: gupnik <[email protected]> Co-authored-by: dzmitry-lahoda <[email protected]> Co-authored-by: zhiqiangxu <[email protected]> Co-authored-by: Nazar Mokrynskyi <[email protected]> Co-authored-by: Anwesh <[email protected]> Co-authored-by: cheme <[email protected]> Co-authored-by: Sam Johnson <[email protected]> Co-authored-by: kianenigma <[email protected]> Co-authored-by: Jegor Sidorenko <[email protected]> Co-authored-by: Muharem <[email protected]> Co-authored-by: joepetrowski <[email protected]> Co-authored-by: Alexandru Gheorghe <[email protected]> Co-authored-by: Gabriel Facco de Arruda <[email protected]> Co-authored-by: Squirrel <[email protected]> Co-authored-by: Andrei Sandu <[email protected]> Co-authored-by: georgepisaltu <[email protected]> Co-authored-by: command-bot <>
-
- Feb 19, 2024
-
-
Gilt0 authored
# Description This PR removes redundant type definition from test definition config implementations like ``` #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Test { type A = A; ... } ``` This changes avoid redundancies in the code as the macro `derive_impl` defines the relevant types. To implement the changes, it was a simple fact of running tests and making sure that the tests would still run while the definition would be removed. Closes #3237 As a note, here is a brief account of things done from the Issue's description statement ``` alliance migrate alliance, fast-unstake and bags list to use derive-impl #1636 asset-conversion DONE asset-rate DONE assets DONE atomic-swap DONE aura DONE authority-discovery DONE authorship migrate babe and authorship to use derive-impl #1790 babe migrate babe and authorship to use derive-impl #1790 bags-list migrate alliance, fast-unstake and bags list to use derive-impl #1636 balances DONE beefy NOTHING TO DO --- also noted this error without failing tests Feb 13 13:49:08.941 ERROR runtime::timestamp: `pallet_timestamp::UnixTime::now` is called at genesis, invalid value returned: 0 beefy-mmr NOTHING TO DO bounties DONE child-bounties DONE collective DONE contracts DONE conviction-voting DONE core-fellowship NOTHING TO DO democracy DONE election-provider-multi-phase NOTHING TO DO elections-phragmen DONE executive NOTHING TO DO fast-unstake migrate alliance, fast-unstake and bags list to use derive-impl #1636 glutton DONE grandpa DONE identity DONE im-online NOTHING TO DO indices Refactor indices pallet #1789 insecure-randomness-collective-flip DONE lottery DONE membership DONE merkle-mountain-range NOTHING TO DO message-queue DONE multisig add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453 nft-fractionalization DONE nfts DONE nicks Refactor pallet-state-trie-migration to fungible::* traits #1801 NOT IN REPO nis DONE node-authorization DONE nomination-pools NOTHING TO DO -- ONLY impl for Runtime offences DELETED EVERYTHING -- IS THAT CORRECT?? preimage DONE proxy add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453 ranked-collective NOTHING TO DO recovery DONE referenda DONE remark DONE root-offences DONE root-testing NOTHING TO DO salary NOTHING TO DO scheduler DONE scored-pool DONE session DONE -- substrate/frame/session/benchmarking/src/mock.rs untouched society NOTHING TO DO staking DONE staking-bags-benchmarks NOT IN REPO state-trie-migration NOTHING TO DO statement DONE sudo DONE system DONE timestamp DONE tips DONE transaction-payment NOTHING TO DO transaction-storage NOTHING TO DO treasury DONE try-runtime NOTHING TO DO -- no specific mention of 'for Test' uniques DONE utility DONE vesting DONE whitelist DONE ``` --------- Co-authored-by: command-bot <> Co-authored-by: gupnik <[email protected]>
-
- Jan 22, 2024
-
-
Davide Galassi authored
Step towards https://github.com/paritytech/polkadot-sdk/issues/1975 As reported https://github.com/paritytech/polkadot-sdk/issues/1975#issuecomment-1774534225 I'd like to encapsulate crypto related stuff in a dedicated folder. Currently all cryptographic primitive wrappers are all sparsed in `substrate/core` which contains "misc core" stuff. To simplify the process, as the first step with this PR I propose to move the cryptographic hashing there. The `substrate/crypto` folder was already created to contains `ec-utils` crate. Notes: - rename `sp-core-hashing` to `sp-crypto-hashing` - rename `sp-core-hashing-proc-macro` to `sp-crypto-hashing-proc-macro` - As the crates name is changed I took the freedom to restart fresh from version 0.1.0 for both crates --------- Co-authored-by: Robert Hambrock <[email protected]>
-
joe petrowski authored
Clean up all the old syntax. --------- Co-authored-by: command-bot <> Co-authored-by: gupnik <[email protected]> Co-authored-by: Nikhil Gupta <[email protected]> Co-authored-by: Maksym H <[email protected]>
-
- Dec 07, 2023
-
-
Oliver Tale-Yazdi authored
Closes https://github.com/paritytech/polkadot-sdk/issues/2319 Changes: - Ensure that only `enqueue_message(s)` is callable from within the message processor. This prevents messed up storage that can currently happen when the pallet is called into recursively. - Use `H256` instead of `[u8; 32]` for clearer API. ## Details The re-entracy check is done with the `environmental` crate by adding a `with_service_mutex(f)` function that runs the closure exclusively. This works since the MQ pallet is not instantiable. --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Francisco Aguirre <[email protected]>
-
- Nov 28, 2023
-
-
gupnik authored
Step in https://github.com/paritytech/polkadot-sdk/issues/171 This PR adds `derive_impl` on all `frame_system` config impls for mock runtimes. The overridden configs are maintained as of now to ensure minimal changes. --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]>
-
- Nov 02, 2023
-
-
Oliver Tale-Yazdi authored
(imported from https://github.com/paritytech/cumulus/pull/2157) ## Changes This MR refactores the XCMP, Parachains System and DMP pallets to use the [MessageQueue](https://github.com/paritytech/substrate/pull/12485) for delayed execution of incoming messages. The DMP pallet is entirely replaced by the MQ and thereby removed. This allows for PoV-bounded execution and resolves a number of issues that stem from the current work-around. All System Parachains adopt this change. The most important changes are in `primitives/core/src/lib.rs`, `parachains/common/src/process_xcm_message.rs`, `pallets/parachain-system/src/lib.rs`, `pallets/xcmp-queue/src/lib.rs` and the runtime configs. ### DMP Queue Pallet The pallet got removed and its logic refactored into parachain-system. Overweight message management can be done directly through the MQ pallet. Final undeployment migrations are provided by `cumulus_pallet_dmp_queue::UndeployDmpQueue` and `DeleteDmpQueue` that can be configured with an aux config trait like: ```rust parameter_types! { pub const DmpQueuePalletName: &'static str = \"DmpQueue\" < CHANGE ME; pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; } impl cumulus_pallet_dmp_queue::MigrationConfig for Runtime { type PalletName = DmpQueuePalletName; type DmpHandler = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>; type DbWeight = <Runtime as frame_system::Config>::DbWeight; } // And adding them to your Migrations tuple: pub type Migrations = ( ... cumulus_pallet_dmp_queue::UndeployDmpQueue<Runtime>, cumulus_pallet_dmp_queue::DeleteDmpQueue<Runtime>, ); ``` ### XCMP Queue pallet Removed all dispatch queue functionality. Incoming XCMP messages are now either: Immediately handled if they are Signals, enqueued into the MQ pallet otherwise. New config items for the XCMP queue pallet: ```rust /// The actual queue implementation that retains the messages for later processing. type XcmpQueue: EnqueueMessage<ParaId>; /// How a XCM over HRMP from a sibling parachain should be processed. type XcmpProcessor: ProcessMessage<Origin = ParaId>; /// The maximal number of suspended XCMP channels at the same time. #[pallet::constant] type MaxInboundSuspended: Get<u32>; ``` How to configure those: ```rust // Use the MessageQueue pallet to store messages for later processing. The `TransformOrigin` is needed since // the MQ pallet itself operators on `AggregateMessageOrigin` but we want to enqueue `ParaId`s. type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>; // Process XCMP messages from siblings. This is type-safe to only accept `ParaId`s. They will be dispatched // with origin `Junction::Sibling(…)`. type XcmpProcessor = ProcessFromSibling< ProcessXcmMessage< AggregateMessageOrigin, xcm_executor::XcmExecutor<xcm_config::XcmConfig>, RuntimeCall, >, >; // Not really important what to choose here. Just something larger than the maximal number of channels. type MaxInboundSuspended = sp_core::ConstU32<1_000>; ``` The `InboundXcmpStatus` storage item was replaced by `InboundXcmpSuspended` since it now only tracks inbound queue suspension and no message indices anymore. Now only sends the most recent channel `Signals`, as all prio ones are out-dated anyway. ### Parachain System pallet For `DMP` messages instead of forwarding them to the `DMP` pallet, it now pushes them to the configured `DmpQueue`. The message processing which was triggered in `set_validation_data` is now being done by the MQ pallet `on_initialize`. XCMP messages are still handed off to the `XcmpMessageHandler` (XCMP-Queue pallet) - no change here. New config items for the parachain system pallet: ```rust /// Queues inbound downward messages for delayed processing. /// /// Analogous to the `XcmpQueue` of the XCMP queue pallet. type DmpQueue: EnqueueMessage<AggregateMessageOrigin>; ``` How to configure: ```rust /// Use the MQ pallet to store DMP messages for delayed processing. type DmpQueue = MessageQueue; ``` ## Message Flow The flow of messages on the parachain side. Messages come in from the left via the `Validation Data` and finally end up at the `Xcm Executor` on the right. ![Untitled (1)](https://github.com/paritytech/cumulus/assets/10380170/6cf8b377-88c9-4aed-96df-baace266e04d) ## Further changes - Bumped the default suspension, drop and resume thresholds in `QueueConfigData::default()`. - `XcmpQueue::{suspend_xcm_execution, resume_xcm_execution}` errors when they would be a noop. - Properly validate the `QueueConfigData` before setting it. - Marked weight files as auto-generated so they wont auto-expand in the MR files view. - Move the `hypothetical` asserts to `frame_support` under the name `experimental_hypothetically` Questions: - [ ] What about the ugly `#[cfg(feature = \"runtime-benchmarks\")]` in the runtimes? Not sure how to best fix. Just having them like this makes tests fail that rely on the real message processor when the feature is enabled. - [ ] Need a good weight for `MessageQueueServiceWeight`. The scheduler already takes 80% so I put it to 10% but that is quite low. TODO: - [x] Remove c&p code after https://github.com/paritytech/polkadot/pull/6271 - [x] Use `HandleMessage` once it is public in Substrate - [x] fix `runtime-benchmarks` feature https://github.com/paritytech/polkadot/pull/6966 - [x] Benchmarks - [x] Tests - [ ] Migrate `InboundXcmpStatus` to `InboundXcmpSuspended` - [x] Possibly cleanup Migrations (DMP+XCMP) - [x] optional: create `TransformProcessMessageOrigin` in Substrate and replace `ProcessFromSibling` - [ ] Rerun weights on ref HW --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Liam Aharon <[email protected]> Co-authored-by: joe petrowski <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: command-bot <>
-
- Oct 19, 2023
-
-
Oliver Tale-Yazdi authored
Changes: - Use a sensible limit for the overweight-cutoff of a single messages instead of the full configured `ServiceWeight`. - Add/Update tests --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-
- Sep 05, 2023
-
-
Marcin S. authored
Co-authored-by: Keith Yeung <[email protected]> Co-authored-by: Francisco Aguirre <[email protected]>
-
- Sep 01, 2023
-
-
gupnik authored
Co-authored-by: Javier Viola <[email protected]>
-
- Aug 14, 2023
-
-
Deepanshu Hooda authored
* feat: Add try_state for message_queue * Update frame/message-queue/src/lib.rs change if let to while let and modify bump_service_head function Co-authored-by: Oliver Tale-Yazdi <[email protected]> * feat: update try_state, add checks for storage * fix: add try_state builder for remaining tests * Update frame/message-queue/src/mock.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> * chore: assert statement to ensure * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use ensure instead of assert Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix function signature and feature gate Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Cleanup code Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Juan <[email protected]>
-
- Jul 18, 2023
-
-
Oliver Tale-Yazdi authored
* Rename WeightMeter functions * Fixes Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fixup and doc + tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * One more test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fixup pallets Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use correct function
🤦 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Apply suggestions from code review Co-authored-by: Juan <[email protected]> * Update primitives/weights/src/weight_meter.rs Co-authored-by: Bastian Köcher <[email protected]> * Update primitives/weights/src/weight_meter.rs Co-authored-by: Bastian Köcher <[email protected]> * Update primitives/weights/src/weight_meter.rs --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Juan <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
- Jul 14, 2023
-
-
juangirini authored
* replace Index by Nonce * replace Index by Nonce * replace Index by Nonce * replace Index by Nonce * replace Index by Nonce * wip * remove index in lieu of nonce * wip * remove accountnonce in lieu of nonce * add minor improvement * rebase and merge conflicts
-
- Jul 13, 2023
-
-
gupnik authored
Moves `Block` to `frame_system` instead of `construct_runtime` and removes `Header` and `BlockNumber` (#14437) * Initial setup * Adds node block * Uses UncheckedExtrinsic and removes Where section * Updates frame_system to use Block * Adds deprecation warning * Fixes pallet-timestamp * Removes Header and BlockNumber * Addresses review comments * Addresses review comments * Adds comment about compiler bug * Removes where clause * Refactors code * Fixes errors in cargo check * Fixes errors in cargo check * Fixes warnings in cargo check * Formatting * Fixes construct_runtime tests * Uses import instead of full path for BlockNumber * Uses import instead of full path for Header * Formatting * Fixes construct_runtime tests * Fixes imports in benchmarks * Formatting * Fixes construct_runtime tests * Formatting * Minor updates * Fixes construct_runtime ui tests * Fixes construct_runtime ui tests with 1.70 * Fixes docs * Fixes docs * Adds u128 mock block type * Fixes split example * fixes for cumulus * ".git/.scripts/commands/fmt/fmt.sh" * Updates new tests * Fixes fully-qualified path in few places * Formatting * Update frame/examples/default-config/src/lib.rs Co-authored-by: Juan <[email protected]> * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Juan <[email protected]> * ".git/.scripts/commands/fmt/fmt.sh" * Addresses some review comments * Fixes build * ".git/.scripts/commands/fmt/fmt.sh" * Update frame/democracy/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> * Update frame/democracy/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> * Update frame/support/procedural/src/construct_runtime/mod.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> * Addresses review comments * Updates trait bounds * Minor fix * ".git/.scripts/commands/fmt/fmt.sh" * Removes unnecessary bound * ".git/.scripts/commands/fmt/fmt.sh" * Updates test * Fixes build * Adds a bound for header * ".git/.scripts/commands/fmt/fmt.sh" * Removes where block * Minor fix * Minor fix * Fixes tests * ".git/.scripts/commands/update-ui/update-ui.sh" 1.70 * Updates test * Update primitives/runtime/src/traits.rs Co-authored-by: Bastian Köcher <[email protected]> * Update primitives/runtime/src/traits.rs Co-authored-by: Bastian Köcher <[email protected]> * Updates doc * Updates doc --------- Co-authored-by: command-bot <> Co-authored-by: Juan <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
- Jul 12, 2023
-
-
Michal Kucharczyk authored
* frame::support: GenesisConfig types for Runtime enabled * frame::support: macro generating GenesisBuild::build for RuntimeGenesisConfig * frame: ambiguity BuildStorage vs GenesisBuild fixed * fix * RuntimeGenesisBuild added * Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed" This reverts commit 950f3d019d0e21c55a739c44cc19cdabd3ff0293. * Revert "fix" This reverts commit a2f76dd24e9a16cf9230d45825ed28787211118b. * Revert "RuntimeGenesisBuild added" This reverts commit 3c131b618138ced29c01ab8d15d8c6410c9e128b. * Revert "Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed"" This reverts commit 2b1ecd467231eddec69f8d328039ba48a380da3d. * Revert "Revert "fix"" This reverts commit fd7fa629adf579d83e30e6ae9fd162637fc45e30. * Code review suggestions * frame: BuildGenesisConfig added, BuildGenesis deprecated * frame: some pallets updated with BuildGenesisConfig * constuct_runtime: support for BuildGenesisConfig * frame::support: genesis_build macro supports BuildGenesisConfig * frame: BuildGenesisConfig added, BuildGenesis deprecated * Cargo.lock update * test-runtime: fixes * Revert "fix" This reverts commit a2f76dd24e9a16cf9230d45825ed28787211118b. * Revert "frame: ambiguity BuildStorage vs GenesisBuild fixed" This reverts commit 950f3d019d0e21c55a739c44cc19cdabd3ff0293. * self review * doc fixed * ui tests fixed * fmt * tests fixed * genesis_build macrto fixed for non-generic GenesisConfig * BuildGenesisConfig constraints added * warning fixed * some duplication removed * fmt * fix * doc tests fix * doc fix * cleanup: remove BuildModuleGenesisStorage * self review comments * fix * Update frame/treasury/src/tests.rs Co-authored-by: Sebastian Kunert <[email protected]> * Update frame/support/src/traits/hooks.rs Co-authored-by: Sebastian Kunert <[email protected]> * doc fix: GenesisBuild exposed * ".git/.scripts/commands/fmt/fmt.sh" * frame: more serde(skip) + cleanup * Update frame/support/src/traits/hooks.rs Co-authored-by: Davide Galassi <[email protected]> * frame: phantom fields moved to the end of structs * chain-spec: Default::default cleanup * test-runtime: phantom at the end * merge master fixes * fix * fix * fix * fix * fix (facepalm) * Update frame/support/procedural/src/pallet/expand/genesis_build.rs Co-authored-by: Bastian Köcher <[email protected]> * fmt * fix * fix --------- Co-authored-by: parity-processbot <> Co-authored-by: Sebastian Kunert <[email protected]> Co-authored-by: Davide Galassi <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
- Jun 28, 2023
-
-
Oliver Tale-Yazdi authored
* pallet-message-queue: add queue pausing Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix build Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Remove check Otherwise it would not start servicing queues that started paused and became unpaused afterwards. Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-
- Jun 19, 2023
-
-
Oleg Plakida authored
Co-authored-by: command-bot <>
-
- May 21, 2023
-
-
Gavin Wood authored
-
- Apr 13, 2023
-
-
Oliver Tale-Yazdi authored
* Align log Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use max instead of sum Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Make comment ordering deterministic Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Dont add Pov overhead when all is ignored Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update test pallet weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Re-run weights on bm2 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Actually use new weights Fucked up the merge for this file... Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update contract weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-
- Mar 16, 2023
-
-
Oliver Tale-Yazdi authored
* Empty commit * ".git/.scripts/commands/bench/bench.sh" all --------- Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: command-bot <>
-
- Mar 13, 2023
-
-
Vivek Pandya authored
* Remove use of trait Store from staking pallet * Remove use of trait Store from bounties pallet * Remove use of trait Store from collective pallet * Remove use of trait Store from babe pallet * Remove use of trait Store from assets pallet * Remove use of trait Store from grandpa pallet * Remove use of trait Store from balances pallet * Remove use of trait Store from authorship pallet * Remove use of trait Store from authority-discovery pallet * Remove use of trait Store from atomic-swap pallet * Remove use of trait Store from sudo pallet * Remove use of trait Store from scheduler pallet * Remove use of trait Store from scored-pool pallet * Remove use of trait Store from society pallet * Remove use of trait Store from lottery pallet * Remove use of trait Store from executive pallet * Remove use of trait Store from democracy pallet * Remove use of trait Store from elections-phragmen pallet * Remove use of trait Store from indices pallet * Remove use of trait Store from identity pallet * Remove use of trait Store from multisig pallet * Remove use of trait Store from merkle-mountain-range pallet * Remove use of trait Store from im-online pallet * Remove use of trait Store from membership pallet * Remove use of trait Store from nicks pallet * Remove use of trait Store from session pallet * Remove use of trait Store from transaction-payment pallet * Remove use of trait Store from utility pallet * Remove use of trait Store from child-bounties pallet * Remove use of trait Store from nis pallet * Remove use of trait Store from nfts pallet * Remove use of trait Store from conviction-voting pallet * Remove use of trait Store from treasury pallet * Remove use of trait Store from vesting pallet * Remove use of trait Store from preimage pallet * Remove use of trait Store from uniques pallet * Remove use of trait Store from ranked-collective pallet * Remove use of trait Store from beefy-mmr pallet * Remove use of trait Store from referenda pallet * Remove use of trait Store from whitelist pallet * Remove use of trait Store from alliance pallet * Remove use of trait Store from nomination-pools pallet * Remove use of trait Store from state-trie-migration pallet * Remove use of trait Store from message-queue pallet * Remove use of trait Store from root-offences pallet * Remove use of trait Store from root-testing pallet * Remove use of trait Store from timestamps pallet * Remove use of trait Store from system pallet * Remove use of trait Store from offences pallet * Remove use of trait Store from recovery pallet * Remove use of trait Store from node-authorization pallet * Remove use of trait Store from proxy pallet * Remove use of trait Store from benchmarking pallet * Remove use of trait Store from bags-list pallet * Add deprecated warning in store_trait * Change warning message * Run cargo fmt * Fix warning and update tests * Remove unnecessary allow deprecated * Remove use of trait Store * Fix mismatch in expected output * Minor update to warning message for deprecation of generate_store with Store trait attribute * Fixes as per review comments * Fixes as per review suggestions * Remove use of Store trait from core-fellowship pallet * Fix type in store_trait.rs * Fixes as pre review comment
-
- Mar 07, 2023
-
-
Oliver Tale-Yazdi authored
* Unknit permanently overweight books A book with only permanently overweight messages should be unkit from the ready ring. This does currently not happen since perm. overweight messages are not counted as "processed" and therefore not increase the "total_processed" counter. This is only a problem when the next and only message that is processed is overweight. Eventually this should resolve itself when another non-overweight message is enqueued and processed. But for correctness it should be unknitted. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * One more tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet-message-queue --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: command-bot <>
-
- Mar 04, 2023
-
-
Gavin Wood authored
* Typo * Update Salary weight Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix test Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
-
- Mar 02, 2023
-
-
Oliver Tale-Yazdi authored
* Deprecate Weight::from_{ref_time, proof_size} Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update templates Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use from_parts Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use from_parts Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Dont revert comment
🤦 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances * Update weight files Signed-off-by: Oliver Tale-Yazdi <[email protected]> * More fixes Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Adapt to Master changes Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: command-bot <>
-
- Feb 28, 2023
-
-
Oliver Tale-Yazdi authored
* Bump default 'additional_trie_layers' to two The default here only works for extremely small runtimes, which have no more than 16 storage prefices. This is changed to a "sane" default of 2, which is save for runtimes with up to 4096 storage prefices (eg StorageValue). Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update tests and test weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix PoV weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_message_queue * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton * Fix sanity check >0 would also do as a check, but let's try this. Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: command-bot <>
-
- Feb 25, 2023
-
-
Oliver Tale-Yazdi authored
* Add Yield message processing error Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add NoopServiceQueues Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Implement temporary error aka Yield Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Make NoopMessageProcessor generic Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Mock pausable message processor Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test paused queues Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Integration test paused queues Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use WeightMeter instead of weight return Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fix Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Make compile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_message_queue * Fix test Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: command-bot <>
-
- Feb 21, 2023
-
-
Vivek Pandya authored
* Change copyright year to 2023 from 2022 * Fix incorrect update of copyright year * Remove years from copy right header * Fix remaining files * Fix typo in a header and remove update-copyright.sh
-
- Jan 27, 2023
-
-
Sam Johnson authored
migrate new benchmarking syntax from `frame_support::benchmarking` to `frame_benchmarking::v2` (#13235) * * re-export frame_support::benchmarking in frame_benchmarking:: * prefer use frame_benchmarking::*; in examples, etc * switch to frame_benchmarking::v2 * completely migrate new benchmarking code out of frame_support * fix doc links * remove unneeded return Co-authored-by: Bastian Köcher <[email protected]> * remove another unneeded return Co-authored-by: Bastian Köcher <[email protected]> * properly export all macros in v1 * refactor existing frame_benchmarking imports to use ::v1 --------- Co-authored-by: Bastian Köcher <[email protected]>
-
- Jan 26, 2023
-
-
Shawn Tabrizi authored
* initial impl * add template test * linear fit proof size * always record proof when tracking storage * calculate worst case pov * remove duplicate worst case * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * more comment output * add cli for worst case map size * update name * clap does not support underscores * rename * expose worst case map values * improve some comments * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update template * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * fix fmt * more fmt * more fmt * Dont panic when there is no proof Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix test features Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Whitelist :extrinsic_index Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use whitelist when recording proof Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add logs Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add PoV testing pallet Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Deploy PoV testing pallet Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Storage benches reside in the PoV pallet Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Linear regress PoV per component Splits the PoV calculation into "measured" and "estimated". The measured part is reported by the Proof recorder and linear regressed over all components at once. The estimated part is calculated as worst-case by using the max PoV size per storage access and calculating one linear regress per component. This gives each component a (possibly) independent PoV. For now the measured size will always be lower than the PoV on Polkadot since it is measured on an empty snapshot. The measured part is therefor only used as diagnostic for debugging. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Put PoV into the weight templates Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Extra alanysis choise for PoV Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add+Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Make benches faster Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Cleanup Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use same template comments Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/bench-bot.sh" pallet dev pallet_balances * ".git/.scripts/bench-bot.sh" pallet dev pallet_democracy * Update referenda mock BlockWeights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Take measured value size into account Signed-off-by: Oliver Tale-Yazdi <[email protected]> * clippy Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * proof_size: None Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ugly, but works Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * wup Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * WIP Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add pov_mode attribute to the benchmarks! macro Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use pov_mode attribute in PoV benchmarking Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Scheduler, Whitelist: Add pov_mode attr Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update PoV weights * Add CLI arg: default-pov-mode Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fix Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "Update PoV weights" This reverts commit 2f3ac2387396470b118122a6ff8fa4ee12216f4b. * Revert "WIP" This reverts commit c34b538cd2bc45da4544e887180184e30957904a. * Revert first approach This reverts commit range 8ddaa2fffe5930f225a30bee314d0b7c94c344dd^..4c84f8748e5395852a9e0e25b0404953fee1a59e Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Clippy Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add extra benchmarks Signed-off-by: Oliver Tale-Yazdi <[email protected]> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_alliance * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_whitelist * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_scheduler * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Clippy Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Clippy
🤦 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add reference benchmarks Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix doc comments Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Undo logging Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add 'Ignored' pov_mode Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Allow multiple attributes per benchmark Turns out that the current benchmarking syntax does not support multiple attributes per bench🤦 . Changing it to support that since otherwise the `pov_mode` would conflict with the others. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Validate pov_mode syntax Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Ignore PoV for all contract benchmarks Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * test Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Bump macro recursion limit Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fmt Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update contract weights They dont have a PoV component anymore. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * fix test ffs Signed-off-by: Oliver Tale-Yazdi <[email protected]> * pov_mode is unsupported in V2 syntax Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix pallet ui tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * update pallet ui Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix pallet ui tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Parity Bot <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: command-bot <> Co-authored-by: Your Name <[email protected]>
-
- Jan 23, 2023
-
-
Sam Johnson authored
* add stub for new benchmark macro * benchmark syntax * add #[extrinsic call] separator * parse #[benchmark] item as a function * proper emission of error when #[extrinsic_call] annotation is missing * clean up * enclosing module via benchmarks! { } working * use an attribute macro on the module instead of benchmarks! { } * cargo fmt * working component implementation * WIP * working * add syntax for Linear<A, B> * parsing of param ranges (still need to build tuple though) * params parsing WIP * clean up (don't need extrinsic call name) * use proper Result syntax for BenchmarkDef parsing * proper parsing of Linear<0, 1> style args * successfully parse and make use of linear component ranges
💥 * rename support variable => home because eventually will be moved * compile-time check that param range types implement ParamRange * switch to using balances as example, failing on instance pallet * successfully set up __origin and __call with balances💥 * clean up * use a module * don't need a variable for transfer * rename benchmark_transfer -> transfer because no longer conflicts * clean up * working with transfer_increasing_users as well💥 * re-add BareBlock * add comments for undocumented structs+functions+traits * refactor in preparation for removing module requirements * switch to a block instead of a module * use the outer macro pattern to to enable #[benchmarks] aggregation * successfully generate SelectedBenchmark💥 * implement components for SelectedBenchmark * implement instance for SelectedBenchmark * properly track #[extra] * working impl for fn benchmarks() * run_benchmarks WIP * finish run_benchmark! impl💥 * import balances transfer_best_case benchmark * import transfer_keep_alive balances pallet benchmark * import set_balance_creating balances pallet benchmark * import set_balance_killing balances pallet benchmark * import force_transfer balances pallet benchmark * add #[extra] annotation and docs to transfer_increasing_users * import transfer_all balances pallet benchmark * import force_unreserve balances pallet benchmark * prepare to implement impl_benchmark_test_suite! * ensure tests cover #[extra] before and after #[benchmark] tag * refactor * clean up * fix * move to outer * switch to benchmarks/instance_benchmarks * test impl almost done, strange compiler error * benchmark test suites working💥 * clean up * add stub and basic parsing for where_clause * working except where clause and extrinsic calls containing method chains * assume option (2) for now wrt https://github.com/paritytech/substrate/pull/12924#issuecomment-1372938718 * clean up * switch to attribute-style * properly handle where clauses * fix subtle missing where clause, now just MessageQueue issues * fix block formatting in message-queue pallet * switch to block vs non-block parsing of extrinsic call * working now but some benchmark tests failing * message-queue tests working (run order issue fixed)🎉 * add comments and internal docs for fame_support_procedural::benchmark * fix license years * docs for lib.rs * add docs to new support procedural macros * don't allow #[benchmark] outside of benchmarking module * add docs * use benchmark(extra, skip_meta) style args * update docs accordingly * appease clippy * bump ci * add notes about `extra` and `skip_meta` * fix doc tests * re-run CI * use `ignore` instead of `no_run` on doc examples * bump CI * replace some if-lets with if-elses * more refactoring of if-let statements * fix remaining if-lets in BenchmarkDef::from() * fix if-lets in benchmarks() * fix remaining if-lets, use nested find_map for extrinsic call * switch to use #[extrinsic_call] or #[block] situationally * refactor ExtrinsicCallDef => BenchmarkCallDef * update docs with info about #[block] * add macro stub for #[extrinsic_call] * fix docs and add stub for #[block] as well * remove unused extern crate line * fix clippy nits * Use V2 bench syntax in pallet-example-basic Just testing the dev-ex... Signed-off-by: Oliver Tale-Yazdi <[email protected]> * carry over comment * use curly-brace style for impl_benchmark_test_suite! * remove unneeded parenthesis * proper handling of _() extrinsic call style * add docs for _() syntax * fix crate access * simplify keyword access Co-authored-by: Keith Yeung <[email protected]> * simplify module content destructuring Co-authored-by: Keith Yeung <[email protected]> * fix crate access "frame_benchmarking" => "frame-benchmarking", compiles * use _() extrinsic call syntax where possible in balances * simplify attr.path.segments.last() Co-authored-by: Keith Yeung <[email protected]> * fix compile error being suppressed * simplify extrinsic call keyword parsing Co-authored-by: Keith Yeung <[email protected]> * use ? operator instead of return None Co-authored-by: Keith Yeung <[email protected]> * rename generics => type_use_generics rename full_generics => type_impl_generics * simplify extrinsic call extraction with transpose * bump CI * nit * proper handling of too many + too few block/extrinsic call annotations * change to B >= A Co-authored-by: Oliver Tale-Yazdi <[email protected]> * remove unneeded ignore Co-authored-by: Oliver Tale-Yazdi <[email protected]> * remove another ignore Co-authored-by: Oliver Tale-Yazdi <[email protected]> * add ui tests * use _() style extrinsic call on accumulate_dummy Co-authored-by: Oliver Tale-Yazdi <[email protected]> * add range check to ParamRange * ui test for bad param ranges * fix failing example * add ignore back to other failing example * tweak expr_call span Co-authored-by: Keith Yeung <[email protected]> * fix typo * eliminate a match Co-authored-by: Keith Yeung <[email protected]> * change pub fn benchmarks to return Result<TokenStream> * fix origin error span * more informative error for invalid benchmark parameter name * fix spans on a few benchmark errors * remove unneeded clone * refactor inner loop of benchmark function parsing * preserve mod attributes * refactor outer loop of benchmark def parsing code, greatly simplified * simplify to use a ? operator when parsing benchmark attr path * fix another ? operator * further simplify benchmark function attr parsing with more ? ops * refactor extrinsic call handling to use if let rather than match * replace is_ok => is_err Co-authored-by: Keith Yeung <[email protected]> * re-use name during expansion of benchmark def * remove unneeded clone * fix span for origin missing error * fix missing semi Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Keith Yeung <[email protected]> Co-authored-by: parity-processbot <>
-
- Jan 07, 2023
-
-
Oliver Tale-Yazdi authored
Signed-off-by: Oliver Tale-Yazdi <[email protected]> Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-
- Dec 12, 2022
-
-
Oliver Tale-Yazdi authored
* frame-system: explicit call index Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use explicit call indices Signed-off-by: Oliver Tale-Yazdi <[email protected]> * pallet-template: explicit call index Signed-off-by: Oliver Tale-Yazdi <[email protected]> * DNM: Temporarily require call_index Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Revert "DNM: Temporarily require call_index" This reverts commit c4934e312e12af72ca05a8029d7da753a9c99346. Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-
Oliver Tale-Yazdi authored
* Fix license Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add mock doc Signed-off-by: Oliver Tale-Yazdi <[email protected]> Signed-off-by: Oliver Tale-Yazdi <[email protected]>
-